Added SDL_WinRTGetDeviceFamily() to find out what type of device your application is running on (thanks Daniel Knobe!)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
diff --git a/WhatsNew.txt b/WhatsNew.txt
index f30e0ab..2555ef4 100644
--- a/WhatsNew.txt
+++ b/WhatsNew.txt
@@ -9,6 +9,16 @@ General:
* Added SDL_fmod()
* Each of the SDL math functions now has the corresponding float version
+Windows:
+* Implemented WASAPI support on Windows UWP and removed the deprecated XAudio2 implementation
+
+Windows UWP:
+* Added SDL_WinRTGetDeviceFamily() to find out what type of device your application is running on
+
+Mac OSX / iOS / tvOS:
+* Added a Metal 2D render implementation
+* Added SDL_RenderGetMetalLayer() and SDL_RenderGetMetalCommandEncoder() to insert your own drawing into SDL rendering when using the Metal implementation
+
---------------------------------------------------------------------------
2.0.7:
diff --git a/include/SDL_system.h b/include/SDL_system.h
index eb069b3..5974188 100644
--- a/include/SDL_system.h
+++ b/include/SDL_system.h
@@ -170,6 +170,25 @@ typedef enum
/**
+ * \brief WinRT Device Family
+ */
+typedef enum
+{
+ /** \brief Unknown family */
+ SDL_WINRT_DEVICEFAMILY_UNKNOWN,
+
+ /** \brief Desktop family*/
+ SDL_WINRT_DEVICEFAMILY_DESKTOP,
+
+ /** \brief Mobile family (for example smartphone) */
+ SDL_WINRT_DEVICEFAMILY_MOBILE,
+
+ /** \brief XBox family */
+ SDL_WINRT_DEVICEFAMILY_XBOX,
+} SDL_WinRT_DeviceFamily;
+
+
+/**
* \brief Retrieves a WinRT defined path on the local file system
*
* \note Documentation on most app-specific path types on WinRT
@@ -203,6 +222,13 @@ extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path
*/
extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType);
+/**
+ * \brief Detects the device family of WinRT plattform on runtime
+ *
+ * \return Device family
+ */
+extern DECLSPEC SDL_WinRT_DeviceFamily SDLCALL SDL_WinRTGetDeviceFamily();
+
#endif /* __WINRT__ */
/* Ends C function definitions when using C++ */
diff --git a/src/core/winrt/SDL_winrtapp_common.cpp b/src/core/winrt/SDL_winrtapp_common.cpp
index 3ee0be3..fda00af 100644
--- a/src/core/winrt/SDL_winrtapp_common.cpp
+++ b/src/core/winrt/SDL_winrtapp_common.cpp
@@ -40,3 +40,25 @@ SDL_WinRTRunApp(int (*mainFunction)(int, char **), void * xamlBackgroundPanel)
return SDL_WinRTInitNonXAMLApp(mainFunction);
}
}
+
+
+extern "C" DECLSPEC SDL_WinRT_DeviceFamily
+SDL_WinRTGetDeviceFamily()
+{
+ 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;
+ }
+
+ return SDL_WINRT_DEVICEFAMILY_UNKNOWN;
+}
\ No newline at end of file