MCPcopy Create free account
hub / github.com/defold/defold / InstallGamepadDriver

Function InstallGamepadDriver

engine/hid/src/native/hid_native.cpp:86–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 1

InitializeGamepadsFunction · 0.85

Calls 3

FullMethod · 0.45
OffsetCapacityMethod · 0.45
PushMethod · 0.45

Tested by

no test coverage detected