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 - SDL_GameControllerOpen fails if the joystick subsystem isn't initialized
Summary: SDL_GameControllerOpen fails if the joystick subsystem isn't initialized
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: joystick (show other bugs)
Version: HG 2.1
Hardware: x86_64 Windows 7
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-15 13:08 UTC by Bastien Dejean
Modified: 2016-10-18 04:44 UTC (History)
1 user (show)

See Also:


Attachments
Patch used to trigger the failure (582 bytes, patch)
2016-10-15 13:08 UTC, Bastien Dejean
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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