From 7c61a54c5bbb6dd178f34bd64bce7fc8095a2a8c Mon Sep 17 00:00:00 2001 From: Greg V Date: Mon, 28 Sep 2020 04:47:16 +0300 Subject: [PATCH 1/2] glfw: request non-transparent window buffer specifically Otherwise, e.g. re3 gets the same issue as https://stackoverflow.com/q/35245809 e.g. on Wayland where transparency is the default --- src/gl/gl3device.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gl/gl3device.cpp b/src/gl/gl3device.cpp index 856527a5..67eae22e 100644 --- a/src/gl/gl3device.cpp +++ b/src/gl/gl3device.cpp @@ -1410,6 +1410,7 @@ startGLFW(void) mode = &glGlobals.modes[glGlobals.currentMode]; glfwSetErrorCallback(glfwerr); + glfwWindowHint(GLFW_ALPHA_BITS, 0); // important e.g. on Wayland glfwWindowHint(GLFW_RED_BITS, mode->mode.redBits); glfwWindowHint(GLFW_GREEN_BITS, mode->mode.greenBits); glfwWindowHint(GLFW_BLUE_BITS, mode->mode.blueBits); From 57227e9b2dfa657101348d47bf335acb72566bd1 Mon Sep 17 00:00:00 2001 From: Greg V Date: Mon, 28 Sep 2020 04:48:34 +0300 Subject: [PATCH 2/2] Use glfwGetFramebufferSize instead of glfwGetWindowSize glfwGetFramebufferSize is scaled by the display scale. This fixes the game being shrunk to the bottom left quarter of the window on Wayland HiDPI setups. --- src/gl/gl3device.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gl/gl3device.cpp b/src/gl/gl3device.cpp index 67eae22e..f4b336e5 100644 --- a/src/gl/gl3device.cpp +++ b/src/gl/gl3device.cpp @@ -1156,7 +1156,7 @@ beginUpdate(Camera *cam) #ifdef LIBRW_SDL2 SDL_GetWindowSize(glGlobals.window, &w, &h); #else - glfwGetWindowSize(glGlobals.window, &w, &h); + glfwGetFramebufferSize(glGlobals.window, &w, &h); #endif }else{ w = cam->frameBuffer->width;