Search code examples
pythonopenglpyopengl

Calling OpenGL Extensions from Python


I am using PyOpenGL 3 on Ubuntu Natty.

I want to use the glDrawElementsBaseVertex function.

I can see it listed in my glxinfo output, so I know my card has it.

However, I cannot find how to actually invoke it. When I import OpenGL.GL I get a NameError if I try to use it. (As distinct from it being None).


Solution

  • Try to import the function through its extension name:

    >>> from OpenGL.GL.ARB.draw_elements_base_vertex import *
    >>> glDrawElementsBaseVertex
    <OpenGL.platform.baseplatform.glDrawElementsBaseVertex object at 0x031D7B30>