Changeset 4849 in orxonox.OLD for orxonox/trunk/src/lib
- Timestamp:
- Jul 13, 2005, 7:03:05 PM (19 years ago)
- Location:
- orxonox/trunk/src/lib/graphics
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/graphics_engine.cc
r4838 r4849 20 20 #include "event_handler.h" 21 21 22 #include "render_2d.h" 22 23 #include "debug.h" 23 24 #include "text_engine.h" … … 58 59 { 59 60 // delete what has to be deleted here 61 62 delete Render2D::getInstance(); 63 GraphicsEngine::singletonRef = NULL; 60 64 } 61 65 … … 148 152 glEnable(GL_DEPTH_TEST); 149 153 150 151 // subscribe the resolutionChanged-event 152 //EventHandler::getInstance()->subscribe(this, ES_GAME, EV_VIDEO_RESIZE); 153 //! @todo eventSystem craps up the Starting of orxonox -> see why. 154 Render2D::getInstance(); 154 155 155 156 this->isInit = true; … … 402 403 * @param dt the time passed 403 404 */ 404 void GraphicsEngine::tick(float dt)405 void GraphicsEngine::tick(float dt) 405 406 { 406 407 if( unlikely(this->bDisplayFPS)) 407 408 409 410 408 { 409 this->currentFPS = 1.0/dt; 410 if( unlikely(this->currentFPS > this->maxFPS)) this->maxFPS = this->currentFPS; 411 if( unlikely(this->currentFPS < this->minFPS)) this->minFPS = this->currentFPS; 411 412 412 413 #ifndef NO_TEXT … … 421 422 this->geTextMinFPS->setText(tmpChar3); 422 423 #endif /* NO_TEXT */ 423 } 424 425 426 } 427 Render2D::getInstance()->tick(dt); 428 429 } 430 431 432 void GraphicsEngine::draw() const 433 { 434 Render2D::getInstance()->draw(); 435 424 436 } 425 437 -
orxonox/trunk/src/lib/graphics/graphics_engine.h
r4836 r4849 63 63 64 64 void tick(float dt); 65 void draw() const; 65 66 void displayFPS(bool display); 66 67 -
orxonox/trunk/src/lib/graphics/render2D/element_2d.h
r4848 r4849 43 43 44 44 //! A class for ... 45 class Element2D : public BaseObject {45 class Element2D : virtual public BaseObject { 46 46 47 47 public: -
orxonox/trunk/src/lib/graphics/render2D/render_2d.cc
r4848 r4849 77 77 78 78 79 void Render2D::tick(float dt) 80 { 81 tIterator<Element2D>* iterator = this->element2DList->getIterator(); 82 Element2D* elem = iterator->nextElement(); 83 while (elem != NULL) 84 { 85 elem->tick(dt); 86 elem = iterator->nextElement(); 87 } 88 delete iterator; 89 90 } 91 92 /** 93 * renders all the Elements of the Render2D-engine 94 */ 79 95 void Render2D::draw() const 80 96 { -
orxonox/trunk/src/lib/graphics/render2D/render_2d.h
r4848 r4849 21 21 inline static Render2D* getInstance() { if (!singletonRef) singletonRef = new Render2D(); return singletonRef; }; 22 22 23 23 void tick(float dt); 24 24 void draw() const; 25 25
Note: See TracChangeset
for help on using the changeset viewer.