Fixed compilation errors on gcc 4.6 not supporting data member initializer

This commit is contained in:
Florian Rival
2015-03-04 07:19:17 +01:00
parent 1c58546dc9
commit b35ce4876c
2 changed files with 21 additions and 8 deletions

View File

@@ -6,7 +6,12 @@
#include "InputManager.h"
InputManager::InputManager(sf::Window * win) :
window(win)
window(win),
lastPressedKey(0),
mouseWheelDelta(0),
keyWasPressed(false),
windowHasFocus(true),
disableInputWhenNotFocused(true)
{
}

View File

@@ -26,7 +26,15 @@ public:
*
* Call SetWindow to set the window for which events must be handled
*/
InputManager() {};
InputManager() :
window(nullptr),
lastPressedKey(0),
mouseWheelDelta(0),
keyWasPressed(false),
windowHasFocus(true),
disableInputWhenNotFocused(true)
{
}
/**
* @brief Constructor to specify a window to manage.
@@ -106,12 +114,12 @@ public:
///@}
private:
sf::Window * window = nullptr;
int lastPressedKey = 0; ///< SFML key code of the last pressed key.
int mouseWheelDelta = 0;
bool keyWasPressed = false; ///< True if a key was pressed during the last step.
bool windowHasFocus = true; ///< True if the render target has the focus.
bool disableInputWhenNotFocused = true; ///< True if input should be ignored when focus is lost.
sf::Window * window;
int lastPressedKey; ///< SFML key code of the last pressed key.
int mouseWheelDelta;
bool keyWasPressed; ///< True if a key was pressed during the last step.
bool windowHasFocus; ///< True if the render target has the focus.
bool disableInputWhenNotFocused; ///< True if input should be ignored when focus is lost.
std::vector<sf::Uint32> charactersEntered; ///< The characters entered during the last frame.
};