From 5a578ba1aedced99ca5ed59c08584ec16de4a815 Mon Sep 17 00:00:00 2001 From: Braden Obrzut Date: Mon, 9 Dec 2019 18:39:36 -0500 Subject: [PATCH] Fixed: GetClientWidth and GetClientHeight were still using SDL_Surface which on some systems would allocate an SDL_Renderer automatically. --- src/posix/sdl/sdlglvideo.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/posix/sdl/sdlglvideo.cpp b/src/posix/sdl/sdlglvideo.cpp index f95afdfd23..39931c28ef 100644 --- a/src/posix/sdl/sdlglvideo.cpp +++ b/src/posix/sdl/sdlglvideo.cpp @@ -506,7 +506,11 @@ int SystemBaseFrameBuffer::GetClientWidth() if (Priv::softpolyEnabled) { - return SDL_GetWindowSurface(Priv::window)->w; + if (polyrendertarget) + SDL_GetRendererOutputSize(polyrendertarget, &width, nullptr); + else + SDL_GetWindowSize(Priv::window, &width, nullptr); + return width; } #ifdef HAVE_VULKAN @@ -523,7 +527,11 @@ int SystemBaseFrameBuffer::GetClientHeight() if (Priv::softpolyEnabled) { - return SDL_GetWindowSurface(Priv::window)->h; + if (polyrendertarget) + SDL_GetRendererOutputSize(polyrendertarget, nullptr, &height); + else + SDL_GetWindowSize(Priv::window, nullptr, &height); + return height; } #ifdef HAVE_VULKAN