GL Studio Safety Critical Embedded C++ Runtime Library
GlsTexturePalette Class Reference

#include <gls_texture_palette.h>

Classes

struct  InitParameters
 

Public Member Functions

 GlsTexturePalette (const InitParameters &initParameters)
 
virtual ~GlsTexturePalette ()
 
void BindTexture (GlsStateManager &gl, const GlsUInt32 index) const
 

Static Public Attributes

static const GlsUInt32 NO_TEXTURE = GLSUINT32_MAX
 

Protected Attributes

GlsPointerArray _imagePointers
 

Detailed Description

Stores a list of textures, each with its own texture handle. This allows the textures to be stored separately from the objects, which allows multiple objects to share the same textures.

Invariant
_imagePointers.Invariant(), invariant of each image in the arrray

Constructor & Destructor Documentation

GlsTexturePalette::GlsTexturePalette ( const InitParameters initParameters)

Create a new texture palette with the indicated number of entries

Parameters
initParametersinitialization parameters for texture palette
Precondition
initParameters.IsValid()
Postcondition
object constructed
virtual GlsTexturePalette::~GlsTexturePalette ( )
virtual

Destructor - shall never be called

Precondition
none
Postcondition
none

Member Function Documentation

void GlsTexturePalette::BindTexture ( GlsStateManager gl,
const GlsUInt32  index 
) const

Bind the texture at the given index, unless it is already bound. Set as the texture to be used for texturing polygons

Parameters
glOpenGL State Manager to bind texture in
indexindex < GetSize(), index != NO_TEXTURE, entry at index is not GLS_NULL
Precondition
index < GetSize(), index != NO_TEXTURE, entry at index is not GLS_NULL
Postcondition
texture at given index is bound to OpenGL

Member Data Documentation

GlsPointerArray GlsTexturePalette::_imagePointers
protected

array of image pointers

const GlsUInt32 GlsTexturePalette::NO_TEXTURE = GLSUINT32_MAX
static

texture index used to indicate that an object does not have a texture