我按照本教程中列出的步骤进行操作 http://www.opentk.com/doc/chapter/0,然后尝试了更广泛的设置。
但是,我不能用(我认为)OpenGL运行任何代码。
示例浏览器程序加载正常,我可以运行Open AL示例,但是标题OpenGL,OpenGLES和OpenTK下的任何示例都会导致此错误:
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
另外,如果我运行下载中提供的游戏示例,我会得到相同的错误,(System.NullReferenceException),但具有不同的细节。
这是在Linux,Ubuntu 12.04和Mono 2.10上。 我从来没有完全理解OpenGL在Linux上是如何工作的,因为似乎总有另一个以某种方式处理openGL的软件包,这是我以前从未听说过的,但我有很多处理这个问题的软件包,并添加了尽可能多的开发包。 glxgears工作正常,并且glxinfo将我的版本报告为1.4,所以看起来opengl在我的系统上工作到我不熟悉的眼睛。我也能够成功编译和运行这个OpenGL示例。 http://open.gl/context#SFML
那么我该怎么做呢?我认为它是Mono和OpenGL之间的某种接口,但我没有看到教程中遗漏的任何内容。