SDL 2.0
SDL_winrtapp_common.cpp File Reference
#include "../../SDL_internal.h"
#include "SDL_main.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 (SDL_main_func mainFunction, 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 47 of file SDL_winrtapp_common.cpp.

48{
49#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. */
50 Platform::String^ deviceFamily = Windows::System::Profile::AnalyticsInfo::VersionInfo->DeviceFamily;
51
52 if (deviceFamily->Equals("Windows.Desktop"))
53 {
54 return SDL_WINRT_DEVICEFAMILY_DESKTOP;
55 }
56 else if (deviceFamily->Equals("Windows.Mobile"))
57 {
58 return SDL_WINRT_DEVICEFAMILY_MOBILE;
59 }
60 else if (deviceFamily->Equals("Windows.Xbox"))
61 {
62 return SDL_WINRT_DEVICEFAMILY_XBOX;
63 }
64#endif
65
66 return SDL_WINRT_DEVICEFAMILY_UNKNOWN;
67}

◆ SDL_WinRTRunApp()

int SDL_WinRTRunApp ( SDL_main_func  mainFunction,
void xamlBackgroundPanel 
)

Definition at line 33 of file SDL_winrtapp_common.cpp.

34{
35 if (xamlBackgroundPanel) {
36 return SDL_WinRTInitXAMLApp(mainFunction, xamlBackgroundPanel);
37 } else {
38 if (FAILED(Windows::Foundation::Initialize(RO_INIT_MULTITHREADED))) {
39 return 1;
40 }
41 return SDL_WinRTInitNonXAMLApp(mainFunction);
42 }
43}
#define FAILED(x)
Definition: SDL_directx.h:54
int SDL_WinRTInitNonXAMLApp(int(*mainFunction)(int, char **))
int SDL_WinRTInitXAMLApp(int(*mainFunction)(int, char **), void *backgroundPanelAsIInspectable)

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

Referenced by WinMain().

Variable Documentation

◆ WINRT_SDLAppEntryPoint

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

Definition at line 30 of file SDL_winrtapp_common.cpp.

Referenced by SDL_WinRTInitNonXAMLApp(), and SDL_WinRTInitXAMLApp().