这是我的源代码https://paste.fedoraproject.org/428184/89404314/pyOpenGL检查布尔
我得到的错误是这样的:
C:\Python27>python.exe wx_gl_vbo_001.py
Traceback (most recent call last):
File "wx_gl_vbo_001.py", line 63, in <module>
MyApp(redirect = False).MainLoop()
File "C:\Python27\lib\site-packages\wx-3.0-msw\wx\_core.py", line 8628, in __init__
self._BootstrapApp()
File "C:\Python27\lib\site-packages\wx-3.0-msw\wx\_core.py", line 8196, in _BootstrapApp
return _core_.PyApp__BootstrapApp(*args, **kwargs)
File "wx_gl_vbo_001.py", line 60, in OnInit
canvas = MyCanvas(frame)
File "wx_gl_vbo_001.py", line 16, in __init__
}""", GL_VERTEX_SHADER)
File "C:\Python27\lib\site-packages\OpenGL\latebind.py", line 44, in __call__
self._finalCall = self.finalise()
File "C:\Python27\lib\site-packages\OpenGL\extensions.py", line 245, in finalise
self.__name__,
OpenGL.error.NullFunctionError: Attempt to call an undefined alternate function (glCompileShader, glCompileShaderARB), check for bool(glCompileShader) before calling
目录(着色器)都配备有该功能:
'compileProgram', 'compileShader', 'found', 'fragment_shader', 'geometry_shader4', 'get_program_binary', 'glAttachShader', 'glBindAttribLocation', 'glCompileShader', 'glCreateProgram', 'glCreateShader',
还没有看太深的代码,但你似乎调用shaders.CompileShader而不是shaders.compileShader。此外,它看起来像你写的着色器实际上是版本120着色器,所以请尝试切换着色器版本。就我所知,像gl_ModelViewProjectionMatrix这样的变量在现代OpenGL版本中不再存在了! – CodeSurgeon
PyPI和binary出现了一些问题我得到了另一个错误:尝试调用未定义的函数glutInit,在调用 –