[client] opengl: support scaled UI for high DPI displays

This commit is contained in:
Quantum authored and Geoffrey McRae committed 2021-02-21 19:06:53 +11:00
1 parent 3ec73e2444
commit 89bdaec95a
1 file changed
+9 -3
+9 -3
View File
@@ -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);