From 60a837f19f8238c8192a6e7bf27d73870deba05a Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Tue, 3 Feb 2015 21:28:08 +0100 Subject: [PATCH] Minor cleanup --- UI/NativeApp.cpp | 15 +++++++++++---- Windows/W32Util/Misc.cpp | 11 +++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 4f6b0b555b..fbfcc4acf4 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -476,7 +476,9 @@ void NativeInit(int argc, const char *argv[], // We do this here, instead of in NativeInitGraphics, because the display may be reset. // When it's reset we don't want to forget all our managed things. - gl_lost_manager_init(); + if (g_Config.iGPUBackend == GPU_BACKEND_OPENGL) { + gl_lost_manager_init(); + } } void NativeInitGraphics() { @@ -772,8 +774,11 @@ void NativeUpdate(InputState &input) { void NativeDeviceLost() { g_gameInfoCache.Clear(); screenManager->deviceLost(); - gl_lost(); - glstate.Restore(); + + if (g_Config.iGPUBackend == GPU_BACKEND_OPENGL) { + gl_lost(); + glstate.Restore(); + } // Should dirty EVERYTHING } @@ -941,7 +946,9 @@ void NativeResized() { } void NativeShutdown() { - gl_lost_manager_shutdown(); + if (g_Config.iGPUBackend == GPU_BACKEND_OPENGL) { + gl_lost_manager_shutdown(); + } screenManager->shutdown(); delete screenManager; diff --git a/Windows/W32Util/Misc.cpp b/Windows/W32Util/Misc.cpp index b9ca9684f1..ae4905a1c7 100644 --- a/Windows/W32Util/Misc.cpp +++ b/Windows/W32Util/Misc.cpp @@ -1,23 +1,26 @@ #include "stdafx.h" +#include "CommonWindows.h" + #include #include +#include + #include "Misc.h" #include "util/text/utf8.h" -#include bool IsVistaOrHigher() { OSVERSIONINFOEX osvi; DWORDLONG dwlConditionMask = 0; int op = VER_GREATER_EQUAL; - ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); + ZeroMemory(&osvi, sizeof(osvi)); + osvi.dwOSVersionInfoSize = sizeof(osvi); osvi.dwMajorVersion = 6; // Vista is 6.0 osvi.dwMinorVersion = 0; VER_SET_CONDITION(dwlConditionMask, VER_MAJORVERSION, op); VER_SET_CONDITION(dwlConditionMask, VER_MINORVERSION, op); - return (bool)VerifyVersionInfo(&osvi, VER_MAJORVERSION | VER_MINORVERSION, dwlConditionMask); + return VerifyVersionInfo(&osvi, VER_MAJORVERSION | VER_MINORVERSION, dwlConditionMask) != FALSE; } namespace W32Util