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

Method getCapabilities

src/SFML/Window/macOS/JoystickImpl.cpp:366–382  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

364
365////////////////////////////////////////////////////////////
366JoystickCaps JoystickImpl::getCapabilities() const
367{
368 const AutoreleasePool pool;
369 JoystickCaps caps;
370
371 // Buttons:
372 caps.buttonCount = static_cast<unsigned int>(m_buttons.size());
373
374 // Axis:
375 for (const auto& [axis, iohidElementRef] : m_axis)
376 caps.axes[axis] = true;
377
378 if (m_hat != nullptr)
379 caps.axes[Joystick::Axis::PovX] = caps.axes[Joystick::Axis::PovY] = true;
380
381 return caps;
382}
383
384
385////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected