Using extension functions

Before using an extension function, you should check that the extension is implemented by the current driver. Typically this is done using glGetString(GL_EXTENSIONS), but pyglet has a convenience module, that does this for you:

    # ... do shadow-related code.
    # ... raise an exception, or use a fallback method

You can also easily check the version of OpenGL:

    # We can assume all OpenGL 1.5 functions are implemented.

Remember to only call the gl_info functions after creating a window.

There is a corresponding glu_info module for checking the version and extensions of GLU.

nVidia often release hardware with extensions before having them registered officially. When you import * from you import only the registered extensions. You can import the latest nVidia extensions with:

from import *