added handling of resize event

This commit is contained in:
Anselme 2015-09-24 11:54:33 +02:00
parent 56efe9fb6c
commit 306d12de27
2 changed files with 16 additions and 5 deletions

View File

@ -26,6 +26,7 @@ void Input::updateEvents(){
/* reset variables */
closeRequested = false;
hasBeenResized = false;
delta_vertical_scroll = 0;
/* global affectation */
@ -71,6 +72,9 @@ void Input::updateEvents(){
case sf::Event::MouseLeft:
//action MouseLeft
break;
case sf::Event::Resized:
hasBeenResized = true;
break;
}
}
for (auto key: heldkeys){
@ -113,6 +117,11 @@ bool Input::isCloseRequested() const
return closeRequested;
}
bool Input::isResized() const
{
return hasBeenResized;
}
/* keyboard-related functions */
bool Input::isKeyPressed(int key) const

View File

@ -27,6 +27,7 @@ class Input{
/* window-related function */
bool isCloseRequested() const;
bool isResized() const;
/* keyboard-related functions */
bool isKeyPressed(int key) const;
@ -45,6 +46,7 @@ class Input{
/* window-related variables */
sf::Window* window;
bool closeRequested;
bool hasBeenResized;
/* general action-mapping variables */
IKeysMap keysmap;