sys: Added setting to override borderless window mode even on Intel

This commit is contained in:
WerWolv
2022-02-15 23:07:48 +01:00
parent f72e9700ab
commit 33a1e7f055
7 changed files with 39 additions and 13 deletions

View File

@@ -14,10 +14,9 @@ int main(int argc, char **argv, char **envp) {
using namespace hex;
ImHexApi::System::impl::setProgramArguments(argc, argv, envp);
bool useBorderlessWindow = false;
#if defined(OS_WINDOWS)
useBorderlessWindow = true;
ImHexApi::System::impl::setBorderlessWindowMode(true);
#endif
// Initialization
@@ -28,13 +27,21 @@ int main(int argc, char **argv, char **envp) {
init::WindowSplash splashWindow;
// Intel's OpenGL driver has weird bugs that cause the drawn window to be offset to the bottom right.
// This can be fixed by either using Mesa3D's OpenGL Software renderer or by simply disabling it.
// If you want to try if it works anyways on your GPU, set the hex.builtin.setting.interface.force_borderless_window_mode setting to 1
bool isIntelGPU = hex::containsIgnoreCase(splashWindow.getGPUVendor(), "Intel");
ImHexApi::System::impl::setBorderlessWindowMode(!isIntelGPU);
if (isIntelGPU)
log::warn("Intel GPU detected! Intel's OpenGL driver has bugs that can cause issues when using ImHex. If you experience any rendering bugs, please try the Mesa3D Software Renderer");
for (const auto &[name, task] : init::getInitTasks())
splashWindow.addStartupTask(name, task);
if (!splashWindow.loop())
ImHexApi::System::getInitArguments().insert({ "tasks-failed", {} });
useBorderlessWindow = !hex::containsIgnoreCase(splashWindow.getGPUVendor(), "Intel");
}
// Clean up
@@ -45,7 +52,7 @@ int main(int argc, char **argv, char **envp) {
// Main window
{
Window window(useBorderlessWindow);
Window window;
if (argc == 1)
; // No arguments provided