From 0a68eb78039a7a27b16d389844beeebed139f864 Mon Sep 17 00:00:00 2001 From: Arisotura Date: Thu, 28 May 2020 11:52:12 +0200 Subject: [PATCH] make it hiDPI compliant (I hope) also misc tweaks --- src/GPU3D_OpenGL.cpp | 2 +- src/OpenGLSupport.h | 5 +++++ src/frontend/qt_sdl/AudioSettingsDialog.ui | 7 +++++-- src/frontend/qt_sdl/main.cpp | 6 +++--- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/GPU3D_OpenGL.cpp b/src/GPU3D_OpenGL.cpp index 74760e5b..9a78504d 100644 --- a/src/GPU3D_OpenGL.cpp +++ b/src/GPU3D_OpenGL.cpp @@ -1236,7 +1236,7 @@ void RenderFrame() glBlitFramebuffer(0, 0, ScreenW, ScreenH, 0, 0, ScreenW/2, ScreenH/2, GL_COLOR_BUFFER_BIT, GL_LINEAR); } - glBindFramebuffer(GL_FRAMEBUFFER, FramebufferID[FrontBuffer]); + //glBindFramebuffer(GL_FRAMEBUFFER, FramebufferID[FrontBuffer]); FrontBuffer = FrontBuffer ? 0 : 1; } diff --git a/src/OpenGLSupport.h b/src/OpenGLSupport.h index 360d2156..edf7edad 100644 --- a/src/OpenGLSupport.h +++ b/src/OpenGLSupport.h @@ -102,6 +102,11 @@ func(GLGETUNIFORMLOCATION, glGetUniformLocation); \ func(GLGETUNIFORMBLOCKINDEX, glGetUniformBlockIndex); \ \ + func(GLFENCESYNC, glFenceSync); \ + func(GLDELETESYNC, glDeleteSync); \ + func(GLWAITSYNC, glWaitSync); \ + func(GLCLIENTWAITSYNC, glClientWaitSync); \ + \ func(GLDRAWBUFFERS, glDrawBuffers); \ \ func(GLBLENDFUNCSEPARATE, glBlendFuncSeparate); \ diff --git a/src/frontend/qt_sdl/AudioSettingsDialog.ui b/src/frontend/qt_sdl/AudioSettingsDialog.ui index c4e993ee..9ae8baad 100644 --- a/src/frontend/qt_sdl/AudioSettingsDialog.ui +++ b/src/frontend/qt_sdl/AudioSettingsDialog.ui @@ -60,12 +60,15 @@ 0 + + <html><head/><body><p>Forward a WAV file to the emulated microphone.</p><p>This input mode is activated by holding the microphone hotkey (see Input and Hotkeys).</p></body></html> + - <html><head/><body><p>Forward a WAV file to the emulated microphone.</p></body></html> + <html><head/><body><p>Forward a WAV file to the emulated microphone.</p><p>This input mode is activated by holding the microphone hotkey (see Input and Hotkeys).</p></body></html> WAV file: @@ -92,7 +95,7 @@ - <html><head/><body><p>Noise will be forwarded to the emulated microphone, simulating blowing into the microphone.</p></body></html> + <html><head/><body><p>Noise will be forwarded to the emulated microphone, simulating blowing into the microphone.</p><p>This input mode is activated by holding the microphone hotkey (see Input and Hotkeys).</p></body></html> Blow noise diff --git a/src/frontend/qt_sdl/main.cpp b/src/frontend/qt_sdl/main.cpp index f282310e..20084ff7 100644 --- a/src/frontend/qt_sdl/main.cpp +++ b/src/frontend/qt_sdl/main.cpp @@ -874,15 +874,15 @@ void ScreenPanelGL::paintGL() { int w = width(); int h = height(); + float factor = devicePixelRatioF(); glClear(GL_COLOR_BUFFER_BIT); - // TODO: check hiDPI compliance of this - glViewport(0, 0, w, h); + glViewport(0, 0, w*factor, h*factor); screenShader->bind(); - screenShader->setUniformValue("uScreenSize", (float)w, (float)h); + screenShader->setUniformValue("uScreenSize", (float)w*factor, (float)h*factor); int frontbuf = GPU::FrontBuffer; glActiveTexture(GL_TEXTURE0);