Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 12, 2009, 4:12:04 PM (16 years ago)
Author:
rgrieder
Message:

Added a few more generic parts to the input library:

  • Created Mouse and Keyboard to join JoyStick and provided them with a templated base class (InputDeviceTemplated) that does most of the work (reduces quite some redundancy)
  • Created InputPrereqs.h from InputInterfaces.h and destroyed the latter
  • Exported InputHandler to its own file and replaced KeyHandler, MouseHandler and JoyStickHandler with the single InputHandler.
  • Deleted the SimpleInputState: There is only one class now which fulfills all our needs.

In general there is now less code and the code itself has more 'pluses'. However I haven't really thrown away any feature at all.

File:
1 edited

Legend:

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

    r3270 r3274  
    3838#include <OgreRenderWindow.h>
    3939
     40#include "util/Convert.h"
    4041#include "core/ConfigValueIncludes.h"
    4142#include "core/Clock.h"
     43#include "core/CommandExecutor.h"
    4244#include "core/ConsoleCommand.h"
    4345#include "core/Core.h"
     
    4749#include "core/input/InputManager.h"
    4850#include "core/input/KeyBinder.h"
    49 #include "core/input/SimpleInputState.h"
     51#include "core/input/InputState.h"
    5052#include "core/Loader.h"
    5153#include "core/XMLFile.h"
     
    125127
    126128        // load master key bindings
    127         masterInputState_ = InputManager::getInstance().createInputState<SimpleInputState>("master", true);
     129        masterInputState_ = InputManager::getInstance().createInputState("master", true);
    128130        masterKeyBinder_ = new KeyBinder();
    129131        masterKeyBinder_->loadBindings("masterKeybindings.ini");
     
    244246    {
    245247        // OIS needs this under linux even if we only use relative input measurement.
    246         if (this->inputManager_)
    247             this->inputManager_->setWindowExtents(newWidth, newHeight);
     248        // HACK:
     249        CommandExecutor::execute("setWindowExtents_s " + multi_cast<std::string>(newWidth) + " " + multi_cast<std::string>(newHeight));
    248250    }
    249251
Note: See TracChangeset for help on using the changeset viewer.