aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorfschildt <florian.schildt@protonmail.com>2025-11-24 18:18:24 +0100
committerfschildt <florian.schildt@protonmail.com>2025-11-24 18:19:45 +0100
commitfeb4bc8cbc66ba928319ddb2cc1bf48010487863 (patch)
tree2011affc8ecb16d295fa86a8ef5b8e6f715a9bc3 /src/main.cpp
parent935f1971bee684c6c9baded2564a550351cc5582 (diff)
renderer: improve resizing
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 8129c68..c830443 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -21,10 +21,12 @@ Game::GameType
DrawGameMenu()
{
Game::GameType type = Game::no_game;
-
- //ImGuiWindowFlags flags = ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove;
ImGuiWindowFlags flags = 0;
+ ImVec2 pos = {100, 200};
+ ImGui::SetNextWindowPos(pos);
+
+
ImGui::Begin("Game Selection", nullptr, flags);
if (ImGui::Button("Tetris")) {
type = Game::tetris;
@@ -38,11 +40,6 @@ DrawGameMenu()
ImGui::End();
- Color clear_color = {0.4f, 0.4f, 0.4f, 1.0f};
- g_renderer.SetCameraSize(4.0f, 3.0f);
- g_renderer.Clear(clear_color);
-
-
return type;
}
@@ -175,6 +172,8 @@ main(int argc, char** argv)
int w, h;
SDL_GetWindowSize(window, &w, &h);
g_renderer.SetScreenSize(w, h);
+ g_renderer.SetClearColor({0.3f, 0.3f, 0.3f});
+ g_renderer.SetCameraSize(4.0f, 3.0f);
if (game) {