Skip to content

Texture

Abstract base class for texture types.

This class is not intended to be used directly. Use one of the concrete texture types such as Texture2D, or derive your own texture class that implements the required interface.

Types

Texture::RowAlignment enum

Specifies the byte alignment of each row in source texture data.

Determines how pixel rows are aligned in memory when uploading texture data to the GPU. The alignment value must match the source image’s row stride to ensure correct decoding and avoid visual artifacts.

Textures generated through the asset builder pipeline are encoded as RGBA8 with 4-byte row alignment by default.

ValueDescription
OneByte1-byte alignment (tightly packed).
TwoBytes2-byte alignment.
FourBytes4-byte alignment (default).
EightBytes8-byte alignment

Texture::Type enum

Enumerates all supported texture types.

ValueDescription
Texture2DTwo-dimensional texture.

Properties

renderer_id unsigned int

Renderer-specific texture handle. Typically corresponds to the underlying graphics API object identifier, for example, an OpenGL texture ID.

cpp
unsigned int renderer_id {0};

row_alignment RowAlignment

Current row alignment used when uploading texture data.

cpp
RowAlignment row_alignment {RowAlignment::FourBytes};

Functions

GetType() Type pure virtual

Identifies the concrete texture type.

cpp
virtual Type Texture::GetType() const=0;

Released under the MIT License.