Open Inventor Reference
SoGLDisplayList Class Reference

Class SoGLDisplayList: More...

#include <Inventor/elements/SoGLCacheContextElement.h>

List of all members.

Public Types

enum  Type { DISPLAY_LIST, TEXTURE_OBJECT, VERTEX_BUFFER_OBJECT }
 Constructor. More...

Public Member Functions

 SoGLDisplayList (SoState *state, Type type, int numToAllocate=1)
void ref ()
 Because display lists may contain textures objects or other display lists, they must be reference counted.
void unref (SoState *state=NULL)
void open (SoState *state, int index=0)
 Open/close a display list.
void close (SoState *state)
void call (SoState *state, int index=0)
 Call a display list, or bind a texture object.
void addDependency (SoState *state)
Type getType ()
 Get methods.
int getNumAllocated ()
GLuint getFirstIndex ()
int getContext ()

Friends

class SoGLCacheContextElement

Detailed Description

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.

Definition at line 114 of file SoGLCacheContextElement.h.


Member Enumeration Documentation

Takes state, type, and number of lists to allocate. Calls either glGenLists() or glGenTextures() to create empty objects/display lists.

Enumerator:
DISPLAY_LIST 
TEXTURE_OBJECT 
VERTEX_BUFFER_OBJECT 

create a Vertex Buffer Object (MeVis ONLY)

Definition at line 122 of file SoGLCacheContextElement.h.


Constructor & Destructor Documentation

SoGLDisplayList::SoGLDisplayList ( SoState state,
Type  type,
int  numToAllocate = 1 
)

Member Function Documentation

void SoGLDisplayList::addDependency ( SoState state)
void SoGLDisplayList::call ( SoState state,
int  index = 0 
)

This automatically sets up a dependency 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 to do the correct reference counting...

void SoGLDisplayList::close ( SoState state)
int SoGLDisplayList::getContext ( ) [inline]

Definition at line 162 of file SoGLCacheContextElement.h.

GLuint SoGLDisplayList::getFirstIndex ( ) [inline]

Definition at line 161 of file SoGLCacheContextElement.h.

int SoGLDisplayList::getNumAllocated ( ) [inline]

Definition at line 160 of file SoGLCacheContextElement.h.

Type SoGLDisplayList::getType ( ) [inline]

Definition at line 159 of file SoGLCacheContextElement.h.

void SoGLDisplayList::open ( SoState state,
int  index = 0 
)

Display lists are done in COMPILE_AND_EXECUTE mode, so you don't need to call() the display list after close(). Opening a texture object binds it; closing it does nothing.

void SoGLDisplayList::ref ( )

You can pass a NULL state to unref(); deletion of the display list or texture object will then be delayed until a render action is applied in the correct context.

void SoGLDisplayList::unref ( SoState state = NULL)

Friends And Related Function Documentation

friend class SoGLCacheContextElement [friend]

Definition at line 173 of file SoGLCacheContextElement.h.


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