Update RingRayLib - raylib.c - Add Function : bool IsGamepadAvailable(int gamepad)
@@ -1120,6 +1120,20 @@ RING_FUNC(ring_SetExitKey)
SetExitKey( (int ) RING_API_GETNUMBER(1));
}
+
+RING_FUNC(ring_IsGamepadAvailable)
+{
+ if ( RING_API_PARACOUNT != 1 ) {
+ RING_API_ERROR(RING_API_MISS1PARA);
+ return ;
+ }
+ if ( ! RING_API_ISNUMBER(1) ) {
+ RING_API_ERROR(RING_API_BADPARATYPE);
+ return ;
+ }
+ RING_API_RETNUMBER(IsGamepadAvailable( (int ) RING_API_GETNUMBER(1)));
+}
+
RING_API void ringlib_init(RingState *pRingState)
{
ring_vm_funcregister("initwindow",ring_InitWindow);
@@ -1206,4 +1220,5 @@ RING_API void ringlib_init(RingState *pRingState)
ring_vm_funcregister("iskeyup",ring_IsKeyUp);
ring_vm_funcregister("getkeypressed",ring_GetKeyPressed);
ring_vm_funcregister("setexitkey",ring_SetExitKey);
+ ring_vm_funcregister("isgamepadavailable",ring_IsGamepadAvailable);
}
