diff --git a/internal/gamepad/gamepad_nintendosdk.go b/internal/gamepad/gamepad_nintendosdk.go index a7cbfe106..c4f39de31 100644 --- a/internal/gamepad/gamepad_nintendosdk.go +++ b/internal/gamepad/gamepad_nintendosdk.go @@ -20,11 +20,6 @@ package gamepad // #cgo darwin LDFLAGS: -Wl,-undefined,dynamic_lookup // // #include "gamepad_nintendosdk.h" -// -// void ebitengine_UpdateGamepads(); -// int ebitengine_GetGamepadCount(); -// void ebitengine_GetGamepads(struct Gamepad* gamepads); -// void ebitengine_VibrateGamepad(int id, double durationInSeconds, double strongMagnitude, double weakMagnitude); import "C" import ( diff --git a/internal/gamepad/gamepad_nintendosdk.h b/internal/gamepad/gamepad_nintendosdk.h index 72bfa5d86..afbcdf82f 100644 --- a/internal/gamepad/gamepad_nintendosdk.h +++ b/internal/gamepad/gamepad_nintendosdk.h @@ -23,3 +23,17 @@ struct Gamepad { float button_values[32]; float axis_values[16]; }; + +#ifdef __cplusplus +extern "C" { +#endif + +void ebitengine_UpdateGamepads(); +int ebitengine_GetGamepadCount(); +void ebitengine_GetGamepads(struct Gamepad *gamepads); +void ebitengine_VibrateGamepad(int id, double durationInSeconds, + double strongMagnitude, double weakMagnitude); + +#ifdef __cplusplus +} // extern "C" +#endif