internal/gamepad: refactoring

This commit is contained in:
Hajime Hoshi 2023-01-01 00:58:42 +09:00
parent 77f32bd088
commit 58692f6d85
2 changed files with 14 additions and 5 deletions

View File

@ -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 (

View File

@ -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