From fd02d88b5938a83075ed38f60c458917d3838e05 Mon Sep 17 00:00:00 2001 From: vanfanel Date: Sun, 10 May 2020 17:52:01 +0200 Subject: [PATCH] Fix for GLES on windowed rendering contexts (X11) --- src/pc/gfx/gfx_sdl2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pc/gfx/gfx_sdl2.c b/src/pc/gfx/gfx_sdl2.c index e85412f1..824c20a4 100644 --- a/src/pc/gfx/gfx_sdl2.c +++ b/src/pc/gfx/gfx_sdl2.c @@ -115,8 +115,10 @@ static void gfx_sdl_init(void) { #else /* GLES platforms generally run without a window server like Xorg. Just use the system video mode, instead of trying to set a new video mode, which does not make any sense in modern displays. */ + SDL_DisplayMode sdl_displaymode; + SDL_GetCurrentDisplayMode(0, &sdl_displaymode); wnd = SDL_CreateWindow("Super Mario 64 PC port (OpenGL_ES2)", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, - 0, 0, SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN_DESKTOP); + sdl_displaymode.w, sdl_displaymode.h, SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_FULLSCREEN_DESKTOP); #endif gfx_sdl_set_fullscreen(configFullscreen);