C4 Engine Terathon Software C4 Engine API Documentation

• Graphics Manager

API Links
Developer Links

struct TextureHeader

Defined in:  C4Textures.h
The TextureHeader structure contains information about a texture map.
Definition

struct TextureHeader

Data Members
TextureType         textureType; The texture type (1D, 2D, 3D, cube, or rectangle).
unsigned long       textureFlags; The texture image flags.
TextureSemantic     colorSemantic; The semantic usage for the color channels.
TextureSemantic     alphaSemantic; The semantic usage for the alpha channel.
TextureFormat       imageFormat; The format of the texture image.
long                imageWidth; The width of the texture map.
long                imageHeight; The height of the texture map.
long                imageDepth; The depth of the texture map (value is 1 for a 2D texture).
TextureWrap         wrapMode[3]; The wrap mode for each coordinate.
long                mipmapCount; The number of mipmap levels.
long                mipmapDataOffset; The offset to the mipmap data array, in bytes relative to the beginning of the TextureHeader structure. This should be 0 for textures created in memory.
unsigned long       auxiliaryDataSize; The size of the auxiliary data, in bytes. This should be 0 for textures created in memory.
long                auxiliaryDataOffset; The offset to the auxiliary data, in bytes relative to the beginning of the TextureHeader structure. This should be 0 for textures created in memory.
Description
The TextureHeader structure contains information about a texture map and is useful when creating a texture image in memory. A texture header can be filled in and passed to the Texture::Get function to create a new texture object.

The textureType member can be one of the following values.
kTexture2D 2D texture map.
kTexture3D 3D texture map.
kTextureCube Cube texture map.
kTextureRectangle Rectangle texture map.
The textureFlags member can be a combination (through logical OR) of the following values.
kTextureFilterInhibit Do not filter the texture (bilinear, trilinear, or anisotropic).
kTextureAnisotropicFilterInhibit Do not apply anisotropic filtering to the texture (but still allow ordinary bilinear or trilinear filtering).
kTextureForceHighQuality Always use the highest resolution image available, even if a lower quality level is selected in the Graphics Manager.
The colorSemantic and alphaSemantic members denote the type of information that is stored in the color channels and the alpha channel of the texture image, respectively. They can each be one of the following values.
kTextureSemanticNone No meaning.
kTextureSemanticData Generic data.
kTextureSemanticDiffuse Diffuse color map.
kTextureSemanticGloss Gloss (specular color) map.
kTextureSemanticEmission Emission color map.
kTextureSemanticOpacity Refractive opacity map.
kTextureSemanticEnvironment Environment map.
kTextureSemanticLight Light projection.
kTextureSemanticNormal Normal map.
kTextureSemanticParallax Parallax data.
kTextureSemanticTransparency Transparency.
kTextureSemanticOcclusion Ambient occlusion.
kTextureSemanticGlow Glow intensity.
The imageFormat member can be one of the following values.
kTextureRGBA8 32-bit RGBA.
kTextureBGRA8 32-bit BGRA.
kTextureARGB8 32-bit ARGB.
kTextureLA8 16-bit luminance-alpha.
kTextureL8 8-bit luminance.
kTextureI8 8-bit intensity.
kTextureBC13 BC1 or BC3 compressed.
kTextureDEPTH16 16-bit depth.
kTextureDEPTH24 24-bit depth.
The wrapMode array contains the wrap mode for each of the three texture mapping axes. They can each be one of the following values unless textureType is kTextureRectangle, in which case the wrap modes must all be kTextureClamp.
kTextureRepeat Repeat.
kTextureClamp Clamp to edge.
kTextureClampBorder Clamp to border.
kTextureMirrorRepeat Mirror and repeat.
kTextureMirrorClamp Mirror once and clamp to edge.
kTextureMirrorClampBorder Mirror once and clamp to border.
See Also

Texture::Get