picogl.backend.texture ====================== .. py:module:: picogl.backend.texture .. autoapi-nested-parse:: Module provides utility functions and a class for managing OpenGL textures. This module contains context managers for handling texture bindings, utility functions for creating procedural textures, and the TextureManager class for managing and reloading textures. It integrates with OpenGL through a backend driver, providing streamlined texture handling and fallback behavior. Classes ------- .. autoapisummary:: picogl.backend.texture.TextureManager Functions --------- .. autoapisummary:: picogl.backend.texture.gl_texture_binding picogl.backend.texture.bind_texture picogl.backend.texture.get_texture_path picogl.backend.texture.create_checkerboard picogl.backend.texture.create_checkerboard_array Module Contents --------------- .. py:function:: gl_texture_binding(texture_gl_id: int | None) gl texture binding .. py:function:: bind_texture(tex: picogl.texture.texture2d.Texture2D | None) bind_texture .. py:function:: get_texture_path(texture_name: str) -> pathlib.Path Return absolute path to a texture. .. py:function:: create_checkerboard(texture_data: numpy.ndarray[Any, Any], texture_size: int) Create a checkerboard pattern .. py:function:: create_checkerboard_array(texture_size: int) -> numpy.ndarray Create fallback RGB checkerboard texture data. .. py:class:: TextureManager(backend) TextureManager .. py:attribute:: backend .. py:attribute:: _textures :type: dict[str, int] .. py:attribute:: _timestamps :type: dict[str, float] .. py:method:: get(name: str) -> int .. py:method:: _reload(name: str, path: pathlib.Path, mtime: float) .. py:method:: _get_fallback(name: str) -> int