picogl.utils.loader.texture

Texture Loader

Attributes

texture

Classes

TextureLoader

Loads a 2D texture from a DDS file or a standard image file using PIL.

Module Contents

class picogl.utils.loader.texture.TextureLoader(file_name: str, mode: str = 'RGB')[source]

Loads a 2D texture from a DDS file or a standard image file using PIL. Automatically creates an OpenGL texture ID.

texture_gl_id: int | None = None[source]
width: int = 0[source]
height: int = 0[source]
format: str = 'RGB'[source]
buffer: bytes | None = None[source]
inversed_v_coords: bool = False[source]
load_dds(file_name: str) None[source]

Load a DDS texture from file. Supports DXT1, DXT3, DXT5 compressed textures. Falls back to PIL loading if compressed texture loading fails.

load_by_pil(file_name: str, mode: str) None[source]

Load a standard image using PIL and upload as OpenGL texture.

delete() None[source]

Deletes the OpenGL texture to free GPU memory.

__len__() int[source]
picogl.utils.loader.texture.texture[source]