Fix render issue, seems like compositor / set window size interaction gone wrong, it produced maybe framebuffer of wrong size not filling entire screen

This commit is contained in:
KK
2026-07-04 10:27:53 +02:00
parent e40d8773c4
commit 1e70444992

View File

@@ -1027,6 +1027,7 @@ int main(int argc, char **argv, char **envp)
int hhalf = 1000; int hhalf = 1000;
int xhalf = 100; int xhalf = 100;
int yhalf = 100; int yhalf = 100;
Unused(xhalf); Unused(yhalf);
#else #else
SDL_DisplayID primary_display_id = SDL_GetPrimaryDisplay(); SDL_DisplayID primary_display_id = SDL_GetPrimaryDisplay();
const SDL_DisplayMode *display_mode = SDL_GetCurrentDisplayMode(primary_display_id); const SDL_DisplayMode *display_mode = SDL_GetCurrentDisplayMode(primary_display_id);
@@ -1042,7 +1043,9 @@ int main(int argc, char **argv, char **envp)
ReportErrorf("Couldn't create window! %s", SDL_GetError()); ReportErrorf("Couldn't create window! %s", SDL_GetError());
return 1; return 1;
} }
#if !OS_LINUX
SDL_SetWindowPosition(SDLWindow, xhalf, yhalf); SDL_SetWindowPosition(SDLWindow, xhalf, yhalf);
#endif
SDL_WindowGLContext = SDL_GL_CreateContext(SDLWindow); SDL_WindowGLContext = SDL_GL_CreateContext(SDLWindow);
SDL_GL_MakeCurrent(SDLWindow, SDL_WindowGLContext); SDL_GL_MakeCurrent(SDLWindow, SDL_WindowGLContext);
@@ -1064,10 +1067,12 @@ int main(int argc, char **argv, char **envp)
SDL_StartTextInput(SDLWindow); SDL_StartTextInput(SDLWindow);
SDL_SetEventEnabled(SDL_EVENT_DROP_FILE, true); SDL_SetEventEnabled(SDL_EVENT_DROP_FILE, true);
SDL_GL_SetSwapInterval(1); // vsync SDL_GL_SetSwapInterval(1); // vsync
{ {
float scale = SDL_GetWindowDisplayScale(SDLWindow); float scale = SDL_GetWindowDisplayScale(SDLWindow);
if (scale != 1.0f) DPIScale = scale; if (scale != 1.0f) DPIScale = scale;
} }
SDL_SyncWindow(SDLWindow);
// InitBuffers // InitBuffers
{ {