Menu

#232 OpenGL.error.NullFunctionError: Attempt to call an undefined

OpenGLContext v2.0
open
GLUT (25)
5
2015-01-09
2010-10-06
Greg Hazel
No

Trying to run this simple example here:
http://blog.vrplumber.com/index.php?/archives/2324-Sphere-rendering-with-numpy....html

I get:
C:\Users\Greg\Downloads>shader_sphere.py
WARNING:OpenGL.arrays.numpymodule:Unable to load numpy_formathandler accelerator from OpenGL_accelerate
WARNING:context:Python Image Library (PIL) not installed, no Image support available
http://www.pythonware.com/products/pil/index.htm
WARNING:context:Unable to load node implementation for MMImageTexture: 'module' object has no attribute 'MMImageTexture'
Traceback (most recent call last):
File "C:\Users\Greg\Downloads\shader_sphere.py", line 116, in <module>
TestContext.ContextMainLoop()
File "C:\Python27\lib\site-packages\openglcontext-2.1.0a11-py2.7.egg\OpenGLContext\glutcontext.py", line 154, in ContextMainLoop
render = cls( *args, **named)
File "C:\Python27\lib\site-packages\openglcontext-2.1.0a11-py2.7.egg\OpenGLContext\glutcontext.py", line 30, in __init__
glutInitDisplayMode( self.DISPLAYMODE )
File "C:\Python27\lib\site-packages\pyopengl-3.0.1-py2.7.egg\OpenGL\platform\baseplatform.py", line 340, in __call__
self.__name__, self.__name__,
OpenGL.error.NullFunctionError: Attempt to call an undefined function glutInitDisplayMode, check for bool(glutInitDisplayMode) before calling

Discussion

  • Greg Hazel

    Greg Hazel - 2010-10-06

    I installed PIL, but I still get:

    C:\Users\Greg\Downloads>shader_sphere.py
    WARNING:OpenGL.arrays.numpymodule:Unable to load numpy_formathandler accelerator from OpenGL_accelerate
    Traceback (most recent call last):
    File "C:\Users\Greg\Downloads\shader_sphere.py", line 116, in <module>
    TestContext.ContextMainLoop()
    File "C:\Python27\lib\site-packages\openglcontext-2.1.0a11-py2.7.egg\OpenGLContext\glutcontext.py", line 154, in ContextMainLoop
    render = cls( *args, **named)
    File "C:\Python27\lib\site-packages\openglcontext-2.1.0a11-py2.7.egg\OpenGLContext\glutcontext.py", line 30, in __init__
    glutInitDisplayMode( self.DISPLAYMODE )
    File "C:\Python27\lib\site-packages\pyopengl-3.0.1-py2.7.egg\OpenGL\platform\baseplatform.py", line 340, in __call__
    self.__name__, self.__name__,
    OpenGL.error.NullFunctionError: Attempt to call an undefined function glutInitDisplayMode, check for bool(glutInitDisplayMode) before calling

     
  • Mike C. Fletcher

    You are missing GLUT, though why I can't say, as it is supposed to be installed with PyOpenGL in the windows installer.

     
  • Greg Hazel

    Greg Hazel - 2010-10-18

    This is Windows 7 x64 with 64-bit Python. The PyOpenGL installer does not work with 64 bit Python (no installers do. see: http://bugs.python.org/issue6792 )

    Instead I did: easy_install pyopengl

     
  • Mike C. Fletcher

    Then you will need a 64-bit build of GLUT, I'm guessing. FreeGLUT or GLUT32 should work.

     
  • Przemysław Lib

    Przemysław Lib - 2011-06-20

    Oh, and check if you have glu32.dll in Windows/SysWOW64 (if not copy it from Windows/System32), it can help (as i 64bit system there are too folders for libs, and sometimes Win do not care to check them both)

     
  • Przemysław Lib

    Przemysław Lib - 2011-06-20

    Sorry. It should be freeglut.dll. import statement is good. Check freeglut website to get compiled Win libraries, but remeber to copy them also to SysWOW64.

     

Log in to post a comment.