Commits

Christian Fischer committed 62eda8c

some fixes for visual studio, dx11, 64bit support

  • Participants
  • Parent commits da8c716

Comments (0)

Files changed (5)

File build/build.cmake

 # enable warnings?
 option(WIESEL_BUILD_WARN_ALL "Enable all warnings on build. (gcc option -Wall)" ON)
 if (WIESEL_BUILD_WARN_ALL)
-	set(CMAKE_CXX_FLAGS "-g -Wall")
-	set(CMAKE_C_FLAGS "-g -Wall")
+	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall")
+	set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS}   -g -Wall")
 endif(WIESEL_BUILD_WARN_ALL)

File build/cmake/modules/wiesel-FindDirectX.cmake

 		if (WIN8_SDK_ROOT_DIR)
 			set (DIRECTX_INC_SEARCH_PATH "${WIN8_SDK_ROOT_DIR}/Include/um" "${WIN8_SDK_ROOT_DIR}/Include/shared")
 			set (DIRECTX_LIB_SEARCH_PATH "${WIN8_SDK_ROOT_DIR}/Lib/Win8/um/${DIRECTX_ARCHITECTURE}")
-			set (DIRECTX_BIN_SEARCH_PATH "${WIN8_SDK_ROOT_DIR}/bin/x86")
+			set (DIRECTX_BIN_SEARCH_PATH "${WIN8_SDK_ROOT_DIR}/bin/${DIRECTX_ARCHITECTURE}")
 		endif ()
 	endif ()
 
 		find_path(
 					DIRECTX_D3D${version}_INCLUDE_DIR
 					"d3d${version}.h"
-					PATHS	${DirectX_INC_SEARCH_PATH}
+					PATHS	${DIRECTX_INC_SEARCH_PATH}
 					DOC		"The include path for the Direct3D ${version} header."
 		)
 		
 		find_library(
 					DIRECTX_D3D${version}_LIBRARY
 					"d3d${version}"
-					PATHS	${DirectX_LIB_SEARCH_PATH}
+					PATHS	${DIRECTX_LIB_SEARCH_PATH}
 					DOC		"The library path for the Direct3D ${version} library."
 		)
-			
+		
 		if (DIRECTX_D3D${version}_INCLUDE_DIR AND DIRECTX_D3D${version}_LIBRARY)
 			set(DIRECTX_D3D${version}_FOUND TRUE)
 			
 			find_path(
 						DIRECTX_D3DX${version}_INCLUDE_DIR
 						"d3dx${version}.h"
-						PATHS	${DirectX_INC_SEARCH_PATH}
+						PATHS	${DIRECTX_INC_SEARCH_PATH}
 						DOC		"The include path for the Direct3DX ${version} header."
 			)
 			
 			find_library(
 						DIRECTX_D3DX${version}_LIBRARY
 						"d3dx${version}"
-						PATHS	${DirectX_LIB_SEARCH_PATH}
+						PATHS	${DIRECTX_LIB_SEARCH_PATH}
 						DOC		"The library path for the Direct3DX ${version} library."
 			)
 				
 	# search for shader compiler executable
 	find_program(
 		DIRECTX_FXC_EXECUTABLE fxc
-		PATHS ${DirectX_BIN_SEARCH_PATH}
+		PATHS ${DIRECTX_BIN_SEARCH_PATH}
 		DOC "Path to fxc.exe executable."
 	)
 

File src/common/wiesel/io/generic_root_fs.cpp

  * Boston, MA 02110-1301 USA
  */
 #include "wiesel.h"
+#include "wiesel/platform_config.h"
 #include "generic_root_fs.h"
 #include "wiesel/util/log.h"
 #include <direct.h>

File src/directx11/wiesel/dx11/video/dx11_render_context.cpp

 		pVideoInfo->api			= "DirectX";
 		pVideoInfo->shaders.api	= "HLSL";
 
-		unsigned int stringLength;
+		size_t stringLength;
 		char str[1024];
 
 		int error = wcstombs_s(&stringLength, str, 1024, adapterDesc.Description, 1024);

File src/directx11/wiesel/dx11/video/dx11_video_driver.cpp

 		}
 
 		case WM_LBUTTONDOWN: {
-			LONG lp = GetWindowLongPtr(hWnd, GWL_USERDATA);
+			LONG_PTR lp = GetWindowLongPtr(hWnd, GWLP_USERDATA);
 			Dx11VideoDeviceDriver *driver = reinterpret_cast<Dx11VideoDeviceDriver*>(lp);
 
 			vector2d location = driver->convertScreenToWorld(vector2d(LOWORD(lParam), HIWORD(lParam)));
 		}
 
 		case WM_LBUTTONUP: {
-			LONG lp = GetWindowLongPtr(hWnd, GWL_USERDATA);
+			LONG_PTR lp = GetWindowLongPtr(hWnd, GWLP_USERDATA);
 			Dx11VideoDeviceDriver *driver = reinterpret_cast<Dx11VideoDeviceDriver*>(lp);
 
 			driver->getScreen()->getTouchHandler()->releaseTouch(0);
 		}
 
 		case WM_MOUSEMOVE: {
-			LONG lp = GetWindowLongPtr(hWnd, GWL_USERDATA);
+			LONG_PTR lp = GetWindowLongPtr(hWnd, GWLP_USERDATA);
 			Dx11VideoDeviceDriver *driver = reinterpret_cast<Dx11VideoDeviceDriver*>(lp);
 
 			vector2d location = driver->convertScreenToWorld(vector2d(LOWORD(lParam), HIWORD(lParam)));
 	}
 
 	// store the reference to this object into the window
-	LONG pThis = reinterpret_cast<LONG>(this);
-	SetWindowLongPtr(hWnd, GWL_USERDATA, pThis);
-
-	LONG lp = GetWindowLongPtr(hWnd, GWL_USERDATA);
-	assert(pThis == lp);
+	LONG_PTR pThis = reinterpret_cast<LONG>(this);
+	SetWindowLongPtr(hWnd, GWLP_USERDATA, pThis);
 
 	ShowWindow(hWnd, nCmdShow);
 	SetForegroundWindow(hWnd);