From b18ea0ef4086e6c23d757c8bb594b246e4ed937c Mon Sep 17 00:00:00 2001 From: Evan Wallace Date: Sun, 13 Dec 2015 19:50:39 +1100 Subject: [PATCH] More warning elimination. --- src/RenderWindow.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/RenderWindow.h b/src/RenderWindow.h index 446c6bde..1c57be87 100644 --- a/src/RenderWindow.h +++ b/src/RenderWindow.h @@ -6,11 +6,12 @@ #include #include #include + namespace hg { //Wraps sf::RenderWindow and adds some additional features. struct RenderWindow { struct InputState { - InputState( + explicit InputState( boost::container::vector const &pressedKeys, boost::container::vector const &pressedMouseButtons, sf::Vector2i mousePosition): @@ -38,7 +39,7 @@ struct RenderWindow { sf::Vector2i mousePosition; }; struct InputStateTracker { - InputStateTracker(sf::RenderWindow const &window) : + explicit InputStateTracker(sf::RenderWindow const &window) : pressedKeys(sf::Keyboard::KeyCount), pressedMouseButtons(sf::Mouse::ButtonCount), mousePos(sf::Mouse::getPosition(window)) @@ -82,6 +83,11 @@ struct RenderWindow { break; case sf::Event::MouseEntered: ///< The mouse cursor entered the area of the window (no data) case sf::Event::MouseLeft: ///< The mouse cursor left the area of the window (no data) + case sf::Event::SensorChanged: + case sf::Event::TouchMoved: + case sf::Event::MouseWheelScrolled: + case sf::Event::TouchBegan: + case sf::Event::TouchEnded: //Nothing to do. break; case sf::Event::JoystickButtonPressed: ///< A joystick button was pressed (data in event.joystickButton) @@ -91,6 +97,7 @@ struct RenderWindow { case sf::Event::JoystickDisconnected: ///< A joystick was disconnected (data in event.joystickConnect) //TODO implement joystick support break; + case sf::Event::Count: ///< Keep last -- the total number of event types assert(false && "sf::Event::Count is not a real event"); break; @@ -121,7 +128,7 @@ struct RenderWindow { RenderWindow() : renderWindow(), inputStateTracker(renderWindow) {} - RenderWindow( + explicit RenderWindow( sf::VideoMode mode, const sf::String &title, sf::Uint32 style = sf::Style::Default,