Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4817 in orxonox.OLD for orxonox/trunk/src/lib/graphics


Ignore:
Timestamp:
Jul 7, 2005, 5:12:45 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: orxonox is now baseobject, graphicsengine handles events itself and is therefore eventlistener now

Location:
orxonox/trunk/src/lib/graphics
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/graphics/graphics_engine.cc

    r4784 r4817  
    1818#include "graphics_engine.h"
    1919#include "resource_manager.h"
     20#include "event_handler.h"
    2021
    2122#include "debug.h"
     
    4647
    4748//  this->listModes();
     49
     50  // subscribe the resolutionChanged-event
     51  EventHandler::getInstance()->subscribe(this, ES_GAME, EV_VIDEO_RESIZE);
     52
    4853}
    4954
     
    5964{
    6065  // delete what has to be deleted here
     66  EventHandler::getInstance()->unsubscribe(this);
    6167}
    6268
     
    389395
    390396
     397/**
     398  \brief processes the events for orxonox main class
     399  \param the event to handle
     400 */
     401void 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  
    55
    66    handles graphical SDL-initialisation, textures, resolutions, and so on
    7 */
     7 */
    88
    99#ifndef _GRAPHICS_ENGINE_H
    1010#define _GRAPHICS_ENGINE_H
    1111
    12 #include "base_object.h"
     12#include "event_listener.h"
    1313
    1414#include "sdlincl.h"
     
    2323   handles graphical SDL-initialisation, textures, resolutions, and so on
    2424 */
    25 class GraphicsEngine : public BaseObject
     25class GraphicsEngine : public EventListener
    2626{
    2727  public:
     
    6464    static void swapBuffers() { SDL_GL_SwapBuffers(); };
    6565
     66    void process(const Event  &event);
    6667
    6768  private:
Note: See TracChangeset for help on using the changeset viewer.