Merge pull request #59 from zsbzsb/feature/joystick_identification

Added support for joystick identification
This commit is contained in:
Laurent Gomila committed 2015-02-24 20:20:59 +01:00
commit a7ff14c407
4 files changed
+76

No files matched your search

+1
View File
@@ -11,6 +11,7 @@ set(SRC
${INCROOT}/Event.h
${SRCROOT}/Joystick.cpp
${INCROOT}/Joystick.h
${INCROOT}/JoystickIdentification.h
${SRCROOT}/Keyboard.cpp
${INCROOT}/Keyboard.h
${SRCROOT}/Mouse.cpp
+16
View File
@@ -64,6 +64,22 @@ float sfJoystick_getAxisPosition(unsigned int joystick, sfJoystickAxis axis)
return sf::Joystick::getAxisPosition(joystick, static_cast<sf::Joystick::Axis>(axis));
}
////////////////////////////////////////////////////////////
sfJoystickIdentification sfJoystick_getIdentification(unsigned int joystick)
{
static std::string name;
sf::Joystick::Identification identification = sf::Joystick::getIdentification(joystick);
name = identification.name;
sfJoystickIdentification result;
result.name = name.c_str();
result.productId = identification.productId;
result.vendorId = identification.vendorId;
return result;
}
////////////////////////////////////////////////////////////
void sfJoystick_update(void)