texture module

This module processes an application’s textures

class texture.Texture(app)[source]

Bases: object

Load and manage 2D and cubemap textures.

Handles texture loading, processing, and OpenGL resource management.

destroy()[source]

Release all texture resources from memory.

Clean up loaded textures when texture manager is destroyed.

get_depth_texture()[source]

Create depth texture for shadow mapping.

Returns:

Depth texture configured for shadow rendering

Return type:

Texture

get_texture(path)[source]

Load 2D texture with mipmapping and anisotropic filtering.

Parameters:

path (str) – Path to texture image file

Returns:

Processed 2D texture ready for rendering

Return type:

Texture

get_texture_cube(dir_path, ext='png')[source]

Load and process cubemap textures for skybox.

Parameters:
  • dir_path (str) – Directory containing cubemap face images

  • ext (str) – File extension for cubemap images (default: ‘png’)

Returns:

Cubemap texture ready for skybox rendering

Return type:

Texture