Class pyglet.gl.gl_info.GLInfo

Information interface for a single GL context.

A default instance is created automatically when the first OpenGL context is created. You can use the module functions as a convenience for this default instance's methods.

If you are using more than one context, you must call set_active_context when the context is active for this GLInfo instance.

Methods

  set_active_context(self)
Store information for the currently active context.
  remove_active_context(self)
bool have_extension(self, extension)
Determine if an OpenGL extension is available.
list of str get_extensions(self)
Get a list of available OpenGL extensions.
str get_version(self)
Get the current OpenGL version.
bool have_version(self, major, minor=0, release=0)
Determine if a version of OpenGL is supported.
str get_renderer(self)
Determine the renderer string of the OpenGL context.
str get_vendor(self)
Determine the vendor string of the OpenGL context.

Class Variables

  have_context = False
  version = '0.0.0'
  vendor = ''
  renderer = ''
  extensions = set([])

Method Details

set_active_context

set_active_context(self)

Store information for the currently active context.

This method is called automatically for the default context.

have_extension

have_extension(self, extension)
Determine if an OpenGL extension is available.
Parameters:
extension : str
The name of the extension to test for, including its GL_ prefix.
Returns:
bool: True if the extension is provided by the driver.

get_extensions

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

get_version

get_version(self)
Get the current OpenGL version.
Returns:
str: the OpenGL version

have_version

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