picogl.backend.glut.glut_renderer

Legacy PicoGL Cube - Compatible with systems without modern shader support.

This example uses legacy OpenGL rendering (OpenGL 1.x/2.x) that works on: - Older macOS systems - Systems without modern OpenGL 3.3+ support - Systems with limited shader support

The renderer uses LegacyGLMesh which bypasses modern VAO/VBO requirements and uses legacy client states and immediate mode rendering.

Classes

GlutRenderer

Legacy cube renderer using PicoGL LegacyGLMesh.

Functions

main()

Main function.

Module Contents

class picogl.backend.glut.glut_renderer.GlutRenderer(width=800, height=600, title='Legacy Glut Renderer')[source]

Legacy cube renderer using PicoGL LegacyGLMesh.

viewport[source]
projection_config[source]
projection[source]
width = 800[source]
height = 600[source]
title = 'Legacy Glut Renderer'[source]
rotation[source]
zoom_distance = 5.0[source]
wireframe_mode = False[source]
auto_rotate = False[source]
mesh = None[source]
vertices[source]
colors[source]
view[source]
init_glut()[source]

Initialize GLUT window.

initialize_glut()[source]
init_gl()[source]

Initialize OpenGL state.

load_cube_data()[source]

Load cube data using PicoGL LegacyGLMesh.

display()[source]

Display callback - render the scene.

apply_rotations()[source]

Apply rotations

draw_mesh()[source]

Draw the cube

update_size(height, width)[source]
reshape(width, height)[source]

Reshape callback - handle window resize.

update_perspective(height, width)[source]
update_viewport(height=None, width=None)[source]
keyboard(key, x, y)[source]

Keyboard callback.

mouse(button, state, x, y)[source]

Mouse callback.

motion(x, y)[source]

Mouse motion callback.

idle()[source]

Idle callback for animation.

run()[source]

Run the application.

picogl.backend.glut.glut_renderer.main()[source]

Main function.