We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3456

Summary: SDL_GameControllerOpen fails if the joystick subsystem isn't initialized
Product: SDL Reporter: Bastien Dejean <nihilhill>
Component: joystickAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: philipp.wiesemann
Version: HG 2.1   
Hardware: x86_64   
OS: Windows 7   
Attachments: Patch used to trigger the failure

Description Bastien Dejean 2016-10-15 13:08:27 UTC
Created attachment 2585 [details]
Patch used to trigger the failure

Steps to reproduce:

cd test
patch testgamecontroller.c < ATTACHED_PATCH
make testgamecontroller
./testgamecontroller 0

(Please also note that the error message (IDirectInputDevice8::SetCooperativeLevel() DirectX error 0xx) doesn't provide any error code.)
Comment 1 Philipp Wiesemann 2016-10-16 18:46:02 UTC
Maybe the fault is in the SDL_VIDEO_DRIVER_WINDOWS section in SDL_InitSubSystem() of "src/SDL.c". Because there only SDL_INIT_JOYSTICK is checked. The flags are adapted for SDL_INIT_GAMECONTROLLER afterwards.
Comment 2 Sam Lantinga 2016-10-18 04:44:51 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/1dfa58e94f88