picogl.backend.gl.driver.frame ============================== .. py:module:: picogl.backend.gl.driver.frame .. autoapi-nested-parse:: 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 ------- .. autoapisummary:: picogl.backend.gl.driver.frame.GLFrameDriver Module Contents --------------- .. py:class:: GLFrameDriver Framebuffer execution helpers for clear and viewport operations. .. py:method:: clear(mask) :staticmethod: .. py:method:: set_clear_background_and_color(color=(0.0, 0.0, 0.0, 1.0)) 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. :param color: 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). :type color: tuple[float, float, float, float] .. py:method:: bind_framebuffer(framebuffer: int) -> None :staticmethod: Bind the window-system default framebuffer (required on some Qt/macOS paths). .. py:method:: bind_default_framebuffer() -> None Bind the window-system default framebuffer (required on some Qt/macOS paths). .. py:method:: set_clear_color_only(color: tuple[float, float, float, float]) -> None Set the clear color without clearing (safe before the default FBO is ready). .. py:method:: set_clear_color(color=(0.0, 0.0, 0.0, 1.0)) :staticmethod: .. py:method:: viewport(x, y, width, height) :staticmethod: .. py:method:: clear_background() 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 :raises clearing operation.: