// // game_dispatch.hpp // gameutils // // Created by Sam Jaffe on 9/2/16. // #pragma once #include #include #include #include "time.hpp" #include "engine_fwd.hpp" #include "events.hpp" #include "math/math_fwd.hpp" #include "math/vector.hpp" namespace engine { class game_dispatch { public: game_dispatch( ); void process_key_event( raw_key_t key, bool press ); void process_mouse_event( math::vec2 click, bool press ); [[noreturn]] void gameloop( ); void quit( ); private: void single_frame( tick t ) { } tick get_tick( ); tick next_frame( ); void cleanup_resources( ) { } // TODO ??? private: math::vec2 screen_size; duration minimum_frame_duration; using scene_t = std::unique_ptr; std::unordered_map scenes; bool running = true; timestamp current_timestamp; struct current_scene_info { current_scene_info( ); current_scene_info( scene * ); scene * ptr; // weak std::string current_scene_id; // metadata math::vec2 local_size; // metadata bool is_mouse_event; bool is_keyboard_event; } curr_scene; }; }