When trying to call OpenTK.Graphics.GL.LoadAll() in my application that uses my GTK GLWidget I get
Unhandled Exception: System.InvalidOperationException: No GraphicsContext available in the calling thread.
at OpenTK.Graphics.GL.LoadAll () [0x00000]
at MainWindow..ctor () [0x0000d] in /home/jtalton/GLTest/GLTest/MainWindow.cs:13
at GLTest.MainClass.Main (System.String args) [0x00005] in /home/jtalton/GLTest/GLTest/Main.cs:11
OpenTK 0.9.0 did not have this issue.
The problem is that the GTK Sharp GLWidget does not create a graphic context until it is "realized". This is so that there will be a valid window and device handle to use when creating the graphics context.
I tried to hook the OpenTK.Graphics.GL.LoadAll () in the the realized event but for some reason my test code does not render anything. It does not crash though.
A problem with adding this call to the realized event is that there may be multiple GLWidgets in an application.