minguo's picture

Examples Do not run

Hi, I thought I'd try out OpenTK. Seems like an interesting project.

I followed the steps outlined here
and then tried here.

However, I can not run any code with (I think) OpenGL.

The example browser program loads fine and I can run the Open AL examples fine, but any example under the headings OpenGL, OpenGLES, and OpenTK result in this error:

Unhandled Exception:  System.NullReferenceException: Object reference not set to an instance of an object
    at OpenTK.Graphics.GraphcisMode.get_Default () [0x00000] in <filename unknown> : 0
    at Examples.Tutorial.Picking..ctor () [0x000000] in <filename uknown> : 0
    at Examples.Tutorial.Picking.Main () [0x000000] in <filename uknown> : 0
    at (Wrapper managed to Native) System.Reflection.MonoMethod:Internalinvoke (System.Reflection.MonoMethod.object.object[].System.Exception&)
    at System.Reflection.MonoMethod.Invoke (System.object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.object[] parameters, System.Globalization.Cultureinfo culture) [0x000000] in <filename uknown> : 0

Also, if I run the game example mentioned by http://www.opentk.com/doc/chapter/0 I get the same error, (System.NullReferenceException) but with different details.

This is on Linux, Ubuntu 12.04 and Mono 2.10.
I've never understood exactly how OpenGL works on Linux but I've got lots and lots of packages dealing with the thing.
glxgears works fine, and glxinfo reports my version as 1.4, so it seems like opengl works on my system to my inexpert eye.

How do I go about troubleshooting this?


Comment viewing options

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

It looks like you have the same problem as this one:


Not sure what the fix would be.. Are you using the 2010-10-06 release? Although the project seems a bit dead, I think you'll have better luck with the SVN version.

minguo's picture

Oh my, yes installing the SVN version seems to have corrected the issue.

Thank you so much!
Is the project in fact dormant? Has it been superseded by something else?