SDL  2.0
SDL_winrtapp_common.cpp File Reference
#include "../../SDL_internal.h"
#include "SDL_system.h"
#include "SDL_winrtapp_direct3d.h"
#include "SDL_winrtapp_xaml.h"
#include <wrl.h>
+ Include dependency graph for SDL_winrtapp_common.cpp:

Go to the source code of this file.

Functions

int SDL_WinRTRunApp (int(*mainFunction)(int, char **), void *xamlBackgroundPanel)
SDL_WinRT_DeviceFamily SDL_WinRTGetDeviceFamily ()

Variables

int(* WINRT_SDLAppEntryPoint )(int, char **) = NULL

Function Documentation

SDL_WinRT_DeviceFamily SDL_WinRTGetDeviceFamily ( )

Definition at line 46 of file SDL_winrtapp_common.cpp.

{
#if NTDDI_VERSION >= NTDDI_WIN10 /* !!! FIXME: I have no idea if this is the right test. This is a UWP API, I think. Older windows should...just return "mobile"? I don't know. --ryan. */
Platform::String^ deviceFamily = Windows::System::Profile::AnalyticsInfo::VersionInfo->DeviceFamily;
if (deviceFamily->Equals("Windows.Desktop"))
{
return SDL_WINRT_DEVICEFAMILY_DESKTOP;
}
else if (deviceFamily->Equals("Windows.Mobile"))
{
return SDL_WINRT_DEVICEFAMILY_MOBILE;
}
else if (deviceFamily->Equals("Windows.Xbox"))
{
return SDL_WINRT_DEVICEFAMILY_XBOX;
}
#endif
return SDL_WINRT_DEVICEFAMILY_UNKNOWN;
}
int SDL_WinRTRunApp ( int(*)(int, char **)  mainFunction,
void xamlBackgroundPanel 
)

Definition at line 32 of file SDL_winrtapp_common.cpp.

References FAILED, SDL_WinRTInitNonXAMLApp(), and SDL_WinRTInitXAMLApp().

Referenced by WinMain().

{
if (xamlBackgroundPanel) {
return SDL_WinRTInitXAMLApp(mainFunction, xamlBackgroundPanel);
} else {
if (FAILED(Windows::Foundation::Initialize(RO_INIT_MULTITHREADED))) {
return 1;
}
return SDL_WinRTInitNonXAMLApp(mainFunction);
}
}

Variable Documentation

int(* WINRT_SDLAppEntryPoint)(int, char **) = NULL

Definition at line 29 of file SDL_winrtapp_common.cpp.

Referenced by SDL_WinRTInitNonXAMLApp(), and SDL_WinRTInitXAMLApp().