Take the 2-minute tour ×

I followed the steps outlined here in the tutorial http://www.opentk.com/doc/chapter/0, and then tried the more expansive setup.

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:

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 provided in the download 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 as there always seems to be another package that deals with openGL in some way that I'd never heard of before, but I've got lots and lots of packages dealing with the thing, and added as many dev packages as I could find. glxgears works fine, and glxinfo reports my version as 1.4, so it seems like opengl works on my system to my inexpert eye. I was also able to successfully compile and run this OpenGL sample. http://open.gl/context#SFML

So how do I go about troubleshooting this? I presume it is some sort of interface between Mono and OpenGL, but I don't see anything I missed in the tutorial.

share|improve this question
Ok, so I asked on the openTK forums as well, and it seems there is an issue with the current stable release of OpenTK. opentk.com/node/1811 Installing the current SVN seems to have resolved the issue, though I would still like to know how I would have gone about trouble shooting the issue. –  Brandt Fuchs Nov 18 '12 at 15:50
This issue is now fixed in OpenTK 1.1. –  The Fiddler Dec 24 '13 at 15:59

Your Answer



Browse other questions tagged or ask your own question.