From 3b61be3145c3d7196c10fe1f8eb89cff32234ef5 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 29 May 2017 14:46:56 +0300 Subject: [PATCH] Removed dependency on dxguid library It's impossible to use VS2017 with XP compatible toolset otherwise --- src/CMakeLists.txt | 12 ------------ src/win32/win32video.cpp | 4 +++- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 387d6855f..8a9b2aa87 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -60,7 +60,6 @@ if( WIN32 ) ( MSVC15 AND NOT CMAKE_GENERATOR_TOOLSET STREQUAL "v141_xp" ) ) # For VS 2017. # for modern Windows SDKs the DirectX headers should be available by default. set( DX_dinput8_LIBRARY dinput8 ) - set( DX_dxguid_LIBRARY dxguid ) else() find_path( D3D_INCLUDE_DIR d3d9.h @@ -97,9 +96,6 @@ if( WIN32 ) find_library( DX_dinput8_LIBRARY dinput8 PATHS ENV DXSDK_DIR PATH_SUFFIXES Lib Lib/${XBITS} ) - find_library( DX_dxguid_LIBRARY dxguid - PATHS ENV DXSDK_DIR - PATH_SUFFIXES Lib Lib/${XBITS} ) # Modern versions of the Windows SDK include dinput8.lib. Unfortunately, # CMake cannot find these libraries via find_library. @@ -108,11 +104,6 @@ if( WIN32 ) set( DX_dinput8_LIBRARY dinput8 ) endif() - # Modern versions of the Windows SDK do NOT include dxguid.lib. Its contents - # were moved to dinput8.lib. - if( NOT DX_dxguid_LIBRARY ) - message( STATUS "Could not find dxguid.lib. Build may fail on old Windows SDKs.") - endif() endif() set( ZDOOM_LIBS @@ -133,9 +124,6 @@ if( WIN32 ) set( ZDOOM_LIBS ${ZDOOM_LIBS} DelayImp ) endif() - if( DX_dxguid_LIBRARY ) - list( APPEND ZDOOM_LIBS "${DX_dxguid_LIBRARY}" ) - endif() else() if( APPLE ) set( NO_GTK ON ) diff --git a/src/win32/win32video.cpp b/src/win32/win32video.cpp index 93da57c69..0546863cb 100644 --- a/src/win32/win32video.cpp +++ b/src/win32/win32video.cpp @@ -284,7 +284,9 @@ void Win32Video::InitDDraw () if (FAILED(dderr)) I_FatalError ("Could not create DirectDraw object: %08lx", dderr); - dderr = ddraw1->QueryInterface (IID_IDirectDraw2, (LPVOID*)&DDraw); + static const GUID IDIRECTDRAW2_GUID = { 0xB3A6F3E0, 0x2B43, 0x11CF, 0xA2, 0xDE, 0x00, 0xAA, 0x00, 0xB9, 0x33, 0x56 }; + + dderr = ddraw1->QueryInterface (IDIRECTDRAW2_GUID, (LPVOID*)&DDraw); if (FAILED(dderr)) { ddraw1->Release ();