chai3d::cDisplayList Class Reference

This class provides support for OpenGL display lists. More...

#include <CDisplayList.h>

Public Member Functions

 cDisplayList ()
 Constructor of cDisplayList. More...
 
 ~cDisplayList ()
 Destructor of cDisplayList. More...
 
void invalidate ()
 This method invalidates the current display list. Request for update. More...
 
bool render (const int a_displayContext, const bool a_useDisplayList)
 This method renders the display list. More...
 
bool begin (const int a_displayContext, const bool a_useDisplayList)
 This method begins the creation of a display list. More...
 
void end (const int a_displayContext, const bool a_executeDisplayList)
 This method finalizes the creation of a display list. More...
 
unsigned int getDisplayListGL (const int a_displayContext)
 This method returns the OpenGL display list number. More...
 

Protected Attributes

unsigned int m_displayList [C_MAX_DISPLAY_CONTEXTS]
 OpenGL display list. More...
 
bool m_flagCreatingDisplayList [C_MAX_DISPLAY_CONTEXTS]
 If true, then the display list is currently in the process of being created. More...
 
bool m_flagMarkedForDeletion [C_MAX_DISPLAY_CONTEXTS]
 If true, then the display list should be deleted from display context. More...
 

Detailed Description

This class provides support for OpenGL display lists.

Constructor & Destructor Documentation

chai3d::cDisplayList::cDisplayList ( )

Constructor of cDisplayList.
The display list is set to zero as it has not yet been created. We also initialize the flag which tells us if a display list is currently being created.

chai3d::cDisplayList::~cDisplayList ( )

Destructor of cDisplayList.

Member Function Documentation

void chai3d::cDisplayList::invalidate ( )

This method invalidates the current display list. We inform the display list that it will need to be updated the next time the object is rendered. We free any graphic card memory which contains the current display list.

bool chai3d::cDisplayList::render ( const int  a_displayContext,
const bool  a_useDisplayList 
)

This method renders the display list. We pass a boolean from the object which indicates if the display list should be used. If the display list is valid and is used for rendering the object, the method returns true, otherwise false.

Parameters
a_displayContextDisplay context number.
a_useDisplayListIf set to true, then display list is rendered.
Returns
true is display list was rendered successfully, otherwise false if the display list was invalid.
bool chai3d::cDisplayList::begin ( const int  a_displayContext,
const bool  a_useDisplayList 
)

This method begins the creation of a display list.

Parameters
a_displayContextDisplay context number.
a_useDisplayListIf true, then display list is created.
Returns
true if the OpenGL display list has been successfully allocated.
void chai3d::cDisplayList::end ( const int  a_displayContext,
const bool  a_executeDisplayList 
)

This method finalizes and compiles the display list. Optionally render the display list as nothing will have yet been rendered at the screen during display list compilation which began after calling method begin().

Parameters
a_displayContextDisplay context number.
a_executeDisplayListIf true, the the display list is rendered immediately after display list has been completed.
unsigned int chai3d::cDisplayList::getDisplayListGL ( const int  a_displayContext)
inline

Member Data Documentation

unsigned int chai3d::cDisplayList::m_displayList[C_MAX_DISPLAY_CONTEXTS]
protected
bool chai3d::cDisplayList::m_flagCreatingDisplayList[C_MAX_DISPLAY_CONTEXTS]
protected
bool chai3d::cDisplayList::m_flagMarkedForDeletion[C_MAX_DISPLAY_CONTEXTS]
protected

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