C4 Engine
C4 Engine API Documentation

TextureAttribute::SetTexture

Defined in:  C4Attributes.h
Sets the texture map object.
Prototype

void SetTexture(const char *name);

void SetTexture(Texture *texture);

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

Parameters
name The name of the texture map to load.
texture The texture object to use. Specifying this parameter increments the reference count of the texture object.
header A texture header from which to construct a new texture object.
image A pointer to a texture image that is used if the texture header does not specify an offset to an image.
Description
The SetTexture function sets the texture map object used by the attribute. If the name parameter is passed to this function, then the texture map is loaded through the Resource Manager. If the header and image parameters are used, then a new texture map is constructed using the information in the TextureHeader structure. If the image parameter is not nullptr, then the texture image is read from the location to which it points; otherwise, the texture header specifies the location of the image.
See Also

TextureAttribute::GetTexture