1
0
mirror of synced 2025-01-22 03:23:49 +01:00

fix: Properly detect Windows 10

This commit is contained in:
WerWolv 2025-01-20 21:45:53 +01:00
parent 3a888d48df
commit 242b100aa3
3 changed files with 11 additions and 4 deletions

View File

@ -28,6 +28,7 @@
#include <fcntl.h>
#include <shellapi.h>
#include <timeapi.h>
#include <VersionHelpers.h>
namespace hex {
@ -389,8 +390,7 @@ namespace hex {
// Windows versions before Windows 10 have issues with transparent framebuffers
// causing the entire window to be slightly transparent ignoring all configurations
OSVERSIONINFOA versionInfo = { };
if (::GetVersionExA(&versionInfo) && versionInfo.dwMajorVersion >= 10) {
if (::IsWindows10OrGreater()) {
glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE);
} else {
glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_FALSE);

View File

@ -924,7 +924,6 @@ namespace hex {
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_API);
glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE);
if (initialWindowProperties.has_value()) {
glfwWindowHint(GLFW_MAXIMIZED, initialWindowProperties->maximized);

View File

@ -7,4 +7,12 @@
<consoleAllocationPolicy xmlns="http://schemas.microsoft.com/SMI/2024/WindowsSettings">detached</consoleAllocationPolicy>
</windowsSettings>
</application>
</assembly>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 10, version 1903 -->
<maxversiontested Id="10.0.18362.1"/>
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application>
</compatibility>
</assembly>