這是我的源代碼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,在調用 –