MCPcopy Create free account
hub / github.com/SFML/SFML / getCapabilitiesDInput

Method getCapabilitiesDInput

src/SFML/Window/Win32/JoystickImpl.cpp:841–862  ·  view source on GitHub ↗

///////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

839
840////////////////////////////////////////////////////////////
841JoystickCaps JoystickImpl::getCapabilitiesDInput() const
842{
843 JoystickCaps caps;
844
845 // Count how many buttons have valid offsets
846 caps.buttonCount = 0;
847
848 for (const int button : m_buttons)
849 {
850 if (button != -1)
851 ++caps.buttonCount;
852 }
853
854 // Check which axes have valid offsets
855 for (unsigned int i = 0; i < Joystick::AxisCount; ++i)
856 {
857 const auto axis = static_cast<Joystick::Axis>(i);
858 caps.axes[axis] = (m_axes[axis] != -1);
859 }
860
861 return caps;
862}
863
864
865////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected