File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed
Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 6969
7070// Initialization/Cleanup routines
7171#include "timer/SDL_timer_c.h"
72- #ifdef SDL_PLATFORM_WINDOWS
72+ #if defined( SDL_PLATFORM_WINDOWS ) && !defined( SDL_PLATFORM_WINRT ) && !defined( SDL_PLATFORM_XBOXONE ) && !defined( SDL_PLATFORM_XBOXSERIES )
7373extern bool SDL_HelperWindowCreate (void );
7474extern void SDL_HelperWindowDestroy (void );
7575#endif
@@ -323,7 +323,7 @@ bool SDL_InitSubSystem(SDL_InitFlags flags)
323323 SDL_DBus_Init ();
324324#endif
325325
326- #ifdef SDL_PLATFORM_WINDOWS
326+ #if defined( SDL_PLATFORM_WINDOWS ) && !defined( SDL_PLATFORM_WINRT ) && !defined( SDL_PLATFORM_XBOXONE ) && !defined( SDL_PLATFORM_XBOXSERIES )
327327 if (flags & (SDL_INIT_HAPTIC | SDL_INIT_JOYSTICK )) {
328328 if (!SDL_HelperWindowCreate ()) {
329329 goto quit_and_error ;
@@ -659,7 +659,7 @@ void SDL_Quit(void)
659659 SDL_bInMainQuit = true;
660660
661661 // Quit all subsystems
662- #ifdef SDL_PLATFORM_WINDOWS
662+ #if defined( SDL_PLATFORM_WINDOWS ) && !defined( SDL_PLATFORM_WINRT ) && !defined( SDL_PLATFORM_XBOXONE ) && !defined( SDL_PLATFORM_XBOXSERIES )
663663 SDL_HelperWindowDestroy ();
664664#endif
665665 SDL_QuitSubSystem (SDL_INIT_EVERYTHING );
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ typedef enum RO_INIT_TYPE
4545#define WC_ERR_INVALID_CHARS 0x00000080
4646#endif
4747
48+ #if !defined(SDL_PLATFORM_WINRT ) && !defined(SDL_PLATFORM_XBOXONE ) && !defined(SDL_PLATFORM_XBOXSERIES )
4849// Dark mode support
4950typedef enum {
5051 UXTHEME_APPMODE_DEFAULT ,
@@ -82,7 +83,7 @@ typedef void (WINAPI *RefreshImmersiveColorPolicyState_t)(void);
8283typedef UxthemePreferredAppMode (WINAPI * SetPreferredAppMode_t )(UxthemePreferredAppMode );
8384typedef BOOL (WINAPI * SetWindowCompositionAttribute_t )(HWND , const WINDOWCOMPOSITIONATTRIBDATA * );
8485typedef void (NTAPI * RtlGetVersion_t )(NT_OSVERSIONINFOW * );
85-
86+ #endif
8687// Fake window to help with DirectInput events.
8788HWND SDL_HelperWindow = NULL ;
8889static const TCHAR * SDL_HelperWindowClassName = TEXT ("SDLHelperWindowInputCatcher" );
@@ -154,6 +155,20 @@ void SDL_HelperWindowDestroy(void)
154155 SDL_HelperWindowClass = 0 ;
155156 }
156157}
158+ #else
159+ // Stub implementations for UWP/Xbox platforms
160+ HWND SDL_HelperWindow = NULL ;
161+
162+ bool SDL_HelperWindowCreate (void )
163+ {
164+ return true; // No-op for UWP/Xbox
165+ }
166+
167+ void SDL_HelperWindowDestroy (void )
168+ {
169+ // No-op for UWP/Xbox
170+ }
171+ #endif
157172
158173// Sets an error message based on an HRESULT
159174bool WIN_SetErrorFromHRESULT (const char * prefix , HRESULT hr )
You can’t perform that action at this time.
0 commit comments