picogl.backend.glut

GLUT backend wrappers for window init, callbacks, and primitives.

Submodules

Classes

GLUTDisplayMode

Flags for glut_init_display_mode().

GLUTMouseButton

GLUT mouse button identifiers.

GLUTMouseState

GLUT mouse button press/release state.

Functions

glut_swap_buffers()

glut swap buffers

glut_wire_cube(size)

glut wire cube

glut_display_func(func) → None

Register the display (redraw) callback.

glut_idle_func(func) → None

Register the idle callback, or None to clear it.

glut_keyboard_func(func) → None

Register the ASCII keyboard callback.

glut_motion_func(func) → None

Register the mouse motion (drag) callback.

glut_mouse_func(func) → None

Register the mouse button callback.

glut_post_redisplay() → None

Request a redraw of the current window.

glut_reshape_func(func) → None

Register the window reshape callback.

glut_create_window(title) → int

Create a GLUT window and return its window id.

glut_init([argv]) → None

Initialize GLUT.

glut_init_display_mode(mode) → None

Set the initial display mode (e.g. RGBA | DOUBLE | DEPTH).

glut_init_window_size(width, height) → None

Set the initial window size in pixels.

glut_main_loop() → None

Enter the GLUT event processing loop (does not return).

glut_solid_teapot(size) → None

Draw a solid teapot of the given size.

glut_wire_teapot(size) → None

Draw a wireframe teapot of the given size.

Package Contents

picogl.backend.glut.glut_swap_buffers()[source]

glut swap buffers

picogl.backend.glut.glut_wire_cube(size: float)[source]

glut wire cube

picogl.backend.glut.glut_display_func(func: DisplayCallback) → None[source]

Register the display (redraw) callback.

picogl.backend.glut.glut_idle_func(func: IdleCallback | None) → None[source]

Register the idle callback, or None to clear it.

picogl.backend.glut.glut_keyboard_func(func: KeyboardCallback) → None[source]

Register the ASCII keyboard callback.

picogl.backend.glut.glut_motion_func(func: MotionCallback) → None[source]

Register the mouse motion (drag) callback.

picogl.backend.glut.glut_mouse_func(func: MouseCallback) → None[source]

Register the mouse button callback.

picogl.backend.glut.glut_post_redisplay() → None[source]

Request a redraw of the current window.

picogl.backend.glut.glut_reshape_func(func: ReshapeCallback) → None[source]

Register the window reshape callback.

class picogl.backend.glut.GLUTDisplayMode[source]

Bases: enum.IntFlag

Flags for glut_init_display_mode().

RGBA = 0
DOUBLE = 0
DEPTH = 0
class picogl.backend.glut.GLUTMouseButton[source]

Bases: enum.IntEnum

GLUT mouse button identifiers.

LEFT = 0
WHEEL_UP = 3
WHEEL_DOWN = 4
class picogl.backend.glut.GLUTMouseState[source]

Bases: enum.IntEnum

GLUT mouse button press/release state.

DOWN = 0
UP = 0
picogl.backend.glut.glut_create_window(title: str | bytes) → int[source]

Create a GLUT window and return its window id.

String titles are encoded as UTF-8.

picogl.backend.glut.glut_init(argv: Sequence[str] | None = None) → None[source]

Initialize GLUT.

Parameters:

argv – Program arguments; defaults to sys.argv.

picogl.backend.glut.glut_init_display_mode(mode: picogl.backend.glut.enums.GLUTDisplayMode | int) → None[source]

Set the initial display mode (e.g. RGBA | DOUBLE | DEPTH).

picogl.backend.glut.glut_init_window_size(width: int, height: int) → None[source]

Set the initial window size in pixels.

picogl.backend.glut.glut_main_loop() → None[source]

Enter the GLUT event processing loop (does not return).

picogl.backend.glut.glut_solid_teapot(size: float) → None[source]

Draw a solid teapot of the given size.

picogl.backend.glut.glut_wire_teapot(size: float) → None[source]

Draw a wireframe teapot of the given size.