added handling of resize event
This commit is contained in:
parent
56efe9fb6c
commit
306d12de27
17
input.cpp
17
input.cpp
@ -26,6 +26,7 @@ void Input::updateEvents(){
|
||||
|
||||
/* reset variables */
|
||||
closeRequested = false;
|
||||
hasBeenResized = false;
|
||||
delta_vertical_scroll = 0;
|
||||
|
||||
/* global affectation */
|
||||
@ -68,9 +69,12 @@ void Input::updateEvents(){
|
||||
case sf::Event::MouseEntered:
|
||||
// action MouseEntered
|
||||
break;
|
||||
case sf::Event::MouseLeft:
|
||||
//action MouseLeft
|
||||
break;
|
||||
case sf::Event::MouseLeft:
|
||||
//action MouseLeft
|
||||
break;
|
||||
case sf::Event::Resized:
|
||||
hasBeenResized = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (auto key: heldkeys){
|
||||
@ -110,7 +114,12 @@ void Input::updateKeyBindings(){
|
||||
|
||||
bool Input::isCloseRequested() const
|
||||
{
|
||||
return closeRequested;
|
||||
return closeRequested;
|
||||
}
|
||||
|
||||
bool Input::isResized() const
|
||||
{
|
||||
return hasBeenResized;
|
||||
}
|
||||
|
||||
/* keyboard-related functions */
|
||||
|
4
input.h
4
input.h
@ -26,7 +26,8 @@ class Input{
|
||||
void updateKeyBindings();
|
||||
|
||||
/* window-related function */
|
||||
bool isCloseRequested() const;
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user