Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 14, 2009, 11:50:47 AM (15 years ago)
Author:
rgrieder
Message:

Added window size as static variable to the WindowEventListener interface.
This resolves several hacks and inconveniences in Mouse, InputManager, InGameConsole, GSGraphics and OrxonoxOverlay.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core4/src/orxonox/gamestates/GSGraphics.cc

    r3279 r3291  
    3939
    4040#include "util/Convert.h"
    41 #include "core/ConfigValueIncludes.h"
    4241#include "core/Clock.h"
    4342#include "core/CommandExecutor.h"
    4443#include "core/ConsoleCommand.h"
    4544#include "core/Core.h"
    46 #include "core/CoreIncludes.h"
    4745#include "core/Game.h"
    4846#include "core/GameMode.h"
     
    7270        , debugOverlay_(0)
    7371    {
    74         RegisterRootObject(GSGraphics);
    7572    }
    7673
    7774    GSGraphics::~GSGraphics()
    78     {
    79     }
    80 
    81     /**
    82     @brief
    83         this function does nothing
    84 
    85         Indeed. Here goes nothing.
    86     */
    87     void GSGraphics::setConfigValues()
    8875    {
    8976    }
     
    10895        GameMode::setShowsGraphics(true);
    10996
    110         setConfigValues();
    111 
    11297        // Load OGRE including the render window
    11398        this->graphicsManager_ = new GraphicsManager();
     
    124109
    125110        // Calls the InputManager which sets up the input devices.
    126         inputManager_ = new InputManager(windowHnd, renderWindow->getWidth(), renderWindow->getHeight());
     111        inputManager_ = new InputManager(windowHnd);
    127112
    128113        // load master key bindings
     
    137122        // Load the InGameConsole
    138123        console_ = new InGameConsole();
    139         console_->initialise(renderWindow->getWidth(), renderWindow->getHeight());
     124        console_->initialise();
    140125
    141126        // load the CEGUI interface
     
    233218        this->graphicsManager_->update(time);
    234219    }
    235 
    236     /**
    237     @brief
    238         Window has resized.
    239     @param rw
    240         The render window it occured in
    241     @note
    242         GraphicsManager has a render window stored itself. This is the same
    243         as rw. But we have to be careful when using multiple render windows!
    244     */
    245     void GSGraphics::windowResized(unsigned int newWidth, unsigned int newHeight)
    246     {
    247         // OIS needs this under linux even if we only use relative input measurement.
    248         // HACK:
    249         CommandExecutor::execute("setWindowExtents_s " + multi_cast<std::string>(newWidth) + " " + multi_cast<std::string>(newHeight));
    250     }
    251 
    252     /**
    253     @brief
    254         Window focus has changed.
    255     @param rw
    256         The render window it occured in
    257     */
    258     void GSGraphics::windowFocusChanged()
    259     {
    260         // instruct InputManager to clear the buffers (core library so we cannot use the interface)
    261         if (this->inputManager_)
    262             this->inputManager_->clearBuffers();
    263     }
    264 
    265220}
Note: See TracChangeset for help on using the changeset viewer.