SFML community forums
General => Feature requests => Topic started by: ExcessNeo on August 14, 2007, 05:49:53 am
-
A suggestion for a future release.
Support for a higher range of Buttons for those with more advanced joysticks
Support for a higher number of Axis for those with more advanced joysticks/joy pads with two analogue sticks
Keep up the good work :D
-
The current specs for the joysticks are limited by the Win32 implementation, but I think I can find a way to improve it.
I keep it for a future release ;)
-
In the win32 api, there is JOYINFOEX struct, which is an extension of the JOYINFO you have used
http://msdn2.microsoft.com/en-us/library/ms709358.aspx
with that you have 6 axes, 32buttons, and 15 joysticks (except for windows NT4, which only have 2)
-
maybe you could have look at OIS http://sourceforge.net/projects/wgois. This is an input library that supports Windows/Linux and if I'm not wrong also Mac.
Since it is also under the zlib/libpng license there should not be any problem to use or integrate it. Why write everything your self ;-). Especially since the support of joysticks is quite good there and in the next version it will even support the Wii mote.
I don't know what had made with his webpage but he had one with some small tutorials how to use it. But there is still an example in the source code.
-
I've downloaded OIS and had a look at the Win32 code : they are using DirectInput for all devices, which is quite bad as DirectInput is just a layer over Win32 ; DirectInput is even disadvised by Microsoft, except for Joysticks.
DirectInput is a set of API calls that abstracts input devices on the system. Internally, DirectInput creates a second thread to read WM_INPUT data, and using the DirectInput APIs will add more overhead than simply reading WM_INPUT directly. DirectInput is only useful for reading data from DirectInput joysticks; however, if you only need to support the Xbox 360 controller for Windows, then use XInput instead. Overall, using DirectInput offers no advantages when reading data from mouse or keyboard devices, and the use of DirectInput in these scenarios is discouraged.
http://msdn2.microsoft.com/en-us/library/bb206183.aspx
If I'd like to get more efficient inputs, I'd rather use more specific Win32 features, like raw inputs.
Concerning JOYINFOEX, I don't remember why I didn't use it ; I'll give it a try when I go back to the joysticks code.
-
I'm actually in the need of more analogs and buttons for my project :oops:
-
How is this part of sfml going?
-
I still didn't work on this part, sorry.
-
Hello, I'm new on this forum. Sorry if I unnecessarily bumped this thread.
This stuff is exactly the reason I joined this forum. Specifically, I'd like SFML to support more joystick axes. Joystick.hpp (http://www.sfml-dev.org/documentation/2.4.1/Joystick_8hpp_source.php) defines an enum sf::Joystick::Axis (http://www.sfml-dev.org/documentation/2.4.1/classsf_1_1Joystick.php#a48db337092c2e263774f94de6d50baa7) that has 8 defined values. I think it would make more sense to address the axes by integers. Some game controllers, such as modern PlayStation gamepads, have axes for accelerometer and every button. A couple of tens of axes.
The restriction on the number of axes in SFML is the only reason that comes to my mind why I could prefer using SDL rather than SFML in a C++ 3D game.