diff --git a/libs/app/include/psemek/app/scene.hpp b/libs/app/include/psemek/app/scene.hpp index 742de2ce..1cd2d513 100644 --- a/libs/app/include/psemek/app/scene.hpp +++ b/libs/app/include/psemek/app/scene.hpp @@ -42,6 +42,9 @@ namespace psemek::app struct scene_base : scene { + void on_scene_enter() override { active_ = true; } + void on_scene_exit() override { active_ = false; } + void on_resize(int width, int height) override { width_ = width; height_ = height; } void on_mouse_move(int x, int y, int, int) override { mouse_ = geom::point{x, y}; } @@ -54,6 +57,8 @@ namespace psemek::app void on_key_down(SDL_Keycode key) override { keys_.insert(key); } void on_key_up(SDL_Keycode key) override { keys_.erase(key); } + bool active() const { return active_; } + bool is_left_button_down() const { return left_button_down_; } bool is_middle_button_down() const { return middle_button_down_; } bool is_right_button_down() const { return right_button_down_; } @@ -66,6 +71,8 @@ namespace psemek::app int height() const { return height_; } private: + bool active_ = false; + int width_ = 0; int height_ = 0;