Package pyglet

pyglet is a cross-platform games and multimedia package.

Detailed documentation is available at http://www.pyglet.org

Submodules

pyglet.app
Application-wide functionality.
pyglet.clock
Precise framerate calculation, scheduling and framerate limiting.
pyglet.event
Event dispatch framework.
pyglet.font
Load fonts and render text.
pyglet.font.base
Abstract classes used by pyglet.font implementations.
pyglet.gl
OpenGL and GLU interface.
pyglet.gl.gl_info
Information about version and extensions of current GL implementation.
pyglet.gl.glu_info
Information about version and extensions of current GLU implementation.
pyglet.graphics
Low-level graphics rendering.
pyglet.graphics.allocation
Memory allocation algorithm for vertex arrays and buffers.
pyglet.graphics.vertexattribute
Access byte arrays as arrays of vertex attributes.
pyglet.graphics.vertexbuffer
Byte abstractions of Vertex Buffer Objects and vertex arrays.
pyglet.graphics.vertexdomain
Manage related vertex attributes within a single vertex domain.
pyglet.image
Image load, capture and high-level texture functions.
pyglet.image.atlas
Group multiple small images into larger textures.
pyglet.info
Get environment information useful for debugging.
pyglet.media
Audio and video playback.
pyglet.resource
Load application resources from a known path.
pyglet.sprite
Display positioned, scaled and rotated images.
pyglet.text
Text formatting, layout and display.
pyglet.text.caret
Provides keyboard and mouse editing procedures for text layout.
pyglet.text.document
Formatted and unformatted document interfaces used by text layout.
pyglet.text.formats
Document formats.
pyglet.text.formats.attributed
Extensible attributed text format for representing pyglet formatted documents.
pyglet.text.formats.html
Decode HTML into attributed text.
pyglet.text.formats.plaintext
Plain text decoder.
pyglet.text.formats.structured
Base class for structured (hierarchical) document formats.
pyglet.text.layout
Render simple text and formatted documents efficiently.
pyglet.text.runlist
Run list encoding utilities.
pyglet.window
Windowing and user-interface events.
pyglet.window.event
Events for pyglet.window.
pyglet.window.key
Key constants and utilities for pyglet.window.
pyglet.window.mouse
Mouse constants and utilities for pyglet.window.

Variables

  options = {'audio': ('directsound', 'openal', 'alsa', 'silent'...
Global dict of pyglet options.
  version = '1.1.3'
The release version of this pyglet installation.

Variables Details

options

Global dict of pyglet options. To change an option from its default, you must import pyglet before any sub-packages. For example:

import pyglet
pyglet.options['debug_gl'] = False

The default options can be overridden from the OS environment. The corresponding environment variable for each option key is prefaced by PYGLET_. For example, in Bash you can set the debug_gl option with:

PYGLET_DEBUG_GL=True; export PYGLET_DEBUG_GL

For options requiring a tuple of values, separate each value with a comma.

The non-development options are:

audio

A sequence of the names of audio modules to attempt to load, in order of preference. Valid driver names are:

  • directsound, the Windows DirectSound audio module (Windows only)
  • alsa, the ALSA audio module (Linux only)
  • openal, the OpenAL audio module
  • silent, no audio
debug_lib
If True, prints the path of each dynamic library loaded.
debug_gl
If True, all calls to OpenGL functions are checked afterwards for errors using glGetError. This will severely impact performance, but provides useful exceptions at the point of failure. By default, this option is enabled if __debug__ is (i.e., if Python was not run with the -O option). It is disabled by default when pyglet is "frozen" within a py2exe or py2app library archive.
shadow_window

By default, pyglet creates a hidden window with a GL context when pyglet.gl is imported. This allows resources to be loaded before the application window is created, and permits GL objects to be shared between windows even after they've been closed. You can disable the creation of the shadow window by setting this option to False. Recommended for advanced devlopers only.

Since: pyglet 1.1

vsync
If set, the pyglet.window.Window.vsync property is ignored, and this option overrides it (to either force vsync on or off). If unset, or set to None, the pyglet.window.Window.vsync property behaves as documented.
xsync

If set (the default), pyglet will attempt to synchronise the drawing of double-buffered windows to the border updates of the X11 window manager. This improves the appearance of the window during resize operations. This option only affects double-buffered windows on X11 servers supporting the Xsync extension with a window manager that implements the _NET_WM_SYNC_REQUEST protocol.

Since: pyglet 1.1

Value:
{'audio': ('directsound', 'openal', 'alsa', 'silent'),
 'debug_font': False,
 'debug_gl': True,
 'debug_gl_trace': False,
 'debug_gl_trace_args': False,
 'debug_graphics_batch': False,
 'debug_lib': False,
 'debug_media': False,
...

version

The release version of this pyglet installation.

Valid only if pyglet was installed from a source or binary distribution (i.e. not in a checked-out copy from SVN).

Use setuptools if you need to check for a specific release version, e.g.:

>>> import pyglet
>>> from pkg_resources import parse_version
>>> parse_version(pyglet.version) >= parse_version('1.1')
True
Value:
'1.1.3'