aboutsummaryrefslogtreecommitdiff
path: root/src/frontend
diff options
context:
space:
mode:
authorArisotura <thetotalworm@gmail.com>2023-12-26 19:32:38 +0100
committerArisotura <thetotalworm@gmail.com>2023-12-26 19:32:38 +0100
commitab8938a6950f613c0f255788b483ef683e5e0851 (patch)
treea9837d27871353de9d9ee3af484a1851ad9fa154 /src/frontend
parentf905b6fb93e1ee35ad39f78eef88d221dda26537 (diff)
fix OSD scaling on hiDPI screens
Diffstat (limited to 'src/frontend')
-rw-r--r--src/frontend/qt_sdl/OSD.cpp4
-rw-r--r--src/frontend/qt_sdl/OSD.h2
-rw-r--r--src/frontend/qt_sdl/Screen.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/frontend/qt_sdl/OSD.cpp b/src/frontend/qt_sdl/OSD.cpp
index 25072df..3734b76 100644
--- a/src/frontend/qt_sdl/OSD.cpp
+++ b/src/frontend/qt_sdl/OSD.cpp
@@ -418,7 +418,7 @@ void DrawNative(QPainter& painter)
Rendering.unlock();
}
-void DrawGL(float w, float h)
+void DrawGL(float w, float h, float factor)
{
if (!Config::ShowOSD) return;
if (!mainWindow || !mainWindow->panel) return;
@@ -430,7 +430,7 @@ void DrawGL(float w, float h)
glUseProgram(Shader[2]);
glUniform2f(uScreenSize, w, h);
- glUniform1f(uScaleFactor, mainWindow->devicePixelRatioF());
+ glUniform1f(uScaleFactor, factor);
glBindBuffer(GL_ARRAY_BUFFER, OSDVertexBuffer);
glBindVertexArray(OSDVertexArray);
diff --git a/src/frontend/qt_sdl/OSD.h b/src/frontend/qt_sdl/OSD.h
index 64131d5..c907a0b 100644
--- a/src/frontend/qt_sdl/OSD.h
+++ b/src/frontend/qt_sdl/OSD.h
@@ -32,7 +32,7 @@ void AddMessage(u32 color, const char* text);
void Update();
void DrawNative(QPainter& painter);
-void DrawGL(float w, float h);
+void DrawGL(float w, float h, float factor);
}
diff --git a/src/frontend/qt_sdl/Screen.cpp b/src/frontend/qt_sdl/Screen.cpp
index 35be7e6..d8af662 100644
--- a/src/frontend/qt_sdl/Screen.cpp
+++ b/src/frontend/qt_sdl/Screen.cpp
@@ -591,7 +591,7 @@ void ScreenPanelGL::drawScreenGL()
screenSettingsLock.unlock();
OSD::Update();
- OSD::DrawGL(w, h);
+ OSD::DrawGL(w, h, factor);
glContext->SwapBuffers();
}