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

SDL_WinRT_DeviceFamily SDL_WinRTGetDeviceFamily ( )

Definition at line 46 of file SDL_winrtapp_common.cpp.

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

◆ 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().

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

Variable Documentation

◆ WINRT_SDLAppEntryPoint

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