From b378b3d05a1c776def6719def44ab04a0e22559e Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Mon, 12 Sep 2016 20:43:45 +0200 Subject: [PATCH] Remove black bars from windowed mode --- src/gl/system/gl_framebuffer.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/gl/system/gl_framebuffer.cpp b/src/gl/system/gl_framebuffer.cpp index 158d7f333f..ed0d07bd56 100644 --- a/src/gl/system/gl_framebuffer.cpp +++ b/src/gl/system/gl_framebuffer.cpp @@ -192,12 +192,23 @@ void OpenGLFrameBuffer::Update() DrawRateStuff(); GLRenderer->Flush(); - GLRenderer->SetOutputViewport(nullptr); - Swap(); swapped = false; Unlock(); CheckBench(); + + if (Windowed) + { + int clientWidth = GetClientWidth(); + int clientHeight = GetClientHeight(); + if (clientWidth > 0 && clientHeight > 0 && (Width != clientWidth || Height != clientHeight)) + { + Resize(clientWidth, clientHeight); + V_OutputResized(Width, Height); + } + } + + GLRenderer->SetOutputViewport(nullptr); }