Module pyglet.gl.glu_info

Information about version and extensions of current GLU implementation.

Usage:

from pyglet.gl import glu_info

if glu_info.have_extension('GLU_EXT_nurbs_tessellator'):
    # ...

If multiple contexts are in use you can use a separate GLUInfo object for each context. Call set_active_context after switching to the desired context for each GLUInfo:

from pyglet.gl.glu_info import GLUInfo

info = GLUInfo()
info.set_active_context()
if info.have_version(1, 3):
    # ...

Note that GLUInfo only returns meaningful information if a context has been created.

Classes

  GLUInfo
Information interface for the GLU library.

Functions

  set_active_context()
Store information for the currently active context.
bool have_version(major, minor=0, release=0)
Determine if a version of GLU is supported.
str get_version()
Get the current GLU version.
bool have_extension(extension)
Determine if a GLU extension is available.
list of str get_extensions()
Get a list of available GLU extensions.

Variables

  __package__ = 'pyglet.gl'

Function Details

set_active_context

set_active_context()

Store information for the currently active context.

This method is called automatically for the default context.

have_version

have_version(major, minor=0, release=0)
Determine if a version of GLU is supported.
Parameters:
major : int
The major revision number (typically 1).
minor : int
The minor revision number.
release : int
The release number.
Returns:
bool: True if the requested or a later version is supported.

get_version

get_version()
Get the current GLU version.
Returns:
str: the GLU version

have_extension

have_extension(extension)
Determine if a GLU extension is available.
Parameters:
extension : str
The name of the extension to test for, including its GLU_ prefix.
Returns:
bool: True if the extension is provided by the implementation.

get_extensions

get_extensions()
Get a list of available GLU extensions.
Returns:
list of str: a list of the available extensions.