Main Page | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

ARLib::Graphics::ARModels Class Reference

Useful class for storing obj file objects. More...

#include <armodels.h>

List of all members.

Static Public Member Functions

ARObjFileAdd (const char *filename, unsigned int key)
 Add a new obj file to the current list of entries.
ARObjFileItem (unsigned int key)
 Returns a pointer to the Obj file associated with the specified key.
void glDraw (unsigned int key)
 Draws the contents of the obj file using OpenGL.
void glDrawList (unsigned int key)
 Draw the contents using a glDrawList.
void Clear ()
 Removes all entries from the current list of models.
void Refresh ()
 Reloads all the models.


Detailed Description

Useful class for storing obj file objects.

The vector of obj files is static therefore no instance of this class needs to created.

For example to add a new obj file to the current entries use...

ARModels::Add( "MyFilename.obj", 1001 );


To draw the obj file contents within an OpenGL update use...

ARModels::glDraw( 1001 );


For better performance the ARModels class can create a glDrawList. Making a call to glDrawList will automatically create the list and draw it. Once the list has been created the glDrawList will not re-create it...

ARModels::glDrawList( 1001 );


Member Function Documentation

ARObjFile * ARModels::Add const char *  filename,
unsigned int  key
[static]
 

Add a new obj file to the current list of entries.

Parameters:
filename Path to the obj file.
key A unique identifier for the obj object.
Returns:
A pointer to the loaded ARObjFile object. This will be NULL if the load failed.

void ARModels::glDraw unsigned int  key  )  [static]
 

Draws the contents of the obj file using OpenGL.

If the object to be draw is static (i.e. never modified) then the preferred and faster method is to us glDrawList.

Parameters:
key The unique identifier for the item to draw.

void ARModels::glDrawList unsigned int  key  )  [static]
 

Draw the contents using a glDrawList.

The first time this method is called will automatically create the draw list.

Parameters:
key The unique identifier for the item to draw.

ARObjFile * ARModels::Item unsigned int  key  )  [static]
 

Returns a pointer to the Obj file associated with the specified key.

Parameters:
key The unique identifier for the item to retrieve.
Returns:
A pointer to the ARObjFile if it exists otherwise NULL is returned.


The documentation for this class was generated from the following files:
Generated on Wed Aug 31 18:01:39 2005 for ARLib by  doxygen 1.3.9.1