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

#include <gls_texture_vertex_array.h>

Classes

struct  InitParameters
 

Public Member Functions

 GlsTextureVertexArray (const InitParameters &initParameters)
 
virtual ~GlsTextureVertexArray ()
 
void SetVertex (const GlsUInt32 index, const GlsTextureVertex &v)
 
void OutputVertices (GlsStateManager &gl, const GlsBool doTextureCoordinates, const GlsBool doVertexColors) const
 
void OutputTriangle (GlsStateManager &gl, const GlsUInt32 v1Index, const GlsUInt32 v2Index, const GlsUInt32 v3Index, const GlsBool doTextureCoordinates, const GlsBool doVertexColors) const
 
void OffsetTextureCoordinates (const GlsVector2D &offset)
 

Protected Attributes

const GlsUInt32 _numVertices
 
GlsTextureVertex *const _vertices
 

Detailed Description

This class encapsulates an array of one or more GlsTextureVertex 's.

Invariant
_numVertices > 0, _vertices != GLS_NULL, every vertex in the array is valid

Constructor & Destructor Documentation

GlsTextureVertexArray::GlsTextureVertexArray ( const InitParameters initParameters)

Constructor - create an instance

Parameters
initParametersinitialization parameters
Precondition
initParameters.IsValid()
Postcondition
instance is created
virtual GlsTextureVertexArray::~GlsTextureVertexArray ( )
virtual

Destructor - shall never be called

Precondition
none
Postcondition
none

Member Function Documentation

void GlsTextureVertexArray::OffsetTextureCoordinates ( const GlsVector2D offset)

Offset all of texture coordinates in the array by a given 2D vector

Parameters
offset2D offset vector
Precondition
offset.IsValid()
Postcondition
texture coordinates in the array are offset by the vector
void GlsTextureVertexArray::OutputTriangle ( GlsStateManager gl,
const GlsUInt32  v1Index,
const GlsUInt32  v2Index,
const GlsUInt32  v3Index,
const GlsBool  doTextureCoordinates,
const GlsBool  doVertexColors 
) const

Output three vertices in the array to GL

Parameters
glGL state manager to receive verts
v1Indexindex of first vertex to send
v2Indexindex of second vertex to send
v3Indexindex of third vertex to send
doTextureCoordinatesGLS_TRUE to send texture coordinates with each vert else GLS_FALSE
doVertexColorsGLS_TRUE to send vertex colors with each vert else GLS_FALSE
Precondition
called inside a GL begin/end pair, v1Index < _numVertices, v2Index < _numVertices, v3Index < _numVertices
Postcondition
vertices are output to GL
void GlsTextureVertexArray::OutputVertices ( GlsStateManager gl,
const GlsBool  doTextureCoordinates,
const GlsBool  doVertexColors 
) const

Output the vertices in the array to GL

Parameters
glGL state manager to receive verts
doTextureCoordinatesGLS_TRUE to send texture coordinates with each vert else GLS_FALSE
doVertexColorsGLS_TRUE to send vertex colors with each vert else GLS_FALSE
Precondition
called inside a GL begin/end pair
Postcondition
vertices are output to GL
void GlsTextureVertexArray::SetVertex ( const GlsUInt32  index,
const GlsTextureVertex v 
)

Set a vertex in the array

Parameters
indexindex to desired vertex to set
vnew value for vertex
Precondition
index < number of elements in array, v.IsValid()
Postcondition
vertex at given index is set to v

Member Data Documentation

const GlsUInt32 GlsTextureVertexArray::_numVertices
protected

number of vertices in vertices array

GlsTextureVertex* const GlsTextureVertexArray::_vertices
protected

array of vertices