src/core/winrt/SDL_winrtapp_direct3d.cpp
changeset 9256 9c45fc8605d9
parent 9240 dc4ad21d8596
child 9619 b94b6d0bff0f
--- a/src/core/winrt/SDL_winrtapp_direct3d.cpp	Tue Dec 02 21:18:50 2014 -0500
+++ b/src/core/winrt/SDL_winrtapp_direct3d.cpp	Wed Dec 03 10:55:23 2014 -0500
@@ -126,6 +126,16 @@
 {
     SDL_assert(SDL_strcmp(name, SDL_HINT_ORIENTATIONS) == 0);
 
+    /* HACK: prevent SDL from altering an app's .appxmanifest-set orientation
+     * from being changed on startup, by detecting when SDL_HINT_ORIENTATIONS
+     * is getting registered.
+     *
+     * TODO, WinRT: consider reading in an app's .appxmanifest file, and apply its orientation when 'newValue == NULL'.
+     */
+    if ((oldValue == NULL) && (newValue == NULL)) {
+        return;
+    }
+
     // Start with no orientation flags, then add each in as they're parsed
     // from newValue.
     unsigned int orientationFlags = 0;