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

Method getCapabilities

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

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

Source from the content-addressed store, hash-verified

304
305////////////////////////////////////////////////////////////
306JoystickCaps JoystickImpl::getCapabilities() const
307{
308 if (directInput)
309 return getCapabilitiesDInput();
310
311 JoystickCaps caps;
312
313 caps.buttonCount = std::min(m_caps.wNumButtons, Joystick::ButtonCount);
314
315 caps.axes[Joystick::Axis::X] = true;
316 caps.axes[Joystick::Axis::Y] = true;
317 caps.axes[Joystick::Axis::Z] = (m_caps.wCaps & JOYCAPS_HASZ) != 0;
318 caps.axes[Joystick::Axis::R] = (m_caps.wCaps & JOYCAPS_HASR) != 0;
319 caps.axes[Joystick::Axis::U] = (m_caps.wCaps & JOYCAPS_HASU) != 0;
320 caps.axes[Joystick::Axis::V] = (m_caps.wCaps & JOYCAPS_HASV) != 0;
321 caps.axes[Joystick::Axis::PovX] = (m_caps.wCaps & JOYCAPS_HASPOV) != 0;
322 caps.axes[Joystick::Axis::PovY] = (m_caps.wCaps & JOYCAPS_HASPOV) != 0;
323
324 return caps;
325}
326
327
328////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected