OpenGL display list management class. More...
#include <Inventor/oglObjects/SoGLDisplayList.h>
A helper class used to store OpenGL display-list-like objects. Currently, it can store either texture objects (which must be treated like display lists; texture objects bound inside a display list must be reference counted, etc) and display lists.
NOTE: This class does not exist in Open Inventor 10.0 and later.Constructor.
Takes state, type, and number of OpenGL objects to create.
numToAllocate > 1 is currently only meaningful for display lists.
Calls the appropriate glGen or glCreate function to create empty objects/display lists. If a texture object is requested and texture objects are not supported, the type will revert to DISPLAY_LIST.
void SoGLDisplayList::addDependency | ( | SoState * | state | ) |
Adds a dependency on this object if there is another display list open in the state.
void SoGLDisplayList::call | ( | SoState * | state, | |
int | index = 0 | |||
) |
For DISPLAY_LIST objects, invokes the display list (calls glCallList).
For other object types, calls the appropriate glBind or glUse function.
This automatically adds a dependency (calls addDependency()) if there is another display list open in the state. You can also use the get() methods below and make the OpenGL calls yourself, in which case you should call the addDependency() method directly to do the correct reference counting.
bool SoGLDisplayList::close | ( | SoState * | state | ) |
For DISPLAY_LIST objects, closes the display list (calls glEndList).
Returns FALSE if display list cannot be closed properly. If the display mode is COMPILE_AND_EXECUTE , the display list will automatically be invoked, else use the call() method to invoke it. COMPILE_AND_EXECUTE is the default, see the setCompileAndExecute() method.
For other object types, does nothing.
SbBool SoGLDisplayList::getCompileAndExecute | ( | ) | const |
Returns TRUE if current display list mode is GL_COMPILE_AND_EXECUTE.
Default is COMPILE_AND_EXECUTE.
GLuint SoGLDisplayList::getFirstIndex | ( | ) | [inline] |
Returns id of first OpenGL object owned by this instance.
int SoGLDisplayList::getNumAllocated | ( | ) | [inline] |
Returns number of OpenGL objects owned by this instance.
SoGLRenderCache* SoGLDisplayList::getParentRenderCache | ( | ) | [inline] |
Returns the parent render cache (initially NULL).
Type SoGLDisplayList::getType | ( | ) | [inline] |
Returns the object type (display list, texture, etc).
void SoGLDisplayList::open | ( | SoState * | state, | |
int | index = 0 | |||
) |
For DISPLAY_LIST objects, creates a new OpenGL display list (calls glNewList).
For other object types, calls the appropriate glBind or glUse function.
void SoGLDisplayList::setCompileAndExecute | ( | SbBool | flag | ) |
Sets whether to use GL_COMPILE or GL_COMPILE_AND_EXECUTE mode for display lists.
Default is COMPILE_AND_EXECUTE.
void SoGLDisplayList::setParentRenderCache | ( | SoGLRenderCache * | parent | ) |
Sets the parent render cache.