picogl.texture.texture2d
This module provides functionality for managing 2D OpenGL texture.
It includes a class for creating, binding, uploading data, setting parameters, generating mipmaps, and deleting 2D texture 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
Texture 2D |
Functions
|
generate_texture |
Module Contents
- class picogl.texture.texture2d.Texture2D(spec: picogl.texture.texture_spec.TextureSpec, data: numpy.ndarray | None = None)[source]
Texture 2D
- picogl.texture.texture2d.upload_texture_2d(target: picogl.backend.gl.enums.GLNumeric, texture_buffer: bytes, texture_height: int, texture_width: int) Any[source]
generate_texture
- Parameters:
target – GLNumeric.UNSIGNED_BYTE
texture_buffer – bytes
texture_height – int
texture_width – int
- Returns:
int