我想在Python創建與過剩的窗口,並有下面的代碼:Python的glutCreateWindow錯誤「錯誤類型」
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);