diff options
| author | fschildt <florian.schildt@protonmail.com> | 2025-10-01 14:08:24 +0200 | 
|---|---|---|
| committer | fschildt <florian.schildt@protonmail.com> | 2025-10-01 14:09:13 +0200 | 
| commit | c775ca6133d93ed97359a6a50bd94a5563c740de (patch) | |
| tree | 9d3efb1c7e7538ff9d5cae408d2c29f9dd3daeab /src/main.cpp | |
| parent | 41c2e2ecfcccf62b3c646980dd283848e33a8134 (diff) | |
general refactoring, prepare breakout game
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 20 | 
1 files changed, 11 insertions, 9 deletions
diff --git a/src/main.cpp b/src/main.cpp index 16dce53..7fc7af6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,5 +1,4 @@ -#include <basic/defs.hpp> -#include <memory> +#include <common/defs.hpp>  #include <renderer/Renderer.hpp>  #include <games/Game.hpp> @@ -13,27 +12,30 @@  #include <imgui_impl_sdl3.h>  #include <iostream> +#include <memory>  #include <cstdlib>  #include <assert.h> -Game::GameType -DrawGameMenu() +Game::GameType DrawGameMenu()  { -    Game::GameType type = Game::NO_GAME; +    Game::GameType type = Game::no_game;      //ImGuiWindowFlags flags = ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove;      ImGuiWindowFlags flags = 0;      ImGui::Begin("Game Selection", nullptr, flags);      if (ImGui::Button("Tetris")) { -        type = Game::TETRIS; +        type = Game::tetris;      }      if (ImGui::Button("Snake")) { -        type = Game::SNAKE; +        type = Game::snake;      }      if (ImGui::Button("Minesweeper")) { -        type = Game::MINESWEEPER; +        type = Game::minesweeper; +    } +    if (ImGui::Button("Breakout")) { +        type = Game::breakout;      }      ImGui::End(); @@ -185,7 +187,7 @@ main(int argc, char **argv)          }          else {              Game::GameType type = DrawGameMenu(); -            if (type != Game::NO_GAME) { +            if (type != Game::no_game) {                  game = Game::Select(type);              }          }  | 
