mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-30 06:58:30 +00:00
Add SDL_HINT_DIRECTINPUT_ENABLED (on by default)
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
|
||||
#if SDL_HAPTIC_DINPUT
|
||||
|
||||
#include "SDL_hints.h"
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_timer.h"
|
||||
#include "SDL_windowshaptic_c.h"
|
||||
@@ -77,6 +78,11 @@ SDL_DINPUT_HapticInit(void)
|
||||
return SDL_SetError("Haptic: SubSystem already open.");
|
||||
}
|
||||
|
||||
if (!SDL_GetHintBoolean(SDL_HINT_DIRECTINPUT_ENABLED, SDL_TRUE)) {
|
||||
/* In some environments, IDirectInput8_Initialize / _EnumDevices can take a minute even with no controllers. */
|
||||
return 0;
|
||||
}
|
||||
|
||||
ret = WIN_CoInitialize();
|
||||
if (FAILED(ret)) {
|
||||
return DI_SetError("Coinitialize", ret);
|
||||
|
Reference in New Issue
Block a user