C4 Engine Terathon Software C4 Engine API Documentation

• Graphics Manager

API Links
Developer Links

class Texture

Defined in:  C4Textures.h
The Texture class encapsulates a texture map.
Definition

class Texture : public Render::TextureObject, public Shared, public ListElement<Texture>

Member Functions
Texture::Get Returns a reference to a texture object.
Texture::GetTextureWidth Returns the width of a texture map.
Texture::GetTextureHeight Returns the height of a texture map.
Texture::GetTextureHeader Returns the TextureHeader data structure for a texture object.
Texture::GetImagePointer Returns a pointer to the image data for a texture object.
Constructor

Texture(TextureResource *resource, long index);

Texture(const TextureHeader *header, const void *image = nullptr);

Parameters
name The name of the texture resource.
index The index of the texture within the texture resource.
header A pointer to a TextureHeader structure describing the texture.
image A pointer to the pixel image for the texture. If this is nullptr, then the location of the image is given by the information in the texture header.
Description
The Texture class encapsulates a texture map that is either stored in a resource or created in memory. Since a texture is a reference-counted shared object, it cannot be created using the new operator, but instead should be created using the Texture::Get function.

A texture should be released by calling the Shared::Release function.
Base Classes
Render::TextureObject Used internally by the Graphics Manager.
Shared Texture objects are reference counted.
ListElement<Texture> Used internally by the Graphics Manager.