
GraphicsContext.CreateDummyContext() throws NullReferenceException.
Posted Monday, 14 November, 2011 - 19:35 by tbarela inHi all,
I'm on winxp, and using the most recent nightly build of OpenTK( v1.1.0.0, 2011-11-11).
I'm trying to use Tao.Glfw & glfw 2.6 to handle my display/input needs. I do the normal initialization stuff with glfw, and then call CreateDummyContext(), which throws a NullReferenceException.
//...snipped! if(Glfw.glfwInit() != 1) throw new Exception("glfwInit() failed."); if(Glfw.glfwOpenWindow(1024,768,8,8,8,8,16,8,Glfw.GLFW_WINDOW) != 1) throw new Exception("glfwOpenWindow() failed."); dummyContext = GraphicsContext.CreateDummyContext();//<---boom!
I've read these similar posts like http://www.opentk.com/node/2713 and http://www.opentk.com/node/1877 . Is this functionality broken, or am I missing something here? If it is broken, will it be fixed anytime soon?
Thanks ahead of time.


Comments
Re: GraphicsContext.CreateDummyContext() throws ...
Hi.
I have met with the same issue.
It is a bug of CreateDummyContext().
I'm using the opentk-2011-11-11.zip, on Windows 7.
I found the solution of this issue.
Some changes are needed in the OpenTK source code.
In "Platform\Dummy\DummyGLContext.cs", replace the constructor
public DummyGLContext(ContextHandle handle)
with this
and, replace this function
public override IntPtr GetAddress( string function )
with this code
And when you creating dummy context, call these code to initialize OpenTK.