Xbox GDKX support (#5869)

* Xbox GDK support (14 squashed commits)

* Added basic keyboard testing

* Update readme

* Code review fixes

* Fixed issue where controller add/removal wasn't working (since the device notification events don't work on Xbox, have to use the joystick thread to poll XInput)
This commit is contained in:
chalonverse 2022-07-01 13:59:14 -07:00 committed by GitHub
parent 0025621b80
commit f317d619cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
77 changed files with 2573 additions and 74 deletions

View file

@ -75,7 +75,9 @@
static int SDLCALL
windows_file_open(SDL_RWops * context, const char *filename, const char *mode)
{
#if !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
UINT old_error_mode;
#endif
HANDLE h;
DWORD r_right, w_right;
DWORD must_exist, truncate;
@ -112,9 +114,11 @@ windows_file_open(SDL_RWops * context, const char *filename, const char *mode)
if (!context->hidden.windowsio.buffer.data) {
return SDL_OutOfMemory();
}
#if !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
/* Do not open a dialog box if failure */
old_error_mode =
SetErrorMode(SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS);
#endif
{
LPTSTR tstr = WIN_UTF8ToString(filename);
@ -125,8 +129,10 @@ windows_file_open(SDL_RWops * context, const char *filename, const char *mode)
SDL_free(tstr);
}
#if !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
/* restore old behavior */
SetErrorMode(old_error_mode);
#endif
if (h == INVALID_HANDLE_VALUE) {
SDL_free(context->hidden.windowsio.buffer.data);