You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reported in version: HG 2.0 Reported for operating system, platform: All, All
Comments on the original bug report:
On 2013-07-15 21:05:26 +0000, Alex Szpakowski wrote:
Created attachment 1237
Patch to add SDL_JoystickIsGameController and SDL_GameControllerOpenFromJoystick
It is sometimes the case that a developer will want to open a GameController from a particular Joystick when some time has passed since the original Joystick has been opened, for example if SDL_GameControllerAddMapping is called while existing Joysticks are connected.
There is currently no SDL function (aside from the SDL_JOYDEVICEADDED event) to facilitate this, and there is also no API to know whether a Joystick object can be opened as a GameController unless the Joystick's device index (which can change and is not retrievable with an SDL function) is also known.
I have attached a patch to add SDL_JoystickIsGameController(SDL_Joystick*) and SDL_GameControllerOpenFromJoystick(SDL_Joystick*). I've tested it in OS X and Windows with an xbox controller and it works as expected. Most of the code is based on SDL_GameControllerOpen and SDL_IsGameController.
I chose the name SDL_JoystickIsGameController to be consistent with SDL_IsGameController and SDL_JoystickIsHaptic, and I chose the name SDL_GameControllerOpenFromJoystick to be consistent with SDL_GameControllerOpen and SDL_HapticOpenFromJoystick.
On 2013-07-27 11:11:34 +0000, Philipp Wiesemann wrote:
(In reply to comment # 0)
Created attachment 1237 [details]
Patch to add SDL_JoystickIsGameController and
SDL_GameControllerOpenFromJoystick
Minor documentation problem in patch: s/suppported/supported/
On 2013-07-28 14:29:25 +0000, Sam Lantinga wrote:
Thanks, we'll keep this for review after the SDL 2.0 release.
On 2013-07-29 13:10:37 +0000, Alfred Reynolds wrote:
Looks good.
I would consider renaming SDL_JoystickIsGameController() to SDL_GameControllerIsJoystickSupported() , just to follow the pattern of the prefix of game controller functions.
I'm also not a fan of reaching into the private guts of sdl joystick for the SDL_PrivateJoystickValid function, but haptic's already does the same thing.
On 2015-02-19 05:22:17 +0000, Ryan C. Gordon wrote:
Marking a large number of bugs with the "triage-2.0.4" keyword at once. Sorry if you got a lot of email from this. This is to help me sort through some bugs in regards to a 2.0.4 release. We may or may not fix this bug for 2.0.4, though!
On 2015-04-07 04:57:58 +0000, Ryan C. Gordon wrote:
(sorry if you get a lot of copies of this email, I'm marking several bugs at once)
Marking bugs for the (mostly) final 2.0.4 TODO list. This means we're hoping to resolve this bug before 2.0.4 ships if possible. In a perfect world, the open bug count with the target-2.0.4 keyword is zero when we ship.
(Note that closing a bug report as WONTFIX, INVALID or WORKSFORME might still happen.)
--ryan.
On 2015-05-28 20:02:06 +0000, Sam Lantinga wrote:
This is a good change, but I want to think it through a little bit more and so will look at it again after 2.0.4 ships.
The text was updated successfully, but these errors were encountered:
Is this still useful?
If so, we probably want to implement those functions in terms of SDL_JoystickGetDeviceIndexFromInstanceID() or maybe even just expose that function so applications can map between open joysticks and the indexed joystick list.
SDL_JoystickGetDeviceIndexFromInstanceID would be useful for someone who is managing references in a scripting object oriented language and making a glue to SDL in the backend.
This bug report was migrated from our old Bugzilla tracker.
These attachments are available in the static archive:
Reported in version: HG 2.0
Reported for operating system, platform: All, All
Comments on the original bug report:
On 2013-07-15 21:05:26 +0000, Alex Szpakowski wrote:
On 2013-07-27 11:11:34 +0000, Philipp Wiesemann wrote:
On 2013-07-28 14:29:25 +0000, Sam Lantinga wrote:
On 2013-07-29 13:10:37 +0000, Alfred Reynolds wrote:
On 2015-02-19 05:22:17 +0000, Ryan C. Gordon wrote:
On 2015-04-07 04:57:58 +0000, Ryan C. Gordon wrote:
On 2015-05-28 20:02:06 +0000, Sam Lantinga wrote:
The text was updated successfully, but these errors were encountered: