I am trying to learn the basics of game programming and I have installed pygame
and pyopengl
for that.
MyCode:
import sys
import OpenGL
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
def draw():
glClear(GL_COLOR_BUFFER_BIT)
glutWireTeapot(0.5)
glFlush()
glutInit(sys.argv)
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB)
glutInitWindowSize(250, 250)
glutInitWindowPosition(100, 100)
glutCreateWindow("Python OGL Program")
glutDisplayFunc(draw)
glutMainLoop()
draw()
When I run the above code in my command prompt using
python test.py
I get the following error.
Traceback (most recent call last):
File "test.py", line 13, in <module>
glutInit(sys.argv)
File "C:\Python27\lib\site-packages\pyopengl-3.0.2a5-py2.7.egg\OpenGL\GLUT\special.py", line 324, in glutInit
_base_glutInit( ctypes.byref(count), holder )
TypeError: 'NoneType' object is not callable
I don't understand why I am getting this error. Am I calling glutinit
in a wrong way?
I am using Python 2.7.2.
_base_glutInit
isNone
inOpenGL/GLUT/special.py
.easy_install
so what do you suggest should I do a clean install from source.