simvx.graphics.materials.texture

Texture loading and bindless descriptor array management.

Module Contents

Classes

TextureManager

Loads textures into the bindless descriptor array with path-based caching.

Data

API

simvx.graphics.materials.texture.__all__

[‘TextureManager’]

simvx.graphics.materials.texture.log[source]

‘getLogger(…)’

class simvx.graphics.materials.texture.TextureManager(engine: Any)[source]

Loads textures into the bindless descriptor array with path-based caching.

Wraps Engine.load_texture() to avoid duplicate GPU uploads for the same file.

Initialization

load(path: str | pathlib.Path) int[source]

Load a texture from disk. Returns its bindless index.

Cached — loading the same path twice returns the same index.

load_from_bytes(data: bytes) int[source]

Load a texture from in-memory image bytes (PNG/JPG). Returns bindless index.

Cached by content hash — identical bytes return the same index.

load_if_exists(path: str | pathlib.Path) int[source]

Load a texture if the file exists. Returns -1 if not found.

get_texture_size(tex_idx: int) tuple[int, int][source]

Return (width, height) for a loaded texture index. (0, 0) if unknown.

property count: int

Number of unique textures loaded.

destroy() None[source]

Cleanup (GPU resources owned by Engine, just clear cache).