| 84 | } |
| 85 | |
| 86 | static void InstallGamepadDriver(HContext context, GamepadDriver* driver, const char* driver_name) |
| 87 | { |
| 88 | NativeContextUserData* user_data = (NativeContextUserData*) context->m_NativeContextUserData; |
| 89 | |
| 90 | if (!driver->m_Initialize(context, driver)) |
| 91 | { |
| 92 | dmLogError("Unable to initialize gamepad driver '%s'", driver_name); |
| 93 | return; |
| 94 | } |
| 95 | |
| 96 | if (user_data->m_GamepadDrivers.Full()) |
| 97 | { |
| 98 | user_data->m_GamepadDrivers.OffsetCapacity(1); |
| 99 | } |
| 100 | |
| 101 | user_data->m_GamepadDrivers.Push(driver); |
| 102 | |
| 103 | dmLogDebug("Installed gamepad driver '%s'", driver_name); |
| 104 | |
| 105 | driver->m_DetectDevices(context, driver); |
| 106 | } |
| 107 | |
| 108 | static void InitializeGamepads(HContext context) |
| 109 | { |
no test coverage detected