From 641ba09975659ac3bd5d8bf1df40e637e3f012a1 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 12 Mar 2014 07:26:07 -0700 Subject: [PATCH 1/2] Fixed compiling Windows RT code on Visual Studio 2013 --- VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj | 13 ++--- .../SDL/SDL-WinRT_VS2012.vcxproj.filters | 10 ++-- src/core/winrt/SDL_winrtapp_xaml.cpp | 1 + src/joystick/winrt/SDL_xinputjoystick.c | 2 +- src/render/direct3d11/SDL_render_d3d11.c | 2 +- ..._winrthelpers.cpp => SDL_render_winrt.cpp} | 47 ++++++++++--------- ..._winrthelpers_cpp.h => SDL_render_winrt.h} | 0 src/video/winrt/SDL_winrtevents.cpp | 2 +- src/video/winrt/SDL_winrtmouse.cpp | 1 - src/video/winrt/SDL_winrtopengles.cpp | 2 +- src/video/winrt/SDL_winrtpointerinput.cpp | 2 +- 11 files changed, 39 insertions(+), 43 deletions(-) rename src/render/direct3d11/{SDL_render_d3d11_winrthelpers.cpp => SDL_render_winrt.cpp} (70%) rename src/render/direct3d11/{SDL_render_d3d11_winrthelpers_cpp.h => SDL_render_winrt.h} (100%) diff --git a/VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj b/VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj index cc5fddd7b..70553a471 100644 --- a/VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj +++ b/VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj @@ -97,16 +97,10 @@ - - true - true - true - true - true - true - + + @@ -285,10 +279,11 @@ - + + diff --git a/VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj.filters b/VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj.filters index fb3195f91..be690eb42 100644 --- a/VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj.filters +++ b/VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj.filters @@ -280,9 +280,8 @@ Source Files - - Source Files - + + @@ -639,9 +638,8 @@ Source Files - - Source Files - + + diff --git a/src/core/winrt/SDL_winrtapp_xaml.cpp b/src/core/winrt/SDL_winrtapp_xaml.cpp index 67a5cddea..5b129d142 100644 --- a/src/core/winrt/SDL_winrtapp_xaml.cpp +++ b/src/core/winrt/SDL_winrtapp_xaml.cpp @@ -42,6 +42,7 @@ SDL_bool WINRT_XAMLWasEnabled = SDL_FALSE; #if WINAPI_FAMILY == WINAPI_FAMILY_APP +extern "C" ISwapChainBackgroundPanelNative * WINRT_GlobalSwapChainBackgroundPanelNative = NULL; static Windows::Foundation::EventRegistrationToken WINRT_XAMLAppEventToken; #endif diff --git a/src/joystick/winrt/SDL_xinputjoystick.c b/src/joystick/winrt/SDL_xinputjoystick.c index 1bb91b272..649f7cbe9 100644 --- a/src/joystick/winrt/SDL_xinputjoystick.c +++ b/src/joystick/winrt/SDL_xinputjoystick.c @@ -18,7 +18,7 @@ misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ -#include "SDL_config.h" +#include "../../SDL_internal.h" #if SDL_JOYSTICK_XINPUT diff --git a/src/render/direct3d11/SDL_render_d3d11.c b/src/render/direct3d11/SDL_render_d3d11.c index 58673d465..e77775722 100644 --- a/src/render/direct3d11/SDL_render_d3d11.c +++ b/src/render/direct3d11/SDL_render_d3d11.c @@ -35,7 +35,7 @@ #ifdef __WINRT__ -#include "SDL_render_d3d11_winrthelpers_cpp.h" +#include "SDL_render_winrt.h" #if WINAPI_FAMILY == WINAPI_FAMILY_APP #include diff --git a/src/render/direct3d11/SDL_render_d3d11_winrthelpers.cpp b/src/render/direct3d11/SDL_render_winrt.cpp similarity index 70% rename from src/render/direct3d11/SDL_render_d3d11_winrthelpers.cpp rename to src/render/direct3d11/SDL_render_winrt.cpp index 25e6765e9..5753beb54 100644 --- a/src/render/direct3d11/SDL_render_d3d11_winrthelpers.cpp +++ b/src/render/direct3d11/SDL_render_winrt.cpp @@ -28,12 +28,15 @@ extern "C" { } #include -#include +#include #if WINAPI_FAMILY == WINAPI_FAMILY_APP #include #endif +#include "SDL_render_winrt.h" + +using namespace ABI; using namespace Windows::UI::Core; using namespace Windows::Graphics::Display; @@ -75,32 +78,32 @@ D3D11_GetCoreWindowFromSDLRenderer(SDL_Renderer * renderer) extern "C" DXGI_MODE_ROTATION D3D11_GetCurrentRotation() { +#if 0 /* FIXME: This doesn't compile on Visual Studio 2013 */ switch (DisplayProperties::CurrentOrientation) { #if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP - /* Windows Phone rotations */ - case DisplayOrientations::Landscape: - return DXGI_MODE_ROTATION_ROTATE90; - case DisplayOrientations::Portrait: - return DXGI_MODE_ROTATION_IDENTITY; - case DisplayOrientations::LandscapeFlipped: - return DXGI_MODE_ROTATION_ROTATE270; - case DisplayOrientations::PortraitFlipped: - return DXGI_MODE_ROTATION_ROTATE180; + /* Windows Phone rotations */ + case DisplayOrientations::Landscape: + return DXGI_MODE_ROTATION_ROTATE90; + case DisplayOrientations::Portrait: + return DXGI_MODE_ROTATION_IDENTITY; + case DisplayOrientations::LandscapeFlipped: + return DXGI_MODE_ROTATION_ROTATE270; + case DisplayOrientations::PortraitFlipped: + return DXGI_MODE_ROTATION_ROTATE180; #else - /* Non-Windows-Phone rotations (ex: Windows 8, Windows RT) */ - case DisplayOrientations::Landscape: - return DXGI_MODE_ROTATION_IDENTITY; - case DisplayOrientations::Portrait: - return DXGI_MODE_ROTATION_ROTATE270; - case DisplayOrientations::LandscapeFlipped: - return DXGI_MODE_ROTATION_ROTATE180; - case DisplayOrientations::PortraitFlipped: - return DXGI_MODE_ROTATION_ROTATE90; + /* Non-Windows-Phone rotations (ex: Windows 8, Windows RT) */ + case DisplayOrientations::Landscape: + return DXGI_MODE_ROTATION_IDENTITY; + case DisplayOrientations::Portrait: + return DXGI_MODE_ROTATION_ROTATE270; + case DisplayOrientations::LandscapeFlipped: + return DXGI_MODE_ROTATION_ROTATE180; + case DisplayOrientations::PortraitFlipped: + return DXGI_MODE_ROTATION_ROTATE90; #endif /* WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP */ - - default: - return DXGI_MODE_ROTATION_UNSPECIFIED; } +#endif + return DXGI_MODE_ROTATION_IDENTITY; } diff --git a/src/render/direct3d11/SDL_render_d3d11_winrthelpers_cpp.h b/src/render/direct3d11/SDL_render_winrt.h similarity index 100% rename from src/render/direct3d11/SDL_render_d3d11_winrthelpers_cpp.h rename to src/render/direct3d11/SDL_render_winrt.h diff --git a/src/video/winrt/SDL_winrtevents.cpp b/src/video/winrt/SDL_winrtevents.cpp index 112c3d494..c27c7084b 100644 --- a/src/video/winrt/SDL_winrtevents.cpp +++ b/src/video/winrt/SDL_winrtevents.cpp @@ -18,7 +18,7 @@ misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ -#include "SDL_config.h" +#include "../../SDL_internal.h" #if SDL_VIDEO_DRIVER_WINRT diff --git a/src/video/winrt/SDL_winrtmouse.cpp b/src/video/winrt/SDL_winrtmouse.cpp index e3cd284fd..fdfbcf94a 100644 --- a/src/video/winrt/SDL_winrtmouse.cpp +++ b/src/video/winrt/SDL_winrtmouse.cpp @@ -18,7 +18,6 @@ misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ - #include "../../SDL_internal.h" #if SDL_VIDEO_DRIVER_WINRT diff --git a/src/video/winrt/SDL_winrtopengles.cpp b/src/video/winrt/SDL_winrtopengles.cpp index 1229eb9bf..b0bf37a33 100644 --- a/src/video/winrt/SDL_winrtopengles.cpp +++ b/src/video/winrt/SDL_winrtopengles.cpp @@ -18,7 +18,7 @@ misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ -#include "SDL_config.h" +#include "../../SDL_internal.h" // TODO: WinRT, make this file compile via C code diff --git a/src/video/winrt/SDL_winrtpointerinput.cpp b/src/video/winrt/SDL_winrtpointerinput.cpp index 13dd5b621..cf8dfd960 100644 --- a/src/video/winrt/SDL_winrtpointerinput.cpp +++ b/src/video/winrt/SDL_winrtpointerinput.cpp @@ -18,7 +18,7 @@ misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ -#include "SDL_config.h" +#include "../../SDL_internal.h" #if SDL_VIDEO_DRIVER_WINRT From c515b79423d9bc86504c3f863d82ce31a5f06600 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 12 Mar 2014 07:55:32 -0700 Subject: [PATCH 2/2] Updated framework version to match dylib version. Actually the dylib compatibility version is 3.0.0, but don't break compatibility with previous frameworks, which were compatibility version 1.0.0 --- Xcode/SDL/SDL.xcodeproj/project.pbxproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Xcode/SDL/SDL.xcodeproj/project.pbxproj b/Xcode/SDL/SDL.xcodeproj/project.pbxproj index 0222d835c..617975242 100755 --- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj +++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj @@ -2773,8 +2773,8 @@ 00CFA622106A567900758660 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; + DYLIB_COMPATIBILITY_VERSION = 1.0.0; + DYLIB_CURRENT_VERSION = 3.1.0; FRAMEWORK_VERSION = A; HEADER_SEARCH_PATHS = /usr/X11R6/include; INFOPLIST_FILE = "Info-Framework.plist"; @@ -2827,8 +2827,8 @@ 00CFA628106A568900758660 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; + DYLIB_COMPATIBILITY_VERSION = 1.0.0; + DYLIB_CURRENT_VERSION = 3.1.0; FRAMEWORK_VERSION = A; HEADER_SEARCH_PATHS = /usr/X11R6/include; INFOPLIST_FILE = "Info-Framework.plist";