fix OSD scaling on hiDPI screens

This commit is contained in:
Arisotura 2023-12-26 19:32:38 +01:00
parent f905b6fb93
commit ab8938a695
3 changed files with 4 additions and 4 deletions

View File

@ -418,7 +418,7 @@ void DrawNative(QPainter& painter)
Rendering.unlock(); Rendering.unlock();
} }
void DrawGL(float w, float h) void DrawGL(float w, float h, float factor)
{ {
if (!Config::ShowOSD) return; if (!Config::ShowOSD) return;
if (!mainWindow || !mainWindow->panel) return; if (!mainWindow || !mainWindow->panel) return;
@ -430,7 +430,7 @@ void DrawGL(float w, float h)
glUseProgram(Shader[2]); glUseProgram(Shader[2]);
glUniform2f(uScreenSize, w, h); glUniform2f(uScreenSize, w, h);
glUniform1f(uScaleFactor, mainWindow->devicePixelRatioF()); glUniform1f(uScaleFactor, factor);
glBindBuffer(GL_ARRAY_BUFFER, OSDVertexBuffer); glBindBuffer(GL_ARRAY_BUFFER, OSDVertexBuffer);
glBindVertexArray(OSDVertexArray); glBindVertexArray(OSDVertexArray);

View File

@ -32,7 +32,7 @@ void AddMessage(u32 color, const char* text);
void Update(); void Update();
void DrawNative(QPainter& painter); void DrawNative(QPainter& painter);
void DrawGL(float w, float h); void DrawGL(float w, float h, float factor);
} }

View File

@ -591,7 +591,7 @@ void ScreenPanelGL::drawScreenGL()
screenSettingsLock.unlock(); screenSettingsLock.unlock();
OSD::Update(); OSD::Update();
OSD::DrawGL(w, h); OSD::DrawGL(w, h, factor);
glContext->SwapBuffers(); glContext->SwapBuffers();
} }