util Package

event Module

class gloopy.util.event.Event[source]

Bases: object

Used when many subscribers would to recieve a function call from a single sender.

__init__()[source]

Subscribe by in-place-add (+= or __iadd__) a callable of the right signature. e.g:

def handler(this, that):
    pass

event = Event()
event += handler

event.fire(1, 2)

The .fire call will invoke handler, passing 1 and 2, and will also invoke all other subscribers to this event.

fire(*args, **kwargs)[source]

call all subscribers to the event

gl_wrap Module

Wrap any OpenGL functions which are fiddly to access via the raw bindings.

gloopy.util.gl_wrap.glGenVertexArray()[source]

Return the integer ID of the created vertex object array

log Module

gloopy.util.log.init_log()[source]

Initialise stdlib logging.

options Module

class gloopy.util.options.Options(argv)[source]

Bases: object

Application-wide options are stored in this object’s attributes. These are populated at start-up by a rough-and-ready check of command-line args. One day they might also take config files into account, to allow persistance of option changes by the user.

vsync: Boolean, default to True. synchronise screen refreshes to monitor. Setting this to True will limit framerate to your monitor refresh rate (e.g. 60fps), which is likely what you want unless you are performance testing. Setting it to False will increase framerate, but not visibly (since your monitor cannot display the extra frames) and will introduce ‘tearing’. Note that some video drivers have settings which override this value.

fullscreen: boolean, default to True. If false, display in a window.

fps: Display frames per second in lower-left of screen.

path Module

Access to all application path values should go via this module. In particular, use this module instead of using __file__ to locate resources, since resources will be separated from source code under some circumstances (e.g. when installed from an rpm.) See excellent talk on cross-platform development using these ideas at: http://us.pycon.org/2010/conference/schedule/event/38/

CONTEXT: tuple of (platform, setup), where:
platform: windows | mac | linux
setup: source | frozen
ROOT: application root directory
DATA: application data directory
SOURCE: root of application source code
SHADERS: location of application shader source code

screenshot Module

gloopy.util.screenshot.screenshot()[source]

save a screenshot to the current directory, named ‘screenshotXX.png’, where XX is successive integers.

Table Of Contents

Previous topic

shapes Package

Next topic

view Package

This Page