#define SDL_MAIN_HANDLED #include #include #include #include "globals.hpp" #include "framework/window.hpp" #include "minesweeper/ui.hpp" int main(int argc, char** argv) { (void)argc; (void)argv; SDL_Init(SDL_INIT_VIDEO); #ifdef SHOW_DEBUG_HELPERS Utils::CheckSDLError("main::SDL_Init"); #endif IMG_Init(IMG_INIT_PNG); #ifdef SHOW_DEBUG_HELPERS Utils::CheckSDLError("main::IMG_Init"); #endif TTF_Init(); #ifdef SHOW_DEBUG_HELPERS Utils::CheckSDLError("main::TTF_Init"); #endif Framework::Window GameWindow; MinesweeperUI UI; SDL_Event Event; bool gameRun{ true }; while (gameRun) { while (SDL_PollEvent(&Event)) { if (Event.type == SDL_QUIT) { gameRun = false; } else { UI.HandleEvent(Event); } } GameWindow.Render(); UI.Render(GameWindow.GetSurface()); GameWindow.Update(); } SDL_Quit(); return 0; }