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.

Location:
code/branches/core4/src/orxonox/gamestates
Files:
2 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}
  • code/branches/core4/src/orxonox/gamestates/GSGraphics.h

    r3290 r3291  
    3737
    3838#include "OrxonoxPrereqs.h"
    39 
    4039#include "core/GameState.h"
    41 #include "core/WindowEventListener.h"
    4240
    4341namespace orxonox
     
    4947        This game state is only left out if we start a dedicated server where no graphics are present.
    5048    */
    51     class _OrxonoxExport GSGraphics : public GameState, public WindowEventListener
     49    class _OrxonoxExport GSGraphics : public GameState
    5250    {
    5351    public:
    5452        GSGraphics(const GameStateConstrParams& params);
    5553        ~GSGraphics();
    56         void setConfigValues();
    5754
    5855        void activate();
     
    6360
    6461    private:
    65         // Window events from WindowEventListener
    66         void windowResized(unsigned int newWidth, unsigned int newHeight);
    67         void windowFocusChanged();
    68 
    6962        // managed singletons
    7063        InputManager*         inputManager_;        //!< Reference to input management
Note: See TracChangeset for help on using the changeset viewer.