#ifndef APP_H #define APP_H #include "app/scene.h" #include "bindings/ruby.h" #include "utils.h" #include "window/window.h" namespace app { struct App { uint64_t current_scene_id = 0; bool running = true; Vec2 mouse_position = {-1, -1}; std::array down_keys{}; std::vector pressed_keys; std::vector released_keys; Vec2 scroll = {0, 0}; std::string text = ""; Ruby::Block update; App(Vec2 size, const char *title); void exit(); void switch_to_scene(uint64_t scene_id); void set_fps(float fps); uint64_t get_fps() const; void loop(); private: uint64_t fps = 60; uint64_t target_frame_time = 1e9 / fps; }; } // namespace app inline app::App *app_ = nullptr; #endif