picogl.backend.gl.driver.frame

A module providing helper operations for framebuffer execution, including clearing framebuffer and setting viewport.

This module utilizes OpenGL commands to perform operations like clearing the framebuffer with specified colors and configuring the viewport for rendering.

Classes

GLFrameDriver

Framebuffer execution helpers for clear and viewport operations.

Module Contents

class picogl.backend.gl.driver.frame.GLFrameDriver[source]

Framebuffer execution helpers for clear and viewport operations.

static clear(mask)[source]
set_clear_background_and_color(color=(0.0, 0.0, 0.0, 1.0))[source]

Clears the screen to a specified color using OpenGL commands.

This method sets the clear color and then clears the color buffer to ensure the screen is rendered with the specified or default background color.

Parameters:

color (tuple[float, float, float, float]) – A tuple representing the RGBA color values to clear the screen. Each value should be between 0.0 and 1.0. Defaults to (0.0, 0.0, 0.0, 1.0).

static bind_framebuffer(framebuffer: int) None[source]

Bind the window-system default framebuffer (required on some Qt/macOS paths).

bind_default_framebuffer() None[source]

Bind the window-system default framebuffer (required on some Qt/macOS paths).

set_clear_color_only(color: tuple[float, float, float, float]) None[source]

Set the clear color without clearing (safe before the default FBO is ready).

static set_clear_color(color=(0.0, 0.0, 0.0, 1.0))[source]
static viewport(x, y, width, height)[source]
clear_background()[source]

Clears the background by removing all color and depth information from the current OpenGL framebuffer.

This method clears the framebuffer’s color and depth buffers, preparing it for rendering the next frame.

Raises:
  • OpenGL.gl.error.GLError – If an OpenGL error occurs during the

  • clearing operation.