From 60fd5d9eaf29227b74967b944bbdf08ae46116e7 Mon Sep 17 00:00:00 2001 From: JupiterRider <60042618+JupiterRider@users.noreply.github.com> Date: Tue, 3 Dec 2024 21:52:01 +0100 Subject: [PATCH] AutomationEvent and AutomationEventList structs added --- Raylib-cs/types/Automation.cs | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Raylib-cs/types/Automation.cs diff --git a/Raylib-cs/types/Automation.cs b/Raylib-cs/types/Automation.cs new file mode 100644 index 0000000..21b7cd6 --- /dev/null +++ b/Raylib-cs/types/Automation.cs @@ -0,0 +1,35 @@ +using System; +using System.Runtime.InteropServices; + +namespace Raylib_cs; + +/// Automation event +[StructLayout(LayoutKind.Sequential)] +public unsafe struct AutomationEvent +{ + /// Event frame + public uint Frame; + + /// Event type (AutomationEventType) + public uint Type; + + /// Event parameters (if required) + public fixed int Params[4]; +} + +/// Automation event list +[StructLayout(LayoutKind.Sequential)] +public unsafe struct AutomationEventList +{ + /// Events max entries (MAX_AUTOMATION_EVENTS) + public uint Capacity; + + /// Events entries count + public uint Count; + + /// Events entries + public AutomationEvent* Events; + + /// + public ReadOnlySpan EventsAsSpan => new(Events, (int)Count); +}