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_WinRTGetDeviceFamily()

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;
}

## SDL_WinRTRunApp()

int SDL_WinRTRunApp | ( | int(*)(int, char **) | mainFunction,
|  | void * | xamlBackgroundPanel
| ) |  |

Definition at line 32 of file SDL_winrtapp_common.cpp.

References DECLSPEC, 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);
}
}
SDL_WinRTInitNonXAMLApp
int SDL_WinRTInitNonXAMLApp(int(*mainFunction)(int, char **))
Definition: SDL_winrtapp_direct3d.cpp:116
FAILED
#define FAILED(x)
Definition: SDL_directx.h:54
SDL_WinRTInitXAMLApp
int SDL_WinRTInitXAMLApp(int(*mainFunction)(int, char **), void *backgroundPanelAsIInspectable)
Definition: SDL_winrtapp_xaml.cpp:102

## Variable Documentation

## WINRT_SDLAppEntryPoint

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

Definition at line 29 of file SDL_winrtapp_common.cpp.

Referenced by SDL_WinRTInitNonXAMLApp(), SDL_WinRTInitXAMLApp(), and WINRT_ProcessWindowSizeChange().