Changeset 4817 in orxonox.OLD for orxonox/trunk/src/lib
- Timestamp:
- Jul 7, 2005, 5:12:45 PM (19 years ago)
- Location:
- orxonox/trunk/src/lib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/event/event_handler.cc
r4816 r4817 65 65 EventHandler::singletonRef = NULL; 66 66 delete this->keyMapper; 67 68 for(int i = 0; i < ES_NUMBER; ++i) 69 { 70 for(int j = 0; j < SDLK_LAST; ++j) 71 { 72 if( this->listeners[i][j] != NULL) 73 { 74 PRINTF(2)("Someone forgot to unsubscribe an EventListener!\n"); 75 } 76 } 77 } 67 78 } 68 79 -
orxonox/trunk/src/lib/event/event_listener.cc
r4457 r4817 1 /* 1 /* 2 2 orxonox - the future of 3D-vertical-scrollers 3 3 … … 17 17 18 18 #include "event_listener.h" 19 #include "event_handler.h" 19 20 20 21 using namespace std; … … 24 25 \brief standard constructor 25 26 */ 26 EventListener::EventListener () 27 EventListener::EventListener () 27 28 { 28 this->setClassID(CL_EVENT_LISTENER, "EventListener"); 29 this->setClassID(CL_EVENT_LISTENER, "EventListener"); 29 30 } 30 31 … … 34 35 35 36 */ 36 EventListener::~EventListener () 37 {} 37 EventListener::~EventListener () 38 { 39 /* unsubscribes itself from the event listener */ 40 EventHandler::getInstance()->unsubscribe(this); 41 } -
orxonox/trunk/src/lib/graphics/graphics_engine.cc
r4784 r4817 18 18 #include "graphics_engine.h" 19 19 #include "resource_manager.h" 20 #include "event_handler.h" 20 21 21 22 #include "debug.h" … … 46 47 47 48 // this->listModes(); 49 50 // subscribe the resolutionChanged-event 51 EventHandler::getInstance()->subscribe(this, ES_GAME, EV_VIDEO_RESIZE); 52 48 53 } 49 54 … … 59 64 { 60 65 // delete what has to be deleted here 66 EventHandler::getInstance()->unsubscribe(this); 61 67 } 62 68 … … 389 395 390 396 397 /** 398 \brief processes the events for orxonox main class 399 \param the event to handle 400 */ 401 void GraphicsEngine::process(const Event &event) 402 { 403 switch (event.type) 404 { 405 case EV_VIDEO_RESIZE: 406 this->resolutionChanged(event.resize); 407 break; 408 } 409 410 } 411 -
orxonox/trunk/src/lib/graphics/graphics_engine.h
r4784 r4817 5 5 6 6 handles graphical SDL-initialisation, textures, resolutions, and so on 7 */7 */ 8 8 9 9 #ifndef _GRAPHICS_ENGINE_H 10 10 #define _GRAPHICS_ENGINE_H 11 11 12 #include " base_object.h"12 #include "event_listener.h" 13 13 14 14 #include "sdlincl.h" … … 23 23 handles graphical SDL-initialisation, textures, resolutions, and so on 24 24 */ 25 class GraphicsEngine : public BaseObject25 class GraphicsEngine : public EventListener 26 26 { 27 27 public: … … 64 64 static void swapBuffers() { SDL_GL_SwapBuffers(); }; 65 65 66 void process(const Event &event); 66 67 67 68 private:
Note: See TracChangeset
for help on using the changeset viewer.