diff --git a/input.cpp b/input.cpp index 3dc2148..4f2a364 100644 --- a/input.cpp +++ b/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 */ diff --git a/input.h b/input.h index 0c2f908..26abf36 100644 --- a/input.h +++ b/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;