Update RingRayLib - raylib.c - Add Function : bool ChangeDirectory(const char *dir)
@@ -926,6 +926,20 @@ RING_FUNC(ring_ClearDirectoryFiles)
ClearDirectoryFiles();
}
+
+RING_FUNC(ring_ChangeDirectory)
+{
+ if ( RING_API_PARACOUNT != 1 ) {
+ RING_API_ERROR(RING_API_MISS1PARA);
+ return ;
+ }
+ if ( ! RING_API_ISSTRING(1) ) {
+ RING_API_ERROR(RING_API_BADPARATYPE);
+ return ;
+ }
+ RING_API_RETNUMBER(ChangeDirectory(RING_API_GETSTRING(1)));
+}
+
RING_API void ringlib_init(RingState *pRingState)
{
ring_vm_funcregister("initwindow",ring_InitWindow);
@@ -998,4 +1012,5 @@ RING_API void ringlib_init(RingState *pRingState)
ring_vm_funcregister("getworkingdirectory",ring_GetWorkingDirectory);
ring_vm_funcregister("getdirectoryfiles",ring_GetDirectoryFiles);
ring_vm_funcregister("cleardirectoryfiles",ring_ClearDirectoryFiles);
+ ring_vm_funcregister("changedirectory",ring_ChangeDirectory);
}
