Update RingRayLib - raylib.c - Add Function : void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color)
@@ -2354,6 +2354,32 @@ RING_FUNC(ring_DrawTriangleFan)
ring_state_free(((VM *) pPointer)->pRingState,RING_API_GETCPOINTER(3,"Color"));
}
+
+RING_FUNC(ring_DrawPoly)
+{
+ if ( RING_API_PARACOUNT != 5 ) {
+ RING_API_ERROR(RING_API_BADPARACOUNT);
+ return ;
+ }
+ if ( ! RING_API_ISNUMBER(2) ) {
+ RING_API_ERROR(RING_API_BADPARATYPE);
+ return ;
+ }
+ if ( ! RING_API_ISNUMBER(3) ) {
+ RING_API_ERROR(RING_API_BADPARATYPE);
+ return ;
+ }
+ if ( ! RING_API_ISNUMBER(4) ) {
+ RING_API_ERROR(RING_API_BADPARATYPE);
+ return ;
+ }
+ DrawPoly(* (Vector2 *) RING_API_GETCPOINTER(1,"Vector2"), (int ) RING_API_GETNUMBER(2), (float ) RING_API_GETNUMBER(3), (float ) RING_API_GETNUMBER(4),* (Color *) RING_API_GETCPOINTER(5,"Color"));
+ if (RING_API_ISCPOINTERNOTASSIGNED(1))
+ ring_state_free(((VM *) pPointer)->pRingState,RING_API_GETCPOINTER(1,"Vector2"));
+ if (RING_API_ISCPOINTERNOTASSIGNED(5))
+ ring_state_free(((VM *) pPointer)->pRingState,RING_API_GETCPOINTER(5,"Color"));
+}
+
RING_API void ringlib_init(RingState *pRingState)
{
ring_vm_funcregister("initwindow",ring_InitWindow);
@@ -2508,4 +2534,5 @@ RING_API void ringlib_init(RingState *pRingState)
ring_vm_funcregister("drawtriangle",ring_DrawTriangle);
ring_vm_funcregister("drawtrianglelines",ring_DrawTriangleLines);
ring_vm_funcregister("drawtrianglefan",ring_DrawTriangleFan);
+ ring_vm_funcregister("drawpoly",ring_DrawPoly);
}
