`GLUT`
Prev | Chapter 3. User's Guide | Next

## `GLUT`

## GL Utility Toolkit; API versions 1.0, 2.0, 3.0, 3.4, 3.6, and 3.7

PyOpenGL provides coverage of all GLUT API versions and the calling convention for the exposed functions are identical to that of the C binding, with a few minor exceptions.

First, the `glutInit` function takes a list of arguments (usually `sys.argv`, but not `sys.argv[1:]`) and returns all non GLUT arguments. For example

    import sys

    my_argv = glutInit(sys.argv)

Secondly, setting callbacks in Python is done in the same way as done in C, but Python has no `NULL` pointer so `None` is used to clear a callback instead, i.e.

    def on_display():
        pass

    glutDisplayFunc(on_display) # set the callback
    glutDisplayFunc(None)       # clear the callback

For more information about GLUT see the Man Pages, the GLUT homepage, or OpenGL.org's GLUT documentation.

Prev | Home | Next
`GLU` | Up | `WGL`