Open Inventor Reference
SoGLDisplayList Class Reference

Class SoGLDisplayList: More...

#include <Inventor/elements/SoGLCacheContextElement.h>

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. More...
 
void unref (SoState *state=NULL)
 
void open (SoState *state, int index=0)
 Open/close a display list. More...
 
void close (SoState *state)
 
void call (SoState *state, int index=0)
 Call a display list, or bind a texture object. More...
 
void addDependency (SoState *state)
 
Type getType ()
 Get methods. More...
 
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 93 of file SoGLCacheContextElement.h.

Member Enumeration Documentation

◆ Type

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 101 of file SoGLCacheContextElement.h.

Constructor & Destructor Documentation

◆ SoGLDisplayList()

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

Member Function Documentation

◆ addDependency()

void SoGLDisplayList::addDependency ( SoState state)

◆ call()

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...

◆ close()

void SoGLDisplayList::close ( SoState state)

◆ getContext()

int SoGLDisplayList::getContext ( )
inline

Definition at line 141 of file SoGLCacheContextElement.h.

◆ getFirstIndex()

GLuint SoGLDisplayList::getFirstIndex ( )
inline

Definition at line 140 of file SoGLCacheContextElement.h.

◆ getNumAllocated()

int SoGLDisplayList::getNumAllocated ( )
inline

Definition at line 139 of file SoGLCacheContextElement.h.

◆ getType()

Type SoGLDisplayList::getType ( )
inline

Definition at line 138 of file SoGLCacheContextElement.h.

◆ open()

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.

◆ ref()

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.

◆ unref()

void SoGLDisplayList::unref ( SoState state = NULL)

Friends And Related Function Documentation

◆ SoGLCacheContextElement

friend class SoGLCacheContextElement
friend

Definition at line 152 of file SoGLCacheContextElement.h.


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