picogl.texture.gltexture

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

GLTexture

gl Texture Mode

Module Contents

class picogl.texture.gltexture.GLTexture[source]

Bases: enum.IntEnum

gl Texture Mode

TEXTURE_2D[source]
TEXTURE_3D[source]
TEXTURE_BINDING_2D[source]
TEXTURE_MIN_FILTER[source]
TEXTURE_MAG_FILTER[source]
TEXTURE_WRAP_S[source]
TEXTURE_WRAP_T[source]
TEXTURE0[source]
ACTIVE_TEXTURE[source]
classmethod choices()[source]
static set_active(unit=TEXTURE0)[source]
static bind(target: int, texture: int)[source]
static enabled_texture2d()[source]

Texture 2D Enabled

static disable_tex2d()[source]
static enable_tex2d()[source]
static get_enabled_tex2d(self) Any[source]
static bound_texture(texture_id: int, unit: int = GL_TEXTURE0)[source]

Bind a texture to a specific unit, restoring previous state.