diff --git a/Raylib-cs/interop/Raylib.cs b/Raylib-cs/interop/Raylib.cs index d5321b3..b2909ef 100644 --- a/Raylib-cs/interop/Raylib.cs +++ b/Raylib-cs/interop/Raylib.cs @@ -686,6 +686,40 @@ public static unsafe partial class Raylib [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void OpenURL(sbyte* url); + // Automation events functionality + + /// Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern AutomationEventList LoadAutomationEventList(sbyte* fileName); + + /// Unload automation events list from file + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern void UnloadAutomationEventList(AutomationEventList list); + + /// Export automation events list as text file + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern CBool ExportAutomationEventList(AutomationEventList list, sbyte* fileName); + + /// Set automation event list to record to + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern void SetAutomationEventList(AutomationEventList* list); + + /// Set automation event internal base frame to start recording + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern void SetAutomationEventBaseFrame(int frame); + + /// Start recording automation events (AutomationEventList must be set) + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern void StartAutomationEventRecording(); + + /// Stop recording automation events + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern void StopAutomationEventRecording(); + + /// Play a recorded automation event + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern void PlayAutomationEvent(AutomationEvent ev); + //------------------------------------------------------------------------------------ // Input Handling Functions (Module: core) //------------------------------------------------------------------------------------ diff --git a/Raylib-cs/types/Raylib.Utils.cs b/Raylib-cs/types/Raylib.Utils.cs index 20cc062..de11c1d 100644 --- a/Raylib-cs/types/Raylib.Utils.cs +++ b/Raylib-cs/types/Raylib.Utils.cs @@ -1329,4 +1329,27 @@ public static unsafe partial class Raylib { return GetScreenToWorldRay(mousePosition, camera); } + + /// Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS + public static AutomationEventList LoadAutomationEventList(string fileName) + { + using var str1 = fileName.ToUtf8Buffer(); + return LoadAutomationEventList(str1.AsPointer()); + } + + /// Export automation events list as text file + public static CBool ExportAutomationEventList(AutomationEventList list, string fileName) + { + using var str1 = fileName.ToUtf8Buffer(); + return ExportAutomationEventList(list, str1.AsPointer()); + } + + /// Set automation event list to record to + public static void SetAutomationEventList(ref AutomationEventList list) + { + fixed (AutomationEventList* p = &list) + { + SetAutomationEventList(p); + } + } }