Fixed compiling Windows RT code on Visual Studio 2013

--HG--
rename : src/render/direct3d11/SDL_render_d3d11_winrthelpers.cpp => src/render/direct3d11/SDL_render_winrt.cpp
rename : src/render/direct3d11/SDL_render_d3d11_winrthelpers_cpp.h => src/render/direct3d11/SDL_render_winrt.h
This commit is contained in:
Sam Lantinga 2014-03-12 07:26:07 -07:00
parent 5007e2996e
commit ad407b378a
11 changed files with 39 additions and 43 deletions

View file

@ -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 <windows.ui.xaml.media.dxinterop.h>

View file

@ -28,12 +28,15 @@ extern "C" {
}
#include <windows.ui.core.h>
#include <windows.foundation.h>
#include <windows.graphics.display.h>
#if WINAPI_FAMILY == WINAPI_FAMILY_APP
#include <windows.ui.xaml.media.dxinterop.h>
#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;
}