Remove requirement of ddraw.lib library, so we can compile with the latest DirectX SDK.

This commit is contained in:
David Capello 2011-07-26 23:42:14 -03:00
parent 8cc1e0e7b7
commit 4fac1f119b
3 changed files with 7 additions and 39 deletions

View File

@ -156,10 +156,9 @@ endif()
# -- Windows --
if(WIN32)
find_package(DDraw)
find_package(DXGuid)
if(NOT DDRAW_FOUND OR NOT DXGUID_FOUND)
if(NOT DXGUID_FOUND)
if(MSVC)
message(FATAL_ERROR
"DirectX required for Windows port. You might need to add DirectX include and lib directories to your INCLUDE and LIB environment variables.")
@ -172,7 +171,6 @@ if(WIN32)
endif()
include_directories(SYSTEM
${DDRAW_INCLUDE_DIR}
${DXGUID_INCLUDE_DIR}
)
@ -182,7 +180,6 @@ if(WIN32)
gdi32
comdlg32
ole32
${DDRAW_LIBRARIES}
${DXGUID_LIBRARIES}
winmm
shlwapi

View File

@ -1,34 +0,0 @@
# - Find DirectInput
# Find the DirectInput includes and libraries
#
# DDRAW_INCLUDE_DIR - where to find ddraw.h
# DDRAW_LIBRARIES - List of libraries when using ddraw.
# DDRAW_FOUND - True if ddraw found.
if(DDRAW_INCLUDE_DIR)
# Already in cache, be silent
set(DDRAW_FIND_QUIETLY TRUE)
endif(DDRAW_INCLUDE_DIR)
find_path(DDRAW_INCLUDE_DIR ddraw.h
PATH $ENV{DXSDK_DIR}/Include
)
find_library(DDRAW_LIBRARY
NAMES ddraw
PATHS "$ENV{DXSDK_DIR}/Lib/$ENV{PROCESSOR_ARCHITECTURE}"
)
# Handle the QUIETLY and REQUIRED arguments and set DDRAW_FOUND to TRUE if
# all listed variables are TRUE.
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(DDRAW DEFAULT_MSG
DDRAW_INCLUDE_DIR DDRAW_LIBRARY)
if(DDRAW_FOUND)
set(DDRAW_LIBRARIES ${DDRAW_LIBRARY})
else(DDRAW_FOUND)
set(DDRAW_LIBRARIES)
endif(DDRAW_FOUND)
mark_as_advanced(DDRAW_INCLUDE_DIR DDRAW_LIBRARY)

View File

@ -50,7 +50,12 @@ int init_directx(void)
HWND allegro_wnd = win_get_window();
/* first we have to set up the DirectDraw1 interface... */
hr = DirectDrawCreate(NULL, &directdraw1, NULL);
hr = CoCreateInstance(&CLSID_DirectDraw, NULL, CLSCTX_ALL, &IID_IDirectDraw, &directdraw1);
if (FAILED(hr))
return -1;
/* ...then query the DirectDraw2 interface */
hr = IDirectDraw_Initialize(directdraw1, NULL);
if (FAILED(hr))
return -1;