mirror of
https://github.com/encounter/SDL.git
synced 2025-12-11 06:27:44 +00:00
Moved raw input event processing from the main thread to the joystick thread
This allows fast joystick event delivery regardless of what the main thread is doing.
This commit is contained in:
@@ -30,7 +30,6 @@
|
||||
#include "../../events/SDL_keyboard_c.h"
|
||||
#include "../../events/SDL_mouse_c.h"
|
||||
|
||||
#include "../../joystick/windows/SDL_rawinputjoystick_c.h"
|
||||
#include "SDL_windowsvideo.h"
|
||||
#include "SDL_windowswindow.h"
|
||||
#include "SDL_hints.h"
|
||||
@@ -811,18 +810,8 @@ WIN_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info)
|
||||
}
|
||||
}
|
||||
|
||||
static LRESULT CALLBACK SDL_HelperWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
#if SDL_JOYSTICK_RAWINPUT
|
||||
if (RAWINPUT_WindowProc(hWnd, msg, wParam, lParam) == 0) {
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
return DefWindowProc(hWnd, msg, wParam, lParam);
|
||||
}
|
||||
|
||||
/*
|
||||
* Creates a HelperWindow used for DirectInput and RawInput events.
|
||||
* Creates a HelperWindow used for DirectInput.
|
||||
*/
|
||||
int
|
||||
SDL_HelperWindowCreate(void)
|
||||
@@ -837,7 +826,7 @@ SDL_HelperWindowCreate(void)
|
||||
|
||||
/* Create the class. */
|
||||
SDL_zero(wce);
|
||||
wce.lpfnWndProc = SDL_GetHintBoolean(SDL_HINT_JOYSTICK_RAWINPUT, SDL_TRUE) ? SDL_HelperWindowProc : DefWindowProc;
|
||||
wce.lpfnWndProc = DefWindowProc;
|
||||
wce.lpszClassName = (LPCWSTR) SDL_HelperWindowClassName;
|
||||
wce.hInstance = hInstance;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user