C4 Engine Terathon Software C4 Engine API Documentation

• Graphics Manager

API Links
Developer Links

class MapAttribute

Defined in:  C4Attributes.h
The MapAttribute class is the base class for attributes that use a texture map.
Definition

class MapAttribute : public Attribute

Member Functions
MapAttribute::GetTextureName Returns the name of the texture map.
MapAttribute::GetTexture Returns the texture map object.
MapAttribute::SetTexture Sets the texture map object.
Constructor

MapAttribute(AttributeType type, const char *name);

MapAttribute(AttributeType type, Texture *texture);

MapAttribute(AttributeType type, const TextureHeader *header, const void *image = nullptr);

The constructors have protected access. The MapAttribute class can only exist as the base class for other material attribute classes that use texture maps.
Parameters
type The attribute type. This must be the type of a subclass that inherits from MapAttribute.
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 MapAttribute class encapsulates information about a texture map for other material attributes. If a MapAttribute object is constructed by passing the name parameter, then the texture map is loaded through the Resource Manager. If a MapAttribute object is constructed by passing the header and image parameters, 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.
Base Classes
Attribute A MapAttribute is a specific type of Attribute.
See Also

TextureMapAttribute

NormalMapAttribute

GlossMapAttribute

EmissionMapAttribute