使用 pygtkglext 的着色器
有人知道如何让 glsl 着色器在 gtk-opengl 窗口中工作吗?使用 glut 所有 glCreateProgram
等函数都可以工作,但是当我尝试将相同的 gl 代码放入 pygtkglext 窗口时,它抱怨 NullReference:
OpenGL.error.NullFunctionError: Attempt to call an undefined function glCreateProgram, check for bool(glCreateProgram) before calling
所以然后我 from OpenGL.GL.ARB.shader_objects import *
,但结果是相似的:
OpenGL.error.NullFunctionError: Attempt to call an undefined function glCreateProgramObjectARB, check for bool(glCreateProgramObjectARB) before calling
任何想法都会有用。
Do someone know how to get glsl shaders work in gtk-opengl window? With glut all glCreateProgram
etc. functions works, but when I tried to put the same gl code into pygtkglext window, its complaining about NullReference:
OpenGL.error.NullFunctionError: Attempt to call an undefined function glCreateProgram, check for bool(glCreateProgram) before calling
So then I from OpenGL.GL.ARB.shader_objects import *
, but the result is similar:
OpenGL.error.NullFunctionError: Attempt to call an undefined function glCreateProgramObjectARB, check for bool(glCreateProgramObjectARB) before calling
Any idea will be useful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
答案是尚不支持。只是 pygtkglext 没有设置 glCreateProgram。然而 git 版本却可以。
The answer is its not supported yet. Simply pygtkglext doesn't set glCreateProgram. However git version does.
OpenGL 入口点是使用 GetProcAddress 例程获得的。我认为 NULL 指针是函数指针 glCreateProgramObjectARB。
这与驱动程序安装的库密切相关。主机上运行的是哪个 OpenGL 版本?也许驱动程序没有实现 glCreateProgramObjectARB。
OpenGL entry points are obtained using GetProcAddress routine. I suppose the NULL pointer is the function pointer glCreateProgramObjectARB.
This is strictly related with libraries installed with the driver. Which OpenGL version is running on the host? Maybe the driver doesn't implements the glCreateProgramObjectARB.