I'm using OpenGL with Qt.
I want to use OpenTK as a simple binding to OpenGL, bеcause it's nicer to write GL.Vertex3(...) than Gl.glVertex3f(...).
But apparently OpenTK tries to be more than that... it tries to handle my GL context or something. More precisely: when I create an opengl window from within Qt, then call a function such as GL.Viewport, I get a null reference exception (which I don't know how to debug).
However, when I first create a small dummy OpenTK.GameWindow and run its mainloop in a separate thread, then that makes GL calls in my actual Qt window work. I suppose that during the GameWindow initialization, some internal DC handle gets initialized, which makes my calls work even for the other window.
So, how would I go about a proper solution? I tried looking through the OpenTK source but once I got to the bindings, I got confused by the code-generation going on.