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

Function InitializeGamepads

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

Source from the content-addressed store, hash-verified

106 }
107
108 static void InitializeGamepads(HContext context)
109 {
110 memset(context->m_Gamepads, 0, sizeof(Gamepad) * MAX_GAMEPAD_COUNT);
111
112 for (uint32_t i = 0; i < MAX_GAMEPAD_COUNT; ++i)
113 {
114 context->m_Gamepads[i].m_Driver = DRIVER_HANDLE_FREE;
115 }
116
117#if defined(__APPLE__)
118 InstallGamepadDriver(context, CreateGamepadDriverApple(context), "Apple");
119#else
120 InstallGamepadDriver(context, CreateGamepadDriverGLFW(context), "GLFW");
121#endif
122 }
123
124 // Called from gamepad drivers
125 void SetGamepadConnectionStatus(HContext context, Gamepad* gamepad, bool connection_status)

Callers 1

InitFunction · 0.85

Calls 2

InstallGamepadDriverFunction · 0.85
CreateGamepadDriverGLFWFunction · 0.85

Tested by

no test coverage detected