aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/qt_sdl/main_shaders.h
diff options
context:
space:
mode:
authorNadia Holmquist Pedersen <nadia@nhp.sh>2021-02-22 18:17:48 +0100
committerGitHub <noreply@github.com>2021-02-22 18:17:48 +0100
commit97643586fafd573b02566ddafb92329c40cb44c4 (patch)
tree464d2b0e19a806b1c7767878d879055c086d020a /src/frontend/qt_sdl/main_shaders.h
parent532dc57025c4a9643f708dcfde32ce8cd4b453a9 (diff)
Fix OpenGL display scaling on high DPI (#1011)
* Fix OpenGL display scaling on high DPI * Scale the OSD too * Fix indent
Diffstat (limited to 'src/frontend/qt_sdl/main_shaders.h')
-rw-r--r--src/frontend/qt_sdl/main_shaders.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/frontend/qt_sdl/main_shaders.h b/src/frontend/qt_sdl/main_shaders.h
index c55f79e..da5a22a 100644
--- a/src/frontend/qt_sdl/main_shaders.h
+++ b/src/frontend/qt_sdl/main_shaders.h
@@ -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;