picogl.texture.gltexture ======================== .. py:module:: picogl.texture.gltexture .. autoapi-nested-parse:: This module provides functionality for managing 2D OpenGL textures. It includes a class for creating, binding, uploading data, setting parameters, generating mipmaps, and deleting 2D textures in OpenGL. This class ensures efficient management of texture resources in graphics applications. Example Usage: ============== >> spec = TextureSpec(width=width, height=height) >> tex = Texture2D(spec, data) >> driver = GLTextureDriver() >> driver.create(tex) >> driver.bind(tex) >> driver.set_parameters() >> driver.upload(tex) >> driver.generate_mipmap() >> return tex.handle Classes ------- .. autoapisummary:: picogl.texture.gltexture.GLTexture Module Contents --------------- .. py:class:: GLTexture Bases: :py:obj:`enum.IntEnum` gl Texture Mode .. py:attribute:: TEXTURE_2D .. py:attribute:: TEXTURE_3D .. py:attribute:: TEXTURE_BINDING_2D .. py:attribute:: TEXTURE_MIN_FILTER .. py:attribute:: TEXTURE_MAG_FILTER .. py:attribute:: TEXTURE_WRAP_S .. py:attribute:: TEXTURE_WRAP_T .. py:attribute:: TEXTURE0 .. py:attribute:: ACTIVE_TEXTURE .. py:method:: choices() :classmethod: .. py:method:: set_active(unit=TEXTURE0) :staticmethod: .. py:method:: bind(target: int, texture: int) :staticmethod: .. py:method:: enabled_texture2d() :staticmethod: Texture 2D Enabled .. py:method:: disable_tex2d() :staticmethod: .. py:method:: enable_tex2d() :staticmethod: .. py:method:: get_enabled_tex2d(self) -> Any :staticmethod: .. py:method:: bound_texture(texture_id: int, unit: int = GL_TEXTURE0) :staticmethod: Bind a texture to a specific unit, restoring previous state.