#pragma once #include "AMI.h" #include "AppState.h" #include "MissionSelect.h" #include "defines.h" #include #include class SDLManager { public: SDLManager(); ~SDLManager(); }; #ifndef NDEBUG class KeyboardHandler { public: void handle_keyup(const SDL_Event& ev, AppState& state); }; #endif // !NDEBUG class App { public: App(); ~App(); int run(); private: void init_sdl(); void init_state(); void handle_events(); void render(); // The SDLManager initializes & quits SDL and its subsystems. Thus, it must be // the first member of the class, so that its constructor is called before the // others and its destructor is called after the others. SDLManager sdl_manager; std::unique_ptr state; std::unique_ptr mission_select; std::unique_ptr ami; bool running; SDL_Window* window; SDL_Renderer* renderer; #ifndef NDEBUG KeyboardHandler keyboard_handler; #endif // !NDEBUG };