opentk

OpenTK multiple GLControl with a single Context

孤街浪徒 提交于 2020-02-03 08:29:14
问题 I m working on a program which should have multiple views of a model. I would like to use multiple GLControls` for that. Is there any possibility to create multiple GLControl which use the same GraphicsContext? I successfully created this on a multithreaded enviroment, but the contexts are not shared then. So I have to load the model for each context, which is bad. My pseudocode for a single threaded enviroment looks something like this: glControl1.MakeCurrent(); // Render here glControl1

OpenTK multiple GLControl with a single Context

生来就可爱ヽ(ⅴ<●) 提交于 2020-02-03 08:29:05
问题 I m working on a program which should have multiple views of a model. I would like to use multiple GLControls` for that. Is there any possibility to create multiple GLControl which use the same GraphicsContext? I successfully created this on a multithreaded enviroment, but the contexts are not shared then. So I have to load the model for each context, which is bad. My pseudocode for a single threaded enviroment looks something like this: glControl1.MakeCurrent(); // Render here glControl1

Convert ImageSharp.Image to ImageSharp.PixelFormats.Rgba32?

回眸只為那壹抹淺笑 提交于 2020-01-24 09:38:09
问题 I am following a tutorial (https://opentk.net/learn/chapter1/4-textures.html) using ImageSharp. How do I convert the type 'ImageSharp.Image' to 'ImageSharp.PixelFormats.Rgba32'? To load the Image, I am using Image<Rgba32> image = Image.Load(path); but I keep getting the error: Cannot implicitly convert type 'SixLabors.ImageSharp.Image' to 'SixLabors.ImageSharp.Image<SixLabors.ImageSharp.PixelFormats.Rgba32>'. An explicit conversion exists (are you missing a cast?). 回答1: The API change in the

OpenTk texture not display the image

本秂侑毒 提交于 2020-01-16 15:47:14
问题 OpenTk texture not display the image It shows only a white triangle, but not with the image i try to load. Here is my code: using System; using System.Collections; using System.Collections.Generic; using System.Drawing; using System.Drawing.Imaging; using OpenTK; using OpenTK.Graphics; using OpenTK.Graphics.OpenGL; using OpenTK.Input; namespace StarterKit{ class Game : GameWindow { uint Texture; public Game() : base(800, 600, GraphicsMode.Default, "OpenTK Quick Start Sample") { VSync =

Need to improve resolution of screenshot from OpenGL

旧城冷巷雨未停 提交于 2020-01-16 13:18:33
问题 I want to get a screen shot from current scene in OpenTK with good resolution. I am using GL.ReadPixels to get a photo for the scene.If I save the photo to disk; I found it with low resolution/quality. following C# code is used to get a photo for the scene : Bitmap bmp = null; if (GraphicsContext.CurrentContext != null) { glControl_window.Invalidate(); int w = glControl_window.ClientSize.Width; int h = glControl_window.ClientSize.Height; bmp = new Bitmap(w, h); System.Drawing.Imaging

The renderer is not using the texture in Open TK

微笑、不失礼 提交于 2020-01-06 17:56:36
问题 Hi I'm trying to use Textures in OpenGL using Open TK. I got a basic example from the official page of OpenTK Framework, but didn't work. I searched here on stackoverflow for some help and changed some parts of the code, but still is not working. (Found and tested: OpenTk texture not display the image) So far I came with this snippet, but this is not displaying the texture (display white instead): UPDATED (With @The Fiddler suggestions) In OpenTK.GLControl.Load event handler: GL.ClearColor

C# OpenTK - Linux Console without X11

瘦欲@ 提交于 2020-01-06 13:08:05
问题 I was just wondering if it is possible to render the OpenTK gamewindow in a Linux Console (Raspberry Pi Raspbian) without any X11 Desktop? If it possible, how do you do it? 回答1: Yes, it's experimental since 1.1 or 1.2. Adjust OpenTK.dll.config if some dll could not be found, and maybe you'll have to find correct libinput version ( libinput-0.2.0 is working on my debian) to match api binding in opentk. I'm not fully sure, but I think that it's only working with modern GL (>3.0). Ensure you

OpenTK - How to achive antialiasing using accumulation buffer

风格不统一 提交于 2020-01-05 07:09:16
问题 Im trying to achieve antialiasing using accumulation buffer, but i don't fully understand what i'm doing wrong. The only effects im getting is drop down in fps, which i know is to be expected in this method. The jitter table is a table filled with floats to make antialiasing look smoother. I think it's probably because setting MartixMode doesnt change UniformMatrix method i later use in drawing objects. Here's my OnRenderFrame method: protected override void OnRenderFrame(FrameEventArgs e) {

Can I remove the Xamarin version of OpenTK and use another?

余生颓废 提交于 2020-01-05 04:11:25
问题 I've down loaded visual studio for mac and have created a cross platform solution. I want to use OpenTK v2 (not the one supplied with xamarin). The problem is that there appears to be an OpenTK namespace that is used run the Xamarin.Mac even when it isn't referenced. The types (Vector4 etc) and the Math Helper class show up in my solution even if the reference isn't showing in the references section. When I add the OpenTK v2 .dll to the packages (from nuget) I get errors saying 'The imported

MonoTouch OpenTK and UniformMatrix4

∥☆過路亽.° 提交于 2020-01-02 04:20:08
问题 I'm trying to pass an OpenTK Matrix4 to a shader uniform, but there doesn't seem to be a suitable overload for GL.UniformMatrix4. The overloads accept either float or float[] or ref float . Similarly I can't find a way to convert a Matrix4 instance to a float array - I've seen one sample that uses a ToArray method on the Matrix4, but that doesn't seem to be present in the distribution I'm using. Sure I'm missing something simple as this is pretty fundamental to being able to pass a model/view