Merged various WinRT build fixes
authorDavid Ludwig <dludwig@pobox.com>
Wed, 12 Mar 2014 12:12:20 -0400
changeset 861224d36bb9c7af
parent 8611 a762dfc67e1a
parent 8610 670e049dfc29
child 8613 ab7b2a148374
Merged various WinRT build fixes
VisualC-WinPhone/SDL/SDL-WinPhone_VS2012.vcxproj
VisualC-WinPhone/SDL/SDL-WinPhone_VS2012.vcxproj.filters
VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj
VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj.filters
src/core/winrt/SDL_winrtapp_xaml.cpp
src/render/direct3d11/SDL_render_d3d11.c
src/render/direct3d11/SDL_render_d3d11_winrthelpers.cpp
src/render/direct3d11/SDL_render_d3d11_winrthelpers_cpp.h
src/render/direct3d11/SDL_render_winrt.cpp
     1.1 --- a/VisualC-WinPhone/SDL/SDL-WinPhone_VS2012.vcxproj	Wed Mar 12 11:57:15 2014 -0400
     1.2 +++ b/VisualC-WinPhone/SDL/SDL-WinPhone_VS2012.vcxproj	Wed Mar 12 12:12:20 2014 -0400
     1.3 @@ -218,7 +218,7 @@
     1.4      <ClInclude Include="..\..\src\haptic\SDL_syshaptic.h" />
     1.5      <ClInclude Include="..\..\src\joystick\SDL_joystick_c.h" />
     1.6      <ClInclude Include="..\..\src\joystick\SDL_sysjoystick.h" />
     1.7 -    <ClInclude Include="..\..\src\render\direct3d11\SDL_render_d3d11_winrthelpers_cpp.h" />
     1.8 +    <ClInclude Include="..\..\src\render\direct3d11\SDL_render_winrt.h" />
     1.9      <ClInclude Include="..\..\src\render\mmx.h" />
    1.10      <ClInclude Include="..\..\src\render\SDL_d3dmath.h" />
    1.11      <ClInclude Include="..\..\src\render\SDL_sysrender.h" />
    1.12 @@ -320,12 +320,7 @@
    1.13      <ClCompile Include="..\..\src\power\SDL_power.c" />
    1.14      <ClCompile Include="..\..\src\power\winrt\SDL_syspower.cpp" />
    1.15      <ClCompile Include="..\..\src\render\direct3d11\SDL_render_d3d11.c" />
    1.16 -    <ClCompile Include="..\..\src\render\direct3d11\SDL_render_d3d11_winrthelpers.cpp">
    1.17 -      <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</CompileAsWinRT>
    1.18 -      <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</CompileAsWinRT>
    1.19 -      <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</CompileAsWinRT>
    1.20 -      <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</CompileAsWinRT>
    1.21 -    </ClCompile>
    1.22 +    <ClCompile Include="..\..\src\render\direct3d11\SDL_render_winrt.cpp" />
    1.23      <ClCompile Include="..\..\src\render\SDL_d3dmath.c" />
    1.24      <ClCompile Include="..\..\src\render\SDL_render.c" />
    1.25      <ClCompile Include="..\..\src\render\SDL_yuv_mmx.c" />
     2.1 --- a/VisualC-WinPhone/SDL/SDL-WinPhone_VS2012.vcxproj.filters	Wed Mar 12 11:57:15 2014 -0400
     2.2 +++ b/VisualC-WinPhone/SDL/SDL-WinPhone_VS2012.vcxproj.filters	Wed Mar 12 12:12:20 2014 -0400
     2.3 @@ -339,9 +339,6 @@
     2.4      <ClInclude Include="..\..\include\SDL_filesystem.h">
     2.5        <Filter>Header Files</Filter>
     2.6      </ClInclude>
     2.7 -    <ClInclude Include="..\..\src\render\direct3d11\SDL_render_d3d11_winrthelpers_cpp.h">
     2.8 -      <Filter>Source Files</Filter>
     2.9 -    </ClInclude>
    2.10      <ClInclude Include="..\..\src\render\SDL_d3dmath.h">
    2.11        <Filter>Source Files</Filter>
    2.12      </ClInclude>
    2.13 @@ -354,6 +351,9 @@
    2.14      <ClInclude Include="..\..\src\dynapi\SDL_dynapi_procs.h">
    2.15        <Filter>Source Files</Filter>
    2.16      </ClInclude>
    2.17 +    <ClInclude Include="..\..\src\render\direct3d11\SDL_render_winrt.h">
    2.18 +      <Filter>Source Files</Filter>
    2.19 +    </ClInclude>
    2.20    </ItemGroup>
    2.21    <ItemGroup>
    2.22      <ClCompile Include="..\..\src\atomic\SDL_atomic.c">
    2.23 @@ -623,9 +623,6 @@
    2.24      <ClCompile Include="..\..\src\render\direct3d11\SDL_render_d3d11.c">
    2.25        <Filter>Source Files</Filter>
    2.26      </ClCompile>
    2.27 -    <ClCompile Include="..\..\src\render\direct3d11\SDL_render_d3d11_winrthelpers.cpp">
    2.28 -      <Filter>Source Files</Filter>
    2.29 -    </ClCompile>
    2.30      <ClCompile Include="..\..\src\render\SDL_d3dmath.c">
    2.31        <Filter>Source Files</Filter>
    2.32      </ClCompile>
    2.33 @@ -638,5 +635,8 @@
    2.34      <ClCompile Include="..\..\src\power\SDL_power.c">
    2.35        <Filter>Source Files</Filter>
    2.36      </ClCompile>
    2.37 +    <ClCompile Include="..\..\src\render\direct3d11\SDL_render_winrt.cpp">
    2.38 +      <Filter>Source Files</Filter>
    2.39 +    </ClCompile>
    2.40    </ItemGroup>
    2.41  </Project>
    2.42 \ No newline at end of file
     3.1 --- a/VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj	Wed Mar 12 11:57:15 2014 -0400
     3.2 +++ b/VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj	Wed Mar 12 12:12:20 2014 -0400
     3.3 @@ -100,14 +100,7 @@
     3.4      <ClCompile Include="..\..\src\power\SDL_power.c" />
     3.5      <ClCompile Include="..\..\src\power\winrt\SDL_syspower.cpp" />
     3.6      <ClCompile Include="..\..\src\render\direct3d11\SDL_render_d3d11.c" />
     3.7 -    <ClCompile Include="..\..\src\render\direct3d11\SDL_render_d3d11_winrthelpers.cpp">
     3.8 -      <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</CompileAsWinRT>
     3.9 -      <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</CompileAsWinRT>
    3.10 -      <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</CompileAsWinRT>
    3.11 -      <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</CompileAsWinRT>
    3.12 -      <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</CompileAsWinRT>
    3.13 -      <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</CompileAsWinRT>
    3.14 -    </ClCompile>
    3.15 +    <ClCompile Include="..\..\src\render\direct3d11\SDL_render_winrt.cpp" />
    3.16      <ClCompile Include="..\..\src\render\opengles2\SDL_render_gles2.c" />
    3.17      <ClCompile Include="..\..\src\render\opengles2\SDL_shaders_gles2.c" />
    3.18      <ClCompile Include="..\..\src\render\SDL_d3dmath.c" />
    3.19 @@ -292,7 +285,7 @@
    3.20      <ClInclude Include="..\..\src\joystick\SDL_gamecontrollerdb.h" />
    3.21      <ClInclude Include="..\..\src\joystick\SDL_joystick_c.h" />
    3.22      <ClInclude Include="..\..\src\joystick\SDL_sysjoystick.h" />
    3.23 -    <ClInclude Include="..\..\src\render\direct3d11\SDL_render_d3d11_winrthelpers_cpp.h" />
    3.24 +    <ClInclude Include="..\..\src\render\direct3d11\SDL_render_winrt.h" />
    3.25      <ClInclude Include="..\..\src\render\mmx.h" />
    3.26      <ClInclude Include="..\..\src\render\opengles2\SDL_gles2funcs.h" />
    3.27      <ClInclude Include="..\..\src\render\opengles2\SDL_shaders_gles2.h" />
     4.1 --- a/VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj.filters	Wed Mar 12 11:57:15 2014 -0400
     4.2 +++ b/VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj.filters	Wed Mar 12 12:12:20 2014 -0400
     4.3 @@ -280,19 +280,19 @@
     4.4      <ClCompile Include="..\..\src\render\direct3d11\SDL_render_d3d11.c">
     4.5        <Filter>Source Files</Filter>
     4.6      </ClCompile>
     4.7 -    <ClCompile Include="..\..\src\render\direct3d11\SDL_render_d3d11_winrthelpers.cpp">
     4.8 -      <Filter>Source Files</Filter>
     4.9 -    </ClCompile>
    4.10      <ClCompile Include="..\..\src\render\SDL_d3dmath.c">
    4.11        <Filter>Source Files</Filter>
    4.12      </ClCompile>
    4.13      <ClCompile Include="..\..\src\dynapi\SDL_dynapi.c">
    4.14        <Filter>Source Files</Filter>
    4.15      </ClCompile>
    4.16 -    <ClCompile Include="..\..\src\power\winrt\SDL_syspower.cpp">
    4.17 +    <ClCompile Include="..\..\src\power\SDL_power.c">
    4.18        <Filter>Source Files</Filter>
    4.19      </ClCompile>
    4.20 -    <ClCompile Include="..\..\src\power\SDL_power.c">
    4.21 +    <ClCompile Include="..\..\src\render\direct3d11\SDL_render_winrt.cpp">
    4.22 +      <Filter>Source Files</Filter>
    4.23 +    </ClCompile>
    4.24 +    <ClCompile Include="..\..\src\power\winrt\SDL_syspower.cpp">
    4.25        <Filter>Source Files</Filter>
    4.26      </ClCompile>
    4.27    </ItemGroup>
    4.28 @@ -651,9 +651,6 @@
    4.29      <ClInclude Include="..\..\src\SDL_internal.h">
    4.30        <Filter>Source Files</Filter>
    4.31      </ClInclude>
    4.32 -    <ClInclude Include="..\..\src\render\direct3d11\SDL_render_d3d11_winrthelpers_cpp.h">
    4.33 -      <Filter>Source Files</Filter>
    4.34 -    </ClInclude>
    4.35      <ClInclude Include="..\..\src\render\SDL_d3dmath.h">
    4.36        <Filter>Source Files</Filter>
    4.37      </ClInclude>
    4.38 @@ -666,6 +663,9 @@
    4.39      <ClInclude Include="..\..\src\dynapi\SDL_dynapi_procs.h">
    4.40        <Filter>Source Files</Filter>
    4.41      </ClInclude>
    4.42 +    <ClInclude Include="..\..\src\render\direct3d11\SDL_render_winrt.h">
    4.43 +      <Filter>Source Files</Filter>
    4.44 +    </ClInclude>
    4.45    </ItemGroup>
    4.46    <ItemGroup>
    4.47      <Filter Include="Header Files">
     5.1 --- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj	Wed Mar 12 11:57:15 2014 -0400
     5.2 +++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj	Wed Mar 12 12:12:20 2014 -0400
     5.3 @@ -2773,8 +2773,8 @@
     5.4  		00CFA622106A567900758660 /* Release */ = {
     5.5  			isa = XCBuildConfiguration;
     5.6  			buildSettings = {
     5.7 -				DYLIB_COMPATIBILITY_VERSION = 1;
     5.8 -				DYLIB_CURRENT_VERSION = 1;
     5.9 +				DYLIB_COMPATIBILITY_VERSION = 1.0.0;
    5.10 +				DYLIB_CURRENT_VERSION = 3.1.0;
    5.11  				FRAMEWORK_VERSION = A;
    5.12  				HEADER_SEARCH_PATHS = /usr/X11R6/include;
    5.13  				INFOPLIST_FILE = "Info-Framework.plist";
    5.14 @@ -2827,8 +2827,8 @@
    5.15  		00CFA628106A568900758660 /* Debug */ = {
    5.16  			isa = XCBuildConfiguration;
    5.17  			buildSettings = {
    5.18 -				DYLIB_COMPATIBILITY_VERSION = 1;
    5.19 -				DYLIB_CURRENT_VERSION = 1;
    5.20 +				DYLIB_COMPATIBILITY_VERSION = 1.0.0;
    5.21 +				DYLIB_CURRENT_VERSION = 3.1.0;
    5.22  				FRAMEWORK_VERSION = A;
    5.23  				HEADER_SEARCH_PATHS = /usr/X11R6/include;
    5.24  				INFOPLIST_FILE = "Info-Framework.plist";
     6.1 --- a/src/core/winrt/SDL_winrtapp_xaml.cpp	Wed Mar 12 11:57:15 2014 -0400
     6.2 +++ b/src/core/winrt/SDL_winrtapp_xaml.cpp	Wed Mar 12 12:12:20 2014 -0400
     6.3 @@ -1,159 +1,160 @@
     6.4 -/*
     6.5 -  Simple DirectMedia Layer
     6.6 -  Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
     6.7 -
     6.8 -  This software is provided 'as-is', without any express or implied
     6.9 -  warranty.  In no event will the authors be held liable for any damages
    6.10 -  arising from the use of this software.
    6.11 -
    6.12 -  Permission is granted to anyone to use this software for any purpose,
    6.13 -  including commercial applications, and to alter it and redistribute it
    6.14 -  freely, subject to the following restrictions:
    6.15 -
    6.16 -  1. The origin of this software must not be misrepresented; you must not
    6.17 -     claim that you wrote the original software. If you use this software
    6.18 -     in a product, an acknowledgment in the product documentation would be
    6.19 -     appreciated but is not required.
    6.20 -  2. Altered source versions must be plainly marked as such, and must not be
    6.21 -     misrepresented as being the original software.
    6.22 -  3. This notice may not be removed or altered from any source distribution.
    6.23 -*/
    6.24 -
    6.25 -/* Windows includes */
    6.26 -#include <agile.h>
    6.27 -#include <Windows.h>
    6.28 -
    6.29 -#if WINAPI_FAMILY == WINAPI_FAMILY_APP
    6.30 -#include <windows.ui.xaml.media.dxinterop.h>
    6.31 -#endif
    6.32 -
    6.33 -
    6.34 -/* SDL includes */
    6.35 -#include "../../SDL_internal.h"
    6.36 -#include "SDL.h"
    6.37 -#include "../../video/winrt/SDL_winrtevents_c.h"
    6.38 -#include "../../video/winrt/SDL_winrtvideo_cpp.h"
    6.39 -#include "SDL_winrtapp_common.h"
    6.40 -#include "SDL_winrtapp_xaml.h"
    6.41 -
    6.42 -
    6.43 -
    6.44 -/* SDL-internal globals: */
    6.45 -SDL_bool WINRT_XAMLWasEnabled = SDL_FALSE;
    6.46 -
    6.47 -#if WINAPI_FAMILY == WINAPI_FAMILY_APP
    6.48 -extern "C" ISwapChainBackgroundPanelNative * WINRT_GlobalSwapChainBackgroundPanelNative = NULL;
    6.49 -static Windows::Foundation::EventRegistrationToken	WINRT_XAMLAppEventToken;
    6.50 -#endif
    6.51 -
    6.52 -
    6.53 -/*
    6.54 - * Input event handlers (XAML)
    6.55 - */
    6.56 -#if WINAPI_FAMILY == WINAPI_FAMILY_APP
    6.57 -
    6.58 -static void
    6.59 -WINRT_OnPointerPressedViaXAML(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ args)
    6.60 -{
    6.61 -    WINRT_ProcessPointerPressedEvent(WINRT_GlobalSDLWindow, args->GetCurrentPoint(nullptr));
    6.62 -}
    6.63 -
    6.64 -static void
    6.65 -WINRT_OnPointerMovedViaXAML(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ args)
    6.66 -{
    6.67 -    WINRT_ProcessPointerMovedEvent(WINRT_GlobalSDLWindow, args->GetCurrentPoint(nullptr));
    6.68 -}
    6.69 -
    6.70 -static void
    6.71 -WINRT_OnPointerReleasedViaXAML(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ args)
    6.72 -{
    6.73 -    WINRT_ProcessPointerReleasedEvent(WINRT_GlobalSDLWindow, args->GetCurrentPoint(nullptr));
    6.74 -}
    6.75 -
    6.76 -static void
    6.77 -WINRT_OnPointerWheelChangedViaXAML(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ args)
    6.78 -{
    6.79 -    WINRT_ProcessPointerWheelChangedEvent(WINRT_GlobalSDLWindow, args->GetCurrentPoint(nullptr));
    6.80 -}
    6.81 -
    6.82 -#endif // WINAPI_FAMILY == WINAPI_FAMILY_APP
    6.83 -
    6.84 -
    6.85 -/*
    6.86 - * XAML-to-SDL Rendering Callback
    6.87 - */
    6.88 -#if WINAPI_FAMILY == WINAPI_FAMILY_APP
    6.89 -
    6.90 -static void
    6.91 -WINRT_OnRenderViaXAML(_In_ Platform::Object^ sender, _In_ Platform::Object^ args)
    6.92 -{
    6.93 -    WINRT_CycleXAMLThread();
    6.94 -}
    6.95 -
    6.96 -#endif // WINAPI_FAMILY == WINAPI_FAMILY_APP
    6.97 -
    6.98 -
    6.99 -/*
   6.100 - * SDL + XAML Initialization
   6.101 - */
   6.102 -
   6.103 -int
   6.104 -SDL_WinRTInitXAMLApp(int (*mainFunction)(int, char **), void * backgroundPanelAsIInspectable)
   6.105 -{
   6.106 -#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
   6.107 -    return SDL_SetError("XAML support is not yet available in Windows Phone.");
   6.108 -#else
   6.109 -    // Declare C++/CX namespaces:
   6.110 -    using namespace Platform;
   6.111 -    using namespace Windows::Foundation;
   6.112 -    using namespace Windows::UI::Core;
   6.113 -    using namespace Windows::UI::Xaml;
   6.114 -    using namespace Windows::UI::Xaml::Controls;
   6.115 -    using namespace Windows::UI::Xaml::Input;
   6.116 -    using namespace Windows::UI::Xaml::Media;
   6.117 -
   6.118 -    // Make sure we have a valid XAML element (to draw onto):
   6.119 -    if ( ! backgroundPanelAsIInspectable) {
   6.120 -        return SDL_SetError("'backgroundPanelAsIInspectable' can't be NULL");
   6.121 -    }
   6.122 -
   6.123 -    Platform::Object ^ backgroundPanel = reinterpret_cast<Object ^>((IInspectable *) backgroundPanelAsIInspectable);
   6.124 -    SwapChainBackgroundPanel ^swapChainBackgroundPanel = dynamic_cast<SwapChainBackgroundPanel ^>(backgroundPanel);
   6.125 -    if ( ! swapChainBackgroundPanel) {
   6.126 -        return SDL_SetError("An unknown or unsupported type of XAML control was specified.");
   6.127 -    }
   6.128 -
   6.129 -    // Setup event handlers:
   6.130 -    swapChainBackgroundPanel->PointerPressed += ref new PointerEventHandler(WINRT_OnPointerPressedViaXAML);
   6.131 -    swapChainBackgroundPanel->PointerReleased += ref new PointerEventHandler(WINRT_OnPointerReleasedViaXAML);
   6.132 -    swapChainBackgroundPanel->PointerWheelChanged += ref new PointerEventHandler(WINRT_OnPointerWheelChangedViaXAML);
   6.133 -    swapChainBackgroundPanel->PointerMoved += ref new PointerEventHandler(WINRT_OnPointerMovedViaXAML);
   6.134 -
   6.135 -    // Setup for rendering:
   6.136 -    IInspectable *panelInspectable = (IInspectable*) reinterpret_cast<IInspectable*>(swapChainBackgroundPanel);
   6.137 -    panelInspectable->QueryInterface(__uuidof(ISwapChainBackgroundPanelNative), (void **)&WINRT_GlobalSwapChainBackgroundPanelNative);
   6.138 -
   6.139 -    WINRT_XAMLAppEventToken = CompositionTarget::Rendering::add(ref new EventHandler<Object^>(WINRT_OnRenderViaXAML));
   6.140 -
   6.141 -    // Make sure the app is ready to call the SDL-centric main() function:
   6.142 -    WINRT_SDLAppEntryPoint = mainFunction;
   6.143 -    SDL_SetMainReady();
   6.144 -
   6.145 -    // Make sure video-init knows that we're initializing XAML:
   6.146 -    SDL_bool oldXAMLWasEnabledValue = WINRT_XAMLWasEnabled;
   6.147 -    WINRT_XAMLWasEnabled = SDL_TRUE;
   6.148 -
   6.149 -    // Make sure video modes are detected now, while we still have access to the WinRT
   6.150 -    // CoreWindow.  WinRT will not allow the app's CoreWindow to be accessed via the
   6.151 -    // SDL/WinRT thread.
   6.152 -    if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) {
   6.153 -        // SDL_InitSubSystem will, on error, set the SDL error.  Let that propogate to
   6.154 -        // the caller to here:
   6.155 -        WINRT_XAMLWasEnabled = oldXAMLWasEnabledValue;
   6.156 -        return -1;
   6.157 -    }
   6.158 -
   6.159 -    // All done, for now.
   6.160 -    return 0;
   6.161 -#endif // WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP  /  else
   6.162 -}
   6.163 +/*
   6.164 +  Simple DirectMedia Layer
   6.165 +  Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
   6.166 +
   6.167 +  This software is provided 'as-is', without any express or implied
   6.168 +  warranty.  In no event will the authors be held liable for any damages
   6.169 +  arising from the use of this software.
   6.170 +
   6.171 +  Permission is granted to anyone to use this software for any purpose,
   6.172 +  including commercial applications, and to alter it and redistribute it
   6.173 +  freely, subject to the following restrictions:
   6.174 +
   6.175 +  1. The origin of this software must not be misrepresented; you must not
   6.176 +     claim that you wrote the original software. If you use this software
   6.177 +     in a product, an acknowledgment in the product documentation would be
   6.178 +     appreciated but is not required.
   6.179 +  2. Altered source versions must be plainly marked as such, and must not be
   6.180 +     misrepresented as being the original software.
   6.181 +  3. This notice may not be removed or altered from any source distribution.
   6.182 +*/
   6.183 +
   6.184 +/* Windows includes */
   6.185 +#include <agile.h>
   6.186 +#include <Windows.h>
   6.187 +
   6.188 +#if WINAPI_FAMILY == WINAPI_FAMILY_APP
   6.189 +#include <windows.ui.xaml.media.dxinterop.h>
   6.190 +#endif
   6.191 +
   6.192 +
   6.193 +/* SDL includes */
   6.194 +#include "../../SDL_internal.h"
   6.195 +#include "SDL.h"
   6.196 +#include "../../video/winrt/SDL_winrtevents_c.h"
   6.197 +#include "../../video/winrt/SDL_winrtvideo_cpp.h"
   6.198 +#include "SDL_winrtapp_common.h"
   6.199 +#include "SDL_winrtapp_xaml.h"
   6.200 +
   6.201 +
   6.202 +
   6.203 +/* SDL-internal globals: */
   6.204 +SDL_bool WINRT_XAMLWasEnabled = SDL_FALSE;
   6.205 +
   6.206 +#if WINAPI_FAMILY == WINAPI_FAMILY_APP
   6.207 +extern "C"
   6.208 +ISwapChainBackgroundPanelNative * WINRT_GlobalSwapChainBackgroundPanelNative = NULL;
   6.209 +static Windows::Foundation::EventRegistrationToken	WINRT_XAMLAppEventToken;
   6.210 +#endif
   6.211 +
   6.212 +
   6.213 +/*
   6.214 + * Input event handlers (XAML)
   6.215 + */
   6.216 +#if WINAPI_FAMILY == WINAPI_FAMILY_APP
   6.217 +
   6.218 +static void
   6.219 +WINRT_OnPointerPressedViaXAML(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ args)
   6.220 +{
   6.221 +    WINRT_ProcessPointerPressedEvent(WINRT_GlobalSDLWindow, args->GetCurrentPoint(nullptr));
   6.222 +}
   6.223 +
   6.224 +static void
   6.225 +WINRT_OnPointerMovedViaXAML(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ args)
   6.226 +{
   6.227 +    WINRT_ProcessPointerMovedEvent(WINRT_GlobalSDLWindow, args->GetCurrentPoint(nullptr));
   6.228 +}
   6.229 +
   6.230 +static void
   6.231 +WINRT_OnPointerReleasedViaXAML(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ args)
   6.232 +{
   6.233 +    WINRT_ProcessPointerReleasedEvent(WINRT_GlobalSDLWindow, args->GetCurrentPoint(nullptr));
   6.234 +}
   6.235 +
   6.236 +static void
   6.237 +WINRT_OnPointerWheelChangedViaXAML(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ args)
   6.238 +{
   6.239 +    WINRT_ProcessPointerWheelChangedEvent(WINRT_GlobalSDLWindow, args->GetCurrentPoint(nullptr));
   6.240 +}
   6.241 +
   6.242 +#endif // WINAPI_FAMILY == WINAPI_FAMILY_APP
   6.243 +
   6.244 +
   6.245 +/*
   6.246 + * XAML-to-SDL Rendering Callback
   6.247 + */
   6.248 +#if WINAPI_FAMILY == WINAPI_FAMILY_APP
   6.249 +
   6.250 +static void
   6.251 +WINRT_OnRenderViaXAML(_In_ Platform::Object^ sender, _In_ Platform::Object^ args)
   6.252 +{
   6.253 +    WINRT_CycleXAMLThread();
   6.254 +}
   6.255 +
   6.256 +#endif // WINAPI_FAMILY == WINAPI_FAMILY_APP
   6.257 +
   6.258 +
   6.259 +/*
   6.260 + * SDL + XAML Initialization
   6.261 + */
   6.262 +
   6.263 +int
   6.264 +SDL_WinRTInitXAMLApp(int (*mainFunction)(int, char **), void * backgroundPanelAsIInspectable)
   6.265 +{
   6.266 +#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
   6.267 +    return SDL_SetError("XAML support is not yet available in Windows Phone.");
   6.268 +#else
   6.269 +    // Declare C++/CX namespaces:
   6.270 +    using namespace Platform;
   6.271 +    using namespace Windows::Foundation;
   6.272 +    using namespace Windows::UI::Core;
   6.273 +    using namespace Windows::UI::Xaml;
   6.274 +    using namespace Windows::UI::Xaml::Controls;
   6.275 +    using namespace Windows::UI::Xaml::Input;
   6.276 +    using namespace Windows::UI::Xaml::Media;
   6.277 +
   6.278 +    // Make sure we have a valid XAML element (to draw onto):
   6.279 +    if ( ! backgroundPanelAsIInspectable) {
   6.280 +        return SDL_SetError("'backgroundPanelAsIInspectable' can't be NULL");
   6.281 +    }
   6.282 +
   6.283 +    Platform::Object ^ backgroundPanel = reinterpret_cast<Object ^>((IInspectable *) backgroundPanelAsIInspectable);
   6.284 +    SwapChainBackgroundPanel ^swapChainBackgroundPanel = dynamic_cast<SwapChainBackgroundPanel ^>(backgroundPanel);
   6.285 +    if ( ! swapChainBackgroundPanel) {
   6.286 +        return SDL_SetError("An unknown or unsupported type of XAML control was specified.");
   6.287 +    }
   6.288 +
   6.289 +    // Setup event handlers:
   6.290 +    swapChainBackgroundPanel->PointerPressed += ref new PointerEventHandler(WINRT_OnPointerPressedViaXAML);
   6.291 +    swapChainBackgroundPanel->PointerReleased += ref new PointerEventHandler(WINRT_OnPointerReleasedViaXAML);
   6.292 +    swapChainBackgroundPanel->PointerWheelChanged += ref new PointerEventHandler(WINRT_OnPointerWheelChangedViaXAML);
   6.293 +    swapChainBackgroundPanel->PointerMoved += ref new PointerEventHandler(WINRT_OnPointerMovedViaXAML);
   6.294 +
   6.295 +    // Setup for rendering:
   6.296 +    IInspectable *panelInspectable = (IInspectable*) reinterpret_cast<IInspectable*>(swapChainBackgroundPanel);
   6.297 +    panelInspectable->QueryInterface(__uuidof(ISwapChainBackgroundPanelNative), (void **)&WINRT_GlobalSwapChainBackgroundPanelNative);
   6.298 +
   6.299 +    WINRT_XAMLAppEventToken = CompositionTarget::Rendering::add(ref new EventHandler<Object^>(WINRT_OnRenderViaXAML));
   6.300 +
   6.301 +    // Make sure the app is ready to call the SDL-centric main() function:
   6.302 +    WINRT_SDLAppEntryPoint = mainFunction;
   6.303 +    SDL_SetMainReady();
   6.304 +
   6.305 +    // Make sure video-init knows that we're initializing XAML:
   6.306 +    SDL_bool oldXAMLWasEnabledValue = WINRT_XAMLWasEnabled;
   6.307 +    WINRT_XAMLWasEnabled = SDL_TRUE;
   6.308 +
   6.309 +    // Make sure video modes are detected now, while we still have access to the WinRT
   6.310 +    // CoreWindow.  WinRT will not allow the app's CoreWindow to be accessed via the
   6.311 +    // SDL/WinRT thread.
   6.312 +    if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) {
   6.313 +        // SDL_InitSubSystem will, on error, set the SDL error.  Let that propogate to
   6.314 +        // the caller to here:
   6.315 +        WINRT_XAMLWasEnabled = oldXAMLWasEnabledValue;
   6.316 +        return -1;
   6.317 +    }
   6.318 +
   6.319 +    // All done, for now.
   6.320 +    return 0;
   6.321 +#endif // WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP  /  else
   6.322 +}
     7.1 --- a/src/joystick/winrt/SDL_xinputjoystick.c	Wed Mar 12 11:57:15 2014 -0400
     7.2 +++ b/src/joystick/winrt/SDL_xinputjoystick.c	Wed Mar 12 12:12:20 2014 -0400
     7.3 @@ -18,7 +18,7 @@
     7.4       misrepresented as being the original software.
     7.5    3. This notice may not be removed or altered from any source distribution.
     7.6  */
     7.7 -#include "SDL_config.h"
     7.8 +#include "../../SDL_internal.h"
     7.9  
    7.10  #if SDL_JOYSTICK_XINPUT
    7.11  
     8.1 --- a/src/render/direct3d11/SDL_render_d3d11.c	Wed Mar 12 11:57:15 2014 -0400
     8.2 +++ b/src/render/direct3d11/SDL_render_d3d11.c	Wed Mar 12 12:12:20 2014 -0400
     8.3 @@ -35,7 +35,7 @@
     8.4  
     8.5  #ifdef __WINRT__
     8.6  
     8.7 -#include "SDL_render_d3d11_winrthelpers_cpp.h"
     8.8 +#include "SDL_render_winrt.h"
     8.9  
    8.10  #if WINAPI_FAMILY == WINAPI_FAMILY_APP
    8.11  #include <windows.ui.xaml.media.dxinterop.h>
     9.1 --- a/src/render/direct3d11/SDL_render_d3d11_winrthelpers.cpp	Wed Mar 12 11:57:15 2014 -0400
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,111 +0,0 @@
     9.4 -/*
     9.5 -  Simple DirectMedia Layer
     9.6 -  Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
     9.7 -
     9.8 -  This software is provided 'as-is', without any express or implied
     9.9 -  warranty.  In no event will the authors be held liable for any damages
    9.10 -  arising from the use of this software.
    9.11 -
    9.12 -  Permission is granted to anyone to use this software for any purpose,
    9.13 -  including commercial applications, and to alter it and redistribute it
    9.14 -  freely, subject to the following restrictions:
    9.15 -
    9.16 -  1. The origin of this software must not be misrepresented; you must not
    9.17 -     claim that you wrote the original software. If you use this software
    9.18 -     in a product, an acknowledgment in the product documentation would be
    9.19 -     appreciated but is not required.
    9.20 -  2. Altered source versions must be plainly marked as such, and must not be
    9.21 -     misrepresented as being the original software.
    9.22 -  3. This notice may not be removed or altered from any source distribution.
    9.23 -*/
    9.24 -#include "../../SDL_internal.h"
    9.25 -
    9.26 -#if SDL_VIDEO_RENDER_D3D11 && !SDL_RENDER_DISABLED
    9.27 -
    9.28 -#include "SDL_syswm.h"
    9.29 -extern "C" {
    9.30 -#include "../SDL_sysrender.h"
    9.31 -}
    9.32 -
    9.33 -#include <windows.ui.core.h>
    9.34 -#include <windows.foundation.h>
    9.35 -
    9.36 -#if WINAPI_FAMILY == WINAPI_FAMILY_APP
    9.37 -#include <windows.ui.xaml.media.dxinterop.h>
    9.38 -#endif
    9.39 -
    9.40 -using namespace Windows::UI::Core;
    9.41 -using namespace Windows::Graphics::Display;
    9.42 -
    9.43 -#include <DXGI.h>
    9.44 -
    9.45 -
    9.46 -extern "C" void *
    9.47 -D3D11_GetCoreWindowFromSDLRenderer(SDL_Renderer * renderer)
    9.48 -{
    9.49 -    SDL_Window * sdlWindow = renderer->window;
    9.50 -    if ( ! renderer->window ) {
    9.51 -        return NULL;
    9.52 -    }
    9.53 -
    9.54 -    SDL_SysWMinfo sdlWindowInfo;
    9.55 -    SDL_VERSION(&sdlWindowInfo.version);
    9.56 -    if ( ! SDL_GetWindowWMInfo(sdlWindow, &sdlWindowInfo) ) {
    9.57 -        return NULL;
    9.58 -    }
    9.59 -
    9.60 -    if (sdlWindowInfo.subsystem != SDL_SYSWM_WINRT) {
    9.61 -        return NULL;
    9.62 -    }
    9.63 -
    9.64 -    if (!sdlWindowInfo.info.winrt.window) {
    9.65 -        return NULL;
    9.66 -    }
    9.67 -
    9.68 -    ABI::Windows::UI::Core::ICoreWindow *coreWindow = NULL;
    9.69 -    if (FAILED(sdlWindowInfo.info.winrt.window->QueryInterface(&coreWindow))) {
    9.70 -        return NULL;
    9.71 -    }
    9.72 -
    9.73 -    IUnknown *coreWindowAsIUnknown = NULL;
    9.74 -    coreWindow->QueryInterface(&coreWindowAsIUnknown);
    9.75 -    coreWindow->Release();
    9.76 -
    9.77 -    return coreWindowAsIUnknown;
    9.78 -}
    9.79 -
    9.80 -extern "C" DXGI_MODE_ROTATION
    9.81 -D3D11_GetCurrentRotation()
    9.82 -{
    9.83 -    switch (DisplayProperties::CurrentOrientation) {
    9.84 -#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
    9.85 -        /* Windows Phone rotations */
    9.86 -        case DisplayOrientations::Landscape:
    9.87 -            return DXGI_MODE_ROTATION_ROTATE90;
    9.88 -        case DisplayOrientations::Portrait:
    9.89 -            return DXGI_MODE_ROTATION_IDENTITY;
    9.90 -        case DisplayOrientations::LandscapeFlipped:
    9.91 -            return DXGI_MODE_ROTATION_ROTATE270;
    9.92 -        case DisplayOrientations::PortraitFlipped:
    9.93 -            return DXGI_MODE_ROTATION_ROTATE180;
    9.94 -#else
    9.95 -        /* Non-Windows-Phone rotations (ex: Windows 8, Windows RT) */
    9.96 -        case DisplayOrientations::Landscape:
    9.97 -            return DXGI_MODE_ROTATION_IDENTITY;
    9.98 -        case DisplayOrientations::Portrait:
    9.99 -            return DXGI_MODE_ROTATION_ROTATE270;
   9.100 -        case DisplayOrientations::LandscapeFlipped:
   9.101 -            return DXGI_MODE_ROTATION_ROTATE180;
   9.102 -        case DisplayOrientations::PortraitFlipped:
   9.103 -            return DXGI_MODE_ROTATION_ROTATE90;
   9.104 -#endif /* WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP */
   9.105 -
   9.106 -    default:
   9.107 -        return DXGI_MODE_ROTATION_UNSPECIFIED;
   9.108 -    }
   9.109 -}
   9.110 -
   9.111 -
   9.112 -#endif /* SDL_VIDEO_RENDER_D3D11 && !SDL_RENDER_DISABLED */
   9.113 -
   9.114 -/* vi: set ts=4 sw=4 expandtab: */
    10.1 --- a/src/render/direct3d11/SDL_render_d3d11_winrthelpers_cpp.h	Wed Mar 12 11:57:15 2014 -0400
    10.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 @@ -1,40 +0,0 @@
    10.4 -/*
    10.5 -  Simple DirectMedia Layer
    10.6 -  Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
    10.7 -
    10.8 -  This software is provided 'as-is', without any express or implied
    10.9 -  warranty.  In no event will the authors be held liable for any damages
   10.10 -  arising from the use of this software.
   10.11 -
   10.12 -  Permission is granted to anyone to use this software for any purpose,
   10.13 -  including commercial applications, and to alter it and redistribute it
   10.14 -  freely, subject to the following restrictions:
   10.15 -
   10.16 -  1. The origin of this software must not be misrepresented; you must not
   10.17 -     claim that you wrote the original software. If you use this software
   10.18 -     in a product, an acknowledgment in the product documentation would be
   10.19 -     appreciated but is not required.
   10.20 -  2. Altered source versions must be plainly marked as such, and must not be
   10.21 -     misrepresented as being the original software.
   10.22 -  3. This notice may not be removed or altered from any source distribution.
   10.23 -*/
   10.24 -#include "../../SDL_internal.h"
   10.25 -
   10.26 -#if SDL_VIDEO_RENDER_D3D11 && !SDL_RENDER_DISABLED
   10.27 -
   10.28 -#include "SDL_render.h"
   10.29 -
   10.30 -#ifdef __cplusplus
   10.31 -extern "C" {
   10.32 -#endif
   10.33 -
   10.34 -void * D3D11_GetCoreWindowFromSDLRenderer(SDL_Renderer * renderer);
   10.35 -DXGI_MODE_ROTATION D3D11_GetCurrentRotation();
   10.36 -
   10.37 -#ifdef __cplusplus
   10.38 -}
   10.39 -#endif
   10.40 -
   10.41 -#endif /* SDL_VIDEO_RENDER_D3D11 && !SDL_RENDER_DISABLED */
   10.42 -
   10.43 -/* vi: set ts=4 sw=4 expandtab: */
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/src/render/direct3d11/SDL_render_winrt.cpp	Wed Mar 12 12:12:20 2014 -0400
    11.3 @@ -0,0 +1,114 @@
    11.4 +/*
    11.5 +  Simple DirectMedia Layer
    11.6 +  Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
    11.7 +
    11.8 +  This software is provided 'as-is', without any express or implied
    11.9 +  warranty.  In no event will the authors be held liable for any damages
   11.10 +  arising from the use of this software.
   11.11 +
   11.12 +  Permission is granted to anyone to use this software for any purpose,
   11.13 +  including commercial applications, and to alter it and redistribute it
   11.14 +  freely, subject to the following restrictions:
   11.15 +
   11.16 +  1. The origin of this software must not be misrepresented; you must not
   11.17 +     claim that you wrote the original software. If you use this software
   11.18 +     in a product, an acknowledgment in the product documentation would be
   11.19 +     appreciated but is not required.
   11.20 +  2. Altered source versions must be plainly marked as such, and must not be
   11.21 +     misrepresented as being the original software.
   11.22 +  3. This notice may not be removed or altered from any source distribution.
   11.23 +*/
   11.24 +#include "../../SDL_internal.h"
   11.25 +
   11.26 +#if SDL_VIDEO_RENDER_D3D11 && !SDL_RENDER_DISABLED
   11.27 +
   11.28 +#include "SDL_syswm.h"
   11.29 +extern "C" {
   11.30 +#include "../SDL_sysrender.h"
   11.31 +}
   11.32 +
   11.33 +#include <windows.ui.core.h>
   11.34 +#include <windows.graphics.display.h>
   11.35 +
   11.36 +#if WINAPI_FAMILY == WINAPI_FAMILY_APP
   11.37 +#include <windows.ui.xaml.media.dxinterop.h>
   11.38 +#endif
   11.39 +
   11.40 +using namespace ABI;
   11.41 +using namespace Windows::UI::Core;
   11.42 +using namespace Windows::Graphics::Display;
   11.43 +
   11.44 +#include <DXGI.h>
   11.45 +
   11.46 +#include "SDL_render_winrt.h"
   11.47 +
   11.48 +
   11.49 +extern "C" void *
   11.50 +D3D11_GetCoreWindowFromSDLRenderer(SDL_Renderer * renderer)
   11.51 +{
   11.52 +    SDL_Window * sdlWindow = renderer->window;
   11.53 +    if ( ! renderer->window ) {
   11.54 +        return NULL;
   11.55 +    }
   11.56 +
   11.57 +    SDL_SysWMinfo sdlWindowInfo;
   11.58 +    SDL_VERSION(&sdlWindowInfo.version);
   11.59 +    if ( ! SDL_GetWindowWMInfo(sdlWindow, &sdlWindowInfo) ) {
   11.60 +        return NULL;
   11.61 +    }
   11.62 +
   11.63 +    if (sdlWindowInfo.subsystem != SDL_SYSWM_WINRT) {
   11.64 +        return NULL;
   11.65 +    }
   11.66 +
   11.67 +    if (!sdlWindowInfo.info.winrt.window) {
   11.68 +        return NULL;
   11.69 +    }
   11.70 +
   11.71 +    ABI::Windows::UI::Core::ICoreWindow *coreWindow = NULL;
   11.72 +    if (FAILED(sdlWindowInfo.info.winrt.window->QueryInterface(&coreWindow))) {
   11.73 +        return NULL;
   11.74 +    }
   11.75 +
   11.76 +    IUnknown *coreWindowAsIUnknown = NULL;
   11.77 +    coreWindow->QueryInterface(&coreWindowAsIUnknown);
   11.78 +    coreWindow->Release();
   11.79 +
   11.80 +    return coreWindowAsIUnknown;
   11.81 +}
   11.82 +
   11.83 +extern "C" DXGI_MODE_ROTATION
   11.84 +D3D11_GetCurrentRotation()
   11.85 +{
   11.86 +#if 0 /* FIXME: This doesn't compile on Visual Studio 2013 */
   11.87 +    switch (DisplayProperties::CurrentOrientation) {
   11.88 +#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
   11.89 +    /* Windows Phone rotations */
   11.90 +    case DisplayOrientations::Landscape:
   11.91 +        return DXGI_MODE_ROTATION_ROTATE90;
   11.92 +    case DisplayOrientations::Portrait:
   11.93 +        return DXGI_MODE_ROTATION_IDENTITY;
   11.94 +    case DisplayOrientations::LandscapeFlipped:
   11.95 +        return DXGI_MODE_ROTATION_ROTATE270;
   11.96 +    case DisplayOrientations::PortraitFlipped:
   11.97 +        return DXGI_MODE_ROTATION_ROTATE180;
   11.98 +#else
   11.99 +    /* Non-Windows-Phone rotations (ex: Windows 8, Windows RT) */
  11.100 +    case DisplayOrientations::Landscape:
  11.101 +        return DXGI_MODE_ROTATION_IDENTITY;
  11.102 +    case DisplayOrientations::Portrait:
  11.103 +        return DXGI_MODE_ROTATION_ROTATE270;
  11.104 +    case DisplayOrientations::LandscapeFlipped:
  11.105 +        return DXGI_MODE_ROTATION_ROTATE180;
  11.106 +    case DisplayOrientations::PortraitFlipped:
  11.107 +        return DXGI_MODE_ROTATION_ROTATE90;
  11.108 +#endif /* WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP */
  11.109 +    }
  11.110 +#endif
  11.111 +    return DXGI_MODE_ROTATION_IDENTITY;
  11.112 +}
  11.113 +
  11.114 +
  11.115 +#endif /* SDL_VIDEO_RENDER_D3D11 && !SDL_RENDER_DISABLED */
  11.116 +
  11.117 +/* vi: set ts=4 sw=4 expandtab: */
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/src/render/direct3d11/SDL_render_winrt.h	Wed Mar 12 12:12:20 2014 -0400
    12.3 @@ -0,0 +1,40 @@
    12.4 +/*
    12.5 +  Simple DirectMedia Layer
    12.6 +  Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
    12.7 +
    12.8 +  This software is provided 'as-is', without any express or implied
    12.9 +  warranty.  In no event will the authors be held liable for any damages
   12.10 +  arising from the use of this software.
   12.11 +
   12.12 +  Permission is granted to anyone to use this software for any purpose,
   12.13 +  including commercial applications, and to alter it and redistribute it
   12.14 +  freely, subject to the following restrictions:
   12.15 +
   12.16 +  1. The origin of this software must not be misrepresented; you must not
   12.17 +     claim that you wrote the original software. If you use this software
   12.18 +     in a product, an acknowledgment in the product documentation would be
   12.19 +     appreciated but is not required.
   12.20 +  2. Altered source versions must be plainly marked as such, and must not be
   12.21 +     misrepresented as being the original software.
   12.22 +  3. This notice may not be removed or altered from any source distribution.
   12.23 +*/
   12.24 +#include "../../SDL_internal.h"
   12.25 +
   12.26 +#if SDL_VIDEO_RENDER_D3D11 && !SDL_RENDER_DISABLED
   12.27 +
   12.28 +#include "SDL_render.h"
   12.29 +
   12.30 +#ifdef __cplusplus
   12.31 +extern "C" {
   12.32 +#endif
   12.33 +
   12.34 +void * D3D11_GetCoreWindowFromSDLRenderer(SDL_Renderer * renderer);
   12.35 +DXGI_MODE_ROTATION D3D11_GetCurrentRotation();
   12.36 +
   12.37 +#ifdef __cplusplus
   12.38 +}
   12.39 +#endif
   12.40 +
   12.41 +#endif /* SDL_VIDEO_RENDER_D3D11 && !SDL_RENDER_DISABLED */
   12.42 +
   12.43 +/* vi: set ts=4 sw=4 expandtab: */
    13.1 --- a/src/video/winrt/SDL_winrtevents.cpp	Wed Mar 12 11:57:15 2014 -0400
    13.2 +++ b/src/video/winrt/SDL_winrtevents.cpp	Wed Mar 12 12:12:20 2014 -0400
    13.3 @@ -18,7 +18,7 @@
    13.4       misrepresented as being the original software.
    13.5    3. This notice may not be removed or altered from any source distribution.
    13.6  */
    13.7 -#include "SDL_config.h"
    13.8 +#include "../../SDL_internal.h"
    13.9  
   13.10  #if SDL_VIDEO_DRIVER_WINRT
   13.11  
    14.1 --- a/src/video/winrt/SDL_winrtmouse.cpp	Wed Mar 12 11:57:15 2014 -0400
    14.2 +++ b/src/video/winrt/SDL_winrtmouse.cpp	Wed Mar 12 12:12:20 2014 -0400
    14.3 @@ -18,7 +18,6 @@
    14.4       misrepresented as being the original software.
    14.5    3. This notice may not be removed or altered from any source distribution.
    14.6  */
    14.7 -
    14.8  #include "../../SDL_internal.h"
    14.9  
   14.10  #if SDL_VIDEO_DRIVER_WINRT
    15.1 --- a/src/video/winrt/SDL_winrtopengles.cpp	Wed Mar 12 11:57:15 2014 -0400
    15.2 +++ b/src/video/winrt/SDL_winrtopengles.cpp	Wed Mar 12 12:12:20 2014 -0400
    15.3 @@ -18,7 +18,7 @@
    15.4       misrepresented as being the original software.
    15.5    3. This notice may not be removed or altered from any source distribution.
    15.6  */
    15.7 -#include "SDL_config.h"
    15.8 +#include "../../SDL_internal.h"
    15.9  
   15.10  // TODO: WinRT, make this file compile via C code
   15.11  
    16.1 --- a/src/video/winrt/SDL_winrtpointerinput.cpp	Wed Mar 12 11:57:15 2014 -0400
    16.2 +++ b/src/video/winrt/SDL_winrtpointerinput.cpp	Wed Mar 12 12:12:20 2014 -0400
    16.3 @@ -18,7 +18,7 @@
    16.4       misrepresented as being the original software.
    16.5    3. This notice may not be removed or altered from any source distribution.
    16.6  */
    16.7 -#include "SDL_config.h"
    16.8 +#include "../../SDL_internal.h"
    16.9  
   16.10  #if SDL_VIDEO_DRIVER_WINRT
   16.11