我正在尝试在 python 中创建一个带有 glut 的窗口并具有以下代码:
glutInit()
glutInitWindowSize(windowWidth, windowHeight)
glutInitWindowPosition(int(centreX - windowWidth/2), int(centreY - windowHeight/2))
glutCreateWindow("MyWindow")
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH)
glutDisplayFunc(displayFun)
glutIdleFunc(animateFun)
glutKeyboardFunc(keyboardFun)
glutPassiveMotionFunc(mouseFun)
glutReshapeFunc(reshapeFun)
initFun()
#loadTextures()
glutMainLoop()
我在 'glutCreateWindow' 行收到一条错误消息:
Traceback (most recent call last):
File "F:\MyProject\main.py", line 301, in <module>
glutCreateWindow("MyWindow")
File "C:\Python34\lib\site-packages\OpenGL\GLUT\special.py", line 73, in glutCreateWindow
return __glutCreateWindowWithExit(title, _exitfunc)
ctypes.ArgumentError: argument 1: <class 'TypeError'>: wrong type
此功能的文档指定
int glutCreateWindow(char *name);