# HG changeset patch # User David Ludwig # Date 1417622123 18000 # Node ID 9c45fc8605d9c16df1549aec1a5285fe289b12a3 # Parent c2ef0d8d6da0d22382a0d58ebbcd5e8f55e65079 WinRT: fixed bug whereby SDL would override an app's default orientation WinRT apps can set a default, preferred orientation via a .appxmanifest file. SDL was overriding this on app startup, and making the app use all possible orientations (landscape and portrait). Thanks to Eric Wing for the heads up on this! diff -r c2ef0d8d6da0 -r 9c45fc8605d9 src/core/winrt/SDL_winrtapp_direct3d.cpp --- 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;