From 89bdaec95a557b96bd5ab6f9f7b808fee67775d2 Mon Sep 17 00:00:00 2001 From: Quantum Date: Sun, 21 Feb 2021 00:53:14 -0500 Subject: [PATCH] [client] opengl: support scaled UI for high DPI displays --- client/renderers/OpenGL/opengl.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/client/renderers/OpenGL/opengl.c b/client/renderers/OpenGL/opengl.c index f09170cf..8a531b1e 100644 --- a/client/renderers/OpenGL/opengl.c +++ b/client/renderers/OpenGL/opengl.c @@ -303,11 +303,17 @@ void opengl_on_resize(void * opaque, const int width, const int height, const do { struct Inst * this = (struct Inst *)opaque; - this->window.x = width; - this->window.y = height; + this->window.x = width * scale; + this->window.y = height * scale; if (destRect.valid) - memcpy(&this->destRect, &destRect, sizeof(LG_RendererRect)); + { + this->destRect.valid = true; + this->destRect.x = destRect.x * scale; + this->destRect.y = destRect.y * scale; + this->destRect.w = destRect.w * scale; + this->destRect.h = destRect.h * scale; + } // setup the projection matrix glViewport(0, 0, this->window.x, this->window.y);