[PyOpenGL-Users] Glut close function
Brought to you by:
mcfletch
|
From: Gijs <in...@bs...> - 2009-06-04 10:20:52
|
Hello List,
I tried to bind an exit-function with Glut, but the function you
normally use to bind your exit-function with, glutCloseFunc, does not
exist in Mac OS X. It's called glutWMCloseFunc in Mac OS X. Now this is
not much of a problem, but when I try to use glutCloseFunc, it gives me
the following traceback:
Traceback (most recent call last):
File "./runtests.py", line 107, in <module>
glutCloseFunc(exitProgram)
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/OpenGL/GLUT/special.py",
line 131, in __call__
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/OpenGL/GLUT/special.py",
line 100, in failFunction
OpenGL.error.NullFunctionError: Undefined GLUT callback function Close,
check for bool(glutCloseFunc) before calling
Kind of obvious of course, but I wanted to know if there is a normal way
to check if this function really exists. I could check for the platform
I'm running the program in, but to me it seems a better solution to
check for the existence of this function. Even neater would be that
PyOpenGL binds glutWMCloseFunc to glutCloseFunc when ran in Mac OS X.
That would at least keep the Glut/OpenGL code platform independent.
Regards, Gijs
|