BALL  1.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Private Attributes | List of all members
BALL::VIEW::GLDisplayList Class Reference

#include <BALL/VIEW/RENDERING/glDisplayList.h>

Classes

class  DisplayListRedeclaration
 
class  NestedDisplayList
 
class  NoDisplayListAvailable
 

Public Types

Type Definitions.
typedef unsigned long GLList
 

Public Member Functions

Constructors
 GLDisplayList ()
 
Destructors
virtual ~GLDisplayList ()
 
virtual void clear ()
 
Accessors: inspectors and mutators
void startDefinition () throw (NestedDisplayList, NoDisplayListAvailable, DisplayListRedeclaration)
 
void endDefinition ()
 
void draw ()
 
void useCompileMode ()
 
void useCompileAndExecuteMode ()
 
Predicates
bool isCompileMode () const
 
bool isCompileAndExecuteMode () const
 
debuggers and diagnostics
virtual bool isValid () const
 
virtual void dump (std::ostream &s=std::cout, Size depth=0) const
 

Static Public Attributes

Predefined static values.
static const GLList DISPLAYLIST_NOT_DEFINED
 

Private Attributes

bool compile_
 
GLList GL_list_
 

Detailed Description

GLDisplayList class. The class GLDisplayList is a container for graphical objects. Graphical objects can be drawn directly to the screen or they can be stored in a display list for faster drawing afterwards. This class provides the means for storing graphical objects in a own display list. This class is a wrapper class for the OpenGL display list mechanims. It defines some useful methods for easy creation of a display list and handles errors that can occur when using display lists. See the OpenGL defintion of display lists for further information concerning display lists.

Definition at line 31 of file glDisplayList.h.

Member Typedef Documentation

typedef unsigned long BALL::VIEW::GLDisplayList::GLList

GLList definition. A display list is stored as a number. For convienence a type is declared that represents such a display list.

Definition at line 45 of file glDisplayList.h.

Constructor & Destructor Documentation

BALL::VIEW::GLDisplayList::GLDisplayList ( )

Default Constructor. There is no copy constructor because the OpenGL display lists cannot be copied. The state of this glDisplayList is set to:

  • display list empty
  • use compile mode instead of compile and execute mode
virtual BALL::VIEW::GLDisplayList::~GLDisplayList ( )
virtual

Destructor. Calls clear()

Member Function Documentation

virtual void BALL::VIEW::GLDisplayList::clear ( )
virtual

Explicit default initialization. Resets the mode of this glDisplayList to compile.

void BALL::VIEW::GLDisplayList::draw ( )

Draw the display list. If this method is called the graphical representation of this will be drawn. Precondition: this glDisplayList has a graphical representation defined before by startDefinition and endDefinition.

See Also
startDefinition
endDefinition
virtual void BALL::VIEW::GLDisplayList::dump ( std::ostream &  s = std::cout,
Size  depth = 0 
) const
virtual

Internal value dump. Dump the current state to the output ostream s with dumping depth depth.

Parameters
soutput stream where to output the state of this glDisplayList
depththe dumping depth
void BALL::VIEW::GLDisplayList::endDefinition ( )

End the display list. This method is the end command for a display list definition.

See Also
startDefinition
bool BALL::VIEW::GLDisplayList::isCompileAndExecuteMode ( ) const

Compile and Execute mode test. Tests if this glDisplayList is set to compile and execute.

See Also
useCompileAndExecuteMode
bool BALL::VIEW::GLDisplayList::isCompileMode ( ) const

Compile mode test. Tests if this glDisplayList is set to compile only.

See Also
useCompileMode
virtual bool BALL::VIEW::GLDisplayList::isValid ( ) const
inlinevirtual

Internal state and consistency self-validation. A glDisplayList is valid if a display list is already defined.

Definition at line 212 of file glDisplayList.h.

void BALL::VIEW::GLDisplayList::startDefinition ( ) throw (NestedDisplayList, NoDisplayListAvailable, DisplayListRedeclaration)

Begin the display list. If graphical objects should be put into a display list they must be put between a startDefinition and endDefinition command. This method indicates the start of a display list. Every object drawn after this method will be compiled into this glDisplayList.

Exceptions
NestedDisplayListthrown whenever a nested display list definition is tried.
NoDisplayListAvailablethrown whenever no memory for the display list is available.
DisplayListRedeclarationthrown whenever this glDisplayList is tried to redefine before destroy is called.
See Also
endDefinition
void BALL::VIEW::GLDisplayList::useCompileAndExecuteMode ( )

Compile and Execute mode switch. Before the definition of the graphical objects between startDefinition and endDefinition the compile and execute mode can be set. If this method is used this glDisplayList will compile the used objects into a display list and simultaneously execute their graphical representation.

See Also
useCompileMode
startDefinition
endDefinition
void BALL::VIEW::GLDisplayList::useCompileMode ( )

Compile mode switch. Before the definition of the graphical objects between startDefinition and endDefinition the compile mode can be set. If this method is used this glDisplayList will only compile the graphical representation of the used objects into a display list.

See Also
useCompileAndExecuteMode
startDefinition
endDefinition

Member Data Documentation

bool BALL::VIEW::GLDisplayList::compile_
private

Definition at line 228 of file glDisplayList.h.

const GLList BALL::VIEW::GLDisplayList::DISPLAYLIST_NOT_DEFINED
static

Empty display list. A predefined value for an empty display list is defined as DISPLAYLIST_NOT_DEFINED.

Definition at line 56 of file glDisplayList.h.

GLList BALL::VIEW::GLDisplayList::GL_list_
private

Definition at line 231 of file glDisplayList.h.