Fix OpenGL display scaling on high DPI (#1011)

* Fix OpenGL display scaling on high DPI

* Scale the OSD too

* Fix indent
This commit is contained in:
Nadia Holmquist Pedersen
2021-02-22 18:17:48 +01:00
committed by GitHub
parent 532dc57025
commit 97643586fa
4 changed files with 11 additions and 5 deletions

View File

@ -23,6 +23,7 @@ const char* kScreenVS = R"(#version 140
uniform vec2 uScreenSize;
uniform mat2x3 uTransform;
uniform float uScaleFactor;
in vec2 vPosition;
in vec2 vTexcoord;
@ -33,9 +34,9 @@ void main()
{
vec4 fpos;
fpos.xy = vec3(vPosition, 1.0) * uTransform;
fpos.xy = vec3(vPosition, 1.0) * uTransform * uScaleFactor;
fpos.xy = ((fpos.xy * 2.0) / uScreenSize) - 1.0;
fpos.xy = ((fpos.xy * 2.0) / (uScreenSize * uScaleFactor)) - 1.0;
fpos.y *= -1;
fpos.z = 0.0;
fpos.w = 1.0;