early-access version 1667
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
@@ -171,7 +171,7 @@ SDL_CreateDeviceNotification(SDL_DeviceNotificationData *data)
|
||||
data->coinitialized = WIN_CoInitialize();
|
||||
|
||||
data->wincl.hInstance = GetModuleHandle(NULL);
|
||||
data->wincl.lpszClassName = L"Message";
|
||||
data->wincl.lpszClassName = TEXT("Message");
|
||||
data->wincl.lpfnWndProc = SDL_PrivateJoystickDetectProc; /* This function is called by windows */
|
||||
data->wincl.cbSize = sizeof (WNDCLASSEX);
|
||||
|
||||
@@ -181,7 +181,7 @@ SDL_CreateDeviceNotification(SDL_DeviceNotificationData *data)
|
||||
return -1;
|
||||
}
|
||||
|
||||
data->messageWindow = (HWND)CreateWindowEx(0, L"Message", NULL, 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, NULL, NULL);
|
||||
data->messageWindow = (HWND)CreateWindowEx(0, TEXT("Message"), NULL, 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, NULL, NULL);
|
||||
if (!data->messageWindow) {
|
||||
WIN_SetError("Failed to create message window for joystick autodetect");
|
||||
SDL_CleanupDeviceNotification(data);
|
||||
@@ -356,6 +356,15 @@ WINDOWS_JoystickInit(void)
|
||||
|
||||
WINDOWS_JoystickDetect();
|
||||
|
||||
#ifdef __WINRT__
|
||||
/* FIXME: WinRT silently does not support device notifications.
|
||||
* Revisit this if UWP ever adds support in a future release.
|
||||
*/
|
||||
s_bJoystickThread = SDL_TRUE;
|
||||
if (SDL_StartJoystickThread() < 0) {
|
||||
return -1;
|
||||
}
|
||||
#else
|
||||
s_bJoystickThread = SDL_GetHintBoolean(SDL_HINT_JOYSTICK_THREAD, SDL_FALSE);
|
||||
if (s_bJoystickThread) {
|
||||
if (SDL_StartJoystickThread() < 0) {
|
||||
@@ -366,6 +375,7 @@ WINDOWS_JoystickInit(void)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user