我正在尝试使用OpenGL库创建一个简单的窗口。
from OpenGL.GL import *
from OpenGL.GLUT import *
def draw():
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
glLoadIdentity()
glutSwapBuffers()
glutInit()
glutInitDisplayMode(GLUT_RGBA)
glutInitWindowSize(900,900)
glutInitWindowPosition(500,500)
window = glutCreateWindow("Paka Paka")
glutDisplayFunc(draw)
glutIdleFunc(draw)
glutMainLoop()
我将glut.dll和glut32.dll发送到同一文件夹。我运行程序,然后
Traceback (most recent call last):
File "C:\Users\Osman\Desktop\kodlama v2\pygletdeneme.py", line 13, in <module>
glutInit()
File "C:\Users\Osman\AppData\Local\Programs\Python\Python37-32\lib\site-packages\OpenGL\GLUT\special.py", line 333, in glutInit
_base_glutInit( ctypes.byref(count), holder )
File "C:\Users\Osman\AppData\Local\Programs\Python\Python37-32\lib\site-packages\OpenGL\platform\baseplatform.py", line 407, in __call__
self.__name__, self.__name__,
OpenGL.error.NullFunctionError: Attempt to call an undefined function glutInit, check for bool(glutInit) before calling
我怎么了?