From 2a0db4ae3e185c54dadc2109afc28d98cce566c2 Mon Sep 17 00:00:00 2001 From: Zachary Hall Date: Sun, 16 Jul 2023 14:11:50 -0700 Subject: [PATCH] Fix initial size being smaller than the min size --- main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.cpp b/main.cpp index d6deb2e..3ab76fb 100644 --- a/main.cpp +++ b/main.cpp @@ -117,8 +117,11 @@ int main(int, char**) SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8); + int window_width = 475; + int window_height = 354; SDL_WindowFlags window_flags = (SDL_WindowFlags)(SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI); - SDL_Window* window = SDL_CreateWindow(NAME, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 475, 54, window_flags); + SDL_Window* window = SDL_CreateWindow(NAME, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, window_width, window_height, window_flags); + SDL_SetWindowMinimumSize(window, window_width, window_height); if (enable_kms) { SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP); } @@ -185,9 +188,6 @@ int main(int, char**) #endif ); fileDialog.SetPwd(path(userdir) / path("Music")); - int window_width = 475; - int window_height = 354; - SDL_SetWindowMinimumSize(window, window_width, window_height); fileDialog.SetWindowSize(window_width, window_height); //fileDialog.SetWindowPos(0, 0); Playback *playback = new Playback();