- Timestamp:
- Jul 13, 2005, 7:03:05 PM (19 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/defs/include_paths.am
r4842 r4849 10 10 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics/importer 11 11 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics/spatial_separation 12 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics/render2D 12 13 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/particles 13 14 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/gui -
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 -
orxonox/trunk/src/story_entities/world.cc
r4838 r4849 849 849 ParticleEngine::getInstance()->draw(); 850 850 851 851 GraphicsEngine::getInstance()->draw(); 852 852 TextEngine::getInstance()->draw(); 853 853 LightManager::getInstance()->draw(); // must be at the end of the drawing procedure, otherwise Light cannot be handled as PNodes // -
orxonox/trunk/src/world_entities/weapons/crosshair.cc
r4838 r4849 180 180 * draws the crosshair 181 181 */ 182 void Crosshair::draw() 182 void Crosshair::draw() const 183 183 { 184 184 GraphicsEngine::storeMatrices(); -
orxonox/trunk/src/world_entities/weapons/crosshair.h
r4836 r4849 8 8 #define _CROSSHAIR_H 9 9 10 #include "p_node.h" 11 #include "element_2d.h" 10 12 #include "event_listener.h" 11 #include "p_node.h" 13 12 14 #include "vector.h" 15 13 16 14 17 // FORWARD DEFINITION … … 18 21 19 22 //! A class that enables the 20 class Crosshair : public PNode, public E ventListener {23 class Crosshair : public PNode, public Element2D, public EventListener { 21 24 22 25 public: … … 33 36 34 37 virtual void process(const Event &event); 35 v oid tick(float dt);36 v oid draw();38 virtual void tick(float dt); 39 virtual void draw() const; 37 40 38 41 private: -
orxonox/trunk/src/world_entities/weapons/weapon_manager.cc
r4837 r4849 243 243 } 244 244 245 crosshair->tick(dt);246 245 crosshair->setRotationSpeed(5); 247 246 } … … 260 259 w->draw(); 261 260 } 262 crosshair->draw();263 261 } 264 262
Note: See TracChangeset
for help on using the changeset viewer.