gdk: Add SDL_GDKGetDefaultUser, SDL_GetPrefPath implementation
This adds some features that are really helpful for single-player titles that don't need a lot of fancy user management and want to reuse their existing desktop work.
Marked as a draft until I get this stuff through cert! Also, this targets SDL2 instead of SDL3, for now.
I believe you can use GetModuleFileNameA(NULL, buff, SDL_arraysize(buff)) for SDL_GetBasePath since the GDK documentation specifically mentions this use case: https://learn.microsoft.com/en-us/gaming/gdk/_content/gc/reference/system/xgame/functions/xlaunchnewgame (see exePath parameter description)
(the game may be deployed as loose files for example...)
Otherwise LGTM.
I believe you can use
GetModuleFileNameA(NULL, buff, SDL_arraysize(buff))forSDL_GetBasePathsince the GDK documentation specifically mentions this use case: https://learn.microsoft.com/en-us/gaming/gdk/_content/gc/reference/system/xgame/functions/xlaunchnewgame (seeexePathparameter description) (the game may be deployed as loose files for example...) Otherwise LGTM.
Implemented this, thanks for the note! The GDK path is now basically the Win32 path, but amazingly the GDK docs recommend using the A functions directly over the W functions, so I went ahead and made that one change.
This change is expected to ship on the Xbox store in the near future, so it should now be ready for review.
This patch has officially passed cert, so I'll probably merge this and an SDL3 version within the next couple days unless somebody stops me...!
This looks good to me! :)
SDL3 variant: https://github.com/libsdl-org/SDL/commit/c0cd8c8142b70c70da4dddc32244da6593cb6bb0