Skip to content

CubeTexture

Represents a cube map texture.

A cube texture stores six face images that form a cube map, commonly used for skyboxes and environment mapping. Each face corresponds to a direction along the positive or negative X, Y, or Z axis. Cube textures are typically created through the engine's cube texture loader rather than instantiated directly.

INFO

Derives from Texture and inherits all public properties and methods.

Construction

Constructors


CubeTexture()

Constructs a cube texture from six face images.

The texture holds shared references to each face image, allowing multiple textures to share the same underlying pixel data.

cpp
CubeTexture::CubeTexture(Images images);
ParameterDescription
imagesThe six face images that make up the cube map.

Factories preferred


CubeTexture::Create() std::shared_ptr<CubeTexture>

Creates a shared instance of CubeTexture.

cpp
static std::shared_ptr<CubeTexture> CubeTexture::Create(Images images);
ParameterDescription
imagesThe six face images that make up the cube map.

Types

CubeTexture::Images struct

The six face images that make up the cube map.

ParameterDescription
positive_x std::shared_ptr<Image>Right face (+X).
negative_x std::shared_ptr<Image>Left face (-X).
positive_y std::shared_ptr<Image>Top face (+Y).
negative_y std::shared_ptr<Image>Bottom face (-Y).
positive_z std::shared_ptr<Image>Front face (+Z).
negative_z std::shared_ptr<Image>Back face (-Z).

Properties

images Images

The source images backing this cube map.

cpp
Images images {};

Functions

GetType() Texture::Type virtual

Identifies this texture as Texture::Type::CubeTexture.

cpp
Type vglx::CubeTexture::GetType() const override;

Released under the MIT License.