Leap.ogl package

Submodules

Leap.ogl.application module

Leap.ogl.element module

Leap.ogl.interface module

Wrapper around PyOpenGL and PyGame

class Leap.ogl.interface.GLInterface[source]

Bases: object

Creates a screen, and allows easy evaluation of events

display_loop()[source]

Main display function, called every iteration

event_handler(event)[source]

A big switch case function for input event

Parameters:event – pygame.Event, used to check for events
Returns:handler for event.type
init()[source]

Sets the env settings for the application in the beginning

init_loop()[source]

It is called before drawing on the screen each time

key_down(key)[source]
Parameters:key – key pressed
key_up(key)[source]
Parameters:key – key unpressed
main_loop()[source]

Blocking loop, as per the convention of opengl

mouse_button_down(event)[source]
Parameters:event – directly passes from event-handler
mouse_button_up(event)[source]
Parameters:event – directly passes from event-handler
mouse_motion()[source]

Detect motion of mouse

stop_and_exit()[source]

Quit the application properly

unimplemented(something)[source]

Simple wrapper around print for ease :param something: any printable object

Leap.ogl.quaternion module

Leap.ogl.sample_elements module

Leap.ogl.world module

Analogue to Stage in a typical application

class Leap.ogl.world.World[source]

holds all the elements, and interface to modify any element

add_element(element)[source]

adds an element onto the screen

Parameters:element – adds the element to the list
clear()[source]

removes all the elements

display()[source]

displays the elements to the screen

transform(pose=None)[source]

modifies the elements selected

Parameters:poseLeap.ogl.element.Element.transform()

Module contents