#pragma once #include #include "gfx/types.h" class DebugOverlay; class ClientNetwork; class Desktop; class LoginScreen; class BootSequence; class MainMenu; class ShapeRenderer; class TextRenderer; union SDL_Event; enum class Screen { LOGIN, MAIN_MENU, BOOTING, DESKTOP }; class GameState { public: GameState(void); ~GameState(void); void init(int screen_width, int screen_height); void start_single_player_now(int screen_width, int screen_height); void handle_event(SDL_Event* event, int screen_width, int screen_height); void update(float dt, int draw_calls, int shape_verts, int text_verts); void render(const RenderContext& context); private: std::unique_ptr _network; std::unique_ptr _desktop; std::unique_ptr _boot_sequence; std::unique_ptr _login_screen; std::unique_ptr _main_menu; std::unique_ptr _debug_overlay; bool _show_debug_overlay; Screen _current_screen; int _screen_width; int _screen_height; bool _is_single_player; void _init_desktop(void); void _run_server(void); };