Decompiled source of ResoniteImGuiLib v2.0.0

plugins/ResoniteImGuiLib/ResoniteImGuiLib.dll

Decompiled 2 months ago
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Numerics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Threading;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.NET.Common;
using BepInExResoniteShim;
using BepisResoniteWrapper;
using Elements.Core;
using FrooxEngine;
using ImGuiNET;
using ResoniteImGuiLib.SDL3;
using SDL3;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")]
[assembly: AssemblyCompany("art0007i")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyInformationalVersion("2.0.0+0d3fb60b4c820d4552e1a4d466d7f073b18356e7")]
[assembly: AssemblyProduct("ResoniteImGuiLib")]
[assembly: AssemblyTitle("ResoniteImGuiLib")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/art0007i/ResoniteImGuiLib")]
[assembly: SecurityPermission(8, SkipVerification = true)]
[assembly: AssemblyVersion("2.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace ResoniteImGuiLib
{
	public class ImGuiInstance
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static ThreadStart <>9__17_0;

			internal void <TryStartSDL3Thread>b__17_0()
			{
				RunSDL3();
			}
		}

		[CompilerGenerated]
		private Action? m_Layout;

		private string _name;

		private ConfigEntry<int4> _entry;

		private static Thread? _sdl3Thread;

		private static Dictionary<string, ImGuiInstance> GuiInstances = new Dictionary<string, ImGuiInstance>();

		internal static ConcurrentQueue<ImGuiInstance> newInstances = new ConcurrentQueue<ImGuiInstance>();

		internal static ConcurrentQueue<ValueTuple<string, Action<SDL3Window>>> windowRequests = new ConcurrentQueue<ValueTuple<string, Action<SDL3Window>>>();

		private static Dictionary<string, SDL3Window> windows = new Dictionary<string, SDL3Window>();

		private static Dictionary<uint, SDL3Window> windowsById = new Dictionary<uint, SDL3Window>();

		public string Name => _name;

		private static bool IsSDL3Running
		{
			get
			{
				Thread sdl3Thread = _sdl3Thread;
				if (sdl3Thread != null)
				{
					return sdl3Thread.IsAlive;
				}
				return false;
			}
		}

		public event Action Layout
		{
			[CompilerGenerated]
			add
			{
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: Expected O, but got Unknown
				Action val = this.m_Layout;
				Action val2;
				do
				{
					val2 = val;
					Action val3 = (Action)global::System.Delegate.Combine((global::System.Delegate)(object)val2, (global::System.Delegate)(object)value);
					val = Interlocked.CompareExchange<Action>(ref this.m_Layout, val3, val2);
				}
				while (val != val2);
			}
			[CompilerGenerated]
			remove
			{
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: Expected O, but got Unknown
				Action val = this.m_Layout;
				Action val2;
				do
				{
					val2 = val;
					Action val3 = (Action)global::System.Delegate.Remove((global::System.Delegate)(object)val2, (global::System.Delegate)(object)value);
					val = Interlocked.CompareExchange<Action>(ref this.m_Layout, val3, val2);
				}
				while (val != val2);
			}
		}

		private ImGuiInstance(string name)
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			_name = name;
			_entry = Plugin.Config.Bind<int4>("Windows", "Rect_" + Name, new int4(200, 200, 400, 300), (ConfigDescription)null);
		}

		public void GetImGui(Action<SDL3Window> callback)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			windowRequests.Enqueue(new ValueTuple<string, Action<SDL3Window>>(Name, callback));
		}

		public static ImGuiInstance GetOrCreate(ImGuiReady onReady)
		{
			return GetOrCreate("global", onReady);
		}

		public static ImGuiInstance GetOrCreate(string name = "global", ImGuiReady? onReady = null)
		{
			ImGuiReady onReady2 = onReady;
			ImGuiInstance imGuiInstance = default(ImGuiInstance);
			if (GuiInstances.TryGetValue(name, ref imGuiInstance))
			{
				if (onReady2 != null)
				{
					imGuiInstance.GetImGui(delegate(SDL3Window gui)
					{
						onReady2(gui, isNewInstance: false);
					});
				}
				return imGuiInstance;
			}
			imGuiInstance = new ImGuiInstance(name);
			GuiInstances.Add(name, imGuiInstance);
			if (onReady2 != null)
			{
				imGuiInstance.GetImGui(delegate(SDL3Window gui)
				{
					onReady2(gui, isNewInstance: true);
				});
			}
			newInstances.Enqueue(imGuiInstance);
			TryStartSDL3Thread();
			return imGuiInstance;
		}

		private static void TryStartSDL3Thread()
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Expected O, but got Unknown
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			if (IsSDL3Running)
			{
				return;
			}
			object obj = <>c.<>9__17_0;
			if (obj == null)
			{
				ThreadStart val = delegate
				{
					RunSDL3();
				};
				<>c.<>9__17_0 = val;
				obj = (object)val;
			}
			_sdl3Thread = new Thread((ThreadStart)obj)
			{
				Name = "Resonite ImGui SDL3",
				Priority = (ThreadPriority)4,
				IsBackground = false
			};
			_sdl3Thread.Start();
		}

		private static void RunSDL3()
		{
			//IL_0220: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: Expected O, but got Unknown
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Expected O, but got Unknown
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			bool flag = default(bool);
			try
			{
				ImGuiInstance request = default(ImGuiInstance);
				ValueTuple<string, Action<SDL3Window>> val2 = default(ValueTuple<string, Action<SDL3Window>>);
				SDL3Window sDL3Window2 = default(SDL3Window);
				Event val3 = default(Event);
				SDL3Window sDL3Window3 = default(SDL3Window);
				string text = default(string);
				SDL3Window sDL3Window4 = default(SDL3Window);
				while (true)
				{
					if (newInstances.TryDequeue(ref request))
					{
						SDL3Window sDL3Window = new SDL3Window("ImGuiContext: " + request.Name, request._entry.Value.x, request._entry.Value.y, request._entry.Value.z, request._entry.Value.w);
						sDL3Window.WindowRectModified += delegate(int4 rect)
						{
							//IL_000b: Unknown result type (might be due to invalid IL or missing references)
							request._entry.Value = rect;
						};
						sDL3Window.RenderCallback = request.Layout;
						windows[request.Name] = sDL3Window;
						uint windowID = SDL.GetWindowID((global::System.IntPtr)sDL3Window.Window);
						if (!windowsById.TryAdd(windowID, sDL3Window))
						{
							ManualLogSource log = Plugin.Log;
							BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(37, 2, ref flag);
							if (flag)
							{
								((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Failed to add window with id ");
								((BepInExLogInterpolatedStringHandler)val).AppendFormatted<uint>((uint)sDL3Window.Window);
								((BepInExLogInterpolatedStringHandler)val).AppendLiteral(", name ");
								((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(request.Name);
								((BepInExLogInterpolatedStringHandler)val).AppendLiteral("!");
							}
							log.LogError(val);
						}
						continue;
					}
					for (int i = 0; i < windowRequests.Count; i++)
					{
						if (windowRequests.TryDequeue(ref val2))
						{
							if (windows.TryGetValue(val2.Item1, ref sDL3Window2))
							{
								val2.Item2?.Invoke(sDL3Window2);
							}
							else
							{
								windowRequests.Enqueue(val2);
							}
						}
					}
					while (SDL.PollEvent(ref val3))
					{
						if (windowsById.TryGetValue(val3.Window.WindowID, ref sDL3Window3))
						{
							sDL3Window3.EventQueue.Enqueue(val3);
						}
					}
					Enumerator<string, SDL3Window> enumerator = windows.GetEnumerator();
					try
					{
						while (enumerator.MoveNext())
						{
							enumerator.Current.Deconstruct(ref text, ref sDL3Window4);
							sDL3Window4.RunOneFrame();
						}
					}
					finally
					{
						((global::System.IDisposable)enumerator).Dispose();
					}
				}
			}
			catch (global::System.Exception ex)
			{
				ManualLogSource log2 = Plugin.Log;
				BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(21, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SDL3 Thread crashed: ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<global::System.Exception>(ex);
				}
				log2.LogError(val);
			}
			Thread? sdl3Thread = _sdl3Thread;
			if (sdl3Thread != null)
			{
				sdl3Thread.Interrupt();
			}
			_sdl3Thread = null;
		}
	}
	public delegate void ImGuiReady(SDL3Window imGui, bool isNewInstance);
	public static class ImGuiLib
	{
		public static ImGuiInstance GetOrCreateInstance(ImGuiReady onReady)
		{
			return GetOrCreateInstance("global", onReady);
		}

		public static ImGuiInstance GetOrCreateInstance(string name = "global", ImGuiReady? onReady = null)
		{
			return ImGuiInstance.GetOrCreate(name, onReady);
		}
	}
	[ResonitePlugin("art0007i.ResoniteImGuiLib", "ResoniteImGuiLib", "2.0.0", "art0007i", "https://github.com/art0007i/ResoniteImGuiLib")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BasePlugin
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static Action <>9__4_1;

			public static Action<string> <>9__4_2;

			public static Action <>9__4_0;

			internal void <Load>b__4_0()
			{
				//IL_0019: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0024: Expected O, but got Unknown
				Engine current = Engine.Current;
				object obj = <>9__4_1;
				if (obj == null)
				{
					Action val = delegate
					{
						CancellationToken.Cancel();
					};
					<>9__4_1 = val;
					obj = (object)val;
				}
				current.OnShutdown += (Action)obj;
				Engine.Current.OnShutdownRequest += delegate
				{
					CancellationToken.Cancel();
				};
			}

			internal void <Load>b__4_1()
			{
				CancellationToken.Cancel();
			}

			internal void <Load>b__4_2(string _)
			{
				CancellationToken.Cancel();
			}
		}

		internal static ManualLogSource Log;

		internal static ConfigFile Config;

		internal static ConfigEntry<color> DefaultBackgroundColor;

		public static readonly CancellationTokenSource CancellationToken = new CancellationTokenSource();

		public override void Load()
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			Log = ((BasePlugin)this).Log;
			Config = ((BasePlugin)this).Config;
			DefaultBackgroundColor = Config.Bind<color>("General", "DefaultBackgroundColor", new color(0.45f, 0.55f, 0.6f, 1f), "Default background color that new ImGui windows will have.");
			object obj = <>c.<>9__4_0;
			if (obj == null)
			{
				Action val = delegate
				{
					//IL_0019: Unknown result type (might be due to invalid IL or missing references)
					//IL_001e: Unknown result type (might be due to invalid IL or missing references)
					//IL_0024: Expected O, but got Unknown
					Engine current = Engine.Current;
					object obj2 = <>c.<>9__4_1;
					if (obj2 == null)
					{
						Action val2 = delegate
						{
							CancellationToken.Cancel();
						};
						<>c.<>9__4_1 = val2;
						obj2 = (object)val2;
					}
					current.OnShutdown += (Action)obj2;
					Engine.Current.OnShutdownRequest += delegate
					{
						CancellationToken.Cancel();
					};
				};
				<>c.<>9__4_0 = val;
				obj = (object)val;
			}
			ResoniteHooks.OnEngineReady += (Action)obj;
		}
	}
	public static class PluginMetadata
	{
		public const string GUID = "art0007i.ResoniteImGuiLib";

		public const string NAME = "ResoniteImGuiLib";

		public const string VERSION = "2.0.0";

		public const string AUTHORS = "art0007i";

		public const string REPOSITORY_URL = "https://github.com/art0007i/ResoniteImGuiLib";
	}
}
namespace ResoniteImGuiLib.SDL3
{
	public class ImGuiSDL3 : global::System.IDisposable
	{
		public readonly nint Window;

		public readonly nint Renderer;

		public readonly uint WindowId;

		private uint _mouseWindowId;

		private int _mousePendingLeaveFrame;

		private nint[] _mouseCursors = new nint[9];

		private nint _mouseLastCursor = -1;

		private int _mouseButtonsDown;

		public ImGuiSDL3(nint window, nint renderer)
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			ImGuiIOPtr iO = ImGui.GetIO();
			ref ImGuiBackendFlags backendFlags = ref ((ImGuiIOPtr)(ref iO)).BackendFlags;
			backendFlags = (ImGuiBackendFlags)((uint)backendFlags | 2u);
			ref ImGuiBackendFlags backendFlags2 = ref ((ImGuiIOPtr)(ref iO)).BackendFlags;
			backendFlags2 = (ImGuiBackendFlags)((uint)backendFlags2 | 4u);
			Window = window;
			WindowId = SDL.GetWindowID((global::System.IntPtr)Window);
			Renderer = renderer;
			_mouseCursors[0] = SDL.CreateSystemCursor((SystemCursor)0);
			_mouseCursors[1] = SDL.CreateSystemCursor((SystemCursor)1);
			_mouseCursors[2] = SDL.CreateSystemCursor((SystemCursor)9);
			_mouseCursors[3] = SDL.CreateSystemCursor((SystemCursor)8);
			_mouseCursors[4] = SDL.CreateSystemCursor((SystemCursor)7);
			_mouseCursors[5] = SDL.CreateSystemCursor((SystemCursor)6);
			_mouseCursors[6] = SDL.CreateSystemCursor((SystemCursor)5);
			_mouseCursors[7] = SDL.CreateSystemCursor((SystemCursor)11);
			_mouseCursors[8] = SDL.CreateSystemCursor((SystemCursor)10);
			SetupPlatformHandles(ImGui.GetMainViewport(), window);
		}

		public void Dispose()
		{
			nint[] mouseCursors = _mouseCursors;
			for (int i = 0; i < mouseCursors.Length; i++)
			{
				SDL.DestroyCursor((global::System.IntPtr)mouseCursors[i]);
			}
		}

		public void NewFrame()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			ImGuiIOPtr iO = ImGui.GetIO();
			int num = default(int);
			int num2 = default(int);
			SDL.GetWindowSize((global::System.IntPtr)Window, ref num, ref num2);
			if (((global::System.Enum)SDL.GetWindowFlags((global::System.IntPtr)Window)).HasFlag((global::System.Enum)(object)(WindowFlags)64))
			{
				num = (num2 = 0);
			}
			int num3 = default(int);
			int num4 = default(int);
			SDL.GetWindowSizeInPixels((global::System.IntPtr)Window, ref num3, ref num4);
			((ImGuiIOPtr)(ref iO)).DisplaySize = new Vector2((float)num, (float)num2);
			if (num > 0 && num2 > 0)
			{
				((ImGuiIOPtr)(ref iO)).DisplayFramebufferScale = new Vector2((float)num3 / (float)num, (float)num4 / (float)num2);
			}
			if (_mousePendingLeaveFrame > 0 && _mousePendingLeaveFrame >= ImGui.GetFrameCount())
			{
				_mouseWindowId = 0u;
				_mousePendingLeaveFrame = 0;
				((ImGuiIOPtr)(ref iO)).AddMousePosEvent(-3.4028235E+38f, -3.4028235E+38f);
			}
			UpdateMouseData();
			UpdateMouseCursor();
		}

		public unsafe bool ProcessEvent(Event e)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Invalid comparison between Unknown and I4
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Invalid comparison between Unknown and I4
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Expected I4, but got Unknown
			//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Expected I4, but got Unknown
			//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_031c: Unknown result type (might be due to invalid IL or missing references)
			//IL_031d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Invalid comparison between Unknown and I4
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			//IL_0216: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_033b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Unknown result type (might be due to invalid IL or missing references)
			//IL_0229: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0245: Unknown result type (might be due to invalid IL or missing references)
			//IL_0246: Unknown result type (might be due to invalid IL or missing references)
			//IL_024b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0256: Unknown result type (might be due to invalid IL or missing references)
			//IL_0257: Unknown result type (might be due to invalid IL or missing references)
			//IL_025c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0261: Unknown result type (might be due to invalid IL or missing references)
			//IL_0262: Unknown result type (might be due to invalid IL or missing references)
			//IL_0267: Unknown result type (might be due to invalid IL or missing references)
			//IL_026c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0271: Unknown result type (might be due to invalid IL or missing references)
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			//IL_0284: Unknown result type (might be due to invalid IL or missing references)
			//IL_028f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0291: Unknown result type (might be due to invalid IL or missing references)
			//IL_0292: Unknown result type (might be due to invalid IL or missing references)
			//IL_0297: Unknown result type (might be due to invalid IL or missing references)
			//IL_029c: Unknown result type (might be due to invalid IL or missing references)
			//IL_029d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b7: Expected I4, but got Unknown
			//IL_02b7: Expected I4, but got Unknown
			//IL_02b7: Expected I4, but got Unknown
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			ImGuiIOPtr iO = ImGui.GetIO();
			EventType val = (EventType)e.Type;
			if ((int)val <= 769)
			{
				switch (val - 524)
				{
				case 0:
					if (!GetViewportForWindowId(e.Window.WindowID).HasValue)
					{
						return false;
					}
					_mouseWindowId = e.Window.WindowID;
					_mousePendingLeaveFrame = 0;
					return true;
				case 1:
					if (!GetViewportForWindowId(e.Window.WindowID).HasValue)
					{
						return false;
					}
					_mousePendingLeaveFrame = ImGui.GetFrameCount() + 1;
					return true;
				case 2:
				case 3:
					if (!GetViewportForWindowId(e.Window.WindowID).HasValue)
					{
						return false;
					}
					((ImGuiIOPtr)(ref iO)).AddFocusEvent(e.Type == 526);
					return true;
				}
				if (val - 768 <= 1)
				{
					if (!GetViewportForWindowId(e.Key.WindowID).HasValue)
					{
						return false;
					}
					UpdateKeyModifiers(e.Key.Mod);
					ImGuiKey val2 = KeyEventToImGui(e.Key.Key, e.Key.Scancode);
					bool flag = e.Type == 768;
					((ImGuiIOPtr)(ref iO)).AddKeyEvent(val2, flag);
					((ImGuiIOPtr)(ref iO)).SetKeyEventNativeData(val2, (int)e.Key.Key, (int)e.Key.Scancode, (int)e.Key.Scancode);
					return true;
				}
			}
			else
			{
				if ((int)val == 771)
				{
					if (!GetViewportForWindowId(e.Text.WindowID).HasValue)
					{
						return false;
					}
					ImGuiNative.ImGuiIO_AddInputCharactersUTF8(ImGuiIOPtr.op_Implicit(iO), (byte*)e.Text.Text);
					return true;
				}
				switch (val - 1024)
				{
				case 0:
					if (!GetViewportForWindowId(e.Motion.WindowID).HasValue)
					{
						return false;
					}
					((ImGuiIOPtr)(ref iO)).AddMouseSourceEvent((ImGuiMouseSource)(e.Motion.Which == 4294967295u));
					((ImGuiIOPtr)(ref iO)).AddMousePosEvent(e.Motion.X, e.Motion.Y);
					return true;
				case 3:
				{
					if (!GetViewportForWindowId(e.Wheel.WindowID).HasValue)
					{
						return false;
					}
					float num2 = 0f - e.Wheel.X;
					float y = e.Wheel.Y;
					((ImGuiIOPtr)(ref iO)).AddMouseSourceEvent((ImGuiMouseSource)(e.Wheel.Which == 4294967295u));
					((ImGuiIOPtr)(ref iO)).AddMouseWheelEvent(num2, y);
					return true;
				}
				case 1:
				case 2:
				{
					if (!GetViewportForWindowId(e.Button.WindowID).HasValue)
					{
						return false;
					}
					int num = e.Button.Button switch
					{
						1 => 0, 
						3 => 1, 
						2 => 2, 
						4 => 3, 
						5 => 4, 
						_ => -1, 
					};
					if (num != -1)
					{
						((ImGuiIOPtr)(ref iO)).AddMouseSourceEvent((ImGuiMouseSource)(e.Button.Which == 4294967295u));
						((ImGuiIOPtr)(ref iO)).AddMouseButtonEvent(num, e.Type == 1025);
						_mouseButtonsDown = ((e.Type == 1025) ? (_mouseButtonsDown | (1 << num)) : (_mouseButtonsDown & ~(1 << num)));
						return true;
					}
					break;
				}
				}
			}
			return false;
		}

		private void UpdateMouseData()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			ImGuiIOPtr iO = ImGui.GetIO();
			if (SDL.GetKeyboardFocus() == (global::System.IntPtr)Window && ((ImGuiIOPtr)(ref iO)).WantSetMousePos)
			{
				SDL.WarpMouseInWindow((global::System.IntPtr)Window, (float)(int)((ImGuiIOPtr)(ref iO)).MousePos.X, (float)(int)((ImGuiIOPtr)(ref iO)).MousePos.Y);
			}
		}

		private void UpdateMouseCursor()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Invalid comparison between Unknown and I4
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			ImGuiIOPtr iO = ImGui.GetIO();
			if (((uint)((ImGuiIOPtr)(ref iO)).ConfigFlags & 0x20u) != 0)
			{
				return;
			}
			ImGuiMouseCursor mouseCursor = ImGui.GetMouseCursor();
			if (((ImGuiIOPtr)(ref iO)).MouseDrawCursor || (int)mouseCursor == -1)
			{
				SDL.HideCursor();
				return;
			}
			nint num = _mouseCursors[mouseCursor];
			if (_mouseLastCursor != num)
			{
				SDL.SetCursor((global::System.IntPtr)num);
				_mouseLastCursor = num;
			}
			SDL.ShowCursor();
		}

		private ImGuiKey KeyEventToImGui(Keycode keycoade, Scancode scancode)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Expected I4, but got Unknown
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Invalid comparison between Unknown and I4
			//IL_0278: Unknown result type (might be due to invalid IL or missing references)
			//IL_027e: Invalid comparison between Unknown and I4
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Invalid comparison between Unknown and I4
			//IL_0388: Unknown result type (might be due to invalid IL or missing references)
			//IL_038e: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b4: Expected I4, but got Unknown
			//IL_0283: Unknown result type (might be due to invalid IL or missing references)
			//IL_0286: Invalid comparison between Unknown and I4
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Invalid comparison between Unknown and I4
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Invalid comparison between Unknown and I4
			//IL_03b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ba: Invalid comparison between Unknown and I4
			//IL_028b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0291: Unknown result type (might be due to invalid IL or missing references)
			//IL_0383: Expected I4, but got Unknown
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0273: Expected I4, but got Unknown
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Invalid comparison between Unknown and I4
			//IL_03bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c5: Invalid comparison between Unknown and I4
			switch (scancode - 84)
			{
			case 14:
				return (ImGuiKey)612;
			case 5:
				return (ImGuiKey)613;
			case 6:
				return (ImGuiKey)614;
			case 7:
				return (ImGuiKey)615;
			case 8:
				return (ImGuiKey)616;
			case 9:
				return (ImGuiKey)617;
			case 10:
				return (ImGuiKey)618;
			case 11:
				return (ImGuiKey)619;
			case 12:
				return (ImGuiKey)620;
			case 13:
				return (ImGuiKey)621;
			case 15:
				return (ImGuiKey)622;
			case 0:
				return (ImGuiKey)623;
			case 1:
				return (ImGuiKey)624;
			case 2:
				return (ImGuiKey)625;
			case 3:
				return (ImGuiKey)626;
			case 4:
				return (ImGuiKey)627;
			case 19:
				return (ImGuiKey)628;
			default:
				if ((int)keycoade <= 122)
				{
					if ((int)keycoade <= 9)
					{
						if ((int)keycoade == 8)
						{
							return (ImGuiKey)523;
						}
						if ((int)keycoade == 9)
						{
							return (ImGuiKey)512;
						}
					}
					else
					{
						if ((int)keycoade == 13)
						{
							return (ImGuiKey)525;
						}
						switch (keycoade - 27)
						{
						case 5:
							return (ImGuiKey)524;
						case 0:
							return (ImGuiKey)526;
						case 12:
							return (ImGuiKey)596;
						case 17:
							return (ImGuiKey)597;
						case 18:
							return (ImGuiKey)598;
						case 19:
							return (ImGuiKey)599;
						case 20:
							return (ImGuiKey)600;
						case 32:
							return (ImGuiKey)601;
						case 34:
							return (ImGuiKey)602;
						case 64:
							return (ImGuiKey)603;
						case 65:
							return (ImGuiKey)604;
						case 66:
							return (ImGuiKey)605;
						case 69:
							return (ImGuiKey)606;
						case 21:
							return (ImGuiKey)536;
						case 22:
							return (ImGuiKey)537;
						case 23:
							return (ImGuiKey)538;
						case 24:
							return (ImGuiKey)539;
						case 25:
							return (ImGuiKey)540;
						case 26:
							return (ImGuiKey)541;
						case 27:
							return (ImGuiKey)542;
						case 28:
							return (ImGuiKey)543;
						case 29:
							return (ImGuiKey)544;
						case 30:
							return (ImGuiKey)545;
						case 70:
							return (ImGuiKey)546;
						case 71:
							return (ImGuiKey)547;
						case 72:
							return (ImGuiKey)548;
						case 73:
							return (ImGuiKey)549;
						case 74:
							return (ImGuiKey)550;
						case 75:
							return (ImGuiKey)551;
						case 76:
							return (ImGuiKey)552;
						case 77:
							return (ImGuiKey)553;
						case 78:
							return (ImGuiKey)554;
						case 79:
							return (ImGuiKey)555;
						case 80:
							return (ImGuiKey)556;
						case 81:
							return (ImGuiKey)557;
						case 82:
							return (ImGuiKey)558;
						case 83:
							return (ImGuiKey)559;
						case 84:
							return (ImGuiKey)560;
						case 85:
							return (ImGuiKey)561;
						case 86:
							return (ImGuiKey)562;
						case 87:
							return (ImGuiKey)563;
						case 88:
							return (ImGuiKey)564;
						case 89:
							return (ImGuiKey)565;
						case 90:
							return (ImGuiKey)566;
						case 91:
							return (ImGuiKey)567;
						case 92:
							return (ImGuiKey)568;
						case 93:
							return (ImGuiKey)569;
						case 94:
							return (ImGuiKey)570;
						case 95:
							return (ImGuiKey)571;
						}
					}
				}
				else if ((int)keycoade <= 1073741939)
				{
					if ((int)keycoade == 127)
					{
						return (ImGuiKey)522;
					}
					switch (keycoade - 1073741881)
					{
					case 23:
						return (ImGuiKey)513;
					case 22:
						return (ImGuiKey)514;
					case 25:
						return (ImGuiKey)515;
					case 24:
						return (ImGuiKey)516;
					case 18:
						return (ImGuiKey)517;
					case 21:
						return (ImGuiKey)518;
					case 17:
						return (ImGuiKey)519;
					case 20:
						return (ImGuiKey)520;
					case 16:
						return (ImGuiKey)521;
					case 0:
						return (ImGuiKey)607;
					case 14:
						return (ImGuiKey)608;
					case 26:
						return (ImGuiKey)609;
					case 13:
						return (ImGuiKey)610;
					case 15:
						return (ImGuiKey)611;
					case 44:
						return (ImGuiKey)535;
					case 1:
						return (ImGuiKey)572;
					case 2:
						return (ImGuiKey)573;
					case 3:
						return (ImGuiKey)574;
					case 4:
						return (ImGuiKey)575;
					case 5:
						return (ImGuiKey)576;
					case 6:
						return (ImGuiKey)577;
					case 7:
						return (ImGuiKey)578;
					case 8:
						return (ImGuiKey)579;
					case 9:
						return (ImGuiKey)580;
					case 10:
						return (ImGuiKey)581;
					case 11:
						return (ImGuiKey)582;
					case 12:
						return (ImGuiKey)583;
					case 47:
						return (ImGuiKey)584;
					case 48:
						return (ImGuiKey)585;
					case 49:
						return (ImGuiKey)586;
					case 50:
						return (ImGuiKey)587;
					case 51:
						return (ImGuiKey)588;
					case 52:
						return (ImGuiKey)589;
					case 53:
						return (ImGuiKey)590;
					case 54:
						return (ImGuiKey)591;
					case 55:
						return (ImGuiKey)592;
					case 56:
						return (ImGuiKey)593;
					case 57:
						return (ImGuiKey)594;
					case 58:
						return (ImGuiKey)595;
					}
				}
				else
				{
					switch (keycoade - 1073742048)
					{
					case 0:
						return (ImGuiKey)527;
					case 1:
						return (ImGuiKey)528;
					case 2:
						return (ImGuiKey)529;
					case 3:
						return (ImGuiKey)530;
					case 4:
						return (ImGuiKey)531;
					case 5:
						return (ImGuiKey)532;
					case 6:
						return (ImGuiKey)533;
					case 7:
						return (ImGuiKey)534;
					}
					if ((int)keycoade == 1073742106)
					{
						return (ImGuiKey)629;
					}
					if ((int)keycoade == 1073742107)
					{
						return (ImGuiKey)630;
					}
				}
				return (ImGuiKey)0;
			}
		}

		public static nint Data()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			ImGuiIOPtr iO = ImGui.GetIO();
			return ((ImGuiIOPtr)(ref iO)).BackendPlatformUserData;
		}

		private static void UpdateKeyModifiers(Keymod mod)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Invalid comparison between Unknown and I4
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Invalid comparison between Unknown and I4
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Invalid comparison between Unknown and I4
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Invalid comparison between Unknown and I4
			ImGuiIOPtr iO = ImGui.GetIO();
			((ImGuiIOPtr)(ref iO)).AddKeyEvent((ImGuiKey)4096, (mod & 0xC0) > 0);
			((ImGuiIOPtr)(ref iO)).AddKeyEvent((ImGuiKey)8192, (mod & 3) > 0);
			((ImGuiIOPtr)(ref iO)).AddKeyEvent((ImGuiKey)16384, (mod & 0x300) > 0);
			((ImGuiIOPtr)(ref iO)).AddKeyEvent((ImGuiKey)32768, (mod & 0xC00) > 0);
		}

		public unsafe static ImGuiViewportPtr? GetViewportForWindowId(uint id)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			ImGuiViewportPtr mainViewport = ImGui.GetMainViewport();
			return (((ImGuiViewportPtr)(ref mainViewport)).ID == id) ? ImGui.GetMainViewport() : ImGuiViewportPtr.op_Implicit((ImGuiViewport*)null);
		}

		private static void SetupPlatformHandles(ImGuiViewportPtr viewport, nint window)
		{
			((ImGuiViewportPtr)(ref viewport)).PlatformHandle = window;
			((ImGuiViewportPtr)(ref viewport)).PlatformHandleRaw = (global::System.IntPtr)0;
		}
	}
	public class ImGuiSDL3Renderer : global::System.IDisposable
	{
		private struct BackupSDLRendererState
		{
			public Rect Viewport;

			public bool ViewportEnabled;

			public bool ClipEnabled;

			public Rect ClipRect;
		}

		public Rect DefaultClipRect;

		public readonly nint Renderer;

		private nint _fontTexture = global::System.IntPtr.Zero;

		public ImGuiSDL3Renderer(nint renderer)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			Renderer = renderer;
			ImGuiIOPtr iO = ImGui.GetIO();
			ref ImGuiBackendFlags backendFlags = ref ((ImGuiIOPtr)(ref iO)).BackendFlags;
			backendFlags = (ImGuiBackendFlags)((uint)backendFlags | 8u);
		}

		public void Dispose()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			ImGuiIOPtr iO = ImGui.GetIO();
			if (_fontTexture != (nint)global::System.IntPtr.Zero)
			{
				ImFontAtlasPtr fonts = ((ImGuiIOPtr)(ref iO)).Fonts;
				((ImFontAtlasPtr)(ref fonts)).SetTexID(global::System.IntPtr.Zero);
				SDL.DestroyTexture((global::System.IntPtr)_fontTexture);
				_fontTexture = global::System.IntPtr.Zero;
			}
		}

		public void NewFrame()
		{
			if (_fontTexture == (nint)global::System.IntPtr.Zero)
			{
				CreateDeviceObjects();
			}
		}

		public unsafe void RenderDrawData(ImDrawDataPtr drawData)
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			if (((ImDrawDataPtr)(ref drawData)).NativePtr == null || ((ImDrawDataPtr)(ref drawData)).CmdListsCount == 0)
			{
				return;
			}
			Vector2 val = default(Vector2);
			((Vector2)(ref val))..ctor(((ImDrawDataPtr)(ref drawData)).FramebufferScale.X, ((ImDrawDataPtr)(ref drawData)).FramebufferScale.Y);
			int num = (int)(((ImDrawDataPtr)(ref drawData)).DisplaySize.X * val.X);
			int num2 = (int)(((ImDrawDataPtr)(ref drawData)).DisplaySize.Y * val.Y);
			if (num <= 0 || num2 <= 0)
			{
				return;
			}
			BackupSDLRendererState state = BackupRendererState();
			SetupRenderState();
			ImGuiPlatformIOPtr platformIO = ImGui.GetPlatformIO();
			((ImGuiPlatformIOPtr)(ref platformIO)).Renderer_RenderState = Renderer;
			Vector2 displayPos = ((ImDrawDataPtr)(ref drawData)).DisplayPos;
			for (int i = 0; i < ((ImDrawDataPtr)(ref drawData)).CmdListsCount; i++)
			{
				ImDrawListPtr drawList = ((ImDrawDataPtr)(ref drawData)).CmdLists[i];
				for (int j = 0; j < ((ImDrawListPtr)(ref drawList)).CmdBuffer.Size; j++)
				{
					ImDrawCmdPtr cmd = ((ImDrawListPtr)(ref drawList)).CmdBuffer[j];
					if (((ImDrawCmdPtr)(ref cmd)).UserCallback == global::System.IntPtr.Zero)
					{
						Vector4 clipRect = ((ImDrawCmdPtr)(ref cmd)).ClipRect;
						Rect val2 = CalculateClipRect(clipRect, displayPos, val, num, num2);
						SDL.SetRenderClipRect((global::System.IntPtr)Renderer, ref val2);
						nint texID = ((ImDrawCmdPtr)(ref cmd)).GetTexID();
						if (!RenderDrawCommand(drawList, cmd, texID, val))
						{
							Console.WriteLine("Failed to render ImGui draw command: " + SDL.GetError());
						}
					}
				}
			}
			((ImGuiPlatformIOPtr)(ref platformIO)).Renderer_RenderState = global::System.IntPtr.Zero;
			RestoreRendererState(state);
		}

		private bool RenderDrawCommand(ImDrawListPtr drawList, ImDrawCmdPtr cmd, nint texId, Vector2 scale)
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
			int idxOffset = (int)((ImDrawCmdPtr)(ref cmd)).IdxOffset;
			int vtxOffset = (int)((ImDrawCmdPtr)(ref cmd)).VtxOffset;
			int elemCount = (int)((ImDrawCmdPtr)(ref cmd)).ElemCount;
			int num = 2147483647;
			int num2 = 0;
			for (int i = 0; i < elemCount; i++)
			{
				ushort num3 = ((ImDrawListPtr)(ref drawList)).IdxBuffer[idxOffset + i];
				num = Math.Min(num, (int)num3);
				num2 = Math.Max(num2, (int)num3);
			}
			num += vtxOffset;
			num2 += vtxOffset;
			int num4 = num2 - num + 1;
			Vertex[] array = (Vertex[])(object)new Vertex[num4];
			int[] array2 = new int[elemCount];
			for (int j = 0; j < num4; j++)
			{
				int num5 = num + j;
				ImDrawVertPtr val = ((ImDrawListPtr)(ref drawList)).VtxBuffer[num5];
				uint col = ((ImDrawVertPtr)(ref val)).col;
				byte b = (byte)(col & 0xFFu);
				byte b2 = (byte)((col >> 8) & 0xFFu);
				byte b3 = (byte)((col >> 16) & 0xFFu);
				byte b4 = (byte)((col >> 24) & 0xFFu);
				array[j] = new Vertex
				{
					Position = new FPoint
					{
						X = ((ImDrawVertPtr)(ref val)).pos.X,
						Y = ((ImDrawVertPtr)(ref val)).pos.Y
					},
					Color = new FColor
					{
						R = (float)(int)b / 255f,
						G = (float)(int)b2 / 255f,
						B = (float)(int)b3 / 255f,
						A = (float)(int)b4 / 255f
					},
					TexCoord = new FPoint
					{
						X = ((ImDrawVertPtr)(ref val)).uv.X,
						Y = ((ImDrawVertPtr)(ref val)).uv.Y
					}
				};
			}
			for (int k = 0; k < elemCount; k++)
			{
				ushort num6 = ((ImDrawListPtr)(ref drawList)).IdxBuffer[idxOffset + k];
				array2[k] = (ushort)(num6 - (num - vtxOffset));
			}
			return SDL.RenderGeometry((global::System.IntPtr)Renderer, (global::System.IntPtr)texId, array, num4, array2, elemCount);
		}

		private void SetupRenderState()
		{
			SDL.SetRenderViewport((global::System.IntPtr)Renderer, (global::System.IntPtr)0);
			SDL.SetRenderClipRect((global::System.IntPtr)Renderer, global::System.IntPtr.Zero);
			SDL.SetRenderDrawBlendMode((global::System.IntPtr)Renderer, (BlendMode)1);
		}

		private BackupSDLRendererState BackupRendererState()
		{
			BackupSDLRendererState backupSDLRendererState = default(BackupSDLRendererState);
			backupSDLRendererState.ViewportEnabled = SDL.RenderViewportSet((global::System.IntPtr)Renderer);
			backupSDLRendererState.ClipEnabled = SDL.RenderClipEnabled((global::System.IntPtr)Renderer);
			BackupSDLRendererState result = backupSDLRendererState;
			SDL.GetRenderViewport((global::System.IntPtr)Renderer, ref result.Viewport);
			SDL.GetRenderClipRect((global::System.IntPtr)Renderer, ref result.ClipRect);
			return result;
		}

		private void RestoreRendererState(BackupSDLRendererState state)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			if (state.ViewportEnabled)
			{
				SDL.SetRenderViewport((global::System.IntPtr)Renderer, state.Viewport);
			}
			else
			{
				SDL.SetRenderViewport((global::System.IntPtr)Renderer, global::System.IntPtr.Zero);
			}
			if (state.ClipEnabled)
			{
				SDL.SetRenderClipRect((global::System.IntPtr)Renderer, ref state.ClipRect);
			}
			else
			{
				SDL.SetRenderClipRect((global::System.IntPtr)Renderer, global::System.IntPtr.Zero);
			}
		}

		private Rect CalculateClipRect(Vector4 clipRect, Vector2 clipOffset, Vector2 scale, int fbWidth, int fbHeight)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			Vector2 val = default(Vector2);
			((Vector2)(ref val))..ctor((clipRect.X - clipOffset.X) * scale.X, (clipRect.Y - clipOffset.Y) * scale.Y);
			Vector2 val2 = default(Vector2);
			((Vector2)(ref val2))..ctor((clipRect.Z - clipOffset.X) * scale.X, (clipRect.W - clipOffset.Y) * scale.Y);
			val.X = Math.Max(0f, val.X);
			val.Y = Math.Max(0f, val.Y);
			val2.X = Math.Min((float)fbWidth, val2.X);
			val2.Y = Math.Min((float)fbHeight, val2.Y);
			Rect result = default(Rect);
			result.X = (int)val.X;
			result.Y = (int)val.Y;
			result.W = (int)(val2.X - val.X);
			result.H = (int)(val2.Y - val.Y);
			return result;
		}

		private unsafe bool CreateDeviceObjects()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			ImGuiIOPtr iO = ImGui.GetIO();
			ImFontAtlasPtr fonts = ((ImGuiIOPtr)(ref iO)).Fonts;
			((ImFontAtlasPtr)(ref fonts)).AddFontDefault();
			fonts = ((ImGuiIOPtr)(ref iO)).Fonts;
			byte* ptr = default(byte*);
			int num = default(int);
			int num2 = default(int);
			((ImFontAtlasPtr)(ref fonts)).GetTexDataAsRGBA32(ref ptr, ref num, ref num2);
			nint num3 = SDL.CreateSurfaceFrom(num, num2, (PixelFormat)373694468, (global::System.IntPtr)(nint)ptr, num * 4);
			if (num3 == (nint)global::System.IntPtr.Zero)
			{
				SDL.LogError((LogCategory)0, "Failed to create font surface: " + SDL.GetError());
				return false;
			}
			_fontTexture = SDL.CreateTextureFromSurface((global::System.IntPtr)Renderer, (global::System.IntPtr)num3);
			if (_fontTexture == (nint)global::System.IntPtr.Zero)
			{
				SDL.LogError((LogCategory)0, "Failed to create font texture: " + SDL.GetError());
				return false;
			}
			if (!SDL.UpdateTexture((global::System.IntPtr)_fontTexture, global::System.IntPtr.Zero, (global::System.IntPtr)(nint)ptr, num * 4))
			{
				SDL.LogError((LogCategory)0, "Failed to update font texture: " + SDL.GetError());
				return false;
			}
			SDL.SetTextureBlendMode((global::System.IntPtr)_fontTexture, (BlendMode)1);
			SDL.SetTextureScaleMode((global::System.IntPtr)_fontTexture, (ScaleMode)1);
			fonts = ((ImGuiIOPtr)(ref iO)).Fonts;
			((ImFontAtlasPtr)(ref fonts)).SetTexID((global::System.IntPtr)_fontTexture);
			SDL.DestroySurface((global::System.IntPtr)num3);
			fonts = ((ImGuiIOPtr)(ref iO)).Fonts;
			((ImFontAtlasPtr)(ref fonts)).ClearTexData();
			return true;
		}
	}
	public class SDL3Window : global::System.IDisposable
	{
		public readonly nint Window;

		public readonly nint Device;

		public readonly ImGuiSDL3 Platform;

		public readonly ImGuiSDL3Renderer Renderer;

		internal readonly Queue<Event> EventQueue = new Queue<Event>();

		[CompilerGenerated]
		private Action<int4>? m_WindowRectModified;

		public color? ClearColor;

		private readonly Stopwatch _timer = Stopwatch.StartNew();

		private TimeSpan _time = TimeSpan.Zero;

		private Rect _screenClipRect;

		private nint _imGuiContext;

		private bool _disposed;

		private bool _shouldClose;

		[field: CompilerGenerated]
		public Action? RenderCallback
		{
			[CompilerGenerated]
			get;
			[CompilerGenerated]
			set;
		}

		public event Action<int4>? WindowRectModified
		{
			[CompilerGenerated]
			add
			{
				Action<int4> val = this.m_WindowRectModified;
				Action<int4> val2;
				do
				{
					val2 = val;
					Action<int4> val3 = (Action<int4>)(object)global::System.Delegate.Combine((global::System.Delegate)(object)val2, (global::System.Delegate)(object)value);
					val = Interlocked.CompareExchange<Action<int4>>(ref this.m_WindowRectModified, val3, val2);
				}
				while (val != val2);
			}
			[CompilerGenerated]
			remove
			{
				Action<int4> val = this.m_WindowRectModified;
				Action<int4> val2;
				do
				{
					val2 = val;
					Action<int4> val3 = (Action<int4>)(object)global::System.Delegate.Remove((global::System.Delegate)(object)val2, (global::System.Delegate)(object)value);
					val = Interlocked.CompareExchange<Action<int4>>(ref this.m_WindowRectModified, val3, val2);
				}
				while (val != val2);
			}
		}

		public SDL3Window(string name, int posX, int posY, int width, int height)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			if (!SDL.Init((InitFlags)32))
			{
				throw new global::System.Exception("SDL_Init failed: " + SDL.GetError());
			}
			if (!SDL.CreateWindowAndRenderer(name, width, height, (WindowFlags)32, ref Window, ref Device))
			{
				throw new global::System.Exception("SDL_CreateWindowAndRenderer failed: " + SDL.GetError());
			}
			SDL.SetWindowTitle((global::System.IntPtr)Window, name);
			SDL.SetWindowSize((global::System.IntPtr)Window, width, height);
			SDL.SetWindowPosition((global::System.IntPtr)Window, posX, posY);
			SDL.SetRenderVSync((global::System.IntPtr)Device, 1);
			SetupScreenClipRect();
			_imGuiContext = ImGui.CreateContext();
			ImGui.SetCurrentContext((global::System.IntPtr)_imGuiContext);
			ImGuiIOPtr iO = ImGui.GetIO();
			ref ImGuiConfigFlags configFlags = ref ((ImGuiIOPtr)(ref iO)).ConfigFlags;
			configFlags = (ImGuiConfigFlags)((uint)configFlags | 0x81u);
			ImFontAtlasPtr fonts = ((ImGuiIOPtr)(ref iO)).Fonts;
			ref ImFontAtlasFlags flags = ref ((ImFontAtlasPtr)(ref fonts)).Flags;
			flags = (ImFontAtlasFlags)((uint)flags | 4u);
			Platform = new ImGuiSDL3(Window, Device);
			Renderer = new ImGuiSDL3Renderer(Device);
		}

		virtual ~SDL3Window()
		{
			Dispose(disposing: false);
		}

		public void Dispose()
		{
			Dispose(disposing: true);
			GC.SuppressFinalize((object)this);
		}

		protected virtual void Dispose(bool disposing)
		{
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			if (_disposed)
			{
				return;
			}
			_disposed = true;
			try
			{
				if (Window != (nint)global::System.IntPtr.Zero)
				{
					int num = default(int);
					int num2 = default(int);
					SDL.GetWindowPosition((global::System.IntPtr)Window, ref num, ref num2);
					int num3 = default(int);
					int num4 = default(int);
					SDL.GetWindowSize((global::System.IntPtr)Window, ref num3, ref num4);
					this.WindowRectModified?.Invoke(new int4(num, num2, num3, num4));
				}
			}
			catch
			{
			}
			if (disposing)
			{
				Renderer?.Dispose();
				Platform?.Dispose();
				RenderCallback = null;
			}
			if (_imGuiContext != (nint)global::System.IntPtr.Zero)
			{
				ImGui.SetCurrentContext((global::System.IntPtr)_imGuiContext);
				ImGui.DestroyContext();
				_imGuiContext = global::System.IntPtr.Zero;
			}
			if (Device != (nint)global::System.IntPtr.Zero)
			{
				SDL.DestroyRenderer((global::System.IntPtr)Device);
			}
			if (Window != (nint)global::System.IntPtr.Zero)
			{
				SDL.DestroyWindow((global::System.IntPtr)Window);
			}
		}

		public void RunOneFrame()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			if (!_disposed)
			{
				ImGui.SetCurrentContext((global::System.IntPtr)_imGuiContext);
				ImGuiIOPtr iO = ImGui.GetIO();
				ref float deltaTime = ref ((ImGuiIOPtr)(ref iO)).DeltaTime;
				TimeSpan val = _timer.Elapsed - _time;
				deltaTime = (float)((TimeSpan)(ref val)).TotalSeconds;
				_time = _timer.Elapsed;
				PollEvents();
				Update();
				color val2 = (color)(((??)ClearColor) ?? Plugin.DefaultBackgroundColor.Value);
				SDL.SetRenderDrawColor((global::System.IntPtr)Device, (byte)(((color)(ref val2)).R * 255f), (byte)(((color)(ref val2)).G * 255f), (byte)(((color)(ref val2)).B * 255f), (byte)(((color)(ref val2)).A * 255f));
				Render();
				if (_shouldClose || Plugin.CancellationToken.IsCancellationRequested)
				{
					Dispose();
				}
				ImGui.SetCurrentContext(global::System.IntPtr.Zero);
			}
		}

		private void PollEvents()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Invalid comparison between Unknown and I4
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Invalid comparison between Unknown and I4
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Invalid comparison between Unknown and I4
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Expected I4, but got Unknown
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			ImGuiIOPtr iO = ImGui.GetIO();
			if (((ImGuiIOPtr)(ref iO)).WantTextInput && !SDL.TextInputActive((global::System.IntPtr)Window))
			{
				SDL.StartTextInput((global::System.IntPtr)Window);
			}
			else
			{
				iO = ImGui.GetIO();
				if (!((ImGuiIOPtr)(ref iO)).WantTextInput && SDL.TextInputActive((global::System.IntPtr)Window))
				{
					SDL.StopTextInput((global::System.IntPtr)Window);
				}
			}
			Event val = default(Event);
			int num = default(int);
			int num2 = default(int);
			int num3 = default(int);
			int num4 = default(int);
			while (EventQueue.TryDequeue(ref val))
			{
				Platform.ProcessEvent(val);
				EventType val2 = (EventType)val.Type;
				if ((int)val2 <= 517)
				{
					if (val2 - 256 > 1)
					{
						if ((int)val2 == 517)
						{
							SDL.GetWindowSize((global::System.IntPtr)Window, ref num, ref num2);
							this.WindowRectModified?.Invoke(new int4(val.Window.Data1, val.Window.Data2, num2, num));
						}
						continue;
					}
				}
				else
				{
					if ((int)val2 == 518)
					{
						SetupScreenClipRect();
						SDL.GetWindowPosition((global::System.IntPtr)Window, ref num3, ref num4);
						this.WindowRectModified?.Invoke(new int4(num3, num4, val.Window.Data1, val.Window.Data2));
						continue;
					}
					switch (val2 - 526)
					{
					default:
						continue;
					case 2:
						break;
					}
				}
				_shouldClose = true;
			}
		}

		private void Update()
		{
			Platform.NewFrame();
			Renderer.NewFrame();
			ImGui.NewFrame();
			Action? renderCallback = RenderCallback;
			if (renderCallback != null)
			{
				renderCallback.Invoke();
			}
			ImGui.EndFrame();
		}

		private void Render()
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			SDL.RenderClear((global::System.IntPtr)Device);
			SDL.SetRenderClipRect((global::System.IntPtr)Device, ref _screenClipRect);
			ImGui.Render();
			Renderer.RenderDrawData(ImGui.GetDrawData());
			SDL.RenderPresent((global::System.IntPtr)Device);
		}

		private void SetupScreenClipRect()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			int w = default(int);
			int h = default(int);
			SDL.GetWindowSize((global::System.IntPtr)Window, ref w, ref h);
			_screenClipRect = new Rect
			{
				X = 0,
				Y = 0,
				W = w,
				H = h
			};
		}
	}
}

plugins/ResoniteImGuiLib/ImGui.NET.dll

Decompiled 2 months ago
using System;
using System.Diagnostics;
using System.Numerics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
[assembly: InternalsVisibleTo("ImPlot.NET")]
[assembly: InternalsVisibleTo("ImNodes.NET")]
[assembly: AssemblyCompany("Eric Mellino")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("A .NET wrapper for the Dear ImGui library.")]
[assembly: AssemblyFileVersion("1.91.6.1")]
[assembly: AssemblyInformationalVersion("1.0.0+8e26803be78b344fd68834817905405b3cdffb94")]
[assembly: AssemblyProduct("ImGui.NET")]
[assembly: AssemblyTitle("ImGui.NET")]
[assembly: SecurityPermission(8, SkipVerification = true)]
[assembly: AssemblyVersion("1.91.6.1")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace ImGuiNET;

public delegate void Platform_CreateWindow(ImGuiViewportPtr vp);
public delegate void Platform_DestroyWindow(ImGuiViewportPtr vp);
public delegate void Platform_ShowWindow(ImGuiViewportPtr vp);
public delegate void Platform_SetWindowPos(ImGuiViewportPtr vp, Vector2 pos);
public unsafe delegate void Platform_GetWindowPos(ImGuiViewportPtr vp, Vector2* outPos);
public delegate void Platform_SetWindowSize(ImGuiViewportPtr vp, Vector2 size);
public unsafe delegate void Platform_GetWindowSize(ImGuiViewportPtr vp, Vector2* outSize);
public delegate void Platform_SetWindowFocus(ImGuiViewportPtr vp);
public delegate byte Platform_GetWindowFocus(ImGuiViewportPtr vp);
public delegate byte Platform_GetWindowMinimized(ImGuiViewportPtr vp);
public delegate void Platform_SetWindowTitle(ImGuiViewportPtr vp, nint title);
public struct ImColor
{
	public Vector4 Value;
}
public struct ImColorPtr
{
	[field: CompilerGenerated]
	public unsafe ImColor* NativePtr
	{
		[CompilerGenerated]
		get;
	}

	public unsafe ref Vector4 Value => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<Vector4>((void*)(&NativePtr->Value));

	public unsafe ImColorPtr(ImColor* nativePtr)
	{
		NativePtr = nativePtr;
	}

	public unsafe ImColorPtr(nint nativePtr)
	{
		NativePtr = (ImColor*)nativePtr;
	}

	public unsafe static implicit operator ImColorPtr(ImColor* nativePtr)
	{
		return new ImColorPtr(nativePtr);
	}

	public unsafe static implicit operator ImColor*(ImColorPtr wrappedPtr)
	{
		return wrappedPtr.NativePtr;
	}

	public static implicit operator ImColorPtr(nint nativePtr)
	{
		return new ImColorPtr(nativePtr);
	}

	public unsafe void Destroy()
	{
		ImGuiNative.ImColor_destroy(NativePtr);
	}

	public unsafe ImColor HSV(float h, float s, float v)
	{
		float a = 1f;
		ImColor result = default(ImColor);
		ImGuiNative.ImColor_HSV(&result, h, s, v, a);
		return result;
	}

	public unsafe ImColor HSV(float h, float s, float v, float a)
	{
		ImColor result = default(ImColor);
		ImGuiNative.ImColor_HSV(&result, h, s, v, a);
		return result;
	}

	public unsafe void SetHSV(float h, float s, float v)
	{
		float a = 1f;
		ImGuiNative.ImColor_SetHSV(NativePtr, h, s, v, a);
	}

	public unsafe void SetHSV(float h, float s, float v, float a)
	{
		ImGuiNative.ImColor_SetHSV(NativePtr, h, s, v, a);
	}
}
public struct ImDrawChannel
{
	public ImVector _CmdBuffer;

	public ImVector _IdxBuffer;
}
public struct ImDrawChannelPtr
{
	[field: CompilerGenerated]
	public unsafe ImDrawChannel* NativePtr
	{
		[CompilerGenerated]
		get;
	}

	public unsafe ImPtrVector<ImDrawCmdPtr> _CmdBuffer => new ImPtrVector<ImDrawCmdPtr>(NativePtr->_CmdBuffer, global::System.Runtime.CompilerServices.Unsafe.SizeOf<ImDrawCmd>());

	public unsafe ImVector<ushort> _IdxBuffer => new ImVector<ushort>(NativePtr->_IdxBuffer);

	public unsafe ImDrawChannelPtr(ImDrawChannel* nativePtr)
	{
		NativePtr = nativePtr;
	}

	public unsafe ImDrawChannelPtr(nint nativePtr)
	{
		NativePtr = (ImDrawChannel*)nativePtr;
	}

	public unsafe static implicit operator ImDrawChannelPtr(ImDrawChannel* nativePtr)
	{
		return new ImDrawChannelPtr(nativePtr);
	}

	public unsafe static implicit operator ImDrawChannel*(ImDrawChannelPtr wrappedPtr)
	{
		return wrappedPtr.NativePtr;
	}

	public static implicit operator ImDrawChannelPtr(nint nativePtr)
	{
		return new ImDrawChannelPtr(nativePtr);
	}
}
public struct ImDrawCmd
{
	public Vector4 ClipRect;

	public nint TextureId;

	public uint VtxOffset;

	public uint IdxOffset;

	public uint ElemCount;

	public nint UserCallback;

	public unsafe void* UserCallbackData;

	public int UserCallbackDataSize;

	public int UserCallbackDataOffset;
}
public struct ImDrawCmdPtr
{
	[field: CompilerGenerated]
	public unsafe ImDrawCmd* NativePtr
	{
		[CompilerGenerated]
		get;
	}

	public unsafe ref Vector4 ClipRect => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<Vector4>((void*)(&NativePtr->ClipRect));

	public unsafe ref nint TextureId => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<nint>((void*)(&NativePtr->TextureId));

	public unsafe ref uint VtxOffset => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<uint>((void*)(&NativePtr->VtxOffset));

	public unsafe ref uint IdxOffset => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<uint>((void*)(&NativePtr->IdxOffset));

	public unsafe ref uint ElemCount => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<uint>((void*)(&NativePtr->ElemCount));

	public unsafe ref nint UserCallback => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<nint>((void*)(&NativePtr->UserCallback));

	public unsafe nint UserCallbackData
	{
		get
		{
			return (nint)NativePtr->UserCallbackData;
		}
		set
		{
			NativePtr->UserCallbackData = (void*)value;
		}
	}

	public unsafe ref int UserCallbackDataSize => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<int>((void*)(&NativePtr->UserCallbackDataSize));

	public unsafe ref int UserCallbackDataOffset => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<int>((void*)(&NativePtr->UserCallbackDataOffset));

	public unsafe ImDrawCmdPtr(ImDrawCmd* nativePtr)
	{
		NativePtr = nativePtr;
	}

	public unsafe ImDrawCmdPtr(nint nativePtr)
	{
		NativePtr = (ImDrawCmd*)nativePtr;
	}

	public unsafe static implicit operator ImDrawCmdPtr(ImDrawCmd* nativePtr)
	{
		return new ImDrawCmdPtr(nativePtr);
	}

	public unsafe static implicit operator ImDrawCmd*(ImDrawCmdPtr wrappedPtr)
	{
		return wrappedPtr.NativePtr;
	}

	public static implicit operator ImDrawCmdPtr(nint nativePtr)
	{
		return new ImDrawCmdPtr(nativePtr);
	}

	public unsafe void Destroy()
	{
		ImGuiNative.ImDrawCmd_destroy(NativePtr);
	}

	public unsafe nint GetTexID()
	{
		return ImGuiNative.ImDrawCmd_GetTexID(NativePtr);
	}
}
public struct ImDrawCmdHeader
{
	public Vector4 ClipRect;

	public nint TextureId;

	public uint VtxOffset;
}
public struct ImDrawCmdHeaderPtr
{
	[field: CompilerGenerated]
	public unsafe ImDrawCmdHeader* NativePtr
	{
		[CompilerGenerated]
		get;
	}

	public unsafe ref Vector4 ClipRect => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<Vector4>((void*)(&NativePtr->ClipRect));

	public unsafe ref nint TextureId => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<nint>((void*)(&NativePtr->TextureId));

	public unsafe ref uint VtxOffset => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<uint>((void*)(&NativePtr->VtxOffset));

	public unsafe ImDrawCmdHeaderPtr(ImDrawCmdHeader* nativePtr)
	{
		NativePtr = nativePtr;
	}

	public unsafe ImDrawCmdHeaderPtr(nint nativePtr)
	{
		NativePtr = (ImDrawCmdHeader*)nativePtr;
	}

	public unsafe static implicit operator ImDrawCmdHeaderPtr(ImDrawCmdHeader* nativePtr)
	{
		return new ImDrawCmdHeaderPtr(nativePtr);
	}

	public unsafe static implicit operator ImDrawCmdHeader*(ImDrawCmdHeaderPtr wrappedPtr)
	{
		return wrappedPtr.NativePtr;
	}

	public static implicit operator ImDrawCmdHeaderPtr(nint nativePtr)
	{
		return new ImDrawCmdHeaderPtr(nativePtr);
	}
}
public struct ImDrawData
{
	public byte Valid;

	public int CmdListsCount;

	public int TotalIdxCount;

	public int TotalVtxCount;

	public ImVector CmdLists;

	public Vector2 DisplayPos;

	public Vector2 DisplaySize;

	public Vector2 FramebufferScale;

	public unsafe ImGuiViewport* OwnerViewport;
}
public struct ImDrawDataPtr
{
	[field: CompilerGenerated]
	public unsafe ImDrawData* NativePtr
	{
		[CompilerGenerated]
		get;
	}

	public unsafe ref bool Valid => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<bool>((void*)(&NativePtr->Valid));

	public unsafe ref int CmdListsCount => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<int>((void*)(&NativePtr->CmdListsCount));

	public unsafe ref int TotalIdxCount => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<int>((void*)(&NativePtr->TotalIdxCount));

	public unsafe ref int TotalVtxCount => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<int>((void*)(&NativePtr->TotalVtxCount));

	public unsafe ImVector<ImDrawListPtr> CmdLists => new ImVector<ImDrawListPtr>(NativePtr->CmdLists);

	public unsafe ref Vector2 DisplayPos => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<Vector2>((void*)(&NativePtr->DisplayPos));

	public unsafe ref Vector2 DisplaySize => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<Vector2>((void*)(&NativePtr->DisplaySize));

	public unsafe ref Vector2 FramebufferScale => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<Vector2>((void*)(&NativePtr->FramebufferScale));

	public unsafe ImGuiViewportPtr OwnerViewport => new ImGuiViewportPtr(NativePtr->OwnerViewport);

	public unsafe ImDrawDataPtr(ImDrawData* nativePtr)
	{
		NativePtr = nativePtr;
	}

	public unsafe ImDrawDataPtr(nint nativePtr)
	{
		NativePtr = (ImDrawData*)nativePtr;
	}

	public unsafe static implicit operator ImDrawDataPtr(ImDrawData* nativePtr)
	{
		return new ImDrawDataPtr(nativePtr);
	}

	public unsafe static implicit operator ImDrawData*(ImDrawDataPtr wrappedPtr)
	{
		return wrappedPtr.NativePtr;
	}

	public static implicit operator ImDrawDataPtr(nint nativePtr)
	{
		return new ImDrawDataPtr(nativePtr);
	}

	public unsafe void AddDrawList(ImDrawListPtr draw_list)
	{
		ImDrawList* nativePtr = draw_list.NativePtr;
		ImGuiNative.ImDrawData_AddDrawList(NativePtr, nativePtr);
	}

	public unsafe void Clear()
	{
		ImGuiNative.ImDrawData_Clear(NativePtr);
	}

	public unsafe void DeIndexAllBuffers()
	{
		ImGuiNative.ImDrawData_DeIndexAllBuffers(NativePtr);
	}

	public unsafe void Destroy()
	{
		ImGuiNative.ImDrawData_destroy(NativePtr);
	}

	public unsafe void ScaleClipRects(Vector2 fb_scale)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawData_ScaleClipRects(NativePtr, fb_scale);
	}
}
[Flags]
public enum ImDrawFlags
{
	None = 0,
	Closed = 1,
	RoundCornersTopLeft = 0x10,
	RoundCornersTopRight = 0x20,
	RoundCornersBottomLeft = 0x40,
	RoundCornersBottomRight = 0x80,
	RoundCornersNone = 0x100,
	RoundCornersTop = 0x30,
	RoundCornersBottom = 0xC0,
	RoundCornersLeft = 0x50,
	RoundCornersRight = 0xA0,
	RoundCornersAll = 0xF0,
	RoundCornersDefault = 0xF0,
	RoundCornersMask = 0x1F0
}
public struct ImDrawList
{
	public ImVector CmdBuffer;

	public ImVector IdxBuffer;

	public ImVector VtxBuffer;

	public ImDrawListFlags Flags;

	public uint _VtxCurrentIdx;

	public nint _Data;

	public unsafe ImDrawVert* _VtxWritePtr;

	public unsafe ushort* _IdxWritePtr;

	public ImVector _Path;

	public ImDrawCmdHeader _CmdHeader;

	public ImDrawListSplitter _Splitter;

	public ImVector _ClipRectStack;

	public ImVector _TextureIdStack;

	public ImVector _CallbacksDataBuf;

	public float _FringeScale;

	public unsafe byte* _OwnerName;
}
public struct ImDrawListPtr
{
	[field: CompilerGenerated]
	public unsafe ImDrawList* NativePtr
	{
		[CompilerGenerated]
		get;
	}

	public unsafe ImPtrVector<ImDrawCmdPtr> CmdBuffer => new ImPtrVector<ImDrawCmdPtr>(NativePtr->CmdBuffer, global::System.Runtime.CompilerServices.Unsafe.SizeOf<ImDrawCmd>());

	public unsafe ImVector<ushort> IdxBuffer => new ImVector<ushort>(NativePtr->IdxBuffer);

	public unsafe ImPtrVector<ImDrawVertPtr> VtxBuffer => new ImPtrVector<ImDrawVertPtr>(NativePtr->VtxBuffer, global::System.Runtime.CompilerServices.Unsafe.SizeOf<ImDrawVert>());

	public unsafe ref ImDrawListFlags Flags => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<ImDrawListFlags>((void*)(&NativePtr->Flags));

	public unsafe ref uint _VtxCurrentIdx => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<uint>((void*)(&NativePtr->_VtxCurrentIdx));

	public unsafe ref nint _Data => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<nint>((void*)(&NativePtr->_Data));

	public unsafe ImDrawVertPtr _VtxWritePtr => new ImDrawVertPtr(NativePtr->_VtxWritePtr);

	public unsafe nint _IdxWritePtr
	{
		get
		{
			return (nint)NativePtr->_IdxWritePtr;
		}
		set
		{
			NativePtr->_IdxWritePtr = (ushort*)value;
		}
	}

	public unsafe ImVector<Vector2> _Path => new ImVector<Vector2>(NativePtr->_Path);

	public unsafe ref ImDrawCmdHeader _CmdHeader => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<ImDrawCmdHeader>((void*)(&NativePtr->_CmdHeader));

	public unsafe ref ImDrawListSplitter _Splitter => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<ImDrawListSplitter>((void*)(&NativePtr->_Splitter));

	public unsafe ImVector<Vector4> _ClipRectStack => new ImVector<Vector4>(NativePtr->_ClipRectStack);

	public unsafe ImVector<nint> _TextureIdStack => new ImVector<nint>(NativePtr->_TextureIdStack);

	public unsafe ImVector<byte> _CallbacksDataBuf => new ImVector<byte>(NativePtr->_CallbacksDataBuf);

	public unsafe ref float _FringeScale => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<float>((void*)(&NativePtr->_FringeScale));

	public unsafe NullTerminatedString _OwnerName => new NullTerminatedString(NativePtr->_OwnerName);

	public unsafe ImDrawListPtr(ImDrawList* nativePtr)
	{
		NativePtr = nativePtr;
	}

	public unsafe ImDrawListPtr(nint nativePtr)
	{
		NativePtr = (ImDrawList*)nativePtr;
	}

	public unsafe static implicit operator ImDrawListPtr(ImDrawList* nativePtr)
	{
		return new ImDrawListPtr(nativePtr);
	}

	public unsafe static implicit operator ImDrawList*(ImDrawListPtr wrappedPtr)
	{
		return wrappedPtr.NativePtr;
	}

	public static implicit operator ImDrawListPtr(nint nativePtr)
	{
		return new ImDrawListPtr(nativePtr);
	}

	public unsafe int _CalcCircleAutoSegmentCount(float radius)
	{
		return ImGuiNative.ImDrawList__CalcCircleAutoSegmentCount(NativePtr, radius);
	}

	public unsafe void _ClearFreeMemory()
	{
		ImGuiNative.ImDrawList__ClearFreeMemory(NativePtr);
	}

	public unsafe void _OnChangedClipRect()
	{
		ImGuiNative.ImDrawList__OnChangedClipRect(NativePtr);
	}

	public unsafe void _OnChangedTextureID()
	{
		ImGuiNative.ImDrawList__OnChangedTextureID(NativePtr);
	}

	public unsafe void _OnChangedVtxOffset()
	{
		ImGuiNative.ImDrawList__OnChangedVtxOffset(NativePtr);
	}

	public unsafe void _PathArcToFastEx(Vector2 center, float radius, int a_min_sample, int a_max_sample, int a_step)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList__PathArcToFastEx(NativePtr, center, radius, a_min_sample, a_max_sample, a_step);
	}

	public unsafe void _PathArcToN(Vector2 center, float radius, float a_min, float a_max, int num_segments)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList__PathArcToN(NativePtr, center, radius, a_min, a_max, num_segments);
	}

	public unsafe void _PopUnusedDrawCmd()
	{
		ImGuiNative.ImDrawList__PopUnusedDrawCmd(NativePtr);
	}

	public unsafe void _ResetForNewFrame()
	{
		ImGuiNative.ImDrawList__ResetForNewFrame(NativePtr);
	}

	public unsafe void _SetTextureID(nint texture_id)
	{
		ImGuiNative.ImDrawList__SetTextureID(NativePtr, texture_id);
	}

	public unsafe void _TryMergeDrawCmds()
	{
		ImGuiNative.ImDrawList__TryMergeDrawCmds(NativePtr);
	}

	public unsafe void AddBezierCubic(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, uint col, float thickness)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		int num_segments = 0;
		ImGuiNative.ImDrawList_AddBezierCubic(NativePtr, p1, p2, p3, p4, col, thickness, num_segments);
	}

	public unsafe void AddBezierCubic(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, uint col, float thickness, int num_segments)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList_AddBezierCubic(NativePtr, p1, p2, p3, p4, col, thickness, num_segments);
	}

	public unsafe void AddBezierQuadratic(Vector2 p1, Vector2 p2, Vector2 p3, uint col, float thickness)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		int num_segments = 0;
		ImGuiNative.ImDrawList_AddBezierQuadratic(NativePtr, p1, p2, p3, col, thickness, num_segments);
	}

	public unsafe void AddBezierQuadratic(Vector2 p1, Vector2 p2, Vector2 p3, uint col, float thickness, int num_segments)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList_AddBezierQuadratic(NativePtr, p1, p2, p3, col, thickness, num_segments);
	}

	public unsafe void AddCallback(nint callback, nint userdata)
	{
		void* userdata2 = ((global::System.IntPtr)userdata).ToPointer();
		uint userdata_size = 0u;
		ImGuiNative.ImDrawList_AddCallback(NativePtr, callback, userdata2, userdata_size);
	}

	public unsafe void AddCallback(nint callback, nint userdata, uint userdata_size)
	{
		void* userdata2 = ((global::System.IntPtr)userdata).ToPointer();
		ImGuiNative.ImDrawList_AddCallback(NativePtr, callback, userdata2, userdata_size);
	}

	public unsafe void AddCircle(Vector2 center, float radius, uint col)
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		int num_segments = 0;
		float thickness = 1f;
		ImGuiNative.ImDrawList_AddCircle(NativePtr, center, radius, col, num_segments, thickness);
	}

	public unsafe void AddCircle(Vector2 center, float radius, uint col, int num_segments)
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		float thickness = 1f;
		ImGuiNative.ImDrawList_AddCircle(NativePtr, center, radius, col, num_segments, thickness);
	}

	public unsafe void AddCircle(Vector2 center, float radius, uint col, int num_segments, float thickness)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList_AddCircle(NativePtr, center, radius, col, num_segments, thickness);
	}

	public unsafe void AddCircleFilled(Vector2 center, float radius, uint col)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		int num_segments = 0;
		ImGuiNative.ImDrawList_AddCircleFilled(NativePtr, center, radius, col, num_segments);
	}

	public unsafe void AddCircleFilled(Vector2 center, float radius, uint col, int num_segments)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList_AddCircleFilled(NativePtr, center, radius, col, num_segments);
	}

	public unsafe void AddConcavePolyFilled(ref Vector2 points, int num_points, uint col)
	{
		fixed (Vector2* points2 = &points)
		{
			ImGuiNative.ImDrawList_AddConcavePolyFilled(NativePtr, points2, num_points, col);
		}
	}

	public unsafe void AddConvexPolyFilled(ref Vector2 points, int num_points, uint col)
	{
		fixed (Vector2* points2 = &points)
		{
			ImGuiNative.ImDrawList_AddConvexPolyFilled(NativePtr, points2, num_points, col);
		}
	}

	public unsafe void AddDrawCmd()
	{
		ImGuiNative.ImDrawList_AddDrawCmd(NativePtr);
	}

	public unsafe void AddEllipse(Vector2 center, Vector2 radius, uint col)
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		float rot = 0f;
		int num_segments = 0;
		float thickness = 1f;
		ImGuiNative.ImDrawList_AddEllipse(NativePtr, center, radius, col, rot, num_segments, thickness);
	}

	public unsafe void AddEllipse(Vector2 center, Vector2 radius, uint col, float rot)
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		int num_segments = 0;
		float thickness = 1f;
		ImGuiNative.ImDrawList_AddEllipse(NativePtr, center, radius, col, rot, num_segments, thickness);
	}

	public unsafe void AddEllipse(Vector2 center, Vector2 radius, uint col, float rot, int num_segments)
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		float thickness = 1f;
		ImGuiNative.ImDrawList_AddEllipse(NativePtr, center, radius, col, rot, num_segments, thickness);
	}

	public unsafe void AddEllipse(Vector2 center, Vector2 radius, uint col, float rot, int num_segments, float thickness)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList_AddEllipse(NativePtr, center, radius, col, rot, num_segments, thickness);
	}

	public unsafe void AddEllipseFilled(Vector2 center, Vector2 radius, uint col)
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		float rot = 0f;
		int num_segments = 0;
		ImGuiNative.ImDrawList_AddEllipseFilled(NativePtr, center, radius, col, rot, num_segments);
	}

	public unsafe void AddEllipseFilled(Vector2 center, Vector2 radius, uint col, float rot)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		int num_segments = 0;
		ImGuiNative.ImDrawList_AddEllipseFilled(NativePtr, center, radius, col, rot, num_segments);
	}

	public unsafe void AddEllipseFilled(Vector2 center, Vector2 radius, uint col, float rot, int num_segments)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList_AddEllipseFilled(NativePtr, center, radius, col, rot, num_segments);
	}

	public unsafe void AddImage(nint user_texture_id, Vector2 p_min, Vector2 p_max)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		Vector2 uv_min = default(Vector2);
		Vector2 uv_max = default(Vector2);
		((Vector2)(ref uv_max))..ctor(1f, 1f);
		uint col = 4294967295u;
		ImGuiNative.ImDrawList_AddImage(NativePtr, user_texture_id, p_min, p_max, uv_min, uv_max, col);
	}

	public unsafe void AddImage(nint user_texture_id, Vector2 p_min, Vector2 p_max, Vector2 uv_min)
	{
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		Vector2 uv_max = default(Vector2);
		((Vector2)(ref uv_max))..ctor(1f, 1f);
		uint col = 4294967295u;
		ImGuiNative.ImDrawList_AddImage(NativePtr, user_texture_id, p_min, p_max, uv_min, uv_max, col);
	}

	public unsafe void AddImage(nint user_texture_id, Vector2 p_min, Vector2 p_max, Vector2 uv_min, Vector2 uv_max)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		uint col = 4294967295u;
		ImGuiNative.ImDrawList_AddImage(NativePtr, user_texture_id, p_min, p_max, uv_min, uv_max, col);
	}

	public unsafe void AddImage(nint user_texture_id, Vector2 p_min, Vector2 p_max, Vector2 uv_min, Vector2 uv_max, uint col)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList_AddImage(NativePtr, user_texture_id, p_min, p_max, uv_min, uv_max, col);
	}

	public unsafe void AddImageQuad(nint user_texture_id, Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		Vector2 uv = default(Vector2);
		Vector2 uv2 = default(Vector2);
		((Vector2)(ref uv2))..ctor(1f, 0f);
		Vector2 uv3 = default(Vector2);
		((Vector2)(ref uv3))..ctor(1f, 1f);
		Vector2 uv4 = default(Vector2);
		((Vector2)(ref uv4))..ctor(0f, 1f);
		uint col = 4294967295u;
		ImGuiNative.ImDrawList_AddImageQuad(NativePtr, user_texture_id, p1, p2, p3, p4, uv, uv2, uv3, uv4, col);
	}

	public unsafe void AddImageQuad(nint user_texture_id, Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, Vector2 uv1)
	{
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		Vector2 uv2 = default(Vector2);
		((Vector2)(ref uv2))..ctor(1f, 0f);
		Vector2 uv3 = default(Vector2);
		((Vector2)(ref uv3))..ctor(1f, 1f);
		Vector2 uv4 = default(Vector2);
		((Vector2)(ref uv4))..ctor(0f, 1f);
		uint col = 4294967295u;
		ImGuiNative.ImDrawList_AddImageQuad(NativePtr, user_texture_id, p1, p2, p3, p4, uv1, uv2, uv3, uv4, col);
	}

	public unsafe void AddImageQuad(nint user_texture_id, Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, Vector2 uv1, Vector2 uv2)
	{
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		Vector2 uv3 = default(Vector2);
		((Vector2)(ref uv3))..ctor(1f, 1f);
		Vector2 uv4 = default(Vector2);
		((Vector2)(ref uv4))..ctor(0f, 1f);
		uint col = 4294967295u;
		ImGuiNative.ImDrawList_AddImageQuad(NativePtr, user_texture_id, p1, p2, p3, p4, uv1, uv2, uv3, uv4, col);
	}

	public unsafe void AddImageQuad(nint user_texture_id, Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, Vector2 uv1, Vector2 uv2, Vector2 uv3)
	{
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		Vector2 uv4 = default(Vector2);
		((Vector2)(ref uv4))..ctor(0f, 1f);
		uint col = 4294967295u;
		ImGuiNative.ImDrawList_AddImageQuad(NativePtr, user_texture_id, p1, p2, p3, p4, uv1, uv2, uv3, uv4, col);
	}

	public unsafe void AddImageQuad(nint user_texture_id, Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, Vector2 uv1, Vector2 uv2, Vector2 uv3, Vector2 uv4)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		uint col = 4294967295u;
		ImGuiNative.ImDrawList_AddImageQuad(NativePtr, user_texture_id, p1, p2, p3, p4, uv1, uv2, uv3, uv4, col);
	}

	public unsafe void AddImageQuad(nint user_texture_id, Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, Vector2 uv1, Vector2 uv2, Vector2 uv3, Vector2 uv4, uint col)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList_AddImageQuad(NativePtr, user_texture_id, p1, p2, p3, p4, uv1, uv2, uv3, uv4, col);
	}

	public unsafe void AddImageRounded(nint user_texture_id, Vector2 p_min, Vector2 p_max, Vector2 uv_min, Vector2 uv_max, uint col, float rounding)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		ImDrawFlags flags = ImDrawFlags.None;
		ImGuiNative.ImDrawList_AddImageRounded(NativePtr, user_texture_id, p_min, p_max, uv_min, uv_max, col, rounding, flags);
	}

	public unsafe void AddImageRounded(nint user_texture_id, Vector2 p_min, Vector2 p_max, Vector2 uv_min, Vector2 uv_max, uint col, float rounding, ImDrawFlags flags)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList_AddImageRounded(NativePtr, user_texture_id, p_min, p_max, uv_min, uv_max, col, rounding, flags);
	}

	public unsafe void AddLine(Vector2 p1, Vector2 p2, uint col)
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		float thickness = 1f;
		ImGuiNative.ImDrawList_AddLine(NativePtr, p1, p2, col, thickness);
	}

	public unsafe void AddLine(Vector2 p1, Vector2 p2, uint col, float thickness)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList_AddLine(NativePtr, p1, p2, col, thickness);
	}

	public unsafe void AddNgon(Vector2 center, float radius, uint col, int num_segments)
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		float thickness = 1f;
		ImGuiNative.ImDrawList_AddNgon(NativePtr, center, radius, col, num_segments, thickness);
	}

	public unsafe void AddNgon(Vector2 center, float radius, uint col, int num_segments, float thickness)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList_AddNgon(NativePtr, center, radius, col, num_segments, thickness);
	}

	public unsafe void AddNgonFilled(Vector2 center, float radius, uint col, int num_segments)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList_AddNgonFilled(NativePtr, center, radius, col, num_segments);
	}

	public unsafe void AddPolyline(ref Vector2 points, int num_points, uint col, ImDrawFlags flags, float thickness)
	{
		fixed (Vector2* points2 = &points)
		{
			ImGuiNative.ImDrawList_AddPolyline(NativePtr, points2, num_points, col, flags, thickness);
		}
	}

	public unsafe void AddQuad(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, uint col)
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		float thickness = 1f;
		ImGuiNative.ImDrawList_AddQuad(NativePtr, p1, p2, p3, p4, col, thickness);
	}

	public unsafe void AddQuad(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, uint col, float thickness)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList_AddQuad(NativePtr, p1, p2, p3, p4, col, thickness);
	}

	public unsafe void AddQuadFilled(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, uint col)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList_AddQuadFilled(NativePtr, p1, p2, p3, p4, col);
	}

	public unsafe void AddRect(Vector2 p_min, Vector2 p_max, uint col)
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		float rounding = 0f;
		ImDrawFlags flags = ImDrawFlags.None;
		float thickness = 1f;
		ImGuiNative.ImDrawList_AddRect(NativePtr, p_min, p_max, col, rounding, flags, thickness);
	}

	public unsafe void AddRect(Vector2 p_min, Vector2 p_max, uint col, float rounding)
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		ImDrawFlags flags = ImDrawFlags.None;
		float thickness = 1f;
		ImGuiNative.ImDrawList_AddRect(NativePtr, p_min, p_max, col, rounding, flags, thickness);
	}

	public unsafe void AddRect(Vector2 p_min, Vector2 p_max, uint col, float rounding, ImDrawFlags flags)
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		float thickness = 1f;
		ImGuiNative.ImDrawList_AddRect(NativePtr, p_min, p_max, col, rounding, flags, thickness);
	}

	public unsafe void AddRect(Vector2 p_min, Vector2 p_max, uint col, float rounding, ImDrawFlags flags, float thickness)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList_AddRect(NativePtr, p_min, p_max, col, rounding, flags, thickness);
	}

	public unsafe void AddRectFilled(Vector2 p_min, Vector2 p_max, uint col)
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		float rounding = 0f;
		ImDrawFlags flags = ImDrawFlags.None;
		ImGuiNative.ImDrawList_AddRectFilled(NativePtr, p_min, p_max, col, rounding, flags);
	}

	public unsafe void AddRectFilled(Vector2 p_min, Vector2 p_max, uint col, float rounding)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		ImDrawFlags flags = ImDrawFlags.None;
		ImGuiNative.ImDrawList_AddRectFilled(NativePtr, p_min, p_max, col, rounding, flags);
	}

	public unsafe void AddRectFilled(Vector2 p_min, Vector2 p_max, uint col, float rounding, ImDrawFlags flags)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList_AddRectFilled(NativePtr, p_min, p_max, col, rounding, flags);
	}

	public unsafe void AddRectFilledMultiColor(Vector2 p_min, Vector2 p_max, uint col_upr_left, uint col_upr_right, uint col_bot_right, uint col_bot_left)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList_AddRectFilledMultiColor(NativePtr, p_min, p_max, col_upr_left, col_upr_right, col_bot_right, col_bot_left);
	}

	public unsafe void AddText(Vector2 pos, uint col, global::System.ReadOnlySpan<char> text_begin)
	{
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		int num = 0;
		num = Encoding.UTF8.GetByteCount(text_begin);
		byte* ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1));
		int utf = Util.GetUtf8(text_begin, ptr, num);
		ptr[utf] = 0;
		ImGuiNative.ImDrawList_AddText_Vec2(NativePtr, pos, col, ptr, ptr + num);
		if (num > 2048)
		{
			Util.Free(ptr);
		}
	}

	public unsafe void AddText(Vector2 pos, uint col, string text_begin)
	{
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		int num = 0;
		num = Encoding.UTF8.GetByteCount(text_begin);
		byte* ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1));
		int utf = Util.GetUtf8(text_begin, ptr, num);
		ptr[utf] = 0;
		ImGuiNative.ImDrawList_AddText_Vec2(NativePtr, pos, col, ptr, ptr + num);
		if (num > 2048)
		{
			Util.Free(ptr);
		}
	}

	public unsafe void AddText(ImFontPtr font, float font_size, Vector2 pos, uint col, global::System.ReadOnlySpan<char> text_begin)
	{
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		ImFont* nativePtr = font.NativePtr;
		int num = 0;
		num = Encoding.UTF8.GetByteCount(text_begin);
		byte* ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1));
		int utf = Util.GetUtf8(text_begin, ptr, num);
		ptr[utf] = 0;
		float wrap_width = 0f;
		Vector4* cpu_fine_clip_rect = null;
		ImGuiNative.ImDrawList_AddText_FontPtr(NativePtr, nativePtr, font_size, pos, col, ptr, ptr + num, wrap_width, cpu_fine_clip_rect);
		if (num > 2048)
		{
			Util.Free(ptr);
		}
	}

	public unsafe void AddText(ImFontPtr font, float font_size, Vector2 pos, uint col, string text_begin)
	{
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		ImFont* nativePtr = font.NativePtr;
		int num = 0;
		num = Encoding.UTF8.GetByteCount(text_begin);
		byte* ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1));
		int utf = Util.GetUtf8(text_begin, ptr, num);
		ptr[utf] = 0;
		float wrap_width = 0f;
		Vector4* cpu_fine_clip_rect = null;
		ImGuiNative.ImDrawList_AddText_FontPtr(NativePtr, nativePtr, font_size, pos, col, ptr, ptr + num, wrap_width, cpu_fine_clip_rect);
		if (num > 2048)
		{
			Util.Free(ptr);
		}
	}

	public unsafe void AddText(ImFontPtr font, float font_size, Vector2 pos, uint col, global::System.ReadOnlySpan<char> text_begin, float wrap_width)
	{
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		ImFont* nativePtr = font.NativePtr;
		int num = 0;
		num = Encoding.UTF8.GetByteCount(text_begin);
		byte* ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1));
		int utf = Util.GetUtf8(text_begin, ptr, num);
		ptr[utf] = 0;
		Vector4* cpu_fine_clip_rect = null;
		ImGuiNative.ImDrawList_AddText_FontPtr(NativePtr, nativePtr, font_size, pos, col, ptr, ptr + num, wrap_width, cpu_fine_clip_rect);
		if (num > 2048)
		{
			Util.Free(ptr);
		}
	}

	public unsafe void AddText(ImFontPtr font, float font_size, Vector2 pos, uint col, string text_begin, float wrap_width)
	{
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		ImFont* nativePtr = font.NativePtr;
		int num = 0;
		num = Encoding.UTF8.GetByteCount(text_begin);
		byte* ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1));
		int utf = Util.GetUtf8(text_begin, ptr, num);
		ptr[utf] = 0;
		Vector4* cpu_fine_clip_rect = null;
		ImGuiNative.ImDrawList_AddText_FontPtr(NativePtr, nativePtr, font_size, pos, col, ptr, ptr + num, wrap_width, cpu_fine_clip_rect);
		if (num > 2048)
		{
			Util.Free(ptr);
		}
	}

	public unsafe void AddText(ImFontPtr font, float font_size, Vector2 pos, uint col, global::System.ReadOnlySpan<char> text_begin, float wrap_width, ref Vector4 cpu_fine_clip_rect)
	{
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		ImFont* nativePtr = font.NativePtr;
		int num = 0;
		num = Encoding.UTF8.GetByteCount(text_begin);
		byte* ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1));
		int utf = Util.GetUtf8(text_begin, ptr, num);
		ptr[utf] = 0;
		fixed (Vector4* cpu_fine_clip_rect2 = &cpu_fine_clip_rect)
		{
			ImGuiNative.ImDrawList_AddText_FontPtr(NativePtr, nativePtr, font_size, pos, col, ptr, ptr + num, wrap_width, cpu_fine_clip_rect2);
			if (num > 2048)
			{
				Util.Free(ptr);
			}
		}
	}

	public unsafe void AddText(ImFontPtr font, float font_size, Vector2 pos, uint col, string text_begin, float wrap_width, ref Vector4 cpu_fine_clip_rect)
	{
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		ImFont* nativePtr = font.NativePtr;
		int num = 0;
		num = Encoding.UTF8.GetByteCount(text_begin);
		byte* ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1));
		int utf = Util.GetUtf8(text_begin, ptr, num);
		ptr[utf] = 0;
		fixed (Vector4* cpu_fine_clip_rect2 = &cpu_fine_clip_rect)
		{
			ImGuiNative.ImDrawList_AddText_FontPtr(NativePtr, nativePtr, font_size, pos, col, ptr, ptr + num, wrap_width, cpu_fine_clip_rect2);
			if (num > 2048)
			{
				Util.Free(ptr);
			}
		}
	}

	public unsafe void AddTriangle(Vector2 p1, Vector2 p2, Vector2 p3, uint col)
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		float thickness = 1f;
		ImGuiNative.ImDrawList_AddTriangle(NativePtr, p1, p2, p3, col, thickness);
	}

	public unsafe void AddTriangle(Vector2 p1, Vector2 p2, Vector2 p3, uint col, float thickness)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList_AddTriangle(NativePtr, p1, p2, p3, col, thickness);
	}

	public unsafe void AddTriangleFilled(Vector2 p1, Vector2 p2, Vector2 p3, uint col)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList_AddTriangleFilled(NativePtr, p1, p2, p3, col);
	}

	public unsafe void ChannelsMerge()
	{
		ImGuiNative.ImDrawList_ChannelsMerge(NativePtr);
	}

	public unsafe void ChannelsSetCurrent(int n)
	{
		ImGuiNative.ImDrawList_ChannelsSetCurrent(NativePtr, n);
	}

	public unsafe void ChannelsSplit(int count)
	{
		ImGuiNative.ImDrawList_ChannelsSplit(NativePtr, count);
	}

	public unsafe ImDrawListPtr CloneOutput()
	{
		return new ImDrawListPtr(ImGuiNative.ImDrawList_CloneOutput(NativePtr));
	}

	public unsafe void Destroy()
	{
		ImGuiNative.ImDrawList_destroy(NativePtr);
	}

	public unsafe Vector2 GetClipRectMax()
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		Vector2 result = default(Vector2);
		ImGuiNative.ImDrawList_GetClipRectMax(&result, NativePtr);
		return result;
	}

	public unsafe Vector2 GetClipRectMin()
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		Vector2 result = default(Vector2);
		ImGuiNative.ImDrawList_GetClipRectMin(&result, NativePtr);
		return result;
	}

	public unsafe void PathArcTo(Vector2 center, float radius, float a_min, float a_max)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		int num_segments = 0;
		ImGuiNative.ImDrawList_PathArcTo(NativePtr, center, radius, a_min, a_max, num_segments);
	}

	public unsafe void PathArcTo(Vector2 center, float radius, float a_min, float a_max, int num_segments)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList_PathArcTo(NativePtr, center, radius, a_min, a_max, num_segments);
	}

	public unsafe void PathArcToFast(Vector2 center, float radius, int a_min_of_12, int a_max_of_12)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList_PathArcToFast(NativePtr, center, radius, a_min_of_12, a_max_of_12);
	}

	public unsafe void PathBezierCubicCurveTo(Vector2 p2, Vector2 p3, Vector2 p4)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		int num_segments = 0;
		ImGuiNative.ImDrawList_PathBezierCubicCurveTo(NativePtr, p2, p3, p4, num_segments);
	}

	public unsafe void PathBezierCubicCurveTo(Vector2 p2, Vector2 p3, Vector2 p4, int num_segments)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList_PathBezierCubicCurveTo(NativePtr, p2, p3, p4, num_segments);
	}

	public unsafe void PathBezierQuadraticCurveTo(Vector2 p2, Vector2 p3)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		int num_segments = 0;
		ImGuiNative.ImDrawList_PathBezierQuadraticCurveTo(NativePtr, p2, p3, num_segments);
	}

	public unsafe void PathBezierQuadraticCurveTo(Vector2 p2, Vector2 p3, int num_segments)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList_PathBezierQuadraticCurveTo(NativePtr, p2, p3, num_segments);
	}

	public unsafe void PathClear()
	{
		ImGuiNative.ImDrawList_PathClear(NativePtr);
	}

	public unsafe void PathEllipticalArcTo(Vector2 center, Vector2 radius, float rot, float a_min, float a_max)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		int num_segments = 0;
		ImGuiNative.ImDrawList_PathEllipticalArcTo(NativePtr, center, radius, rot, a_min, a_max, num_segments);
	}

	public unsafe void PathEllipticalArcTo(Vector2 center, Vector2 radius, float rot, float a_min, float a_max, int num_segments)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList_PathEllipticalArcTo(NativePtr, center, radius, rot, a_min, a_max, num_segments);
	}

	public unsafe void PathFillConcave(uint col)
	{
		ImGuiNative.ImDrawList_PathFillConcave(NativePtr, col);
	}

	public unsafe void PathFillConvex(uint col)
	{
		ImGuiNative.ImDrawList_PathFillConvex(NativePtr, col);
	}

	public unsafe void PathLineTo(Vector2 pos)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList_PathLineTo(NativePtr, pos);
	}

	public unsafe void PathLineToMergeDuplicate(Vector2 pos)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList_PathLineToMergeDuplicate(NativePtr, pos);
	}

	public unsafe void PathRect(Vector2 rect_min, Vector2 rect_max)
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		float rounding = 0f;
		ImDrawFlags flags = ImDrawFlags.None;
		ImGuiNative.ImDrawList_PathRect(NativePtr, rect_min, rect_max, rounding, flags);
	}

	public unsafe void PathRect(Vector2 rect_min, Vector2 rect_max, float rounding)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		ImDrawFlags flags = ImDrawFlags.None;
		ImGuiNative.ImDrawList_PathRect(NativePtr, rect_min, rect_max, rounding, flags);
	}

	public unsafe void PathRect(Vector2 rect_min, Vector2 rect_max, float rounding, ImDrawFlags flags)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList_PathRect(NativePtr, rect_min, rect_max, rounding, flags);
	}

	public unsafe void PathStroke(uint col)
	{
		ImDrawFlags flags = ImDrawFlags.None;
		float thickness = 1f;
		ImGuiNative.ImDrawList_PathStroke(NativePtr, col, flags, thickness);
	}

	public unsafe void PathStroke(uint col, ImDrawFlags flags)
	{
		float thickness = 1f;
		ImGuiNative.ImDrawList_PathStroke(NativePtr, col, flags, thickness);
	}

	public unsafe void PathStroke(uint col, ImDrawFlags flags, float thickness)
	{
		ImGuiNative.ImDrawList_PathStroke(NativePtr, col, flags, thickness);
	}

	public unsafe void PopClipRect()
	{
		ImGuiNative.ImDrawList_PopClipRect(NativePtr);
	}

	public unsafe void PopTextureID()
	{
		ImGuiNative.ImDrawList_PopTextureID(NativePtr);
	}

	public unsafe void PrimQuadUV(Vector2 a, Vector2 b, Vector2 c, Vector2 d, Vector2 uv_a, Vector2 uv_b, Vector2 uv_c, Vector2 uv_d, uint col)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList_PrimQuadUV(NativePtr, a, b, c, d, uv_a, uv_b, uv_c, uv_d, col);
	}

	public unsafe void PrimRect(Vector2 a, Vector2 b, uint col)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList_PrimRect(NativePtr, a, b, col);
	}

	public unsafe void PrimRectUV(Vector2 a, Vector2 b, Vector2 uv_a, Vector2 uv_b, uint col)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList_PrimRectUV(NativePtr, a, b, uv_a, uv_b, col);
	}

	public unsafe void PrimReserve(int idx_count, int vtx_count)
	{
		ImGuiNative.ImDrawList_PrimReserve(NativePtr, idx_count, vtx_count);
	}

	public unsafe void PrimUnreserve(int idx_count, int vtx_count)
	{
		ImGuiNative.ImDrawList_PrimUnreserve(NativePtr, idx_count, vtx_count);
	}

	public unsafe void PrimVtx(Vector2 pos, Vector2 uv, uint col)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList_PrimVtx(NativePtr, pos, uv, col);
	}

	public unsafe void PrimWriteIdx(ushort idx)
	{
		ImGuiNative.ImDrawList_PrimWriteIdx(NativePtr, idx);
	}

	public unsafe void PrimWriteVtx(Vector2 pos, Vector2 uv, uint col)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		ImGuiNative.ImDrawList_PrimWriteVtx(NativePtr, pos, uv, col);
	}

	public unsafe void PushClipRect(Vector2 clip_rect_min, Vector2 clip_rect_max)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		byte intersect_with_current_clip_rect = 0;
		ImGuiNative.ImDrawList_PushClipRect(NativePtr, clip_rect_min, clip_rect_max, intersect_with_current_clip_rect);
	}

	public unsafe void PushClipRect(Vector2 clip_rect_min, Vector2 clip_rect_max, bool intersect_with_current_clip_rect)
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		byte intersect_with_current_clip_rect2 = (intersect_with_current_clip_rect ? ((byte)1) : ((byte)0));
		ImGuiNative.ImDrawList_PushClipRect(NativePtr, clip_rect_min, clip_rect_max, intersect_with_current_clip_rect2);
	}

	public unsafe void PushClipRectFullScreen()
	{
		ImGuiNative.ImDrawList_PushClipRectFullScreen(NativePtr);
	}

	public unsafe void PushTextureID(nint texture_id)
	{
		ImGuiNative.ImDrawList_PushTextureID(NativePtr, texture_id);
	}
}
[Flags]
public enum ImDrawListFlags
{
	None = 0,
	AntiAliasedLines = 1,
	AntiAliasedLinesUseTex = 2,
	AntiAliasedFill = 4,
	AllowVtxOffset = 8
}
public struct ImDrawListSplitter
{
	public int _Current;

	public int _Count;

	public ImVector _Channels;
}
public struct ImDrawListSplitterPtr
{
	[field: CompilerGenerated]
	public unsafe ImDrawListSplitter* NativePtr
	{
		[CompilerGenerated]
		get;
	}

	public unsafe ref int _Current => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<int>((void*)(&NativePtr->_Current));

	public unsafe ref int _Count => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<int>((void*)(&NativePtr->_Count));

	public unsafe ImPtrVector<ImDrawChannelPtr> _Channels => new ImPtrVector<ImDrawChannelPtr>(NativePtr->_Channels, global::System.Runtime.CompilerServices.Unsafe.SizeOf<ImDrawChannel>());

	public unsafe ImDrawListSplitterPtr(ImDrawListSplitter* nativePtr)
	{
		NativePtr = nativePtr;
	}

	public unsafe ImDrawListSplitterPtr(nint nativePtr)
	{
		NativePtr = (ImDrawListSplitter*)nativePtr;
	}

	public unsafe static implicit operator ImDrawListSplitterPtr(ImDrawListSplitter* nativePtr)
	{
		return new ImDrawListSplitterPtr(nativePtr);
	}

	public unsafe static implicit operator ImDrawListSplitter*(ImDrawListSplitterPtr wrappedPtr)
	{
		return wrappedPtr.NativePtr;
	}

	public static implicit operator ImDrawListSplitterPtr(nint nativePtr)
	{
		return new ImDrawListSplitterPtr(nativePtr);
	}

	public unsafe void Clear()
	{
		ImGuiNative.ImDrawListSplitter_Clear(NativePtr);
	}

	public unsafe void ClearFreeMemory()
	{
		ImGuiNative.ImDrawListSplitter_ClearFreeMemory(NativePtr);
	}

	public unsafe void Destroy()
	{
		ImGuiNative.ImDrawListSplitter_destroy(NativePtr);
	}

	public unsafe void Merge(ImDrawListPtr draw_list)
	{
		ImDrawList* nativePtr = draw_list.NativePtr;
		ImGuiNative.ImDrawListSplitter_Merge(NativePtr, nativePtr);
	}

	public unsafe void SetCurrentChannel(ImDrawListPtr draw_list, int channel_idx)
	{
		ImDrawList* nativePtr = draw_list.NativePtr;
		ImGuiNative.ImDrawListSplitter_SetCurrentChannel(NativePtr, nativePtr, channel_idx);
	}

	public unsafe void Split(ImDrawListPtr draw_list, int count)
	{
		ImDrawList* nativePtr = draw_list.NativePtr;
		ImGuiNative.ImDrawListSplitter_Split(NativePtr, nativePtr, count);
	}
}
public struct ImDrawVert
{
	public Vector2 pos;

	public Vector2 uv;

	public uint col;
}
public struct ImDrawVertPtr
{
	[field: CompilerGenerated]
	public unsafe ImDrawVert* NativePtr
	{
		[CompilerGenerated]
		get;
	}

	public unsafe ref Vector2 pos => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<Vector2>((void*)(&NativePtr->pos));

	public unsafe ref Vector2 uv => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<Vector2>((void*)(&NativePtr->uv));

	public unsafe ref uint col => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<uint>((void*)(&NativePtr->col));

	public unsafe ImDrawVertPtr(ImDrawVert* nativePtr)
	{
		NativePtr = nativePtr;
	}

	public unsafe ImDrawVertPtr(nint nativePtr)
	{
		NativePtr = (ImDrawVert*)nativePtr;
	}

	public unsafe static implicit operator ImDrawVertPtr(ImDrawVert* nativePtr)
	{
		return new ImDrawVertPtr(nativePtr);
	}

	public unsafe static implicit operator ImDrawVert*(ImDrawVertPtr wrappedPtr)
	{
		return wrappedPtr.NativePtr;
	}

	public static implicit operator ImDrawVertPtr(nint nativePtr)
	{
		return new ImDrawVertPtr(nativePtr);
	}
}
public struct ImFont
{
	public ImVector IndexAdvanceX;

	public float FallbackAdvanceX;

	public float FontSize;

	public ImVector IndexLookup;

	public ImVector Glyphs;

	public unsafe ImFontGlyph* FallbackGlyph;

	public unsafe ImFontAtlas* ContainerAtlas;

	public unsafe ImFontConfig* ConfigData;

	public short ConfigDataCount;

	public short EllipsisCharCount;

	public ushort EllipsisChar;

	public ushort FallbackChar;

	public float EllipsisWidth;

	public float EllipsisCharStep;

	public byte DirtyLookupTables;

	public float Scale;

	public float Ascent;

	public float Descent;

	public int MetricsTotalSurface;

	[FixedBuffer(typeof(byte), 2)]
	public unsafe fixed byte Used4kPagesMap[2];
}
public struct ImFontPtr
{
	[field: CompilerGenerated]
	public unsafe ImFont* NativePtr
	{
		[CompilerGenerated]
		get;
	}

	public unsafe ImVector<float> IndexAdvanceX => new ImVector<float>(NativePtr->IndexAdvanceX);

	public unsafe ref float FallbackAdvanceX => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<float>((void*)(&NativePtr->FallbackAdvanceX));

	public unsafe ref float FontSize => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<float>((void*)(&NativePtr->FontSize));

	public unsafe ImVector<ushort> IndexLookup => new ImVector<ushort>(NativePtr->IndexLookup);

	public unsafe ImPtrVector<ImFontGlyphPtr> Glyphs => new ImPtrVector<ImFontGlyphPtr>(NativePtr->Glyphs, global::System.Runtime.CompilerServices.Unsafe.SizeOf<ImFontGlyph>());

	public unsafe ImFontGlyphPtr FallbackGlyph => new ImFontGlyphPtr(NativePtr->FallbackGlyph);

	public unsafe ImFontAtlasPtr ContainerAtlas => new ImFontAtlasPtr(NativePtr->ContainerAtlas);

	public unsafe ImFontConfigPtr ConfigData => new ImFontConfigPtr(NativePtr->ConfigData);

	public unsafe ref short ConfigDataCount => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<short>((void*)(&NativePtr->ConfigDataCount));

	public unsafe ref short EllipsisCharCount => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<short>((void*)(&NativePtr->EllipsisCharCount));

	public unsafe ref ushort EllipsisChar => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<ushort>((void*)(&NativePtr->EllipsisChar));

	public unsafe ref ushort FallbackChar => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<ushort>((void*)(&NativePtr->FallbackChar));

	public unsafe ref float EllipsisWidth => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<float>((void*)(&NativePtr->EllipsisWidth));

	public unsafe ref float EllipsisCharStep => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<float>((void*)(&NativePtr->EllipsisCharStep));

	public unsafe ref bool DirtyLookupTables => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<bool>((void*)(&NativePtr->DirtyLookupTables));

	public unsafe ref float Scale => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<float>((void*)(&NativePtr->Scale));

	public unsafe ref float Ascent => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<float>((void*)(&NativePtr->Ascent));

	public unsafe ref float Descent => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<float>((void*)(&NativePtr->Descent));

	public unsafe ref int MetricsTotalSurface => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<int>((void*)(&NativePtr->MetricsTotalSurface));

	public unsafe RangeAccessor<byte> Used4kPagesMap => new RangeAccessor<byte>(NativePtr->Used4kPagesMap, 2);

	public unsafe ImFontPtr(ImFont* nativePtr)
	{
		NativePtr = nativePtr;
	}

	public unsafe ImFontPtr(nint nativePtr)
	{
		NativePtr = (ImFont*)nativePtr;
	}

	public unsafe static implicit operator ImFontPtr(ImFont* nativePtr)
	{
		return new ImFontPtr(nativePtr);
	}

	public unsafe static implicit operator ImFont*(ImFontPtr wrappedPtr)
	{
		return wrappedPtr.NativePtr;
	}

	public static implicit operator ImFontPtr(nint nativePtr)
	{
		return new ImFontPtr(nativePtr);
	}

	public unsafe void AddGlyph(ImFontConfigPtr src_cfg, ushort c, float x0, float y0, float x1, float y1, float u0, float v0, float u1, float v1, float advance_x)
	{
		ImFontConfig* nativePtr = src_cfg.NativePtr;
		ImGuiNative.ImFont_AddGlyph(NativePtr, nativePtr, c, x0, y0, x1, y1, u0, v0, u1, v1, advance_x);
	}

	public unsafe void AddRemapChar(ushort dst, ushort src)
	{
		byte overwrite_dst = 1;
		ImGuiNative.ImFont_AddRemapChar(NativePtr, dst, src, overwrite_dst);
	}

	public unsafe void AddRemapChar(ushort dst, ushort src, bool overwrite_dst)
	{
		byte overwrite_dst2 = (overwrite_dst ? ((byte)1) : ((byte)0));
		ImGuiNative.ImFont_AddRemapChar(NativePtr, dst, src, overwrite_dst2);
	}

	public unsafe void BuildLookupTable()
	{
		ImGuiNative.ImFont_BuildLookupTable(NativePtr);
	}

	public unsafe Vector2 CalcTextSizeA(float size, float max_width, float wrap_width, global::System.ReadOnlySpan<char> text_begin)
	{
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		int num = 0;
		num = Encoding.UTF8.GetByteCount(text_begin);
		byte* ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1));
		int utf = Util.GetUtf8(text_begin, ptr, num);
		ptr[utf] = 0;
		byte** remaining = null;
		Vector2 result = default(Vector2);
		ImGuiNative.ImFont_CalcTextSizeA(&result, NativePtr, size, max_width, wrap_width, ptr, ptr + num, remaining);
		if (num > 2048)
		{
			Util.Free(ptr);
		}
		return result;
	}

	public unsafe Vector2 CalcTextSizeA(float size, float max_width, float wrap_width, string text_begin)
	{
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		int num = 0;
		num = Encoding.UTF8.GetByteCount(text_begin);
		byte* ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1));
		int utf = Util.GetUtf8(text_begin, ptr, num);
		ptr[utf] = 0;
		byte** remaining = null;
		Vector2 result = default(Vector2);
		ImGuiNative.ImFont_CalcTextSizeA(&result, NativePtr, size, max_width, wrap_width, ptr, ptr + num, remaining);
		if (num > 2048)
		{
			Util.Free(ptr);
		}
		return result;
	}

	public unsafe Vector2 CalcTextSizeA(float size, float max_width, float wrap_width, global::System.ReadOnlySpan<char> text_begin, ref byte* remaining)
	{
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		int num = 0;
		num = Encoding.UTF8.GetByteCount(text_begin);
		byte* ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1));
		int utf = Util.GetUtf8(text_begin, ptr, num);
		ptr[utf] = 0;
		fixed (byte** remaining2 = &remaining)
		{
			Vector2 result = default(Vector2);
			ImGuiNative.ImFont_CalcTextSizeA(&result, NativePtr, size, max_width, wrap_width, ptr, ptr + num, remaining2);
			if (num > 2048)
			{
				Util.Free(ptr);
			}
			return result;
		}
	}

	public unsafe Vector2 CalcTextSizeA(float size, float max_width, float wrap_width, string text_begin, ref byte* remaining)
	{
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		int num = 0;
		num = Encoding.UTF8.GetByteCount(text_begin);
		byte* ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1));
		int utf = Util.GetUtf8(text_begin, ptr, num);
		ptr[utf] = 0;
		fixed (byte** remaining2 = &remaining)
		{
			Vector2 result = default(Vector2);
			ImGuiNative.ImFont_CalcTextSizeA(&result, NativePtr, size, max_width, wrap_width, ptr, ptr + num, remaining2);
			if (num > 2048)
			{
				Util.Free(ptr);
			}
			return result;
		}
	}

	public unsafe string CalcWordWrapPositionA(float scale, global::System.ReadOnlySpan<char> text, float wrap_width)
	{
		int num = 0;
		byte* ptr;
		if (text != global::System.ReadOnlySpan<char>.op_Implicit((char[])null))
		{
			num = Encoding.UTF8.GetByteCount(text);
			ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1));
			int utf = Util.GetUtf8(text, ptr, num);
			ptr[utf] = 0;
		}
		else
		{
			ptr = null;
		}
		byte* ptr2 = ImGuiNative.ImFont_CalcWordWrapPositionA(NativePtr, scale, ptr, ptr + num, wrap_width);
		if (num > 2048)
		{
			Util.Free(ptr);
		}
		return Util.StringFromPtr(ptr2);
	}

	public unsafe string CalcWordWrapPositionA(float scale, string text, float wrap_width)
	{
		int num = 0;
		byte* ptr;
		if (text != null)
		{
			num = Encoding.UTF8.GetByteCount(text);
			ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1));
			int utf = Util.GetUtf8(text, ptr, num);
			ptr[utf] = 0;
		}
		else
		{
			ptr = null;
		}
		byte* ptr2 = ImGuiNative.ImFont_CalcWordWrapPositionA(NativePtr, scale, ptr, ptr + num, wrap_width);
		if (num > 2048)
		{
			Util.Free(ptr);
		}
		return Util.StringFromPtr(ptr2);
	}

	public unsafe void ClearOutputData()
	{
		ImGuiNative.ImFont_ClearOutputData(NativePtr);
	}

	public unsafe void Destroy()
	{
		ImGuiNative.ImFont_destroy(NativePtr);
	}

	public unsafe ImFontGlyphPtr FindGlyph(ushort c)
	{
		return new ImFontGlyphPtr(ImGuiNative.ImFont_FindGlyph(NativePtr, c));
	}

	public unsafe ImFontGlyphPtr FindGlyphNoFallback(ushort c)
	{
		return new ImFontGlyphPtr(ImGuiNative.ImFont_FindGlyphNoFallback(NativePtr, c));
	}

	public unsafe float GetCharAdvance(ushort c)
	{
		return ImGuiNative.ImFont_GetCharAdvance(NativePtr, c);
	}

	public unsafe string GetDebugName()
	{
		return Util.StringFromPtr(ImGuiNative.ImFont_GetDebugName(NativePtr));
	}

	public unsafe void GrowIndex(int new_size)
	{
		ImGuiNative.ImFont_GrowIndex(NativePtr, new_size);
	}

	public unsafe bool IsLoaded()
	{
		return ImGuiNative.ImFont_IsLoaded(NativePtr) != 0;
	}

	public unsafe void RenderChar(ImDrawListPtr draw_list, float size, Vector2 pos, uint col, ushort c)
	{
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		ImDrawList* nativePtr = draw_list.NativePtr;
		ImGuiNative.ImFont_RenderChar(NativePtr, nativePtr, size, pos, col, c);
	}

	public unsafe void RenderText(ImDrawListPtr draw_list, float size, Vector2 pos, uint col, Vector4 clip_rect, global::System.ReadOnlySpan<char> text_begin)
	{
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		ImDrawList* nativePtr = draw_list.NativePtr;
		int num = 0;
		num = Encoding.UTF8.GetByteCount(text_begin);
		byte* ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1));
		int utf = Util.GetUtf8(text_begin, ptr, num);
		ptr[utf] = 0;
		float wrap_width = 0f;
		byte cpu_fine_clip = 0;
		ImGuiNative.ImFont_RenderText(NativePtr, nativePtr, size, pos, col, clip_rect, ptr, ptr + num, wrap_width, cpu_fine_clip);
		if (num > 2048)
		{
			Util.Free(ptr);
		}
	}

	public unsafe void RenderText(ImDrawListPtr draw_list, float size, Vector2 pos, uint col, Vector4 clip_rect, string text_begin)
	{
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		ImDrawList* nativePtr = draw_list.NativePtr;
		int num = 0;
		num = Encoding.UTF8.GetByteCount(text_begin);
		byte* ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1));
		int utf = Util.GetUtf8(text_begin, ptr, num);
		ptr[utf] = 0;
		float wrap_width = 0f;
		byte cpu_fine_clip = 0;
		ImGuiNative.ImFont_RenderText(NativePtr, nativePtr, size, pos, col, clip_rect, ptr, ptr + num, wrap_width, cpu_fine_clip);
		if (num > 2048)
		{
			Util.Free(ptr);
		}
	}

	public unsafe void RenderText(ImDrawListPtr draw_list, float size, Vector2 pos, uint col, Vector4 clip_rect, global::System.ReadOnlySpan<char> text_begin, float wrap_width)
	{
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		ImDrawList* nativePtr = draw_list.NativePtr;
		int num = 0;
		num = Encoding.UTF8.GetByteCount(text_begin);
		byte* ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1));
		int utf = Util.GetUtf8(text_begin, ptr, num);
		ptr[utf] = 0;
		byte cpu_fine_clip = 0;
		ImGuiNative.ImFont_RenderText(NativePtr, nativePtr, size, pos, col, clip_rect, ptr, ptr + num, wrap_width, cpu_fine_clip);
		if (num > 2048)
		{
			Util.Free(ptr);
		}
	}

	public unsafe void RenderText(ImDrawListPtr draw_list, float size, Vector2 pos, uint col, Vector4 clip_rect, string text_begin, float wrap_width)
	{
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		ImDrawList* nativePtr = draw_list.NativePtr;
		int num = 0;
		num = Encoding.UTF8.GetByteCount(text_begin);
		byte* ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1));
		int utf = Util.GetUtf8(text_begin, ptr, num);
		ptr[utf] = 0;
		byte cpu_fine_clip = 0;
		ImGuiNative.ImFont_RenderText(NativePtr, nativePtr, size, pos, col, clip_rect, ptr, ptr + num, wrap_width, cpu_fine_clip);
		if (num > 2048)
		{
			Util.Free(ptr);
		}
	}

	public unsafe void RenderText(ImDrawListPtr draw_list, float size, Vector2 pos, uint col, Vector4 clip_rect, global::System.ReadOnlySpan<char> text_begin, float wrap_width, bool cpu_fine_clip)
	{
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		ImDrawList* nativePtr = draw_list.NativePtr;
		int num = 0;
		num = Encoding.UTF8.GetByteCount(text_begin);
		byte* ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1));
		int utf = Util.GetUtf8(text_begin, ptr, num);
		ptr[utf] = 0;
		byte cpu_fine_clip2 = (cpu_fine_clip ? ((byte)1) : ((byte)0));
		ImGuiNative.ImFont_RenderText(NativePtr, nativePtr, size, pos, col, clip_rect, ptr, ptr + num, wrap_width, cpu_fine_clip2);
		if (num > 2048)
		{
			Util.Free(ptr);
		}
	}

	public unsafe void RenderText(ImDrawListPtr draw_list, float size, Vector2 pos, uint col, Vector4 clip_rect, string text_begin, float wrap_width, bool cpu_fine_clip)
	{
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		ImDrawList* nativePtr = draw_list.NativePtr;
		int num = 0;
		num = Encoding.UTF8.GetByteCount(text_begin);
		byte* ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1));
		int utf = Util.GetUtf8(text_begin, ptr, num);
		ptr[utf] = 0;
		byte cpu_fine_clip2 = (cpu_fine_clip ? ((byte)1) : ((byte)0));
		ImGuiNative.ImFont_RenderText(NativePtr, nativePtr, size, pos, col, clip_rect, ptr, ptr + num, wrap_width, cpu_fine_clip2);
		if (num > 2048)
		{
			Util.Free(ptr);
		}
	}

	public unsafe void SetGlyphVisible(ushort c, bool visible)
	{
		byte visible2 = (visible ? ((byte)1) : ((byte)0));
		ImGuiNative.ImFont_SetGlyphVisible(NativePtr, c, visible2);
	}
}
public struct ImFontAtlas
{
	public ImFontAtlasFlags Flags;

	public nint TexID;

	public int TexDesiredWidth;

	public int TexGlyphPadding;

	public byte Locked;

	public unsafe void* UserData;

	public byte TexReady;

	public byte TexPixelsUseColors;

	public unsafe byte* TexPixelsAlpha8;

	public unsafe uint* TexPixelsRGBA32;

	public int TexWidth;

	public int TexHeight;

	public Vector2 TexUvScale;

	public Vector2 TexUvWhitePixel;

	public ImVector Fonts;

	public ImVector CustomRects;

	public ImVector ConfigData;

	public Vector4 TexUvLines_0;

	public Vector4 TexUvLines_1;

	public Vector4 TexUvLines_2;

	public Vector4 TexUvLines_3;

	public Vector4 TexUvLines_4;

	public Vector4 TexUvLines_5;

	public Vector4 TexUvLines_6;

	public Vector4 TexUvLines_7;

	public Vector4 TexUvLines_8;

	public Vector4 TexUvLines_9;

	public Vector4 TexUvLines_10;

	public Vector4 TexUvLines_11;

	public Vector4 TexUvLines_12;

	public Vector4 TexUvLines_13;

	public Vector4 TexUvLines_14;

	public Vector4 TexUvLines_15;

	public Vector4 TexUvLines_16;

	public Vector4 TexUvLines_17;

	public Vector4 TexUvLines_18;

	public Vector4 TexUvLines_19;

	public Vector4 TexUvLines_20;

	public Vector4 TexUvLines_21;

	public Vector4 TexUvLines_22;

	public Vector4 TexUvLines_23;

	public Vector4 TexUvLines_24;

	public Vector4 TexUvLines_25;

	public Vector4 TexUvLines_26;

	public Vector4 TexUvLines_27;

	public Vector4 TexUvLines_28;

	public Vector4 TexUvLines_29;

	public Vector4 TexUvLines_30;

	public Vector4 TexUvLines_31;

	public Vector4 TexUvLines_32;

	public Vector4 TexUvLines_33;

	public Vector4 TexUvLines_34;

	public Vector4 TexUvLines_35;

	public Vector4 TexUvLines_36;

	public Vector4 TexUvLines_37;

	public Vector4 TexUvLines_38;

	public Vector4 TexUvLines_39;

	public Vector4 TexUvLines_40;

	public Vector4 TexUvLines_41;

	public Vector4 TexUvLines_42;

	public Vector4 TexUvLines_43;

	public Vector4 TexUvLines_44;

	public Vector4 TexUvLines_45;

	public Vector4 TexUvLines_46;

	public Vector4 TexUvLines_47;

	public Vector4 TexUvLines_48;

	public Vector4 TexUvLines_49;

	public Vector4 TexUvLines_50;

	public Vector4 TexUvLines_51;

	public Vector4 TexUvLines_52;

	public Vector4 TexUvLines_53;

	public Vector4 TexUvLines_54;

	public Vector4 TexUvLines_55;

	public Vector4 TexUvLines_56;

	public Vector4 TexUvLines_57;

	public Vector4 TexUvLines_58;

	public Vector4 TexUvLines_59;

	public Vector4 TexUvLines_60;

	public Vector4 TexUvLines_61;

	public Vector4 TexUvLines_62;

	public Vector4 TexUvLines_63;

	public unsafe nint* FontBuilderIO;

	public uint FontBuilderFlags;

	public int PackIdMouseCursors;

	public int PackIdLines;
}
public struct ImFontAtlasPtr
{
	[field: CompilerGenerated]
	public unsafe ImFontAtlas* NativePtr
	{
		[CompilerGenerated]
		get;
	}

	public unsafe ref ImFontAtlasFlags Flags => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<ImFontAtlasFlags>((void*)(&NativePtr->Flags));

	public unsafe ref nint TexID => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<nint>((void*)(&NativePtr->TexID));

	public unsafe ref int TexDesiredWidth => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<int>((void*)(&NativePtr->TexDesiredWidth));

	public unsafe ref int TexGlyphPadding => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<int>((void*)(&NativePtr->TexGlyphPadding));

	public unsafe ref bool Locked => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<bool>((void*)(&NativePtr->Locked));

	public unsafe nint UserData
	{
		get
		{
			return (nint)NativePtr->UserData;
		}
		set
		{
			NativePtr->UserData = (void*)value;
		}
	}

	public unsafe ref bool TexReady => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<bool>((void*)(&NativePtr->TexReady));

	public unsafe ref bool TexPixelsUseColors => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<bool>((void*)(&NativePtr->TexPixelsUseColors));

	public unsafe nint TexPixelsAlpha8
	{
		get
		{
			return (nint)NativePtr->TexPixelsAlpha8;
		}
		set
		{
			NativePtr->TexPixelsAlpha8 = (byte*)value;
		}
	}

	public unsafe nint TexPixelsRGBA32
	{
		get
		{
			return (nint)NativePtr->TexPixelsRGBA32;
		}
		set
		{
			NativePtr->TexPixelsRGBA32 = (uint*)value;
		}
	}

	public unsafe ref int TexWidth => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<int>((void*)(&NativePtr->TexWidth));

	public unsafe ref int TexHeight => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<int>((void*)(&NativePtr->TexHeight));

	public unsafe ref Vector2 TexUvScale => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<Vector2>((void*)(&NativePtr->TexUvScale));

	public unsafe ref Vector2 TexUvWhitePixel => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<Vector2>((void*)(&NativePtr->TexUvWhitePixel));

	public unsafe ImVector<ImFontPtr> Fonts => new ImVector<ImFontPtr>(NativePtr->Fonts);

	public unsafe ImPtrVector<ImFontAtlasCustomRectPtr> CustomRects => new ImPtrVector<ImFontAtlasCustomRectPtr>(NativePtr->CustomRects, global::System.Runtime.CompilerServices.Unsafe.SizeOf<ImFontAtlasCustomRect>());

	public unsafe ImPtrVector<ImFontConfigPtr> ConfigData => new ImPtrVector<ImFontConfigPtr>(NativePtr->ConfigData, global::System.Runtime.CompilerServices.Unsafe.SizeOf<ImFontConfig>());

	public unsafe RangeAccessor<Vector4> TexUvLines => new RangeAccessor<Vector4>(&NativePtr->TexUvLines_0, 64);

	public unsafe nint FontBuilderIO
	{
		get
		{
			return (nint)NativePtr->FontBuilderIO;
		}
		set
		{
			NativePtr->FontBuilderIO = (nint*)value;
		}
	}

	public unsafe ref uint FontBuilderFlags => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<uint>((void*)(&NativePtr->FontBuilderFlags));

	public unsafe ref int PackIdMouseCursors => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<int>((void*)(&NativePtr->PackIdMouseCursors));

	public unsafe ref int PackIdLines => ref global::System.Runtime.CompilerServices.Unsafe.AsRef<int>((void*)(&NativePtr->PackIdLines));

	public unsafe ImFontAtlasPtr(ImFontAtlas* nativePtr)
	{
		NativePtr = nativePtr;
	}

	public unsafe ImFontAtlasPtr(nint nativePtr)
	{
		NativePtr = (ImFontAtlas*)nativePtr;
	}

	public unsafe static implicit operator ImFontAtlasPtr(ImFontAtlas* nativePtr)
	{
		return new ImFontAtlasPtr(nativePtr);
	}

	public unsafe static implicit operator ImFontAtlas*(ImFontAtlasPtr wrappedPtr)
	{
		return wrappedPtr.NativePtr;
	}

	public static implicit operator ImFontAtlasPtr(nint nativePtr)
	{
		return new ImFontAtlasPtr(nativePtr);
	}

	public unsafe int AddCustomRectFontGlyph(ImFontPtr font, ushort id, int width, int height, float advance_x)
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		ImFont* nativePtr = font.NativePtr;
		return ImGuiNative.ImFontAtlas_AddCustomRectFontGlyph(NativePtr, nativePtr, id, width, height, advance_x, default(Vector2));
	}

	public unsafe int AddCustomRectFontGlyph(ImFontPtr font, ushort id, int width, int height, float advance_x, Vector2 offset)
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		ImFont* nativePtr = font.NativePtr;
		return ImGuiNative.ImFontAtlas_AddCustomRectFontGlyph(NativePtr, nativePtr, id, width, height, advance_x, offset);
	}

	public unsafe int AddCustomRectRegular(int width, int height)
	{
		return ImGuiNative.ImFontAtlas_AddCustomRectRegular(NativePtr, width, height);
	}

	public unsafe ImFontPtr AddFont(ImFontConfigPtr font_cfg)
	{
		ImFontConfig* nativePtr = font_cfg.NativePtr;
		return new ImFontPtr(ImGuiNative.ImFontAtlas_AddFont(NativePtr, nativePtr));
	}

	public unsafe ImFontPtr AddFontDefault()
	{
		ImFontConfig* font_cfg = null;
		return new ImFontPtr(ImGuiNative.ImFontAtlas_AddFontDefault(NativePtr, font_cfg));
	}

	public unsafe ImFontPtr AddFontDefault(ImFontConfigPtr font_cfg)
	{
		ImFontConfig* nativePtr = font_cfg.NativePtr;
		return new ImFontPtr(ImGuiNative.ImFontAtlas_AddFontDefault(NativePtr, nativePtr));
	}

	public unsafe ImFontPtr AddFontFromFileTTF(global::System.ReadOnlySpan<char> filename, float size_pixels)
	{
		int num = 0;
		byte* ptr;
		if (filename != global::System.ReadOnlySpan<char>.op_Implicit((char[])null))
		{
			num = Encoding.UTF8.GetByteCount(filename);
			ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1));
			int utf = Util.GetUtf8(filename, ptr, num);
			ptr[utf] = 0;
		}
		else
		{
			ptr = null;
		}
		ImFontConfig* font_cfg = null;
		ushort* glyph_ranges = null;
		ImFont* nativePtr = ImGuiNative.ImFontAtlas_AddFontFromFileTTF(NativePtr, ptr, size_pixels, font_cfg, glyph_ranges);
		if (num > 2048)
		{
			Util.Free(ptr);
		}
		return new ImFontPtr(nativePtr);
	}

	public unsafe ImFontPtr AddFontFromFileTTF(string filename, float size_pixels)
	{
		int num = 0;
		byte* ptr;
		if (filename != null)
		{
			num = Encoding.UTF8.GetByteCount(filename);
			ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1));
			int utf = Util.GetUtf8(filename, ptr, num);
			ptr[utf] = 0;
		}
		else
		{
			ptr = null;
		}
		ImFontConfig* font_cfg = null;
		ushort* glyph_ranges = null;
		ImFont* nativePtr = ImGuiNative.ImFontAtlas_AddFontFromFileTTF(NativePtr, ptr, size_pixels, font_cfg, glyph_ranges);
		if (num > 2048)
		{
			Util.Free(ptr);
		}
		return new ImFontPtr(nativePtr);
	}

	public unsafe ImFontPtr AddFontFromFileTTF(global::System.ReadOnlySpan<char> filename, float size_pixels, ImFontConfigPtr font_cfg)
	{
		int num = 0;
		byte* ptr;
		if (filename != global::System.ReadOnlySpan<char>.op_Implicit((char[])null))
		{
			num = Encoding.UTF8.GetByteCount(filename);
			ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1));
			int utf = Util.GetUtf8(filename, ptr, num);
			ptr[utf] = 0;
		}
		else
		{
			ptr = null;
		}
		ImFontConfig* nativePtr = font_cfg.NativePtr;
		ushort* glyph_ranges = null;
		ImFont* nativePtr2 = ImGuiNative.ImFontAtlas_AddFontFromFileTTF(NativePtr, ptr, size_pixels, nativePtr, glyph_ranges);
		if (num > 2048)
		{
			Util.Free(ptr);
		}
		return new ImFontPtr(nativePtr2);
	}

	public unsafe ImFontPtr AddFontFromFileTTF(string filename, float size_pixels, ImFontConfigPtr font_cfg)
	{
		int num = 0;
		byte* ptr;
		if (filename != null)
		{
			num = Encoding.UTF8.GetByteCount(filename);
			ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1));
			int utf = Util.GetUtf8(filename, ptr, num);
			ptr[utf] = 0;
		}
		else
		{
			ptr = null;
		}
		ImFontConfig* nativePtr = font_cfg.NativePtr;
		ushort* glyph_ranges = null;
		ImFont* nativePtr2 = ImGuiNative.ImFontAtlas_AddFontFromFileTTF(NativePtr, ptr, size_pixels, nativePtr, glyph_ranges);
		if (num > 2048)
		{
			Util.Free(ptr);
		}
		return new ImFontPtr(nativePtr2);
	}

	public unsafe ImFontPtr AddFontFromFileTTF(global::System.ReadOnlySpan<char> filename, float size_pixels, ImFontConfigPtr font_cfg, nint glyph_ranges)
	{
		int num = 0;
		byte* ptr;
		if (filename != global::System.ReadOnlySpan<char>.op_Implicit((char[])null))
		{
			num = Encoding.UTF8.GetByteCount(filename);
			ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1));
			int utf = Util.GetUtf8(filename, ptr, num);
			ptr[utf] = 0;
		}
		else
		{
			ptr = null;
		}
		ImFontConfig* nativePtr = font_cfg.NativePtr;
		ushort* glyph_ranges2 = (ushort*)((global::System.IntPtr)glyph_ranges).ToPointer();
		ImFont* nativePtr2 = ImGuiNative.ImFontAtlas_AddFontFromFileTTF(NativePtr, ptr, size_pixels, nativePtr, glyph_ranges2);
		if (num > 2048)
		{
			Util.Free(ptr);
		}
		return new ImFontPtr(nativePtr2);
	}

	public unsafe ImFontPtr AddFontFromFileTTF(string filename, float size_pixels, ImFontConfigPtr font_cfg, nint glyph_ranges)
	{
		int num = 0;
		byte* ptr;
		if (filename != null)
		{
			num = Encoding.UTF8.GetByteCount(filename);
			ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1));
			int utf = Util.GetUtf8(filename, ptr, num);
			ptr[utf] = 0;
		}
		else
		{
			ptr = null;
		}
		ImFontConfig* nativePtr = font_cfg.NativePtr;
		ushort* glyph_ranges2 = (ushort*)((global::System.IntPtr)glyph_ranges).ToPointer();
		ImFont* nativePtr2 = ImGuiNative.ImFontAtlas_AddFontFromFileTTF(NativePtr, ptr, size_pixels, nativePtr, glyph_ranges2);
		if (num > 2048)
		{
			Util.Free(ptr);
		}
		return new ImFontPtr(nativePtr2);
	}

	public unsafe ImFontPtr AddFontFromMemoryCompressedBase85TTF(global::System.ReadOnlySpan<char> compressed_font_data_base85, float size_pixels)
	{
		int num = 0;
		byte* ptr;
		if (compressed_font_data_base85 != global::System.ReadOnlySpan<char>.op_Implicit((char[])null))
		{
			num = Encoding.UTF8.GetByteCount(compressed_font_data_base85);
			ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1));
			int utf = Util.GetUtf8(compressed_font_data_base85, ptr, num);
			ptr[utf] = 0;
		}
		else
		{
			ptr = null;
		}
		ImFontConfig* font_cfg = null;
		ushort* glyph_ranges = null;
		ImFont* nativePtr = ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(NativePtr, ptr, size_pixels, font_cfg, glyph_ranges);
		if (num > 2048)
		{
			Util.Free(ptr);
		}
		return new ImFontPtr(nativePtr);
	}

	public unsafe ImFontPtr AddFontFromMemoryCompressedBase85TTF(string compressed_font_data_base85, float size_pixels)
	{
		int num = 0;
		byte* ptr;
		if (compressed_font_data_base85 != null)
		{
			num = Encoding.UTF8.GetByteCount(compressed_font_data_base85);
			ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1));
			int utf = Util.GetUtf8(compressed_font_data_base85, ptr, num);
			ptr[utf] = 0;
		}
		else
		{
			ptr = null;
		}
		ImFontConfig* font_cfg = null;
		ushort* glyph_ranges = null;
		ImFont* nativePtr = ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(NativePtr, ptr, size_pixels, font_cfg, glyph_ranges);
		if (num > 2048)
		{
			Util.Free(ptr);
		}
		return new ImFontPtr(nativePtr);
	}

	public unsafe ImFontPtr AddFontFromMemoryCompressedBase85TTF(global::System.ReadOnlySpan<char> compressed_font_data_base85, float size_pixels, ImFontConfigPtr font_cfg)
	{
		int num = 0;
		byte* ptr;
		if (compressed_font_data_base85 != global::System.ReadOnlySpan<char>.op_Implicit((char[])null))
		{
			num = Encoding.UTF8.GetByteCount(compressed_font_data_base85);
			ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1));
			int utf = Util.GetUtf8(compressed_font_data_base85, ptr, num);
			ptr[utf] = 0;
		}
		else
		{
			ptr = null;
		}
		ImFontConfig* nativePtr = font_cfg.NativePtr;
		ushort* glyph_ranges = null;
		ImFont* nativePtr2 = ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(NativePtr, ptr, size_pixels, nativePtr, glyph_ranges);
		if (num > 2048)
		{
			Util.Free(ptr);
		}
		return new ImFontPtr(nativePtr2);
	}

	public unsafe ImFontPtr AddFontFromMemoryCompressedBase85TTF(string compressed_font_data_base85, float size_pixels, ImFontConfigPtr font_cfg)
	{
		int num = 0;
		byte* ptr;
		if (compressed_font_data_base85 != null)
		{
			num = Encoding.UTF8.GetByteCount(compressed_font_data_base85);
			ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1));
			int utf = Util.GetUtf8(compressed_font_data_base85, ptr, num);
			ptr[utf] = 0;
		}
		else
		{
			ptr = null;
		}
		ImFontConfig* nativePtr = font_cfg.NativePtr;
		ushort* glyph_ranges = null;
		ImFont* nativePtr2 = ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(NativePtr, ptr, size_pixels, nativePtr, glyph_ranges);
		if (num > 2048)
		{
			Util.Free(ptr);
		}
		return new ImFontPtr(nativePtr2);
	}

	public unsafe ImFontPtr AddFontFromMemoryCompressedBase85TTF(global::System.ReadOnlySpan<char> compressed_font_data_base85, float size_pixels, ImFontConfigPtr font_cfg, nint glyph_ranges)
	{
		int num = 0;
		byte* ptr;
		if (compressed_font_data_base85 != global::System.ReadOnlySpan<char>.op_Implicit((char[])null))
		{
			num = Encoding.UTF8.GetByteCount(compressed_font_data_base85);
			ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1));
			int utf = Util.GetUtf8(compressed_font_data_base85, ptr, num);
			ptr[utf] = 0;
		}
		else
		{
			ptr = null;
		}
		ImFontConfig* nativePtr = font_cfg.NativePtr;
		ushort* glyph_ranges2 = (ushort*)((global::System.IntPtr)glyph_ranges).ToPointer();
		ImFont* nativePtr2 = ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(NativePtr, ptr, size_pixels, nativePtr, glyph_ranges2);
		if (num > 2048)
		{
			Util.Free(ptr);
		}
		return new ImFontPtr(nativePtr2);
	}

	public unsafe ImFontPtr AddFontFromMemoryCompressedBase85TTF(string compressed_font_data_base85, float size_pixels, ImFontConfigPtr font_cfg, nint glyph_ranges)
	{
		int num = 0;
		byte* ptr;
		if (compressed_font_data_base85 != null)
		{
			num = Encoding.UTF8.GetByteCount(compressed_font_data_base85);
			ptr = ((num <= 2048) ? stackalloc byte[(int)(uint)(num + 1)] : Util.Allocate(num + 1));
			int utf = Util.GetUtf8(compressed_font_data_base85, ptr, num);
			ptr[utf] = 0;
		}
		else
		{
			ptr = null;
		}
		ImFontConfig* nativePtr = font_cfg.NativePtr;
		ushort* glyph_ranges2 = (ushort*)((global::System.IntPtr)glyph_ranges).ToPointer();
		ImFont* nativePtr2 = ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(NativePtr, ptr, size_pixels, nativePtr, glyph_ranges2);
		if (num > 2048)
		{
			Util.Free(ptr);
		}
		return new ImFontPtr(nativePtr2);
	}

	public unsafe ImFontPtr AddFontFromMemoryCompressedTTF(nint compressed_font_data, int compressed_font_data_size, float size_pixels)
	{
		void* compressed_font_data2 = ((global::System.IntPtr)compressed_font_data).ToPointer();
		ImFontConfig* font_cfg = null;
		ushort* glyph_ranges = null;
		return new ImFontPtr(ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedTTF(NativePtr, compressed_font_data2, compressed_font_data_size, size_pixels, font_cfg, glyph_ranges));
	}

	public unsafe ImFontPtr AddFontFromMemoryCompressedTTF(nint compressed_font_data, int compressed_font_data_size, float size_pixels, ImFontConfigPtr font_cfg)
	{
		void* compressed_font_data2 = ((global::System.IntPtr)compressed_font_data).ToPointer();
		ImFontConfig* nativePtr = font_cfg.NativePtr;
		ushort* glyph_ranges = null;
		return new ImFontPtr(ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedTTF(NativePtr, compressed_font_data2, compressed_font_data_size, size_pixels, nativePtr, glyph_ranges));
	}

	public unsafe ImFontPtr AddFontFromMemoryCompressedTTF(nint compressed_font_data, int compressed_font_data_size, float size_pixels, ImFontConfigPtr font_cfg, nint glyph_ranges)
	{
		void* compressed_font_data2 = ((global::System.IntPtr)compressed_font_data).ToPointer();
		ImFontConfig* nativePtr = font_cfg.NativePtr;
		ushort* glyph_ranges2 = (ushort*)((global::System.IntPtr)glyph_ranges).ToPointer();
		return new ImFontPtr(ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedTTF(NativePtr, compressed_font_data2, compressed_font_data_size, size_pixels, nativePtr, glyph_ranges2));
	}

	public unsafe ImFontPtr AddFontFromMemoryTTF(nint font_data, int font_data_size, float size_pixels)
	{
		void* font_data2 = ((global::System.IntPtr)font_data).ToPointer();
		ImFontConfig* font_cfg = null;
		ushort* glyph_ranges = null;
		return new ImFontPtr(ImGuiNative.ImFontAtlas_AddFontFromMemoryTTF(NativePtr, font_data2, font_data_size, size_pixels, font_cfg, glyph_ranges));
	}

	public unsafe ImFontPtr AddFontFromMemoryTTF(nint font_data, int font_data_size, float size_pixels, ImFontConfigPtr font_cfg)
	{
		void* font_data2 = ((global::System.IntPtr)font_data).ToPointer();
		ImFontConfig* nativePtr = font_cfg.NativePtr;
		ushort* glyph_ranges = null;
		return new ImFontPtr(ImGuiNative.ImFontAtlas_AddFontFromMemoryTTF(NativePtr, font_data2, font_data_size, size_pixels, nativePtr, glyph_ranges));
	}

	public unsafe ImFontPtr AddFontFromMemoryTTF(nint font_data, int font_data_size, float size_pixels, ImFontConfigPtr font_cfg, nint glyph_ranges)
	{
		void* font_data2 = ((global::System.IntPtr)font_data).ToPointer();
		ImFontConfig* nativePtr = font_cfg.NativePtr;
		ushort* glyph_ranges2 = (ushort*)((global::System.IntPtr)glyph_ranges).ToPointer();
		return new ImFontPtr(ImGuiNative.ImFontAtlas_AddFontFromMemoryTTF(NativePtr, font_data2, font_data_size, size_pixels, nativePtr, glyph_ranges2));
	}

	public unsafe bool Build()
	{
		return ImGuiNative.ImFontAtlas_Build(NativePtr) != 0;
	}

	public unsafe void CalcCustomRectUV(ImFontAtlasCustomRectPtr rect, out Vector2 out_uv_min, out Vector2 out_uv_max)
	{
		ImFontAtlasCustomRect* nativePtr = rect.NativePtr;
		fixed (Vector2* out_uv_min2 = &out_uv_min)
		{
			fixed (Vector2* out_uv_max2 = &out_uv_max)
			{
				ImGuiNative.ImFontAtlas_CalcCustomRectUV(NativePtr, nativePtr, out_uv_min2, out_uv_max2);
			}
		}
	}

	public unsafe void Clear()
	{
		ImGuiNative.ImFontAtlas_Clear(NativePtr);
	}

	public unsafe void ClearFonts()
	{
		ImGuiNative.ImFontAtlas_ClearFonts(NativePtr);
	}

	public unsafe void ClearInputData()
	{
		ImGuiNative.ImFontAtlas_ClearInputData(NativePtr);
	}

	public unsafe void ClearTexData()
	{
		ImGuiNative.ImFontAtlas_ClearTexData(NativePtr);
	}

	public unsafe void Destroy()
	{
		ImGuiNative.ImFontAtlas_destroy(NativePtr);
	}

	public unsafe ImFontAtlasCustomRectPtr GetCustomRectByIndex(int index)
	{
		return new ImFontAtlasCustomRectPtr(ImGuiNative.ImFontAtlas_GetCustomRectByIndex(NativePtr, index));
	}

	public unsafe nint GetGlyphRangesChineseFull()
	{
		return (nint)ImGuiNative.ImFontAtlas_GetGlyphRangesChineseFull(NativePtr);
	}

	public unsafe nint GetGlyphRangesChineseSimplifiedCommon()
	{
		return (nint)ImGuiNative.ImFontAtlas_GetGlyphRangesChineseSimplifiedCommon(NativePtr);
	}

	public unsafe nint GetGlyphRangesCyrillic()
	{
		return (nint)ImGuiNative.ImFontAtlas_GetGlyphRangesCyrillic(NativePtr);
	}

	public unsafe nint GetGlyphRangesDefault()
	{
		return (nint)ImGuiNative.ImFontAtlas_GetGlyphRangesDefault(NativePtr);
	}

	public unsafe nint GetGlyphRangesGreek()
	{
		return (nint)ImGuiNative.ImFontAtlas_GetGlyphRangesGreek(NativePtr);
	}

	public unsafe nint GetGlyphRangesJapanese()
	{
		return (nint)ImGuiNative.ImFontAtlas_GetGlyphRangesJapanese(NativePtr);
	}

	public unsafe nint GetGlyphRangesKorean()
	{
		return (nint)ImGuiNative.ImFontAtlas_GetGlyphRangesKorean(NativePtr);
	}

	public unsafe nint GetGlyphRangesThai()
	{
		return (nint)ImGuiNative.ImFontAtlas_GetGlyphRangesThai(NativePtr);
	}

	public unsafe nint GetGlyphRangesVietnamese()
	{
		return (nint)ImGuiNative.ImFontAtlas_GetGlyphRangesVietnamese(NativePtr);
	}

	public unsafe bool GetMouseCursorTexData(ImGuiMouseCursor cursor, out Vector2 out_offset, out Vector2 out_size, out Vector2 out_uv_border, out Vector2 out_uv_fill)
	{
		fixed (Vector2* out_offset2 = &out_offset)
		{
			fixed (Vector2* out_size2 = &out_size)
			{
				fixed (Vector2* out_uv_border2 = &out_uv_border)
				{
					fixed (Vector2* out_uv_fill2 = &out_uv_fill)
					{
						return ImGuiNative.ImFontAtlas_GetMouseCursorTexData(NativePtr, cursor, out_offset2, out_size2, out_uv_border2, out_uv_fill2) != 0;
					}
				}
			}
		}
	}

	public unsafe void GetTexDataAsAlpha8(out byte* out_pixels, out int out_width, out int out_height)
	{
		int* out_bytes_per_pixel = null;
		fixed (byte** out_pixels2 = &out_pixels)
		{
			fixed (int* out_width2 = &out_width)
			{
				fixed (int* out_height2 = &out_height)
				{
					ImGuiNative.ImFontAtlas_GetTexDataAsAlpha8(NativePtr, out_pixels2, out_width2, out_height2, out_bytes_per_pixel);
				}
			}
		}
	}

	public unsafe void GetTexDataAsAlpha8(out byte* out_pixels, out int out_width, out int out_height, out int out_bytes_per_pixel)
	{
		fixed (byte** out_pixels2 = &out_pixels)
		{
			fixed (int* out_width2 = &out_width)
			{
				fixed (int* out_height2 = &out_height)
				{
					fixed (int* out_bytes_per_pixel2 = &out_bytes_per_pixel)
					{
						ImGuiNative.ImFontAtlas_GetTexDataAsAlpha8(NativePtr, out_pixels2, out_width2, out_height2, out_bytes_per_pixel2);
					}
				}
			}
		}
	}

	public unsafe void GetTexDataAsAlpha8(out nint out_pixels, out int out_width, out int out_height)
	{
		int* out_bytes_per_pixel = null;
		fixed (nint* out_pixels2 = &out_pixels)
		{
			fixed (int* out_width2 = &out_width)
			{
				fixed (int* out_height2 = &out_height)
				{
					ImGuiNative.ImFontAtlas_GetTexDataAsAlpha8(NativePtr, out_pixels2, out_width2, out_height2, out_bytes_per_pixel);
				}
			}
		}
	}

	public unsafe void GetTexDataAsAlpha8(out nint out_pixels, out int out_width, out int out_height, out int out_bytes_per_pixel)
	{
		fixed (nint* out_pixels2 = &out_pixels)
		{
			fixed (int* out_width2 = &out_width)
			{
				fixed (int* out_height2 = &out_height)
				{
					fixed (int* out_bytes_per_pixel2 = &out_bytes_per_pixel)
					{
						ImGuiNative.ImFontAtlas_GetTexDataAsAlpha8(NativePtr, out_pixels2, out_width2, out_height2, out_bytes_per_pixel2);
					}
				}
			}
		}
	}

	public unsafe void GetTexDataAsRGBA32(out byte* out_pixels, out int out_width, out int out_height)
	{
		int* out_bytes_per_pixel = null;
		fixed (byte** out_pixels2 = &out_pixels)
		{
			fixed (int* out_width2 = &out_width)
			{
				fixed (int* out_height2 = &out_height)
				{
					ImGuiNative.ImFontAtlas_GetTexDataAsRGBA32(NativePtr, out_pixels2, out_width2, out_height2, out_bytes_per_pixel);
				}
			}
		}
	}

	public unsafe void GetTexDataAsRGBA32(out byte* out_pixels, out int out_width, out int out_height, out int out_bytes_per_pixel)
	{
		fixed (byte** out_pixels2 = &out_pixels)
		{
			fixed (int* out_width2 = &out_width)
			{
				fixed (int* out_height2 = &out_height)
				{
					fixed (int* out_bytes_per_pixel2 = &out_bytes_per_pixel)
					{
						ImGuiNative.ImFontAtlas_GetTexDataAsRGBA32(NativePtr, out_pixels2, out_width2, out_height2, out_bytes_per_pixel2);
					}
				}
			}
		}
	}

	public unsafe void GetTexDataAsRGBA32(out nint out_pixels, out int out_width, out int out_height)
	{
		int* out_bytes_per_pixel = null;
		fixed (nint* out_pixels2 = &out_pixels)
		{
			fixed (int* out_width2 = &out_width)
			{
				fixed (int* out_height2 = &out_height)
				{
					ImGuiN