bool CJoystickInterfaceCocoa::ScanForJoysticks(JoystickVector& joysticks)
{
    CLockObject lock(m_deviceDiscoveryMutex);

    for (auto it = m_discoveredDevices.begin(); it != m_discoveredDevices.end(); ++it)
        joysticks.push_back(JoystickPtr(new CJoystickCocoa(*it, this)));

    return true;
}
bool CJoystickInterfaceXInput::ScanForJoysticks(JoystickVector& joysticks)
{
  XINPUT_STATE_EX controllerState; // No need to memset, only checking for controller existence

  for (unsigned int i = 0; i < MAX_JOYSTICKS; i++)
  {
    if (!CXInputDLL::Get().GetState(i, controllerState))
      continue;

    joysticks.push_back(JoystickPtr(new CJoystickXInput(i)));
  }

  return true;
}