Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start a cross platform library for controller input #884

Open
bvssvni opened this issue Apr 25, 2015 · 12 comments

Comments

@bvssvni
Copy link
Member

commented Apr 25, 2015

This idea was suggested on IRC. The argument is that the code in SDL2 doesn't look that bad, and since controllers might need feedback it won't work as window events.

@bvssvni bvssvni added the discussion label Apr 25, 2015

@bvssvni

This comment has been minimized.

Copy link
Member Author

commented May 4, 2015

Alternative is to write an abstraction.

@bvssvni

This comment has been minimized.

Copy link
Member Author

commented May 22, 2015

Another benefit with this approach is the possibility to make it work with multiple threads. This will decouple the input from the game loop and give better accuracy.

@bvssvni

This comment has been minimized.

Copy link
Member Author

commented May 22, 2015

UI widgets could use the mouse/keyboard events polled from the window, while gameplay could use an independent library.

@xaviershay

This comment has been minimized.

Copy link
Contributor

commented Sep 14, 2015

Is there an example of using gamepad input with the currently system (in a non-portable way)?

@bvssvni

This comment has been minimized.

Copy link
Member Author

commented Sep 14, 2015

@xaviershay I've done it with sdl2_window and sdl2. I opened PistonDevelopers/piston-examples#306

@xaviershay

This comment has been minimized.

@xaviershay

This comment has been minimized.

Copy link
Contributor

commented Sep 27, 2015

@bvssvni

This comment has been minimized.

Copy link
Member Author

commented Oct 2, 2015

@luser

This comment has been minimized.

Copy link

commented Mar 17, 2016

I'm possibly interested in working on this. I'm one of the authors of the W3C Gamepad API spec, and I wrote most of the Gamepad API implementation in Firefox. I've been learning Rust over the past several months and I was thinking about trying to contribute a Gamepad API implementation to Servo.

Trying to do something sensible with game controllers devolves into a giant headache, and it's different on every platform, but it's feasible.

@luser

This comment has been minimized.

Copy link

commented Mar 17, 2016

One thing that's bothering me right now about the code in Piston is the terminology--nobody calls game controllers "Joysticks" anymore. :) When I wrote the first prototype implementation of the Gamepad API I called it the "Joystick API" (too much time spent with DirectInput years ago, I guess) and I got a ton of pushback from people telling me that was silly, everyone uses gamepads nowadays.

@bvssvni

This comment has been minimized.

Copy link
Member Author

commented Mar 18, 2016

@luser Sure, go ahead! I opened #1047

@bvssvni

This comment has been minimized.

Copy link
Member Author

commented Sep 1, 2016

Some people already started on this. I opened #1113 to list external projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.