Sepidar's picture

Strange NullReferenceException

Hi,

I am writing a program, running on many different machines. The program uses a control that is derived from GLControl. In a few of machines which program runs on them, OpenTK raises a NullReferenceException. I believe this exception is machine dependent, because the code works fine on the machines exact same condition.

The buggy code is located in the constructor of the form. I read a thread here and tried to solve the problem with:

            dummyGraphics = OpenTK.Graphics.GraphicsContext.CreateDummyContext();
            OpenTK.Graphics.OpenGL.GL.LoadAll();

but now CreateDummyContext raises the exception. My version of OpenTK is 1.0.0.201.

How should I solve this problem?

Thank you in advance for your help


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
AndyKorth's picture

Which platforms does it work on, and which platforms have trouble?

I believe none of the GLControl examples ever worked on my Mac.