Update RingRayLib - raylib.c - Add Function : void SetMaterialTexture(Material *material, int mapType, Texture2D texture)
@@ -5053,6 +5053,26 @@ RING_FUNC(ring_UnloadMaterial)
ring_state_free(((VM *) pPointer)->pRingState,RING_API_GETCPOINTER(1,"Material"));
}
+
+RING_FUNC(ring_SetMaterialTexture)
+{
+ if ( RING_API_PARACOUNT != 3 ) {
+ RING_API_ERROR(RING_API_MISS3PARA);
+ return ;
+ }
+ if ( ! RING_API_ISPOINTER(1) ) {
+ RING_API_ERROR(RING_API_BADPARATYPE);
+ return ;
+ }
+ if ( ! RING_API_ISNUMBER(2) ) {
+ RING_API_ERROR(RING_API_BADPARATYPE);
+ return ;
+ }
+ SetMaterialTexture((Material *) RING_API_GETCPOINTER(1,"Material"), (int ) RING_API_GETNUMBER(2),* (Texture2D *) RING_API_GETCPOINTER(3,"Texture2D"));
+ if (RING_API_ISCPOINTERNOTASSIGNED(3))
+ ring_state_free(((VM *) pPointer)->pRingState,RING_API_GETCPOINTER(3,"Texture2D"));
+}
+
RING_API void ringlib_init(RingState *pRingState)
{
ring_vm_funcregister("initwindow",ring_InitWindow);
@@ -5340,4 +5360,5 @@ RING_API void ringlib_init(RingState *pRingState)
ring_vm_funcregister("loadmaterials",ring_LoadMaterials);
ring_vm_funcregister("loadmaterialdefault",ring_LoadMaterialDefault);
ring_vm_funcregister("unloadmaterial",ring_UnloadMaterial);
+ ring_vm_funcregister("setmaterialtexture",ring_SetMaterialTexture);
}
