proj home

Files   Classes   Functions   Hierarchy  

graphicsImmediateDeferred.cpp

Go to the documentation of this file.
00001 #include <graphicsImmediateDeferred.h>
00002 
00003 
00004 graphicsImmediateDeferred::graphicsImmediateDeferred()
00005   : gdynamic(true), graphicsDeferred(true), 
00006     graphicsImmediate(true), drawDeferredFirst(true)
00007 {
00008 }
00009 
00010 void graphicsImmediateDeferred::draw()
00011 {
00012   GOBJDEBUGCODE
00013   glPushAttrib(GL_CURRENT_BIT);
00014   glPushAttrib(GL_LIGHTING_BIT);
00015 
00016   if (drawDeferredFirst)
00017   {
00018     gdynamic.draw();
00019     graphicsImmediate.draw();
00020   }
00021   else
00022   {
00023     graphicsImmediate.draw();
00024     gdynamic.draw();
00025   }
00026 
00027   glPopAttrib();
00028   glPopAttrib();
00029 }
00030 
00031 void graphicsImmediateDeferred::update()
00032 {
00033   gdynamic.nuke();
00034 cout << "graphicsImmedateDeferred::update()" << endl;
00035 
00036   assert(gobjContainer::global!=0);
00037   // Save the current global graphics stream.
00038   gobjContainer & g(*gobjContainer::global);
00039 
00040   // Make this the new graphics stream.
00041   gdynamic.set();
00042 
00043   // Writes all the graphics to gobjContainer::global
00044   graphicsDeferred.draw();  
00045 
00046   // Restore global graphics stream.
00047   g.set();  
00048 }
00049 
00050 
00051 

Generated on Fri Mar 4 00:49:27 2011 for Chelton Evans Source by  doxygen 1.5.8