diff options
author | Nao Pross <naopross@thearcway.org> | 2018-02-12 00:13:39 +0100 |
---|---|---|
committer | Nao Pross <naopross@thearcway.org> | 2018-02-12 00:13:39 +0100 |
commit | d3e8495212f9008f0c2650fb5ee628b464ca5ac0 (patch) | |
tree | e45ef935e17e24184cce7a75d5a281133d49b271 /src/main/headers/Scene.hpp | |
parent | Update README to add dependencies (diff) | |
download | Subconscious-old-d3e8495212f9008f0c2650fb5ee628b464ca5ac0.tar.gz Subconscious-old-d3e8495212f9008f0c2650fb5ee628b464ca5ac0.zip |
Handle WindowResize event and add zoom
Diffstat (limited to 'src/main/headers/Scene.hpp')
-rw-r--r-- | src/main/headers/Scene.hpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main/headers/Scene.hpp b/src/main/headers/Scene.hpp index 2b19d31..b7a46e6 100644 --- a/src/main/headers/Scene.hpp +++ b/src/main/headers/Scene.hpp @@ -6,7 +6,19 @@ class Scene { public: - virtual void render(sf::RenderWindow &window) = 0; + constexpr static float MAX_ZOOM = 10; + constexpr static float MIN_ZOOM = .1; + + virtual void render() = 0; + virtual void resize(const sf::Event::SizeEvent &size) = 0; + + virtual void zoom(float factor) {} + +protected: + float _zoom = 1; + sf::RenderWindow &_window; + + Scene(sf::RenderWindow &window) : _window(window) {} }; #endif |