fix OSD scaling on hiDPI screens
This commit is contained in:
parent
f905b6fb93
commit
ab8938a695
|
@ -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);
|
||||||
|
|
|
@ -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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue