vegastrike  0.5.1.r1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GFXVertexList Class Reference

#include <gfxlib_struct.h>

Inheritance diagram for GFXVertexList:
GFXSphereVertexList

Classes

union  INDEX
 
union  VDAT
 Vertices and colors stored. More...
 

Public Member Functions

void RefreshDisplayList ()
 Propagates modifications to the display list. More...
 
 GFXVertexList (enum POLYTYPE poly, int numVertices, const GFXVertex *vertices, int numindices, bool Mutable=false, unsigned int *index=0)
 creates a vertex list with 1 polytype and a given number of vertices More...
 
 GFXVertexList (enum POLYTYPE *poly, int numVertices, const GFXVertex *vertices, int numlists, int *offsets, bool Mutable=false, unsigned int *index=0)
 Creates a vertex list with an arbitrary number of poly types and given vertices, num list and offsets (see above) More...
 
 GFXVertexList (enum POLYTYPE poly, int numVertices, const GFXColorVertex *colors, int numindices, bool Mutable=false, unsigned int *index=0)
 Creates a vertex list with 1 poly type and color information to boot. More...
 
 GFXVertexList (enum POLYTYPE *poly, int numVertices, const GFXColorVertex *colors, int numlists, int *offsets, bool Mutable=false, unsigned int *index=0)
 Creates a vertex list with an arbitrary number of poly types and color. More...
 
virtual ~GFXVertexList ()
 
virtual int numTris () const
 Returns number of Triangles in vertex list (counts tri strips) More...
 
virtual int numQuads () const
 Returns number of Quads in vertex list (counts quad strips) More...
 
unsigned int GetIndex (int offset) const
 Looks up the index in the appropriate short, char or int array. More...
 
POLYTYPEGetPolyType () const
 
int * GetOffsets () const
 
int GetNumLists () const
 
bool hasColor () const
 
int GetNumVertices () const
 
virtual VDATMap (bool read, bool write)
 
void UnMap ()
 
virtual VDATBeginMutate (int offset)
 Returns the array of vertices to be mutated. More...
 
virtual void EndMutate (int newsize=0)
 Ends mutation and refreshes display list. More...
 
void LoadDrawState ()
 Loads the draw state (what is active) of a given vlist for mass drawing. More...
 
virtual void BeginDrawState (GFXBOOL lock=GFXTRUE)
 Specifies array pointers and loads the draw state of a given vlist for mass drawing. More...
 
virtual void Draw ()
 Draws a single copy of the mass-loaded vlist. More...
 
void Draw (enum POLYTYPE poly, int numV)
 
void Draw (enum POLYTYPE poly, int numV, unsigned char *index)
 
void Draw (enum POLYTYPE poly, int numV, unsigned short *index)
 
void Draw (enum POLYTYPE poly, int numV, unsigned int *index)
 
void DrawOnce ()
 Loads draw state and prepares to draw only once. More...
 
virtual void EndDrawState (GFXBOOL lock=GFXTRUE)
 
virtual void GetPolys (GFXVertex **vert, int *numPolys, int *numTris)
 returns a packed vertex list with number of polys and number of tries to passed in arguments. Useful for getting vertex info from a mesh More...
 

Protected Member Functions

const GFXVertexGetVertex (int index) const
 Num vertices allocated. More...
 
const GFXColorVertexGetColorVertex (int index) const
 
void Init (enum POLYTYPE *poly, int numVertices, const GFXVertex *vert, const GFXColorVertex *colors, int numlists, int *offsets, bool Mutable, unsigned int *indices)
 Init function (call from construtor) More...
 
virtual void Draw (enum POLYTYPE *poly, const INDEX index, const int numLists, const int *offsets)
 
void RenormalizeNormals ()
 
 GFXVertexList ()
 

Static Protected Member Functions

static void VtxCopy (GFXVertexList *thus, GFXVertex *dst, int offset, int howmany)
 copies nonindexed vertices to dst vertex array More...
 
static void ColVtxCopy (GFXVertexList *thus, GFXVertex *dst, int offset, int howmany)
 Copies nonindex colored vertices to dst vertex array. More...
 
static void ColIndVtxCopy (GFXVertexList *thus, GFXVertex *dst, int offset, int howmany)
 Copies indexed colored vertices to dst vertex array. More...
 
static void IndVtxCopy (GFXVertexList *thus, GFXVertex *dst, int offset, int howmany)
 Copies indexed vertices to dst vertex array. More...
 

Protected Attributes

int numVertices
 
union GFXVertexList::VDAT data
 
union GFXVertexList::INDEX index
 
enum POLYTYPEmode
 Array of modes that vertices will be drawn with. More...
 
bool unique_mode
 
int display_list
 Display list number if list is indeed active. 0 otherwise. More...
 
int vbo_data
 
int numlists
 number of different mode, drawn lists More...
 
int * offsets
 
char changed
 If vertex list has been mutated since last draw. Low 3 bits store the stride of the index list (if avail). another bit for if color is presnet. More...
 

Friends

class GFXSphereVertexList
 

Detailed Description

A vertex list is a list of any conglomeration of POLY TYPES. It is held for storage in an array of GFXVertex but attempts to use a display list to hold information if possible

Definition at line 491 of file gfxlib_struct.h.

Constructor & Destructor Documentation

GFXVertexList::GFXVertexList ( )
protected

Definition at line 602 of file gfxlib_struct.cpp.

GFXVertexList::GFXVertexList ( enum POLYTYPE  poly,
int  numVertices,
const GFXVertex vertices,
int  numindices,
bool  Mutable = false,
unsigned int *  index = 0 
)
inline

creates a vertex list with 1 polytype and a given number of vertices

Definition at line 558 of file gfxlib_struct.h.

GFXVertexList::GFXVertexList ( enum POLYTYPE poly,
int  numVertices,
const GFXVertex vertices,
int  numlists,
int *  offsets,
bool  Mutable = false,
unsigned int *  index = 0 
)
inline

Creates a vertex list with an arbitrary number of poly types and given vertices, num list and offsets (see above)

Definition at line 568 of file gfxlib_struct.h.

GFXVertexList::GFXVertexList ( enum POLYTYPE  poly,
int  numVertices,
const GFXColorVertex colors,
int  numindices,
bool  Mutable = false,
unsigned int *  index = 0 
)
inline

Creates a vertex list with 1 poly type and color information to boot.

Definition at line 579 of file gfxlib_struct.h.

GFXVertexList::GFXVertexList ( enum POLYTYPE poly,
int  numVertices,
const GFXColorVertex colors,
int  numlists,
int *  offsets,
bool  Mutable = false,
unsigned int *  index = 0 
)
inline

Creates a vertex list with an arbitrary number of poly types and color.

Definition at line 589 of file gfxlib_struct.h.

GFXVertexList::~GFXVertexList ( )
virtual

Definition at line 506 of file gfxlib_struct.cpp.

Member Function Documentation

void GFXVertexList::BeginDrawState ( GFXBOOL  lock = GFXTRUE)
virtual

Specifies array pointers and loads the draw state of a given vlist for mass drawing.

Reimplemented in GFXSphereVertexList.

Definition at line 164 of file gfxlib_struct.cpp.

union GFXVertexList::VDAT * GFXVertexList::BeginMutate ( int  offset)
virtual

Returns the array of vertices to be mutated.

Reimplemented in GFXSphereVertexList.

Definition at line 575 of file gfxlib_struct.cpp.

static void GFXVertexList::ColIndVtxCopy ( GFXVertexList thus,
GFXVertex dst,
int  offset,
int  howmany 
)
staticprotected

Copies indexed colored vertices to dst vertex array.

static void GFXVertexList::ColVtxCopy ( GFXVertexList thus,
GFXVertex dst,
int  offset,
int  howmany 
)
staticprotected

Copies nonindex colored vertices to dst vertex array.

void GFXVertexList::Draw ( enum POLYTYPE poly,
const INDEX  index,
const int  numLists,
const int *  offsets 
)
protectedvirtual

Reimplemented in GFXSphereVertexList.

Definition at line 312 of file gfxlib_struct.cpp.

void GFXVertexList::Draw ( )
virtual

Draws a single copy of the mass-loaded vlist.

Reimplemented in GFXSphereVertexList.

Definition at line 306 of file gfxlib_struct.cpp.

void GFXVertexList::Draw ( enum POLYTYPE  poly,
int  numV 
)

Definition at line 264 of file gfxlib_struct.cpp.

void GFXVertexList::Draw ( enum POLYTYPE  poly,
int  numV,
unsigned char *  index 
)

Definition at line 270 of file gfxlib_struct.cpp.

void GFXVertexList::Draw ( enum POLYTYPE  poly,
int  numV,
unsigned short *  index 
)

Definition at line 279 of file gfxlib_struct.cpp.

void GFXVertexList::Draw ( enum POLYTYPE  poly,
int  numV,
unsigned int *  index 
)

Definition at line 288 of file gfxlib_struct.cpp.

void GFXVertexList::DrawOnce ( )

Loads draw state and prepares to draw only once.

Definition at line 298 of file gfxlib_struct.cpp.

void GFXVertexList::EndDrawState ( GFXBOOL  lock = GFXTRUE)
virtual

Reimplemented in GFXSphereVertexList.

Definition at line 250 of file gfxlib_struct.cpp.

void GFXVertexList::EndMutate ( int  newsize = 0)
virtual

Ends mutation and refreshes display list.

Reimplemented in GFXSphereVertexList.

Definition at line 581 of file gfxlib_struct.cpp.

const GFXColorVertex* GFXVertexList::GetColorVertex ( int  index) const
protected
unsigned int GFXVertexList::GetIndex ( int  offset) const

Looks up the index in the appropriate short, char or int array.

int GFXVertexList::GetNumLists ( ) const

Definition at line 625 of file gfxlib_struct.cpp.

int GFXVertexList::GetNumVertices ( ) const
inline

Definition at line 611 of file gfxlib_struct.h.

int * GFXVertexList::GetOffsets ( ) const

Definition at line 620 of file gfxlib_struct.cpp.

virtual void GFXVertexList::GetPolys ( GFXVertex **  vert,
int *  numPolys,
int *  numTris 
)
virtual

returns a packed vertex list with number of polys and number of tries to passed in arguments. Useful for getting vertex info from a mesh

Reimplemented in GFXSphereVertexList.

POLYTYPE * GFXVertexList::GetPolyType ( ) const

Definition at line 615 of file gfxlib_struct.cpp.

const GFXVertex* GFXVertexList::GetVertex ( int  index) const
protected

Num vertices allocated.

bool GFXVertexList::hasColor ( ) const
static void GFXVertexList::IndVtxCopy ( GFXVertexList thus,
GFXVertex dst,
int  offset,
int  howmany 
)
staticprotected

Copies indexed vertices to dst vertex array.

void GFXVertexList::Init ( enum POLYTYPE poly,
int  numVertices,
const GFXVertex vert,
const GFXColorVertex colors,
int  numlists,
int *  offsets,
bool  Mutable,
unsigned int *  indices 
)
protected

Init function (call from construtor)

void GFXVertexList::LoadDrawState ( )

Loads the draw state (what is active) of a given vlist for mass drawing.

GFXVertexList::VDAT * GFXVertexList::Map ( bool  read,
bool  write 
)
virtual

Definition at line 529 of file gfxlib_struct.cpp.

virtual int GFXVertexList::numQuads ( ) const
virtual

Returns number of Quads in vertex list (counts quad strips)

virtual int GFXVertexList::numTris ( ) const
virtual

Returns number of Triangles in vertex list (counts tri strips)

void GFXVertexList::RefreshDisplayList ( )

Propagates modifications to the display list.

Definition at line 72 of file gfxlib_struct.cpp.

void GFXVertexList::RenormalizeNormals ( )
protected
void GFXVertexList::UnMap ( )

Definition at line 556 of file gfxlib_struct.cpp.

static void GFXVertexList::VtxCopy ( GFXVertexList thus,
GFXVertex dst,
int  offset,
int  howmany 
)
staticprotected

copies nonindexed vertices to dst vertex array

Friends And Related Function Documentation

friend class GFXSphereVertexList
friend

Definition at line 493 of file gfxlib_struct.h.

Member Data Documentation

char GFXVertexList::changed
protected

If vertex list has been mutated since last draw. Low 3 bits store the stride of the index list (if avail). another bit for if color is presnet.

Definition at line 531 of file gfxlib_struct.h.

union GFXVertexList::VDAT GFXVertexList::data
protected
int GFXVertexList::display_list
protected

Display list number if list is indeed active. 0 otherwise.

Definition at line 521 of file gfxlib_struct.h.

union GFXVertexList::INDEX GFXVertexList::index
protected
enum POLYTYPE* GFXVertexList::mode
protected

Array of modes that vertices will be drawn with.

Definition at line 518 of file gfxlib_struct.h.

int GFXVertexList::numlists
protected

number of different mode, drawn lists

Definition at line 524 of file gfxlib_struct.h.

int GFXVertexList::numVertices
protected

Definition at line 498 of file gfxlib_struct.h.

int* GFXVertexList::offsets
protected

number of vertices in each individual mode. 2 triangles 3 quads and 2 lines would be {6,12,4} as the offsets

Definition at line 529 of file gfxlib_struct.h.

bool GFXVertexList::unique_mode
protected

Definition at line 519 of file gfxlib_struct.h.

int GFXVertexList::vbo_data
protected

Definition at line 522 of file gfxlib_struct.h.


The documentation for this class was generated from the following files: