impr: Allow ImHex to be used without subpixel rendering on Windows if only OpenGL 3 is available

This commit is contained in:
WerWolv
2025-08-09 19:13:45 +02:00
parent e6f46747b6
commit d925c8216d
7 changed files with 62 additions and 14 deletions

View File

@@ -397,8 +397,13 @@ namespace hex {
}
void Window::configureGLFW() {
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1);
if (ImHexApi::System::getGLVersion() >= SemanticVersion(4,1,0)) {
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1);
} else {
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
}
glfwWindowHint(GLFW_DECORATED, ImHexApi::System::isBorderlessWindowModeEnabled() ? GL_FALSE : GL_TRUE);
// Windows versions before Windows 10 have issues with transparent framebuffers