rDisplayListFiller Class Reference

create an object of this type to fill a display list while you render More...

#include <rDisplayList.h>

Collaboration diagram for rDisplayListFiller:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 rDisplayListFiller (rDisplayList &list)
 constructor, automatically starting to fill teh list
 ~rDisplayListFiller ()
void Start ()
 starts filling the display list (done automatically on construction)
void Stop ()
 stops filling the display list (done automatically on destruction)

Private Member Functions

 rDisplayListFiller (rDisplayListFiller const &)
rDisplayListFilleroperator= (rDisplayListFiller const &)

Private Attributes

rDisplayListlist_
 the list

Friends

class rDisplayList


Detailed Description

create an object of this type to fill a display list while you render

Definition at line 129 of file rDisplayList.h.


Constructor & Destructor Documentation

rDisplayListFiller::rDisplayListFiller ( rDisplayList list  )  [explicit]

constructor, automatically starting to fill teh list

Definition at line 203 of file rDisplayList.cpp.

00205     : list_( list )
00206 #endif
00207 {
00208     Start();
00209 }

rDisplayListFiller::~rDisplayListFiller (  ) 

Definition at line 244 of file rDisplayList.cpp.

References Stop().

00245 {
00246     Stop();
00247 }

Here is the call graph for this function:

rDisplayListFiller::rDisplayListFiller ( rDisplayListFiller const &   )  [private]


Member Function Documentation

void rDisplayListFiller::Start (  ) 

starts filling the display list (done automatically on construction)

Definition at line 212 of file rDisplayList.cpp.

References rDisplayList::filling_, rDisplayList::inhibit_, rDisplayList::list_, list_, rDisplayList_CAC, rDisplayList_Off, sr_useDisplayLists, and tASSERT.

00213 {
00214 #ifndef DEDICATED
00215     bool useList = sr_useDisplayLists != rDisplayList_Off && list_.inhibit_ == 0 && !sr_currentFiller;
00216     if ( useList )
00217     {
00218 #ifdef LIST_STATS
00219         sr_counter.Count( rListCounter::Create );
00220 #endif
00221         if ( !list_.list_ )
00222         {
00223             list_.list_=glGenLists(1);
00224             tASSERT( list_.list_ );
00225         }
00226         glNewList(list_.list_, sr_useDisplayLists == rDisplayList_CAC ? GL_COMPILE : GL_COMPILE_AND_EXECUTE );
00227         list_.filling_ = true;
00228         sr_currentFiller = this;
00229     }
00230     else if ( list_.inhibit_ > 0 )
00231     {
00232         --list_.inhibit_;
00233     }
00234 
00235 #ifdef LIST_STATS
00236     if ( !useList && !sr_currentFiller )
00237     {
00238         sr_counter.Count( rListCounter::Not );
00239     }
00240 #endif
00241 #endif
00242 }

void rDisplayListFiller::Stop (  ) 

stops filling the display list (done automatically on destruction)

Definition at line 250 of file rDisplayList.cpp.

References rDisplayList::Call(), rDisplayList::filling_, rDisplayList::inhibit_, rDisplayList::list_, list_, rDisplayList_CAC, sr_useDisplayLists, and tASSERT.

Referenced by rDisplayList::Cancel(), and ~rDisplayListFiller().

00251 {
00252 #ifndef DEDICATED
00253     if ( list_.filling_ )
00254     {
00255         tASSERT( list_.list_ );
00256         tASSERT( sr_currentFiller == this );
00257 
00258         sr_currentFiller = 0;
00259         list_.filling_ = false;
00260         glEndList();
00261 
00262         if ( sr_useDisplayLists == rDisplayList_CAC )
00263         {
00264             // call the list, making sure it really gets executed
00265             int inhibit = list_.inhibit_;
00266             list_.inhibit_ = 0;
00267             list_.Call();
00268             list_.inhibit_ = inhibit;
00269         }
00270     }
00271 
00272     // to debug, clearing every display list may be useful:
00273     // list_.Clear(0);
00274 #endif
00275 }

Here is the call graph for this function:

Here is the caller graph for this function:

rDisplayListFiller& rDisplayListFiller::operator= ( rDisplayListFiller const &   )  [private]


Friends And Related Function Documentation

friend class rDisplayList [friend]

Definition at line 131 of file rDisplayList.h.


Member Data Documentation

rDisplayList& rDisplayListFiller::list_ [private]

the list

Definition at line 149 of file rDisplayList.h.

Referenced by rDisplayList::Cancel(), Start(), and Stop().


The documentation for this class was generated from the following files:
Generated on Sat Mar 15 23:52:25 2008 for Armagetron Advanced by  doxygen 1.5.4