using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; 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; using Microsoft.CodeAnalysis; using Microsoft.Toolkit.HighPerformance; using Microsoft.Toolkit.HighPerformance.Buffers; using Raylib_CsLo.InternalHelpers; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("NotNotTech")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCopyright("(C) NotNotTech and Contribs")] [assembly: AssemblyDescription("\r\n Managed C# bindings to Raylib, a friendly 2d/3d game framework similar to XNA / MonoGame.\r\n - Win/Linux/OsX supported.\r\n - Includes bindings for raylib extras: RayGui, Easings, Physac, RlGl, RayMath.\r\n - Minimal bindings + convenience wrappers to make it easier to use.\r\n - Tested and verified via more than 100 examples (**ALL** Raylib examples ported). These [examples are available to you in the GitHub Repo](https://github.com/NotNotTech/Raylib-CsLo/tree/main/Raylib-CsLo.Examples)\r\n - Requires `unsafe` for 3d workflows.\r\n - Supports net5+, Mono 6.4+, NetCore3.0\r\n - Tested on Win10 Net6. Please test on other platforms and [raise an issue](https://github.com/NotNotTech/Raylib-CsLo/issues) if any problems occur.\r\n - A focus on performance. No runtime allocations if at all possible.\r\n - No intellisense docs. [read the raylib cheatsheet for docs](https://www.raylib.com/cheatsheet/cheatsheet.html) or [view the examples](https://github.com/NotNotTech/Raylib-CsLo/tree/main/Raylib-CsLo.Examples)\r\n ")] [assembly: AssemblyFileVersion("0.0.0.*")] [assembly: AssemblyInformationalVersion("4.2.0.9")] [assembly: AssemblyProduct("Raylib-CsLo")] [assembly: AssemblyTitle("Raylib-CsLo")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/NotNotTech/Raylib-CsLo")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.20128")] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] internal sealed class IsUnmanagedAttribute : Attribute { } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NativeIntegerAttribute : Attribute { public readonly bool[] TransformFlags; public NativeIntegerAttribute() { TransformFlags = new bool[1] { true }; } public NativeIntegerAttribute(bool[] P_0) { TransformFlags = P_0; } } } namespace Raylib_CsLo { public struct AudioStream { public unsafe rAudioBuffer* buffer; public unsafe rAudioProcessor* processor; public uint sampleRate; public uint sampleSize; public uint channels; } public enum BlendMode { BLEND_ALPHA, BLEND_ADDITIVE, BLEND_MULTIPLIED, BLEND_ADD_COLORS, BLEND_SUBTRACT_COLORS, BLEND_ALPHA_PREMULTIPLY, BLEND_CUSTOM } public struct BoneInfo { public unsafe fixed sbyte name[32]; public int parent; } public struct BoundingBox { public Vector3 min; public Vector3 max; public BoundingBox(Vector3 min, Vector3 max) { this.min = min; this.max = max; } } public struct Camera2D { public Vector2 offset; public Vector2 target; public float rotation; public float zoom; } public struct Camera3D { public Vector3 position; public Vector3 target; public Vector3 up; public float fovy; public int projection; public CameraProjection projection_ { get { return (CameraProjection)projection; } set { projection = (int)value; } } public Camera3D(Vector3 position, Vector3 target, Vector3 up, float fovy, CameraProjection projection) { this.position = position; this.target = target; this.up = up; this.fovy = fovy; this.projection = (int)projection; } } public enum CameraMode { CAMERA_CUSTOM, CAMERA_FREE, CAMERA_ORBITAL, CAMERA_FIRST_PERSON, CAMERA_THIRD_PERSON } public enum CameraProjection { CAMERA_PERSPECTIVE, CAMERA_ORTHOGRAPHIC } public struct Color { public byte r; public byte g; public byte b; public byte a; public Color(byte r, byte g, byte b, byte a) { this.r = r; this.g = g; this.b = b; this.a = a; } public Color(int r, int g, int b, int a) { this.r = (byte)r; this.g = (byte)g; this.b = (byte)b; this.a = (byte)a; } } public enum ConfigFlags { FLAG_VSYNC_HINT = 64, FLAG_FULLSCREEN_MODE = 2, FLAG_WINDOW_RESIZABLE = 4, FLAG_WINDOW_UNDECORATED = 8, FLAG_WINDOW_HIDDEN = 128, FLAG_WINDOW_MINIMIZED = 512, FLAG_WINDOW_MAXIMIZED = 1024, FLAG_WINDOW_UNFOCUSED = 2048, FLAG_WINDOW_TOPMOST = 4096, FLAG_WINDOW_ALWAYS_RUN = 256, FLAG_WINDOW_TRANSPARENT = 16, FLAG_WINDOW_HIGHDPI = 8192, FLAG_WINDOW_MOUSE_PASSTHROUGH = 16384, FLAG_MSAA_4X_HINT = 32, FLAG_INTERLACED_HINT = 65536 } public enum CubemapLayout { CUBEMAP_LAYOUT_AUTO_DETECT, CUBEMAP_LAYOUT_LINE_VERTICAL, CUBEMAP_LAYOUT_LINE_HORIZONTAL, CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR, CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE, CUBEMAP_LAYOUT_PANORAMA } public static class Easings { public static float EaseLinearNone(float t, float b, float c, float d) { return c * t / d + b; } public static float EaseLinearIn(float t, float b, float c, float d) { return c * t / d + b; } public static float EaseLinearOut(float t, float b, float c, float d) { return c * t / d + b; } public static float EaseLinearInOut(float t, float b, float c, float d) { return c * t / d + b; } public static float EaseSineIn(float t, float b, float c, float d) { return (0f - c) * MathF.Cos(t / d * (MathF.PI / 2f)) + c + b; } public static float EaseSineOut(float t, float b, float c, float d) { return c * MathF.Sin(t / d * (MathF.PI / 2f)) + b; } public static float EaseSineInOut(float t, float b, float c, float d) { return (0f - c) / 2f * (MathF.Cos(MathF.PI * t / d) - 1f) + b; } public static float EaseCircIn(float t, float b, float c, float d) { t /= d; return (0f - c) * (MathF.Sqrt(1f - t * t) - 1f) + b; } public static float EaseCircOut(float t, float b, float c, float d) { t = t / d - 1f; return c * MathF.Sqrt(1f - t * t) + b; } public static float EaseCircInOut(float t, float b, float c, float d) { if ((t /= d / 2f) < 1f) { return (0f - c) / 2f * (MathF.Sqrt(1f - t * t) - 1f) + b; } t -= 2f; return c / 2f * (MathF.Sqrt(1f - t * t) + 1f) + b; } public static float EaseCubicIn(float t, float b, float c, float d) { t /= d; return c * t * t * t + b; } public static float EaseCubicOut(float t, float b, float c, float d) { t = t / d - 1f; return c * (t * t * t + 1f) + b; } public static float EaseCubicInOut(float t, float b, float c, float d) { if ((t /= d / 2f) < 1f) { return c / 2f * t * t * t + b; } t -= 2f; return c / 2f * (t * t * t + 2f) + b; } public static float EaseQuadIn(float t, float b, float c, float d) { t /= d; return c * t * t + b; } public static float EaseQuadOut(float t, float b, float c, float d) { t /= d; return (0f - c) * t * (t - 2f) + b; } public static float EaseQuadInOut(float t, float b, float c, float d) { if ((t /= d / 2f) < 1f) { return c / 2f * (t * t) + b; } return (0f - c) / 2f * ((t - 1f) * (t - 3f) - 1f) + b; } public static float EaseExpoIn(float t, float b, float c, float d) { if (t != 0f) { return c * MathF.Pow(2f, 10f * (t / d - 1f)) + b; } return b; } public static float EaseExpoOut(float t, float b, float c, float d) { if (t != d) { return c * (0f - MathF.Pow(2f, -10f * t / d) + 1f) + b; } return b + c; } public static float EaseExpoInOut(float t, float b, float c, float d) { if (t == 0f) { return b; } if (t == d) { return b + c; } if ((t /= d / 2f) < 1f) { return c / 2f * MathF.Pow(2f, 10f * (t - 1f)) + b; } return c / 2f * (0f - MathF.Pow(2f, -10f * (t - 1f)) + 2f) + b; } public static float EaseBackIn(float t, float b, float c, float d) { float num = 1.70158f; float num2 = (t /= d); return c * num2 * t * ((num + 1f) * t - num) + b; } public static float EaseBackOut(float t, float b, float c, float d) { float num = 1.70158f; t = t / d - 1f; return c * (t * t * ((num + 1f) * t + num) + 1f) + b; } public static float EaseBackInOut(float t, float b, float c, float d) { float num = 1.70158f; if ((t /= d / 2f) < 1f) { num *= 1.525f; return c / 2f * (t * t * ((num + 1f) * t - num)) + b; } float num2 = (t -= 2f); num *= 1.525f; return c / 2f * (num2 * t * ((num + 1f) * t + num) + 2f) + b; } public static float EaseBounceOut(float t, float b, float c, float d) { if ((t /= d) < 0.36363637f) { return c * (7.5625f * t * t) + b; } if (t < 0.72727275f) { float num = (t -= 0.54545456f); return c * (7.5625f * num * t + 0.75f) + b; } if ((double)t < 0.9090909090909091) { float num2 = (t -= 0.8181818f); return c * (7.5625f * num2 * t + 0.9375f) + b; } float num3 = (t -= 21f / 22f); return c * (7.5625f * num3 * t + 63f / 64f) + b; } public static float EaseBounceIn(float t, float b, float c, float d) { return c - EaseBounceOut(d - t, 0f, c, d) + b; } public static float EaseBounceInOut(float t, float b, float c, float d) { if (t < d / 2f) { return EaseBounceIn(t * 2f, 0f, c, d) * 0.5f + b; } return EaseBounceOut(t * 2f - d, 0f, c, d) * 0.5f + c * 0.5f + b; } public static float EaseElasticIn(float t, float b, float c, float d) { if (t == 0f) { return b; } if ((t /= d) == 1f) { return b + c; } float num = d * 0.3f; float num2 = num / 4f; return 0f - c * MathF.Pow(2f, 10f * (t -= 1f)) * MathF.Sin((t * d - num2) * (MathF.PI * 2f) / num) + b; } public static float EaseElasticOut(float t, float b, float c, float d) { if (t == 0f) { return b; } if ((t /= d) == 1f) { return b + c; } float num = d * 0.3f; float num2 = num / 4f; return c * MathF.Pow(2f, -10f * t) * MathF.Sin((t * d - num2) * (MathF.PI * 2f) / num) + c + b; } public static float EaseElasticInOut(float t, float b, float c, float d) { if (t == 0f) { return b; } if ((t /= d / 2f) == 2f) { return b + c; } float num = d * 0.45000002f; float num2 = num / 4f; if (t < 1f) { float num3 = c * MathF.Pow(2f, 10f * (t -= 1f)); return -0.5f * (num3 * MathF.Sin((t * d - num2) * (MathF.PI * 2f) / num)) + b; } return c * MathF.Pow(2f, -10f * (t -= 1f)) * MathF.Sin((t * d - num2) * (MathF.PI * 2f) / num) * 0.5f + c + b; } } public struct FilePathList { public uint capacity; public uint count; public unsafe sbyte** paths; } public struct float16 { public unsafe fixed float v[16]; public unsafe static float16 FromMatrix(Matrix4x4 matrix) { float16* ptr = (float16*)(&matrix); return *ptr; } } public struct float3 { public unsafe fixed float v[3]; public unsafe static float3 FromVector3(Vector3 vector) { float3* ptr = (float3*)(&vector); return *ptr; } } public struct Font { public int baseSize; public int glyphCount; public int glyphPadding; public Texture texture; public unsafe Rectangle* recs; public unsafe GlyphInfo* glyphs; } public enum FontType { FONT_DEFAULT, FONT_BITMAP, FONT_SDF } public enum GamepadAxis { GAMEPAD_AXIS_LEFT_X, GAMEPAD_AXIS_LEFT_Y, GAMEPAD_AXIS_RIGHT_X, GAMEPAD_AXIS_RIGHT_Y, GAMEPAD_AXIS_LEFT_TRIGGER, GAMEPAD_AXIS_RIGHT_TRIGGER } public enum GamepadButton { GAMEPAD_BUTTON_UNKNOWN, GAMEPAD_BUTTON_LEFT_FACE_UP, GAMEPAD_BUTTON_LEFT_FACE_RIGHT, GAMEPAD_BUTTON_LEFT_FACE_DOWN, GAMEPAD_BUTTON_LEFT_FACE_LEFT, GAMEPAD_BUTTON_RIGHT_FACE_UP, GAMEPAD_BUTTON_RIGHT_FACE_RIGHT, GAMEPAD_BUTTON_RIGHT_FACE_DOWN, GAMEPAD_BUTTON_RIGHT_FACE_LEFT, GAMEPAD_BUTTON_LEFT_TRIGGER_1, GAMEPAD_BUTTON_LEFT_TRIGGER_2, GAMEPAD_BUTTON_RIGHT_TRIGGER_1, GAMEPAD_BUTTON_RIGHT_TRIGGER_2, GAMEPAD_BUTTON_MIDDLE_LEFT, GAMEPAD_BUTTON_MIDDLE, GAMEPAD_BUTTON_MIDDLE_RIGHT, GAMEPAD_BUTTON_LEFT_THUMB, GAMEPAD_BUTTON_RIGHT_THUMB } public enum Gesture { GESTURE_NONE = 0, GESTURE_TAP = 1, GESTURE_DOUBLETAP = 2, GESTURE_HOLD = 4, GESTURE_DRAG = 8, GESTURE_SWIPE_RIGHT = 0x10, GESTURE_SWIPE_LEFT = 0x20, GESTURE_SWIPE_UP = 0x40, GESTURE_SWIPE_DOWN = 0x80, GESTURE_PINCH_IN = 0x100, GESTURE_PINCH_OUT = 0x200 } public struct GlyphInfo { public int value; public int offsetX; public int offsetY; public int advanceX; public Image image; } public enum GuiCheckBoxProperty { CHECK_PADDING = 0x10 } public enum GuiColorPickerProperty { COLOR_SELECTOR_SIZE = 16, HUEBAR_WIDTH, HUEBAR_PADDING, HUEBAR_SELECTOR_HEIGHT, HUEBAR_SELECTOR_OVERFLOW } public enum GuiComboBoxProperty { COMBO_BUTTON_WIDTH = 16, COMBO_BUTTON_SPACING } public enum GuiControl { DEFAULT, LABEL, BUTTON, TOGGLE, SLIDER, PROGRESSBAR, CHECKBOX, COMBOBOX, DROPDOWNBOX, TEXTBOX, VALUEBOX, SPINNER, LISTVIEW, COLORPICKER, SCROLLBAR, STATUSBAR } public enum GuiControlProperty { BORDER_COLOR_NORMAL, BASE_COLOR_NORMAL, TEXT_COLOR_NORMAL, BORDER_COLOR_FOCUSED, BASE_COLOR_FOCUSED, TEXT_COLOR_FOCUSED, BORDER_COLOR_PRESSED, BASE_COLOR_PRESSED, TEXT_COLOR_PRESSED, BORDER_COLOR_DISABLED, BASE_COLOR_DISABLED, TEXT_COLOR_DISABLED, BORDER_WIDTH, TEXT_PADDING, TEXT_ALIGNMENT, RESERVED } public enum GuiDefaultProperty { TEXT_SIZE = 16, TEXT_SPACING, LINE_COLOR, BACKGROUND_COLOR } public enum GuiDropdownBoxProperty { ARROW_PADDING = 16, DROPDOWN_ITEMS_SPACING } public enum GuiIconName { ICON_NONE, ICON_FOLDER_FILE_OPEN, ICON_FILE_SAVE_CLASSIC, ICON_FOLDER_OPEN, ICON_FOLDER_SAVE, ICON_FILE_OPEN, ICON_FILE_SAVE, ICON_FILE_EXPORT, ICON_FILE_ADD, ICON_FILE_DELETE, ICON_FILETYPE_TEXT, ICON_FILETYPE_AUDIO, ICON_FILETYPE_IMAGE, ICON_FILETYPE_PLAY, ICON_FILETYPE_VIDEO, ICON_FILETYPE_INFO, ICON_FILE_COPY, ICON_FILE_CUT, ICON_FILE_PASTE, ICON_CURSOR_HAND, ICON_CURSOR_POINTER, ICON_CURSOR_CLASSIC, ICON_PENCIL, ICON_PENCIL_BIG, ICON_BRUSH_CLASSIC, ICON_BRUSH_PAINTER, ICON_WATER_DROP, ICON_COLOR_PICKER, ICON_RUBBER, ICON_COLOR_BUCKET, ICON_TEXT_T, ICON_TEXT_A, ICON_SCALE, ICON_RESIZE, ICON_FILTER_POINT, ICON_FILTER_BILINEAR, ICON_CROP, ICON_CROP_ALPHA, ICON_SQUARE_TOGGLE, ICON_SYMMETRY, ICON_SYMMETRY_HORIZONTAL, ICON_SYMMETRY_VERTICAL, ICON_LENS, ICON_LENS_BIG, ICON_EYE_ON, ICON_EYE_OFF, ICON_FILTER_TOP, ICON_FILTER, ICON_TARGET_POINT, ICON_TARGET_SMALL, ICON_TARGET_BIG, ICON_TARGET_MOVE, ICON_CURSOR_MOVE, ICON_CURSOR_SCALE, ICON_CURSOR_SCALE_RIGHT, ICON_CURSOR_SCALE_LEFT, ICON_UNDO, ICON_REDO, ICON_REREDO, ICON_MUTATE, ICON_ROTATE, ICON_REPEAT, ICON_SHUFFLE, ICON_EMPTYBOX, ICON_TARGET, ICON_TARGET_SMALL_FILL, ICON_TARGET_BIG_FILL, ICON_TARGET_MOVE_FILL, ICON_CURSOR_MOVE_FILL, ICON_CURSOR_SCALE_FILL, ICON_CURSOR_SCALE_RIGHT_FILL, ICON_CURSOR_SCALE_LEFT_FILL, ICON_UNDO_FILL, ICON_REDO_FILL, ICON_REREDO_FILL, ICON_MUTATE_FILL, ICON_ROTATE_FILL, ICON_REPEAT_FILL, ICON_SHUFFLE_FILL, ICON_EMPTYBOX_SMALL, ICON_BOX, ICON_BOX_TOP, ICON_BOX_TOP_RIGHT, ICON_BOX_RIGHT, ICON_BOX_BOTTOM_RIGHT, ICON_BOX_BOTTOM, ICON_BOX_BOTTOM_LEFT, ICON_BOX_LEFT, ICON_BOX_TOP_LEFT, ICON_BOX_CENTER, ICON_BOX_CIRCLE_MASK, ICON_POT, ICON_ALPHA_MULTIPLY, ICON_ALPHA_CLEAR, ICON_DITHERING, ICON_MIPMAPS, ICON_BOX_GRID, ICON_GRID, ICON_BOX_CORNERS_SMALL, ICON_BOX_CORNERS_BIG, ICON_FOUR_BOXES, ICON_GRID_FILL, ICON_BOX_MULTISIZE, ICON_ZOOM_SMALL, ICON_ZOOM_MEDIUM, ICON_ZOOM_BIG, ICON_ZOOM_ALL, ICON_ZOOM_CENTER, ICON_BOX_DOTS_SMALL, ICON_BOX_DOTS_BIG, ICON_BOX_CONCENTRIC, ICON_BOX_GRID_BIG, ICON_OK_TICK, ICON_CROSS, ICON_ARROW_LEFT, ICON_ARROW_RIGHT, ICON_ARROW_DOWN, ICON_ARROW_UP, ICON_ARROW_LEFT_FILL, ICON_ARROW_RIGHT_FILL, ICON_ARROW_DOWN_FILL, ICON_ARROW_UP_FILL, ICON_AUDIO, ICON_FX, ICON_WAVE, ICON_WAVE_SINUS, ICON_WAVE_SQUARE, ICON_WAVE_TRIANGULAR, ICON_CROSS_SMALL, ICON_PLAYER_PREVIOUS, ICON_PLAYER_PLAY_BACK, ICON_PLAYER_PLAY, ICON_PLAYER_PAUSE, ICON_PLAYER_STOP, ICON_PLAYER_NEXT, ICON_PLAYER_RECORD, ICON_MAGNET, ICON_LOCK_CLOSE, ICON_LOCK_OPEN, ICON_CLOCK, ICON_TOOLS, ICON_GEAR, ICON_GEAR_BIG, ICON_BIN, ICON_HAND_POINTER, ICON_LASER, ICON_COIN, ICON_EXPLOSION, ICON_1UP, ICON_PLAYER, ICON_PLAYER_JUMP, ICON_KEY, ICON_DEMON, ICON_TEXT_POPUP, ICON_GEAR_EX, ICON_CRACK, ICON_CRACK_POINTS, ICON_STAR, ICON_DOOR, ICON_EXIT, ICON_MODE_2D, ICON_MODE_3D, ICON_CUBE, ICON_CUBE_FACE_TOP, ICON_CUBE_FACE_LEFT, ICON_CUBE_FACE_FRONT, ICON_CUBE_FACE_BOTTOM, ICON_CUBE_FACE_RIGHT, ICON_CUBE_FACE_BACK, ICON_CAMERA, ICON_SPECIAL, ICON_LINK_NET, ICON_LINK_BOXES, ICON_LINK_MULTI, ICON_LINK, ICON_LINK_BROKE, ICON_TEXT_NOTES, ICON_NOTEBOOK, ICON_SUITCASE, ICON_SUITCASE_ZIP, ICON_MAILBOX, ICON_MONITOR, ICON_PRINTER, ICON_PHOTO_CAMERA, ICON_PHOTO_CAMERA_FLASH, ICON_HOUSE, ICON_HEART, ICON_CORNER, ICON_VERTICAL_BARS, ICON_VERTICAL_BARS_FILL, ICON_LIFE_BARS, ICON_INFO, ICON_CROSSLINE, ICON_HELP, ICON_FILETYPE_ALPHA, ICON_FILETYPE_HOME, ICON_LAYERS_VISIBLE, ICON_LAYERS, ICON_WINDOW, ICON_HIDPI, ICON_FILETYPE_BINARY, ICON_HEX, ICON_SHIELD, ICON_FILE_NEW, ICON_FOLDER_ADD, ICON_ALARM, ICON_206, ICON_207, ICON_208, ICON_209, ICON_210, ICON_211, ICON_212, ICON_213, ICON_214, ICON_215, ICON_216, ICON_217, ICON_218, ICON_219, ICON_220, ICON_221, ICON_222, ICON_223, ICON_224, ICON_225, ICON_226, ICON_227, ICON_228, ICON_229, ICON_230, ICON_231, ICON_232, ICON_233, ICON_234, ICON_235, ICON_236, ICON_237, ICON_238, ICON_239, ICON_240, ICON_241, ICON_242, ICON_243, ICON_244, ICON_245, ICON_246, ICON_247, ICON_248, ICON_249, ICON_250, ICON_251, ICON_252, ICON_253, ICON_254, ICON_255 } public enum GuiListViewProperty { LIST_ITEMS_HEIGHT = 16, LIST_ITEMS_SPACING, SCROLLBAR_WIDTH, SCROLLBAR_SIDE } public enum GuiProgressBarProperty { PROGRESS_PADDING = 0x10 } public enum GuiScrollBarProperty { ARROWS_SIZE = 16, ARROWS_VISIBLE, SCROLL_SLIDER_PADDING, SCROLL_SLIDER_SIZE, SCROLL_PADDING, SCROLL_SPEED } public enum GuiSliderProperty { SLIDER_WIDTH = 16, SLIDER_PADDING } public enum GuiSpinnerProperty { SPIN_BUTTON_WIDTH = 16, SPIN_BUTTON_SPACING } public enum GuiState { STATE_NORMAL, STATE_FOCUSED, STATE_PRESSED, STATE_DISABLED } public struct GuiStyleProp { public ushort controlId; public ushort propertyId; public uint propertyValue; } public enum GuiTextAlignment { TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, TEXT_ALIGN_RIGHT } public enum GuiTextBoxProperty { TEXT_INNER_PADDING = 16, TEXT_LINES_SPACING } public enum GuiToggleProperty { GROUP_PADDING = 0x10 } public struct Image { public unsafe void* data; public int width; public int height; public int mipmaps; public int format; } public enum KeyboardKey { KEY_NULL = 0, KEY_APOSTROPHE = 39, KEY_COMMA = 44, KEY_MINUS = 45, KEY_PERIOD = 46, KEY_SLASH = 47, KEY_ZERO = 48, KEY_ONE = 49, KEY_TWO = 50, KEY_THREE = 51, KEY_FOUR = 52, KEY_FIVE = 53, KEY_SIX = 54, KEY_SEVEN = 55, KEY_EIGHT = 56, KEY_NINE = 57, KEY_SEMICOLON = 59, KEY_EQUAL = 61, KEY_A = 65, KEY_B = 66, KEY_C = 67, KEY_D = 68, KEY_E = 69, KEY_F = 70, KEY_G = 71, KEY_H = 72, KEY_I = 73, KEY_J = 74, KEY_K = 75, KEY_L = 76, KEY_M = 77, KEY_N = 78, KEY_O = 79, KEY_P = 80, KEY_Q = 81, KEY_R = 82, KEY_S = 83, KEY_T = 84, KEY_U = 85, KEY_V = 86, KEY_W = 87, KEY_X = 88, KEY_Y = 89, KEY_Z = 90, KEY_LEFT_BRACKET = 91, KEY_BACKSLASH = 92, KEY_RIGHT_BRACKET = 93, KEY_GRAVE = 96, KEY_SPACE = 32, KEY_ESCAPE = 256, KEY_ENTER = 257, KEY_TAB = 258, KEY_BACKSPACE = 259, KEY_INSERT = 260, KEY_DELETE = 261, KEY_RIGHT = 262, KEY_LEFT = 263, KEY_DOWN = 264, KEY_UP = 265, KEY_PAGE_UP = 266, KEY_PAGE_DOWN = 267, KEY_HOME = 268, KEY_END = 269, KEY_CAPS_LOCK = 280, KEY_SCROLL_LOCK = 281, KEY_NUM_LOCK = 282, KEY_PRINT_SCREEN = 283, KEY_PAUSE = 284, KEY_F1 = 290, KEY_F2 = 291, KEY_F3 = 292, KEY_F4 = 293, KEY_F5 = 294, KEY_F6 = 295, KEY_F7 = 296, KEY_F8 = 297, KEY_F9 = 298, KEY_F10 = 299, KEY_F11 = 300, KEY_F12 = 301, KEY_LEFT_SHIFT = 340, KEY_LEFT_CONTROL = 341, KEY_LEFT_ALT = 342, KEY_LEFT_SUPER = 343, KEY_RIGHT_SHIFT = 344, KEY_RIGHT_CONTROL = 345, KEY_RIGHT_ALT = 346, KEY_RIGHT_SUPER = 347, KEY_KB_MENU = 348, KEY_KP_0 = 320, KEY_KP_1 = 321, KEY_KP_2 = 322, KEY_KP_3 = 323, KEY_KP_4 = 324, KEY_KP_5 = 325, KEY_KP_6 = 326, KEY_KP_7 = 327, KEY_KP_8 = 328, KEY_KP_9 = 329, KEY_KP_DECIMAL = 330, KEY_KP_DIVIDE = 331, KEY_KP_MULTIPLY = 332, KEY_KP_SUBTRACT = 333, KEY_KP_ADD = 334, KEY_KP_ENTER = 335, KEY_KP_EQUAL = 336, KEY_BACK = 4, KEY_MENU = 82, KEY_VOLUME_UP = 24, KEY_VOLUME_DOWN = 25 } public struct Material { public Shader shader; public unsafe MaterialMap* maps; public unsafe fixed float @params[4]; } public struct MaterialMap { public Texture texture; public Color color; public float value; } public enum MaterialMapIndex { MATERIAL_MAP_ALBEDO, MATERIAL_MAP_METALNESS, MATERIAL_MAP_NORMAL, MATERIAL_MAP_ROUGHNESS, MATERIAL_MAP_OCCLUSION, MATERIAL_MAP_EMISSION, MATERIAL_MAP_HEIGHT, MATERIAL_MAP_CUBEMAP, MATERIAL_MAP_IRRADIANCE, MATERIAL_MAP_PREFILTER, MATERIAL_MAP_BRDF } public struct Matrix2x2 { public float m00; public float m01; public float m10; public float m11; } public struct Mesh { public int vertexCount; public int triangleCount; public unsafe float* vertices; public unsafe float* texcoords; public unsafe float* texcoords2; public unsafe float* normals; public unsafe float* tangents; public unsafe byte* colors; public unsafe ushort* indices; public unsafe float* animVertices; public unsafe float* animNormals; public unsafe byte* boneIds; public unsafe float* boneWeights; public uint vaoId; public unsafe uint* vboId; } public struct Model { public Matrix4x4 transform; public int meshCount; public int materialCount; public unsafe Mesh* meshes; public unsafe Material* materials; public unsafe int* meshMaterial; public int boneCount; public unsafe BoneInfo* bones; public unsafe Transform* bindPose; } public struct ModelAnimation { public int boneCount; public int frameCount; public unsafe BoneInfo* bones; public unsafe Transform** framePoses; } public enum MouseButton { MOUSE_BUTTON_LEFT, MOUSE_BUTTON_RIGHT, MOUSE_BUTTON_MIDDLE, MOUSE_BUTTON_SIDE, MOUSE_BUTTON_EXTRA, MOUSE_BUTTON_FORWARD, MOUSE_BUTTON_BACK } public enum MouseCursor { MOUSE_CURSOR_DEFAULT, MOUSE_CURSOR_ARROW, MOUSE_CURSOR_IBEAM, MOUSE_CURSOR_CROSSHAIR, MOUSE_CURSOR_POINTING_HAND, MOUSE_CURSOR_RESIZE_EW, MOUSE_CURSOR_RESIZE_NS, MOUSE_CURSOR_RESIZE_NWSE, MOUSE_CURSOR_RESIZE_NESW, MOUSE_CURSOR_RESIZE_ALL, MOUSE_CURSOR_NOT_ALLOWED } public struct Music { public AudioStream stream; public uint frameCount; public Bool looping; public int ctxType; public unsafe void* ctxData; } [AttributeUsage(AttributeTargets.Struct, AllowMultiple = false, Inherited = true)] [Conditional("DEBUG")] internal sealed class NativeInheritanceAttribute : Attribute { private readonly string _name; public string Name => _name; public NativeInheritanceAttribute(string name) { _name = name; } } [AttributeUsage(AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = false, Inherited = true)] [Conditional("DEBUG")] internal sealed class NativeTypeNameAttribute : Attribute { private readonly string _name; public string Name => _name; public NativeTypeNameAttribute(string name) { _name = name; } } public struct NPatchInfo { public Rectangle source; public int left; public int top; public int right; public int bottom; public int layout; public NPatchInfo(Rectangle source, int left, int top, int right, int bottom, NPatchLayout layout) { this.source = source; this.left = left; this.top = top; this.right = right; this.bottom = bottom; this.layout = (int)layout; } } public enum NPatchLayout { NPATCH_NINE_PATCH, NPATCH_THREE_PATCH_VERTICAL, NPATCH_THREE_PATCH_HORIZONTAL } public static class Physac { public const int PHYSAC_MAX_BODIES = 64; public const int PHYSAC_MAX_MANIFOLDS = 4096; public const int PHYSAC_MAX_VERTICES = 24; public const int PHYSAC_DEFAULT_CIRCLE_VERTICES = 24; public const int PHYSAC_COLLISION_ITERATIONS = 100; public const float PHYSAC_PENETRATION_ALLOWANCE = 0.05f; public const float PHYSAC_PENETRATION_CORRECTION = 0.4f; public const float PHYSAC_PI = MathF.PI; public const float PHYSAC_DEG2RAD = MathF.PI / 180f; [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void InitPhysics(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void UpdatePhysics(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void ResetPhysics(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void ClosePhysics(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetPhysicsTimeStep(double delta); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetPhysicsGravity(float x, float y); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern PhysicsBodyData* CreatePhysicsBodyCircle(Vector2 pos, float radius, float density); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern PhysicsBodyData* CreatePhysicsBodyRectangle(Vector2 pos, float width, float height, float density); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern PhysicsBodyData* CreatePhysicsBodyPolygon(Vector2 pos, float radius, int sides, float density); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void DestroyPhysicsBody(PhysicsBodyData* body); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void PhysicsAddForce(PhysicsBodyData* body, Vector2 force); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void PhysicsAddTorque(PhysicsBodyData* body, float amount); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void PhysicsShatter(PhysicsBodyData* body, Vector2 position, float force); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void SetPhysicsBodyRotation(PhysicsBodyData* body, float radians); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern PhysicsBodyData* GetPhysicsBody(int index); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int GetPhysicsBodiesCount(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int GetPhysicsShapeType(int index); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int GetPhysicsShapeVerticesCount(int index); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern Vector2 GetPhysicsShapeVertex(PhysicsBodyData* body, int vertex); } public struct PhysicsBodyData { public uint id; public Bool enabled; public Vector2 position; public Vector2 velocity; public Vector2 force; public float angularVelocity; public float torque; public float orient; public float inertia; public float inverseInertia; public float mass; public float inverseMass; public float staticFriction; public float dynamicFriction; public float restitution; public Bool useGravity; public Bool isGrounded; public Bool freezeOrient; public PhysicsShape shape; } public struct PhysicsManifoldData { public struct _contacts_e__FixedBuffer { public Vector2 e0; public Vector2 e1; public ref Vector2 this[int index] { [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return ref AsSpan()[index]; } } [MethodImpl(MethodImplOptions.AggressiveInlining)] public Span AsSpan() { return MemoryMarshal.CreateSpan(ref e0, 2); } } public uint id; public unsafe PhysicsBodyData* bodyA; public unsafe PhysicsBodyData* bodyB; public float penetration; public Vector2 normal; public _contacts_e__FixedBuffer contacts; public uint contactsCount; public float restitution; public float dynamicFriction; public float staticFriction; } public struct PhysicsShape { public PhysicsShapeType type; public unsafe PhysicsBodyData* body; public PhysicsVertexData vertexData; public float radius; public Matrix2x2 transform; } public enum PhysicsShapeType { PHYSICS_CIRCLE, PHYSICS_POLYGON } public struct PhysicsVertexData { public struct _positions_e__FixedBuffer { public Vector2 e0; public Vector2 e1; public Vector2 e2; public Vector2 e3; public Vector2 e4; public Vector2 e5; public Vector2 e6; public Vector2 e7; public Vector2 e8; public Vector2 e9; public Vector2 e10; public Vector2 e11; public Vector2 e12; public Vector2 e13; public Vector2 e14; public Vector2 e15; public Vector2 e16; public Vector2 e17; public Vector2 e18; public Vector2 e19; public Vector2 e20; public Vector2 e21; public Vector2 e22; public Vector2 e23; public ref Vector2 this[int index] { [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return ref AsSpan()[index]; } } [MethodImpl(MethodImplOptions.AggressiveInlining)] public Span AsSpan() { return MemoryMarshal.CreateSpan(ref e0, 24); } } public struct _normals_e__FixedBuffer { public Vector2 e0; public Vector2 e1; public Vector2 e2; public Vector2 e3; public Vector2 e4; public Vector2 e5; public Vector2 e6; public Vector2 e7; public Vector2 e8; public Vector2 e9; public Vector2 e10; public Vector2 e11; public Vector2 e12; public Vector2 e13; public Vector2 e14; public Vector2 e15; public Vector2 e16; public Vector2 e17; public Vector2 e18; public Vector2 e19; public Vector2 e20; public Vector2 e21; public Vector2 e22; public Vector2 e23; public ref Vector2 this[int index] { [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return ref AsSpan()[index]; } } [MethodImpl(MethodImplOptions.AggressiveInlining)] public Span AsSpan() { return MemoryMarshal.CreateSpan(ref e0, 24); } } public uint vertexCount; public _positions_e__FixedBuffer positions; public _normals_e__FixedBuffer normals; } public enum PixelFormat { PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1, PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA, PIXELFORMAT_UNCOMPRESSED_R5G6B5, PIXELFORMAT_UNCOMPRESSED_R8G8B8, PIXELFORMAT_UNCOMPRESSED_R5G5B5A1, PIXELFORMAT_UNCOMPRESSED_R4G4B4A4, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, PIXELFORMAT_UNCOMPRESSED_R32, PIXELFORMAT_UNCOMPRESSED_R32G32B32, PIXELFORMAT_UNCOMPRESSED_R32G32B32A32, PIXELFORMAT_COMPRESSED_DXT1_RGB, PIXELFORMAT_COMPRESSED_DXT1_RGBA, PIXELFORMAT_COMPRESSED_DXT3_RGBA, PIXELFORMAT_COMPRESSED_DXT5_RGBA, PIXELFORMAT_COMPRESSED_ETC1_RGB, PIXELFORMAT_COMPRESSED_ETC2_RGB, PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA, PIXELFORMAT_COMPRESSED_PVRT_RGB, PIXELFORMAT_COMPRESSED_PVRT_RGBA, PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA, PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA } [StructLayout(LayoutKind.Sequential, Size = 1)] public struct rAudioBuffer { } [StructLayout(LayoutKind.Sequential, Size = 1)] public struct rAudioProcessor { } public struct Ray { public Vector3 position; public Vector3 direction; public Ray(Vector3 position, Vector3 direction) { this.position = position; this.direction = direction; } } public struct RayCollision { public Bool hit; public float distance; public Vector3 point; public Vector3 normal; } public static class RayGui { public const int SCROLLBAR_LEFT_SIDE = 0; public const int SCROLLBAR_RIGHT_SIDE = 1; public static ReadOnlySpan RAYGUI_VERSION => "3.2\0"u8; [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void GuiEnable(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void GuiDisable(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void GuiLock(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void GuiUnlock(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool GuiIsLocked(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void GuiFade(float alpha); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void GuiSetState(int state); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int GuiGetState(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void GuiSetFont(Font font); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Font GuiGetFont(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void GuiSetStyle(int control, int property, int value); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int GuiGetStyle(int control, int property); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public unsafe static extern bool GuiWindowBox(Rectangle bounds, sbyte* title); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void GuiGroupBox(Rectangle bounds, sbyte* text); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void GuiLine(Rectangle bounds, sbyte* text); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void GuiPanel(Rectangle bounds, sbyte* text); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern Rectangle GuiScrollPanel(Rectangle bounds, sbyte* text, Rectangle content, Vector2* scroll); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void GuiLabel(Rectangle bounds, sbyte* text); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public unsafe static extern bool GuiButton(Rectangle bounds, sbyte* text); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public unsafe static extern bool GuiLabelButton(Rectangle bounds, sbyte* text); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public unsafe static extern bool GuiToggle(Rectangle bounds, sbyte* text, [MarshalAs(UnmanagedType.U1)] bool active); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern int GuiToggleGroup(Rectangle bounds, sbyte* text, int active); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public unsafe static extern bool GuiCheckBox(Rectangle bounds, sbyte* text, [MarshalAs(UnmanagedType.U1)] bool @checked); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern int GuiComboBox(Rectangle bounds, sbyte* text, int active); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public unsafe static extern bool GuiDropdownBox(Rectangle bounds, sbyte* text, int* active, [MarshalAs(UnmanagedType.U1)] bool editMode); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public unsafe static extern bool GuiSpinner(Rectangle bounds, sbyte* text, int* value, int minValue, int maxValue, [MarshalAs(UnmanagedType.U1)] bool editMode); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public unsafe static extern bool GuiValueBox(Rectangle bounds, sbyte* text, int* value, int minValue, int maxValue, [MarshalAs(UnmanagedType.U1)] bool editMode); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public unsafe static extern bool GuiTextBox(Rectangle bounds, sbyte* text, int textSize, [MarshalAs(UnmanagedType.U1)] bool editMode); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public unsafe static extern bool GuiTextBoxMulti(Rectangle bounds, sbyte* text, int textSize, [MarshalAs(UnmanagedType.U1)] bool editMode); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern float GuiSlider(Rectangle bounds, sbyte* textLeft, sbyte* textRight, float value, float minValue, float maxValue); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern float GuiSliderBar(Rectangle bounds, sbyte* textLeft, sbyte* textRight, float value, float minValue, float maxValue); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern float GuiProgressBar(Rectangle bounds, sbyte* textLeft, sbyte* textRight, float value, float minValue, float maxValue); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void GuiStatusBar(Rectangle bounds, sbyte* text); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void GuiDummyRec(Rectangle bounds, sbyte* text); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern Vector2 GuiGrid(Rectangle bounds, sbyte* text, float spacing, int subdivs); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern int GuiListView(Rectangle bounds, sbyte* text, int* scrollIndex, int active); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern int GuiListViewEx(Rectangle bounds, sbyte** text, int count, int* focus, int* scrollIndex, int active); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern int GuiMessageBox(Rectangle bounds, sbyte* title, sbyte* message, sbyte* buttons); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern int GuiTextInputBox(Rectangle bounds, sbyte* title, sbyte* message, sbyte* buttons, sbyte* text, int textMaxSize, int* secretViewActive); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern Color GuiColorPicker(Rectangle bounds, sbyte* text, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern Color GuiColorPanel(Rectangle bounds, sbyte* text, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern float GuiColorBarAlpha(Rectangle bounds, sbyte* text, float alpha); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern float GuiColorBarHue(Rectangle bounds, sbyte* text, float value); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void GuiLoadStyle(sbyte* fileName); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void GuiLoadStyleDefault(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern sbyte* GuiIconText(int iconId, sbyte* text); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void GuiDrawIcon(int iconId, int posX, int posY, int pixelSize, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern uint* GuiGetIcons(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern uint* GuiGetIconData(int iconId); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void GuiSetIconData(int iconId, uint* data); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void GuiSetIconScale(uint scale); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void GuiSetIconPixel(int iconId, int x, int y); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void GuiClearIconPixel(int iconId, int x, int y); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool GuiCheckIconPixel(int iconId, int x, int y); public unsafe static bool GuiWindowBox(Rectangle bounds, string? title) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = title.MarshalUtf8(); try { return GuiWindowBox(bounds, spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static void GuiGroupBox(Rectangle bounds, string? text) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { GuiGroupBox(bounds, spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static void GuiLine(Rectangle bounds, string? text) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { GuiLine(bounds, spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static void GuiLabel(Rectangle bounds, string? text) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { GuiLabel(bounds, spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static bool GuiButton(Rectangle bounds, string? text) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { return GuiButton(bounds, spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static bool GuiLabelButton(Rectangle bounds, string? text) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { return GuiLabelButton(bounds, spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static bool GuiToggle(Rectangle bounds, string? text, bool active) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { return GuiToggle(bounds, spanOwner.AsPtr(), active); } finally { spanOwner.Dispose(); } } public unsafe static int GuiToggleGroup(Rectangle bounds, string? text, int active) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { return GuiToggleGroup(bounds, spanOwner.AsPtr(), active); } finally { spanOwner.Dispose(); } } public unsafe static bool GuiCheckBox(Rectangle bounds, string? text, bool @checked) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { return GuiCheckBox(bounds, spanOwner.AsPtr(), @checked); } finally { spanOwner.Dispose(); } } public unsafe static int GuiComboBox(Rectangle bounds, string? text, int active) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { return GuiComboBox(bounds, spanOwner.AsPtr(), active); } finally { spanOwner.Dispose(); } } public unsafe static bool GuiDropdownBox(Rectangle bounds, string? text, int* active, bool editMode) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { return GuiDropdownBox(bounds, spanOwner.AsPtr(), active, editMode); } finally { spanOwner.Dispose(); } } public unsafe static bool GuiSpinner(Rectangle bounds, string? text, int* value, int minValue, int maxValue, bool editMode) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { return GuiSpinner(bounds, spanOwner.AsPtr(), value, minValue, maxValue, editMode); } finally { spanOwner.Dispose(); } } public unsafe static bool GuiValueBox(Rectangle bounds, string? text, int* value, int minValue, int maxValue, bool editMode) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { return GuiValueBox(bounds, spanOwner.AsPtr(), value, minValue, maxValue, editMode); } finally { spanOwner.Dispose(); } } public unsafe static bool GuiTextBox(Rectangle bounds, string? text, int textSize, bool editMode) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { return GuiTextBox(bounds, spanOwner.AsPtr(), textSize, editMode); } finally { spanOwner.Dispose(); } } public unsafe static bool GuiTextBoxMulti(Rectangle bounds, string? text, int textSize, bool editMode) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { return GuiTextBoxMulti(bounds, spanOwner.AsPtr(), textSize, editMode); } finally { spanOwner.Dispose(); } } public unsafe static float GuiSlider(Rectangle bounds, string? textLeft, string? textRight, float value, float minValue, float maxValue) { //IL_0001: 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_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_000f: 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) SpanOwner spanOwner = textLeft.MarshalUtf8(); try { SpanOwner spanOwner2 = textRight.MarshalUtf8(); try { return GuiSlider(bounds, spanOwner.AsPtr(), spanOwner2.AsPtr(), value, minValue, maxValue); } finally { spanOwner2.Dispose(); } } finally { spanOwner.Dispose(); } } public unsafe static float GuiSliderBar(Rectangle rectangle, string? leftText, string? rightText, float value, float minValue, float maxValue) { //IL_0001: 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_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_000f: 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) SpanOwner spanOwner = leftText.MarshalUtf8(); try { SpanOwner spanOwner2 = rightText.MarshalUtf8(); try { return GuiSliderBar(rectangle, spanOwner.AsPtr(), spanOwner2.AsPtr(), value, minValue, maxValue); } finally { spanOwner2.Dispose(); } } finally { spanOwner.Dispose(); } } public unsafe static float GuiProgressBar(Rectangle bounds, string? textLeft, string? textRight, float value, float minValue, float maxValue) { //IL_0001: 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_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_000f: 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) SpanOwner spanOwner = textLeft.MarshalUtf8(); try { SpanOwner spanOwner2 = textRight.MarshalUtf8(); try { return GuiProgressBar(bounds, spanOwner.AsPtr(), spanOwner2.AsPtr(), value, minValue, maxValue); } finally { spanOwner2.Dispose(); } } finally { spanOwner.Dispose(); } } public unsafe static void GuiStatusBar(Rectangle bounds, string? text) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { GuiStatusBar(bounds, spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static void GuiDummyRec(Rectangle bounds, string? text) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { GuiDummyRec(bounds, spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static int GuiListView(Rectangle bounds, string? text, int* scrollIndex, int active) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { return GuiListView(bounds, spanOwner.AsPtr(), scrollIndex, active); } finally { spanOwner.Dispose(); } } public unsafe static int GuiListViewEx(Rectangle bounds, string[] textArray, int count, int* focus, int* scrollIndex, int active) { sbyte** ptr = stackalloc sbyte*[textArray.Length]; for (int i = 0; i < textArray.Length; i++) { ptr[i] = (sbyte*)(void*)Marshal.StringToCoTaskMemUTF8(textArray[i]); } int result = GuiListViewEx(bounds, ptr, count, focus, scrollIndex, active); for (int j = 0; j < textArray.Length; j++) { Marshal.ZeroFreeCoTaskMemUTF8((IntPtr)ptr[j]); } return result; } public unsafe static int GuiMessageBox(Rectangle bounds, string? title, string? message, string? buttons) { //IL_0001: 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_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_000f: 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_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_0022: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = title.MarshalUtf8(); try { SpanOwner spanOwner2 = message.MarshalUtf8(); try { SpanOwner spanOwner3 = buttons.MarshalUtf8(); try { return GuiMessageBox(bounds, spanOwner.AsPtr(), spanOwner2.AsPtr(), spanOwner3.AsPtr()); } finally { spanOwner3.Dispose(); } } finally { spanOwner2.Dispose(); } } finally { spanOwner.Dispose(); } } public unsafe static int GuiTextInputBox(Rectangle bounds, string? title, string? message, string? buttons, string? text, int textMaxSize = 255) { //IL_0001: 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_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_000f: 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_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_001e: 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_002a: 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) SpanOwner spanOwner = title.MarshalUtf8(); try { SpanOwner spanOwner2 = message.MarshalUtf8(); try { SpanOwner spanOwner3 = buttons.MarshalUtf8(); try { SpanOwner spanOwner4 = text.MarshalUtf8(); try { return GuiTextInputBox(bounds, spanOwner.AsPtr(), spanOwner2.AsPtr(), spanOwner3.AsPtr(), spanOwner4.AsPtr(), textMaxSize, null); } finally { spanOwner4.Dispose(); } } finally { spanOwner3.Dispose(); } } finally { spanOwner2.Dispose(); } } finally { spanOwner.Dispose(); } } public unsafe static void GuiLoadStyle(string? fileName) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = fileName.MarshalUtf8(); try { GuiLoadStyle(spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static string GuiIconText(int iconId, string? text) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { return Helpers.Utf8ToString(GuiIconText(iconId, spanOwner.AsPtr())); } finally { spanOwner.Dispose(); } } } public static class Raylib { public static readonly Color LIGHTGRAY = new Color { r = 200, g = 200, b = 200, a = byte.MaxValue }; public static readonly Color GRAY = new Color { r = 130, g = 130, b = 130, a = byte.MaxValue }; public static readonly Color DARKGRAY = new Color { r = 80, g = 80, b = 80, a = byte.MaxValue }; public static readonly Color YELLOW = new Color { r = 253, g = 249, b = 0, a = byte.MaxValue }; public static readonly Color GOLD = new Color { r = byte.MaxValue, g = 203, b = 0, a = byte.MaxValue }; public static readonly Color ORANGE = new Color { r = byte.MaxValue, g = 161, b = 0, a = byte.MaxValue }; public static readonly Color PINK = new Color { r = byte.MaxValue, g = 109, b = 194, a = byte.MaxValue }; public static readonly Color RED = new Color { r = 230, g = 41, b = 55, a = byte.MaxValue }; public static readonly Color MAROON = new Color { r = 190, g = 33, b = 55, a = byte.MaxValue }; public static readonly Color GREEN = new Color { r = 0, g = 228, b = 48, a = byte.MaxValue }; public static readonly Color LIME = new Color { r = 0, g = 158, b = 47, a = byte.MaxValue }; public static readonly Color DARKGREEN = new Color { r = 0, g = 117, b = 44, a = byte.MaxValue }; public static readonly Color SKYBLUE = new Color { r = 102, g = 191, b = byte.MaxValue, a = byte.MaxValue }; public static readonly Color BLUE = new Color { r = 0, g = 121, b = 241, a = byte.MaxValue }; public static readonly Color DARKBLUE = new Color { r = 0, g = 82, b = 172, a = byte.MaxValue }; public static readonly Color PURPLE = new Color { r = 200, g = 122, b = byte.MaxValue, a = byte.MaxValue }; public static readonly Color VIOLET = new Color { r = 135, g = 60, b = 190, a = byte.MaxValue }; public static readonly Color DARKPURPLE = new Color { r = 112, g = 31, b = 126, a = byte.MaxValue }; public static readonly Color BEIGE = new Color { r = 211, g = 176, b = 131, a = byte.MaxValue }; public static readonly Color BROWN = new Color { r = 127, g = 106, b = 79, a = byte.MaxValue }; public static readonly Color DARKBROWN = new Color { r = 76, g = 63, b = 47, a = byte.MaxValue }; public static readonly Color WHITE = new Color { r = byte.MaxValue, g = byte.MaxValue, b = byte.MaxValue, a = byte.MaxValue }; public static readonly Color BLACK = new Color { r = 0, g = 0, b = 0, a = byte.MaxValue }; public static readonly Color BLANK = new Color { r = 0, g = 0, b = 0, a = 0 }; public static readonly Color MAGENTA = new Color { r = byte.MaxValue, g = 0, b = byte.MaxValue, a = byte.MaxValue }; public static readonly Color RAYWHITE = new Color { r = 245, g = 245, b = 245, a = byte.MaxValue }; public const MouseButton MOUSE_LEFT_BUTTON = MouseButton.MOUSE_BUTTON_LEFT; public const MouseButton MOUSE_RIGHT_BUTTON = MouseButton.MOUSE_BUTTON_RIGHT; public const MouseButton MOUSE_MIDDLE_BUTTON = MouseButton.MOUSE_BUTTON_MIDDLE; public const MaterialMapIndex MATERIAL_MAP_DIFFUSE = MaterialMapIndex.MATERIAL_MAP_ALBEDO; public const MaterialMapIndex MATERIAL_MAP_SPECULAR = MaterialMapIndex.MATERIAL_MAP_METALNESS; public const ShaderLocationIndex SHADER_LOC_MAP_DIFFUSE = ShaderLocationIndex.SHADER_LOC_MAP_ALBEDO; public const ShaderLocationIndex SHADER_LOC_MAP_SPECULAR = ShaderLocationIndex.SHADER_LOC_MAP_METALNESS; public static ReadOnlySpan RAYLIB_VERSION => "4.2\0"u8; [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void InitWindow(int width, int height, sbyte* title); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool WindowShouldClose(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void CloseWindow(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool IsWindowReady(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool IsWindowFullscreen(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool IsWindowHidden(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool IsWindowMinimized(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool IsWindowMaximized(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool IsWindowFocused(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool IsWindowResized(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool IsWindowState(uint flag); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetWindowState(uint flags); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void ClearWindowState(uint flags); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void ToggleFullscreen(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void MaximizeWindow(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void MinimizeWindow(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void RestoreWindow(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetWindowIcon(Image image); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void SetWindowTitle(sbyte* title); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetWindowPosition(int x, int y); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetWindowMonitor(int monitor); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetWindowMinSize(int width, int height); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetWindowSize(int width, int height); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetWindowOpacity(float opacity); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void* GetWindowHandle(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int GetScreenWidth(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int GetScreenHeight(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int GetRenderWidth(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int GetRenderHeight(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int GetMonitorCount(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int GetCurrentMonitor(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Vector2 GetMonitorPosition(int monitor); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int GetMonitorWidth(int monitor); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int GetMonitorHeight(int monitor); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int GetMonitorPhysicalWidth(int monitor); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int GetMonitorPhysicalHeight(int monitor); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int GetMonitorRefreshRate(int monitor); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Vector2 GetWindowPosition(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Vector2 GetWindowScaleDPI(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern sbyte* GetMonitorName(int monitor); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void SetClipboardText(sbyte* text); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern sbyte* GetClipboardText(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void EnableEventWaiting(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DisableEventWaiting(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SwapScreenBuffer(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void PollInputEvents(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void WaitTime(double seconds); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void ShowCursor(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void HideCursor(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool IsCursorHidden(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void EnableCursor(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DisableCursor(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool IsCursorOnScreen(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void ClearBackground(Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void BeginDrawing(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void EndDrawing(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void BeginMode2D(Camera2D camera); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void EndMode2D(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void BeginMode3D(Camera3D camera); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void EndMode3D(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void BeginTextureMode(RenderTexture target); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void EndTextureMode(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void BeginShaderMode(Shader shader); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void EndShaderMode(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void BeginBlendMode(int mode); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void EndBlendMode(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void BeginScissorMode(int x, int y, int width, int height); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void EndScissorMode(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void BeginVrStereoMode(VrStereoConfig config); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void EndVrStereoMode(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern VrStereoConfig LoadVrStereoConfig(VrDeviceInfo device); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void UnloadVrStereoConfig(VrStereoConfig config); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern Shader LoadShader(sbyte* vsFileName, sbyte* fsFileName); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern Shader LoadShaderFromMemory(sbyte* vsCode, sbyte* fsCode); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern int GetShaderLocation(Shader shader, sbyte* uniformName); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern int GetShaderLocationAttrib(Shader shader, sbyte* attribName); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void SetShaderValue(Shader shader, int locIndex, void* value, int uniformType); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void SetShaderValueV(Shader shader, int locIndex, void* value, int uniformType, int count); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetShaderValueMatrix(Shader shader, int locIndex, Matrix4x4 mat); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetShaderValueTexture(Shader shader, int locIndex, Texture texture); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void UnloadShader(Shader shader); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Ray GetMouseRay(Vector2 mousePosition, Camera3D camera); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Matrix4x4 GetCameraMatrix(Camera3D camera); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Matrix4x4 GetCameraMatrix2D(Camera2D camera); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Vector2 GetWorldToScreen(Vector3 position, Camera3D camera); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Vector2 GetScreenToWorld2D(Vector2 position, Camera2D camera); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Vector2 GetWorldToScreenEx(Vector3 position, Camera3D camera, int width, int height); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Vector2 GetWorldToScreen2D(Vector2 position, Camera2D camera); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetTargetFPS(int fps); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int GetFPS(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern float GetFrameTime(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern double GetTime(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int GetRandomValue(int min, int max); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetRandomSeed(uint seed); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void TakeScreenshot(sbyte* fileName); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetConfigFlags(uint flags); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void TraceLog(int logLevel, sbyte* text); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetTraceLogLevel(int logLevel); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void* MemAlloc(uint size); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void* MemRealloc(void* ptr, uint size); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void MemFree(void* ptr); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void OpenURL(sbyte* url); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void SetTraceLogCallback(delegate* unmanaged[Cdecl] callback); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void SetLoadFileDataCallback(delegate* unmanaged[Cdecl] callback); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void SetSaveFileDataCallback(delegate* unmanaged[Cdecl] callback); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void SetLoadFileTextCallback(delegate* unmanaged[Cdecl] callback); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void SetSaveFileTextCallback(delegate* unmanaged[Cdecl] callback); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern byte* LoadFileData(sbyte* fileName, uint* bytesRead); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void UnloadFileData(byte* data); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public unsafe static extern bool SaveFileData(sbyte* fileName, void* data, uint bytesToWrite); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public unsafe static extern bool ExportDataAsCode(sbyte* data, uint size, sbyte* fileName); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern sbyte* LoadFileText(sbyte* fileName); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void UnloadFileText(sbyte* text); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public unsafe static extern bool SaveFileText(sbyte* fileName, sbyte* text); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public unsafe static extern bool FileExists(sbyte* fileName); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public unsafe static extern bool DirectoryExists(sbyte* dirPath); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public unsafe static extern bool IsFileExtension(sbyte* fileName, sbyte* ext); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern int GetFileLength(sbyte* fileName); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern sbyte* GetFileExtension(sbyte* fileName); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern sbyte* GetFileName(sbyte* filePath); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern sbyte* GetFileNameWithoutExt(sbyte* filePath); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern sbyte* GetDirectoryPath(sbyte* filePath); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern sbyte* GetPrevDirectoryPath(sbyte* dirPath); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern sbyte* GetWorkingDirectory(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern sbyte* GetApplicationDirectory(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public unsafe static extern bool ChangeDirectory(sbyte* dir); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public unsafe static extern bool IsPathFile(sbyte* path); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern FilePathList LoadDirectoryFiles(sbyte* dirPath); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern FilePathList LoadDirectoryFilesEx(sbyte* basePath, sbyte* filter, [MarshalAs(UnmanagedType.U1)] bool scanSubdirs); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void UnloadDirectoryFiles(FilePathList files); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool IsFileDropped(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern FilePathList LoadDroppedFiles(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void UnloadDroppedFiles(FilePathList files); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern nint GetFileModTime(sbyte* fileName); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern byte* CompressData(byte* data, int dataSize, int* compDataSize); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern byte* DecompressData(byte* compData, int compDataSize, int* dataSize); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern sbyte* EncodeDataBase64(byte* data, int dataSize, int* outputSize); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern byte* DecodeDataBase64(byte* data, int* outputSize); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool IsKeyPressed(int key); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool IsKeyDown(int key); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool IsKeyReleased(int key); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool IsKeyUp(int key); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetExitKey(int key); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int GetKeyPressed(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int GetCharPressed(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool IsGamepadAvailable(int gamepad); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern sbyte* GetGamepadName(int gamepad); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool IsGamepadButtonPressed(int gamepad, int button); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool IsGamepadButtonDown(int gamepad, int button); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool IsGamepadButtonReleased(int gamepad, int button); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool IsGamepadButtonUp(int gamepad, int button); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int GetGamepadButtonPressed(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int GetGamepadAxisCount(int gamepad); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern float GetGamepadAxisMovement(int gamepad, int axis); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern int SetGamepadMappings(sbyte* mappings); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool IsMouseButtonPressed(int button); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool IsMouseButtonDown(int button); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool IsMouseButtonReleased(int button); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool IsMouseButtonUp(int button); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int GetMouseX(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int GetMouseY(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Vector2 GetMousePosition(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Vector2 GetMouseDelta(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetMousePosition(int x, int y); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetMouseOffset(int offsetX, int offsetY); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetMouseScale(float scaleX, float scaleY); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern float GetMouseWheelMove(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Vector2 GetMouseWheelMoveV(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetMouseCursor(int cursor); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int GetTouchX(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int GetTouchY(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Vector2 GetTouchPosition(int index); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int GetTouchPointId(int index); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int GetTouchPointCount(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetGesturesEnabled(uint flags); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool IsGestureDetected(int gesture); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int GetGestureDetected(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern float GetGestureHoldDuration(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Vector2 GetGestureDragVector(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern float GetGestureDragAngle(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Vector2 GetGesturePinchVector(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern float GetGesturePinchAngle(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetCameraMode(Camera3D camera, int mode); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void UpdateCamera(Camera3D* camera); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetCameraPanControl(int keyPan); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetCameraAltControl(int keyAlt); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetCameraSmoothZoomControl(int keySmoothZoom); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetCameraMoveControls(int keyFront, int keyBack, int keyRight, int keyLeft, int keyUp, int keyDown); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetShapesTexture(Texture texture, Rectangle source); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawPixel(int posX, int posY, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawPixelV(Vector2 position, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawLineBezierQuad(Vector2 startPos, Vector2 endPos, Vector2 controlPos, float thick, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawLineBezierCubic(Vector2 startPos, Vector2 endPos, Vector2 startControlPos, Vector2 endControlPos, float thick, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void DrawLineStrip(Vector2* points, int pointCount, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawCircle(int centerX, int centerY, float radius, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawCircleSector(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawCircleV(Vector2 center, float radius, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawCircleLines(int centerX, int centerY, float radius, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawRectangle(int posX, int posY, int width, int height, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawRectangleV(Vector2 position, Vector2 size, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawRectangleRec(Rectangle rec, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawRectangleLines(int posX, int posY, int width, int height, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, float lineThick, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void DrawTriangleFan(Vector2* points, int pointCount, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void DrawTriangleStrip(Vector2* points, int pointCount, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawPolyLines(Vector2 center, int sides, float radius, float rotation, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawPolyLinesEx(Vector2 center, int sides, float radius, float rotation, float lineThick, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool CheckCollisionPointRec(Vector2 point, Rectangle rec); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public unsafe static extern bool CheckCollisionPointPoly(Vector2 point, Vector2* points, int pointCount); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public unsafe static extern bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, Vector2* collisionPoint); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool CheckCollisionPointLine(Vector2 point, Vector2 p1, Vector2 p2, int threshold); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern Image LoadImage(sbyte* fileName); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern Image LoadImageRaw(sbyte* fileName, int width, int height, int format, int headerSize); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern Image LoadImageAnim(sbyte* fileName, int* frames); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern Image LoadImageFromMemory(sbyte* fileType, byte* fileData, int dataSize); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Image LoadImageFromTexture(Texture texture); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Image LoadImageFromScreen(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void UnloadImage(Image image); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public unsafe static extern bool ExportImage(Image image, sbyte* fileName); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public unsafe static extern bool ExportImageAsCode(Image image, sbyte* fileName); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Image GenImageColor(int width, int height, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Image GenImageGradientV(int width, int height, Color top, Color bottom); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Image GenImageGradientH(int width, int height, Color left, Color right); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Image GenImageWhiteNoise(int width, int height, float factor); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Image GenImagePerlinNoise(int width, int height, int offsetX, int offsetY, float scale); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Image GenImageCellular(int width, int height, int tileSize); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Image ImageCopy(Image image); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Image ImageFromImage(Image image, Rectangle rec); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern Image ImageText(sbyte* text, int fontSize, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern Image ImageTextEx(Font font, sbyte* text, float fontSize, float spacing, Color tint); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageFormat(Image* image, int newFormat); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageToPOT(Image* image, Color fill); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageCrop(Image* image, Rectangle crop); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageAlphaCrop(Image* image, float threshold); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageAlphaClear(Image* image, Color color, float threshold); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageAlphaMask(Image* image, Image alphaMask); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageAlphaPremultiply(Image* image); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageResize(Image* image, int newWidth, int newHeight); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageResizeNN(Image* image, int newWidth, int newHeight); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageResizeCanvas(Image* image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageMipmaps(Image* image); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageDither(Image* image, int rBpp, int gBpp, int bBpp, int aBpp); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageFlipVertical(Image* image); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageFlipHorizontal(Image* image); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageRotateCW(Image* image); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageRotateCCW(Image* image); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageColorTint(Image* image, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageColorInvert(Image* image); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageColorGrayscale(Image* image); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageColorContrast(Image* image, float contrast); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageColorBrightness(Image* image, int brightness); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageColorReplace(Image* image, Color color, Color replace); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern Color* LoadImageColors(Image image); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern Color* LoadImagePalette(Image image, int maxPaletteSize, int* colorCount); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void UnloadImageColors(Color* colors); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void UnloadImagePalette(Color* colors); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Rectangle GetImageAlphaBorder(Image image, float threshold); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Color GetImageColor(Image image, int x, int y); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageClearBackground(Image* dst, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageDrawPixel(Image* dst, int posX, int posY, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageDrawPixelV(Image* dst, Vector2 position, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageDrawLine(Image* dst, int startPosX, int startPosY, int endPosX, int endPosY, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageDrawLineV(Image* dst, Vector2 start, Vector2 end, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageDrawCircle(Image* dst, int centerX, int centerY, int radius, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageDrawCircleV(Image* dst, Vector2 center, int radius, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageDrawRectangle(Image* dst, int posX, int posY, int width, int height, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageDrawRectangleV(Image* dst, Vector2 position, Vector2 size, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageDrawRectangleRec(Image* dst, Rectangle rec, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageDrawRectangleLines(Image* dst, Rectangle rec, int thick, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageDraw(Image* dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageDrawText(Image* dst, sbyte* text, int posX, int posY, int fontSize, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void ImageDrawTextEx(Image* dst, Font font, sbyte* text, Vector2 position, float fontSize, float spacing, Color tint); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern Texture LoadTexture(sbyte* fileName); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Texture LoadTextureFromImage(Image image); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Texture LoadTextureCubemap(Image image, int layout); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern RenderTexture LoadRenderTexture(int width, int height); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void UnloadTexture(Texture texture); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void UnloadRenderTexture(RenderTexture target); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void UpdateTexture(Texture texture, void* pixels); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void UpdateTextureRec(Texture texture, Rectangle rec, void* pixels); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void GenTextureMipmaps(Texture* texture); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetTextureFilter(Texture texture, int filter); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetTextureWrap(Texture texture, int wrap); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawTexture(Texture texture, int posX, int posY, Color tint); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawTextureV(Texture texture, Vector2 position, Color tint); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawTextureEx(Texture texture, Vector2 position, float rotation, float scale, Color tint); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawTextureRec(Texture texture, Rectangle source, Vector2 position, Color tint); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawTextureQuad(Texture texture, Vector2 tiling, Vector2 offset, Rectangle quad, Color tint); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawTextureTiled(Texture texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, float scale, Color tint); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawTexturePro(Texture texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawTextureNPatch(Texture texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void DrawTexturePoly(Texture texture, Vector2 center, Vector2* points, Vector2* texcoords, int pointCount, Color tint); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Color Fade(Color color, float alpha); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int ColorToInt(Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Vector4 ColorNormalize(Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Color ColorFromNormalized(Vector4 normalized); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Vector3 ColorToHSV(Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Color ColorFromHSV(float hue, float saturation, float value); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Color ColorAlpha(Color color, float alpha); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Color ColorAlphaBlend(Color dst, Color src, Color tint); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Color GetColor(uint hexValue); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern Color GetPixelColor(void* srcPtr, int format); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void SetPixelColor(void* dstPtr, Color color, int format); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int GetPixelDataSize(int width, int height, int format); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Font GetFontDefault(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern Font LoadFont(sbyte* fileName); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern Font LoadFontEx(sbyte* fileName, int fontSize, int* fontChars, int glyphCount); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Font LoadFontFromImage(Image image, Color key, int firstChar); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern Font LoadFontFromMemory(sbyte* fileType, byte* fileData, int dataSize, int fontSize, int* fontChars, int glyphCount); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern GlyphInfo* LoadFontData(byte* fileData, int dataSize, int fontSize, int* fontChars, int glyphCount, int type); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern Image GenImageFontAtlas(GlyphInfo* chars, Rectangle** recs, int glyphCount, int fontSize, int padding, int packMethod); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void UnloadFontData(GlyphInfo* chars, int glyphCount); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void UnloadFont(Font font); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public unsafe static extern bool ExportFontAsCode(Font font, sbyte* fileName); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawFPS(int posX, int posY); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void DrawText(sbyte* text, int posX, int posY, int fontSize, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void DrawTextEx(Font font, sbyte* text, Vector2 position, float fontSize, float spacing, Color tint); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void DrawTextPro(Font font, sbyte* text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSize, Color tint); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void DrawTextCodepoints(Font font, int* codepoints, int count, Vector2 position, float fontSize, float spacing, Color tint); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern int MeasureText(sbyte* text, int fontSize); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern Vector2 MeasureTextEx(Font font, sbyte* text, float fontSize, float spacing); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int GetGlyphIndex(Font font, int codepoint); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern GlyphInfo GetGlyphInfo(Font font, int codepoint); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Rectangle GetGlyphAtlasRec(Font font, int codepoint); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern int* LoadCodepoints(sbyte* text, int* count); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void UnloadCodepoints(int* codepoints); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern int GetCodepointCount(sbyte* text); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern int GetCodepoint(sbyte* text, int* bytesProcessed); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern sbyte* CodepointToUTF8(int codepoint, int* byteSize); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern sbyte* TextCodepointsToUTF8(int* codepoints, int length); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern int TextCopy(sbyte* dst, sbyte* src); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public unsafe static extern bool TextIsEqual(sbyte* text1, sbyte* text2); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern uint TextLength(sbyte* text); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern sbyte* TextFormat(sbyte* text); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern sbyte* TextSubtext(sbyte* text, int position, int length); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern sbyte* TextReplace(sbyte* text, sbyte* replace, sbyte* by); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern sbyte* TextInsert(sbyte* text, sbyte* insert, int position); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern sbyte* TextJoin(sbyte** textList, int count, sbyte* delimiter); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern sbyte** TextSplit(sbyte* text, sbyte delimiter, int* count); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void TextAppend(sbyte* text, sbyte* append, int* position); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern int TextFindIndex(sbyte* text, sbyte* find); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern sbyte* TextToUpper(sbyte* text); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern sbyte* TextToLower(sbyte* text); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern sbyte* TextToPascal(sbyte* text); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern int TextToInteger(sbyte* text); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawPoint3D(Vector3 position, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawTriangle3D(Vector3 v1, Vector3 v2, Vector3 v3, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void DrawTriangleStrip3D(Vector3* points, int pointCount, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawCube(Vector3 position, float width, float height, float length, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawCubeV(Vector3 position, Vector3 size, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawCubeWiresV(Vector3 position, Vector3 size, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawCubeTexture(Texture texture, Vector3 position, float width, float height, float length, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawCubeTextureRec(Texture texture, Rectangle source, Vector3 position, float width, float height, float length, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawSphere(Vector3 centerPos, float radius, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawCylinderEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawPlane(Vector3 centerPos, Vector2 size, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawRay(Ray ray, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawGrid(int slices, float spacing); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern Model LoadModel(sbyte* fileName); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Model LoadModelFromMesh(Mesh mesh); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void UnloadModel(Model model); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void UnloadModelKeepMeshes(Model model); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern BoundingBox GetModelBoundingBox(Model model); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawModel(Model model, Vector3 position, float scale, Color tint); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawModelWires(Model model, Vector3 position, float scale, Color tint); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawBoundingBox(BoundingBox box, Color color); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawBillboard(Camera3D camera, Texture texture, Vector3 position, float size, Color tint); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawBillboardRec(Camera3D camera, Texture texture, Rectangle source, Vector3 position, Vector2 size, Color tint); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawBillboardPro(Camera3D camera, Texture texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void UploadMesh(Mesh* mesh, [MarshalAs(UnmanagedType.U1)] bool dynamic); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void UpdateMeshBuffer(Mesh mesh, int index, void* data, int dataSize, int offset); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void UnloadMesh(Mesh mesh); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void DrawMesh(Mesh mesh, Material material, Matrix4x4 transform); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void DrawMeshInstanced(Mesh mesh, Material material, Matrix4x4* transforms, int instances); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public unsafe static extern bool ExportMesh(Mesh mesh, sbyte* fileName); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern BoundingBox GetMeshBoundingBox(Mesh mesh); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void GenMeshTangents(Mesh* mesh); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Mesh GenMeshPoly(int sides, float radius); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Mesh GenMeshPlane(float width, float length, int resX, int resZ); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Mesh GenMeshCube(float width, float height, float length); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Mesh GenMeshSphere(float radius, int rings, int slices); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Mesh GenMeshHemiSphere(float radius, int rings, int slices); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Mesh GenMeshCylinder(float radius, float height, int slices); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Mesh GenMeshCone(float radius, float height, int slices); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Mesh GenMeshTorus(float radius, float size, int radSeg, int sides); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Mesh GenMeshKnot(float radius, float size, int radSeg, int sides); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Mesh GenMeshHeightmap(Image heightmap, Vector3 size); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern Material* LoadMaterials(sbyte* fileName, int* materialCount); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Material LoadMaterialDefault(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void UnloadMaterial(Material material); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void SetMaterialTexture(Material* material, int mapType, Texture texture); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void SetModelMeshMaterial(Model* model, int meshId, int materialId); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern ModelAnimation* LoadModelAnimations(sbyte* fileName, uint* animCount); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void UnloadModelAnimation(ModelAnimation anim); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void UnloadModelAnimations(ModelAnimation* animations, uint count); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool IsModelAnimationValid(Model model, ModelAnimation anim); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool CheckCollisionSpheres(Vector3 center1, float radius1, Vector3 center2, float radius2); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern RayCollision GetRayCollisionSphere(Ray ray, Vector3 center, float radius); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern RayCollision GetRayCollisionBox(Ray ray, BoundingBox box); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern RayCollision GetRayCollisionMesh(Ray ray, Mesh mesh, Matrix4x4 transform); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern RayCollision GetRayCollisionTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern RayCollision GetRayCollisionQuad(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void InitAudioDevice(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void CloseAudioDevice(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool IsAudioDeviceReady(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetMasterVolume(float volume); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern Wave LoadWave(sbyte* fileName); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern Wave LoadWaveFromMemory(sbyte* fileType, byte* fileData, int dataSize); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern Sound LoadSound(sbyte* fileName); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Sound LoadSoundFromWave(Wave wave); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void UpdateSound(Sound sound, void* data, int sampleCount); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void UnloadWave(Wave wave); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void UnloadSound(Sound sound); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public unsafe static extern bool ExportWave(Wave wave, sbyte* fileName); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public unsafe static extern bool ExportWaveAsCode(Wave wave, sbyte* fileName); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void PlaySound(Sound sound); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void StopSound(Sound sound); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void PauseSound(Sound sound); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void ResumeSound(Sound sound); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void PlaySoundMulti(Sound sound); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void StopSoundMulti(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int GetSoundsPlaying(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool IsSoundPlaying(Sound sound); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetSoundVolume(Sound sound, float volume); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetSoundPitch(Sound sound, float pitch); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetSoundPan(Sound sound, float pan); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Wave WaveCopy(Wave wave); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void WaveCrop(Wave* wave, int initSample, int finalSample); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void WaveFormat(Wave* wave, int sampleRate, int sampleSize, int channels); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern float* LoadWaveSamples(Wave wave); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void UnloadWaveSamples(float* samples); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern Music LoadMusicStream(sbyte* fileName); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern Music LoadMusicStreamFromMemory(sbyte* fileType, byte* data, int dataSize); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void UnloadMusicStream(Music music); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void PlayMusicStream(Music music); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool IsMusicStreamPlaying(Music music); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void UpdateMusicStream(Music music); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void StopMusicStream(Music music); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void PauseMusicStream(Music music); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void ResumeMusicStream(Music music); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SeekMusicStream(Music music, float position); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetMusicVolume(Music music, float volume); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetMusicPitch(Music music, float pitch); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetMusicPan(Music music, float pan); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern float GetMusicTimeLength(Music music); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern float GetMusicTimePlayed(Music music); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern AudioStream LoadAudioStream(uint sampleRate, uint sampleSize, uint channels); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void UnloadAudioStream(AudioStream stream); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void UpdateAudioStream(AudioStream stream, void* data, int frameCount); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool IsAudioStreamProcessed(AudioStream stream); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void PlayAudioStream(AudioStream stream); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void PauseAudioStream(AudioStream stream); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void ResumeAudioStream(AudioStream stream); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool IsAudioStreamPlaying(AudioStream stream); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void StopAudioStream(AudioStream stream); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetAudioStreamVolume(AudioStream stream, float volume); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetAudioStreamPitch(AudioStream stream, float pitch); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetAudioStreamPan(AudioStream stream, float pan); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void SetAudioStreamBufferSizeDefault(int size); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void SetAudioStreamCallback(AudioStream stream, delegate* unmanaged[Cdecl] callback); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void AttachAudioStreamProcessor(AudioStream stream, delegate* unmanaged[Cdecl] processor); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void DetachAudioStreamProcessor(AudioStream stream, delegate* unmanaged[Cdecl] processor); public static bool IsKeyPressed(KeyboardKey key) { return IsKeyPressed((int)key); } public static bool IsKeyDown(KeyboardKey key) { return IsKeyDown((int)key); } public static bool IsKeyReleased(KeyboardKey key) { return IsKeyReleased((int)key); } public static bool IsKeyUp(KeyboardKey key) { return IsKeyUp((int)key); } public static void SetExitKey(KeyboardKey key) { SetExitKey((int)key); } public static KeyboardKey GetKeyPressed_() { return (KeyboardKey)GetKeyPressed(); } public unsafe static void InitWindow(int width, int height, string title) { //IL_0001: 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_0009: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = title.MarshalUtf8(); try { InitWindow(width, height, spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public static bool IsGestureDetected(Gesture gesture) { return IsGestureDetected((int)gesture); } public static Gesture GetGestureDetected_() { return (Gesture)GetGestureDetected(); } public static void DrawText(string text, float posX, float posY, float fontSize, Color color) { DrawText(text, (int)posX, (int)posY, (int)fontSize, color); } public unsafe static void DrawText(string text, int posX, int posY, int fontSize, Color color) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { DrawText(spanOwner.AsPtr(), posX, posY, fontSize, color); } finally { spanOwner.Dispose(); } } public static bool IsMouseButtonPressed(MouseButton button) { return IsMouseButtonPressed((int)button); } public static bool IsMouseButtonDown(MouseButton button) { return IsMouseButtonDown((int)button); } public static bool IsMouseButtonReleased(MouseButton button) { return IsMouseButtonReleased((int)button); } public static bool IsMouseButtonUp(MouseButton button) { return IsMouseButtonUp((int)button); } public static string TextFormat(string format, params object[] args) { return format.SPrintF(args); } [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern sbyte* TextFormat(sbyte* text, __arglist); public static void SetConfigFlags(ConfigFlags flags) { SetConfigFlags((uint)flags); } public unsafe static Texture LoadTexture(string fileName) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = fileName.MarshalUtf8(); try { return LoadTexture(spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static string GetMonitorName_(int monitor) { return Helpers.Utf8ToString(GetMonitorName(monitor)); } public unsafe static void SetClipboardText(string text) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { SetClipboardText(spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static string GetClipboardText_() { return Helpers.Utf8ToString(GetClipboardText()); } public unsafe static Shader LoadShader(string? vsFileName, string fsFileName) { //IL_0001: 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_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_000e: 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) SpanOwner spanOwner = vsFileName.MarshalUtf8(); try { SpanOwner spanOwner2 = fsFileName.MarshalUtf8(); try { return LoadShader(spanOwner.AsPtr(), spanOwner2.AsPtr()); } finally { spanOwner2.Dispose(); } } finally { spanOwner.Dispose(); } } public unsafe static Shader LoadShaderFromMemory(string? vsCode, string fsCode) { //IL_0001: 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_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_000e: 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) SpanOwner spanOwner = vsCode.MarshalUtf8(); try { SpanOwner spanOwner2 = fsCode.MarshalUtf8(); try { return LoadShaderFromMemory(spanOwner.AsPtr(), spanOwner2.AsPtr()); } finally { spanOwner2.Dispose(); } } finally { spanOwner.Dispose(); } } public unsafe static int GetShaderLocation(Shader shader, string uniformName) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = uniformName.MarshalUtf8(); try { return GetShaderLocation(shader, spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static int GetShaderLocationAttrib(Shader shader, string uniformName) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = uniformName.MarshalUtf8(); try { return GetShaderLocationAttrib(shader, spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static void TakeScreenshot(string fileName) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = fileName.MarshalUtf8(); try { TakeScreenshot(spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static void TraceLog(int logLevel, string text) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { TraceLog(logLevel, spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public static void TraceLog(TraceLogLevel logLevel, string text, params object[] args) { text = text.SPrintF(args); TraceLog((int)logLevel, text); } public unsafe static string GetGamepadName_(int gamepad) { return Helpers.Utf8ToString(GetGamepadName(gamepad)); } public static bool TextIsEqual(string a, string b) { return a == b; } public static bool IsGamepadButtonPressed(int gamepad, GamepadButton button) { return IsGamepadButtonPressed(gamepad, (int)button); } public static bool IsGamepadButtonDown(int gamepad, GamepadButton button) { return IsGamepadButtonDown(gamepad, (int)button); } public static bool IsGamepadButtonReleased(int gamepad, GamepadButton button) { return IsGamepadButtonReleased(gamepad, (int)button); } public static bool IsGamepadButtonUp(int gamepad, GamepadButton button) { return IsGamepadButtonUp(gamepad, (int)button); } public static float GetGamepadAxisMovement(int gamepad, GamepadAxis axis) { return GetGamepadAxisMovement(gamepad, (int)axis); } public unsafe static string[] GetDroppedFilesAndClear() { FilePathList files = LoadDroppedFiles(); uint count = files.count; string[] array = new string[count]; for (int i = 0; i < count; i++) { array[i] = Helpers.Utf8ToString(files.paths[i]); } UnloadDroppedFiles(files); return array; } public static void SetCameraMode(Camera3D camera, CameraMode mode) { SetCameraMode(camera, (int)mode); } public unsafe static void UpdateCamera(ref Camera3D camera) { fixed (Camera3D* camera2 = &camera) { UpdateCamera(camera2); } } public unsafe static int MeasureText(string text, int fontSize) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { return MeasureText(spanOwner.AsPtr(), fontSize); } finally { spanOwner.Dispose(); } } public static void SetTextureFilter(Texture texture, TextureFilter filter) { SetTextureFilter(texture, (int)filter); } public static void SetTextureWrap(Texture texture, TextureWrap wrap) { SetTextureWrap(texture, (int)wrap); } public unsafe static void SetShaderValue(Shader shader, int locIndex, T* value, ShaderUniformDataType uniformType) where T : unmanaged { SetShaderValue(shader, locIndex, value, (int)uniformType); } public unsafe static void SetShaderValue(Shader shader, int uniformLoc, ref T value, ShaderUniformDataType uniformType) where T : unmanaged { fixed (T* value2 = &value) { SetShaderValue(shader, uniformLoc, value2, (int)uniformType); } } public unsafe static void SetShaderValue(Shader shader, int uniformLoc, T value, ShaderUniformDataType uniformType) where T : unmanaged { SetShaderValue(shader, uniformLoc, &value, (int)uniformType); } public static void SetShaderValue(Shader shader, int uniformLoc, T[] values, ShaderUniformDataType uniformType) where T : unmanaged { SetShaderValue(shader, uniformLoc, (Span)values, uniformType); } public unsafe static void SetShaderValue(Shader shader, int uniformLoc, Span values, ShaderUniformDataType uniformType) where T : unmanaged { fixed (T* value = values) { SetShaderValue(shader, uniformLoc, value, (int)uniformType); } } public unsafe static void SetShaderValueV(Shader shader, int locIndex, Span values, ShaderUniformDataType uniformType, int count) where T : unmanaged { fixed (T* value = values) { SetShaderValueV(shader, locIndex, value, (int)uniformType, count); } } public unsafe static void SetShaderValueV(Shader shader, int locIndex, ref T arrayOffset, ShaderUniformDataType uniformType, int count) where T : unmanaged { fixed (T* value = &arrayOffset) { SetShaderValueV(shader, locIndex, value, (int)uniformType, count); } } public static void ClearWindowState(ConfigFlags flags) { ClearWindowState((uint)flags); } public static void SetWindowState(ConfigFlags flags) { SetWindowState((uint)flags); } public static bool IsWindowState(ConfigFlags flags) { return IsWindowState((uint)flags); } public unsafe static ModelAnimation[] LoadModelAnimations(string fileName) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = fileName.MarshalUtf8(); try { uint num = default(uint); ModelAnimation* ptr = LoadModelAnimations(spanOwner.AsPtr(), &num); ModelAnimation[] array = new ModelAnimation[num]; for (int i = 0; i < num; i++) { array[i] = ptr[i]; } MemFree(ptr); return array; } finally { spanOwner.Dispose(); } } public static void UnloadModelAnimations(Span modelAnimations) { Span span = modelAnimations; for (int i = 0; i < span.Length; i++) { UnloadModelAnimation(span[i]); } } public unsafe static void SetMaterialTexture(Material* material, MaterialMapIndex mapType, Texture texture) { SetMaterialTexture(material, (int)mapType, texture); } public unsafe static Model LoadModel(string fileName) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = fileName.MarshalUtf8(); try { return LoadModel(spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static Image LoadImage(string fileName) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = fileName.MarshalUtf8(); try { return LoadImage(spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public static string GetFileName(string filePath) { return Path.GetFileName(filePath); } public static void DrawGrid(int slices, double spacing) { DrawGrid(slices, (float)spacing); } public static Texture LoadTextureCubemap(Image image, CubemapLayout layout) { return LoadTextureCubemap(image, (int)layout); } public unsafe static long GetFileModTime(string fileName) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = fileName.MarshalUtf8(); try { return GetFileModTime(spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static void DrawMeshInstanced(Mesh mesh, Material material, Span transforms, int instances) { fixed (Matrix4x4* transforms2 = transforms) { DrawMeshInstanced(mesh, material, transforms2, instances); } } public static void BeginBlendMode(BlendMode blendMode) { BeginBlendMode((int)blendMode); } public unsafe static void ImageDrawTextEx(ref Image dst, Font font, string fileName, Vector2 position, float fontSize, float spacing, Color tint) { //IL_0001: 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) SpanOwner spanOwner = fileName.MarshalUtf8(); try { fixed (Image* dst2 = &dst) { ImageDrawTextEx(dst2, font, spanOwner.AsPtr(), position, fontSize, spacing, tint); } } finally { spanOwner.Dispose(); } } public unsafe static void ImageDrawTextEx(Image* p_dst, Font font, string fileName, Vector2 position, float fontSize, float spacing, Color tint) { //IL_0001: 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_0009: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = fileName.MarshalUtf8(); try { ImageDrawTextEx(p_dst, font, spanOwner.AsPtr(), position, fontSize, spacing, tint); } finally { spanOwner.Dispose(); } } public unsafe static Font LoadFont(string fileName) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = fileName.MarshalUtf8(); try { return LoadFont(spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static void ImageFormat(Image* image, PixelFormat newFormat) { ImageFormat(image, (int)newFormat); } public unsafe static Font LoadFontEx(string fileName, int fontSize, int glyphCount) { return LoadFontEx(fileName, fontSize, null, glyphCount); } public unsafe static Font LoadFontEx(string fileName, int fontSize, int* fontChars, int glyphCount) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = fileName.MarshalUtf8(); try { return LoadFontEx(spanOwner.AsPtr(), fontSize, fontChars, glyphCount); } finally { spanOwner.Dispose(); } } public unsafe static void DrawTextEx(Font font, string text, Vector2 position, float fontSize, float spacing, Color tint) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { DrawTextEx(font, spanOwner.AsPtr(), position, fontSize, spacing, tint); } finally { spanOwner.Dispose(); } } public unsafe static void ExportImage(Image image, string fileName) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = fileName.MarshalUtf8(); try { ExportImage(image, spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static void DrawTexturePoly(Texture texture, Vector2 center, Span positions, Span texcoords, int pointCount, Color tint) { fixed (Vector2* points = positions) { fixed (Vector2* texcoords2 = texcoords) { DrawTexturePoly(texture, center, points, texcoords2, pointCount, tint); } } } public unsafe static Image LoadImageRaw(string fileName, int width, int height, PixelFormat format, int headerSize) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = fileName.MarshalUtf8(); try { return LoadImageRaw(spanOwner.AsPtr(), width, height, (int)format, headerSize); } finally { spanOwner.Dispose(); } } public unsafe static Sound LoadSound(string fileName) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = fileName.MarshalUtf8(); try { return LoadSound(spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static bool IsFileExtension(string fileName, string exts) { //IL_0001: 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_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_000e: 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) SpanOwner spanOwner = fileName.MarshalUtf8(); try { SpanOwner spanOwner2 = exts.MarshalUtf8(); try { return IsFileExtension(spanOwner.AsPtr(), spanOwner2.AsPtr()); } finally { spanOwner2.Dispose(); } } finally { spanOwner.Dispose(); } } public unsafe static int TextLength(string text) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { return (int)TextLength(spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static int GetCodepoint(char stringChar, out int bytesProcessed) { sbyte b = (sbyte)stringChar; int num = 0; int codepoint = GetCodepoint(&b, &num); bytesProcessed = num; return codepoint; } public unsafe static Vector2 MeasureTextEx(Font font, string text, float fontSize, float spacing) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { return MeasureTextEx(font, spanOwner.AsPtr(), fontSize, spacing); } finally { spanOwner.Dispose(); } } public unsafe static GlyphInfo* LoadFontData(byte* fileData, int dataSize, int fontSize, int* fontChars, int glyphCount, FontType type) { return LoadFontData(fileData, dataSize, fontSize, fontChars, glyphCount, (int)type); } public unsafe static byte* LoadFileData(string fileName, out uint bytesRead) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = fileName.MarshalUtf8(); try { uint num = default(uint); byte* result = LoadFileData(spanOwner.AsPtr(), &num); bytesRead = num; return result; } finally { spanOwner.Dispose(); } } public static void SetMouseCursor(MouseCursor cursor) { SetMouseCursor((int)cursor); } public unsafe static int GetCodepointCount(string text) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { return GetCodepointCount(spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public static string TextSubtext(string message, int position, int length) { return message.Substring(position, Math.Min(length, message.Length - position)); } public unsafe static void UpdateAudioStream(AudioStream stream, Span data, int frameCount) { fixed (short* data2 = data) { UpdateAudioStream(stream, data2, frameCount); } } public unsafe static void SetWindowTitle(string title) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = title.MarshalUtf8(); try { SetWindowTitle(spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static bool SaveFileData(string fileName, void* data, uint bytesToWrite) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = fileName.MarshalUtf8(); try { return SaveFileData(spanOwner.AsPtr(), data, bytesToWrite); } finally { spanOwner.Dispose(); } } public unsafe static string LoadFileText(string fileName) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = fileName.MarshalUtf8(); try { return Helpers.Utf8ToString(LoadFileText(spanOwner.AsPtr())); } finally { spanOwner.Dispose(); } } public unsafe static void UnloadFileText(string text) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { UnloadFileText(spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static bool SaveFileText(string fileName, string text) { //IL_0001: 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_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_000e: 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) SpanOwner spanOwner = fileName.MarshalUtf8(); try { SpanOwner spanOwner2 = text.MarshalUtf8(); try { return SaveFileText(spanOwner.AsPtr(), spanOwner2.AsPtr()); } finally { spanOwner2.Dispose(); } } finally { spanOwner.Dispose(); } } public unsafe static bool FileExists(string fileName) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = fileName.MarshalUtf8(); try { return FileExists(spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static bool DirectoryExists(string dirPath) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = dirPath.MarshalUtf8(); try { return DirectoryExists(spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static string GetFileExtension(string fileName) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = fileName.MarshalUtf8(); try { return Helpers.Utf8ToString(GetFileExtension(spanOwner.AsPtr())); } finally { spanOwner.Dispose(); } } public unsafe static string GetFileNameWithoutExt(string filePath) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = filePath.MarshalUtf8(); try { return Helpers.Utf8ToString(GetFileNameWithoutExt(spanOwner.AsPtr())); } finally { spanOwner.Dispose(); } } public unsafe static string GetDirectoryPath(string filePath) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = filePath.MarshalUtf8(); try { return Helpers.Utf8ToString(GetDirectoryPath(spanOwner.AsPtr())); } finally { spanOwner.Dispose(); } } public unsafe static string GetPrevDirectoryPath(string filePath) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = filePath.MarshalUtf8(); try { return Helpers.Utf8ToString(GetPrevDirectoryPath(spanOwner.AsPtr())); } finally { spanOwner.Dispose(); } } public unsafe static string GetWorkingDirectory_() { return Helpers.Utf8ToString(GetWorkingDirectory()); } public static string[] GetDirectoryFiles(string dirPath) { return Directory.GetFiles(dirPath); } public unsafe static bool ChangeDirectory(string dir) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = dir.MarshalUtf8(); try { return ChangeDirectory(spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static void OpenURL(string url) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = url.MarshalUtf8(); try { OpenURL(spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static int SetGamepadMappings(string mappings) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = mappings.MarshalUtf8(); try { return SetGamepadMappings(spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static Image LoadImageRaw(string fileName, int width, int height, int format, int headerSize) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = fileName.MarshalUtf8(); try { return LoadImageRaw(spanOwner.AsPtr(), width, height, format, headerSize); } finally { spanOwner.Dispose(); } } public unsafe static Image LoadImageAnim(string fileName, int* frames) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = fileName.MarshalUtf8(); try { return LoadImageAnim(spanOwner.AsPtr(), frames); } finally { spanOwner.Dispose(); } } public unsafe static Image LoadImageFromMemory(string fileType, byte* fileData, int dataSize) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = fileType.MarshalUtf8(); try { return LoadImageFromMemory(spanOwner.AsPtr(), fileData, dataSize); } finally { spanOwner.Dispose(); } } public unsafe static bool ExportImageAsCode(Image image, string fileName) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = fileName.MarshalUtf8(); try { return ExportImageAsCode(image, spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static Image ImageText(string text, int fontSize, Color color) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { return ImageText(spanOwner.AsPtr(), fontSize, color); } finally { spanOwner.Dispose(); } } public unsafe static Image ImageTextEx(Font font, string text, float fontSize, float spacing, Color tint) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { return ImageTextEx(font, spanOwner.AsPtr(), fontSize, spacing, tint); } finally { spanOwner.Dispose(); } } public unsafe static void ImageDrawText(Image* dst, string text, int posX, int posY, int fontSize, Color color) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { ImageDrawText(dst, spanOwner.AsPtr(), posX, posY, fontSize, color); } finally { spanOwner.Dispose(); } } public unsafe static Font LoadFontFromMemory(string fileType, byte* fileData, int dataSize, int fontSize, int* fontChars, int glyphCount) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = fileType.MarshalUtf8(); try { return LoadFontFromMemory(spanOwner.AsPtr(), fileData, dataSize, fontSize, fontChars, glyphCount); } finally { spanOwner.Dispose(); } } public unsafe static void DrawTextPro(Font font, string text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { DrawTextPro(font, spanOwner.AsPtr(), position, origin, rotation, fontSize, spacing, tint); } finally { spanOwner.Dispose(); } } public unsafe static int* LoadCodepoints(string text, int* count) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { return LoadCodepoints(spanOwner.AsPtr(), count); } finally { spanOwner.Dispose(); } } public unsafe static int GetCodepoint(string text, int* bytesProcessed) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { return GetCodepoint(spanOwner.AsPtr(), bytesProcessed); } finally { spanOwner.Dispose(); } } public unsafe static string CodepointToUTF8_(int codepoint, int* byteSize) { return Helpers.Utf8ToString(CodepointToUTF8(codepoint, byteSize)); } public unsafe static string TextCodepointsToUTF8_(int* codepoints, int length) { return Helpers.Utf8ToString(TextCodepointsToUTF8(codepoints, length)); } public unsafe static int TextCopy(string dst, string src) { //IL_0001: 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_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_000e: 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) SpanOwner spanOwner = dst.MarshalUtf8(); try { SpanOwner spanOwner2 = src.MarshalUtf8(); try { return TextCopy(spanOwner.AsPtr(), spanOwner2.AsPtr()); } finally { spanOwner2.Dispose(); } } finally { spanOwner.Dispose(); } } public unsafe static int TextToInteger(string text) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = text.MarshalUtf8(); try { return TextToInteger(spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static bool ExportMesh(Mesh mesh, string fileName) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = fileName.MarshalUtf8(); try { return ExportMesh(mesh, spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static Material* LoadMaterials(string fileName, int* materialCount) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = fileName.MarshalUtf8(); try { return LoadMaterials(spanOwner.AsPtr(), materialCount); } finally { spanOwner.Dispose(); } } public unsafe static ModelAnimation* LoadModelAnimations(string fileName, uint* animCount) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = fileName.MarshalUtf8(); try { return LoadModelAnimations(spanOwner.AsPtr(), animCount); } finally { spanOwner.Dispose(); } } public unsafe static Wave LoadWave(string fileName) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = fileName.MarshalUtf8(); try { return LoadWave(spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static Wave LoadWaveFromMemory(string fileType, byte* fileData, int dataSize) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = fileType.MarshalUtf8(); try { return LoadWaveFromMemory(spanOwner.AsPtr(), fileData, dataSize); } finally { spanOwner.Dispose(); } } public unsafe static bool ExportWave(Wave wave, string fileName) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = fileName.MarshalUtf8(); try { return ExportWave(wave, spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static bool ExportWaveAsCode(Wave wave, string fileName) { //IL_0001: 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_0008: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = fileName.MarshalUtf8(); try { return ExportWaveAsCode(wave, spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static Music LoadMusicStream(string fileName) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = fileName.MarshalUtf8(); try { return LoadMusicStream(spanOwner.AsPtr()); } finally { spanOwner.Dispose(); } } public unsafe static Music LoadMusicStreamFromMemory(string fileType, byte* data, int dataSize) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) SpanOwner spanOwner = fileType.MarshalUtf8(); try { return LoadMusicStreamFromMemory(spanOwner.AsPtr(), data, dataSize); } finally { spanOwner.Dispose(); } } } public static class RayMath { public const float PI = MathF.PI; public const float EPSILON = 1E-06f; public const float DEG2RAD = MathF.PI / 180f; public const float RAD2DEG = 180f / MathF.PI; public static float Clamp(float value, float min, float max) { float num = ((value < min) ? min : value); if (num > max) { num = max; } return num; } public static float Lerp(float start, float end, float amount) { return start + amount * (end - start); } public static float Normalize(float value, float start, float end) { return (value - start) / (end - start); } public static float Remap(float value, float inputStart, float inputEnd, float outputStart, float outputEnd) { return (value - inputStart) / (inputEnd - inputStart) * (outputEnd - outputStart) + outputStart; } public static float Wrap(float value, float min, float max) { return value - (max - min) * floorf((value - min) / (max - min)); } public static int FloatEquals(float x, float y) { if (!(fabsf(x - y) <= 1E-06f * MathF.Max(1f, MathF.Max(fabsf(x), fabsf(y))))) { return 0; } return 1; } public static Vector2 Vector2Zero() { return new Vector2 { X = 0f, Y = 0f }; } public static Vector2 Vector2One() { return new Vector2 { X = 1f, Y = 1f }; } public static Vector2 Vector2Add(Vector2 v1, Vector2 v2) { return new Vector2 { X = v1.X + v2.X, Y = v1.Y + v2.Y }; } public static Vector2 Vector2AddValue(Vector2 v, float add) { return new Vector2 { X = v.X + add, Y = v.Y + add }; } public static Vector2 Vector2Subtract(Vector2 v1, Vector2 v2) { return new Vector2 { X = v1.X - v2.X, Y = v1.Y - v2.Y }; } public static Vector2 Vector2SubtractValue(Vector2 v, float sub) { return new Vector2 { X = v.X - sub, Y = v.Y - sub }; } public static float Vector2Length(Vector2 v) { return MathF.Sqrt(v.X * v.X + v.Y * v.Y); } public static float Vector2LengthSqr(Vector2 v) { return v.X * v.X + v.Y * v.Y; } public static float Vector2DotProduct(Vector2 v1, Vector2 v2) { return v1.X * v2.X + v1.Y * v2.Y; } public static float Vector2Distance(Vector2 v1, Vector2 v2) { return MathF.Sqrt((v1.X - v2.X) * (v1.X - v2.X) + (v1.Y - v2.Y) * (v1.Y - v2.Y)); } public static float Vector2DistanceSqr(Vector2 v1, Vector2 v2) { return (v1.X - v2.X) * (v1.X - v2.X) + (v1.Y - v2.Y) * (v1.Y - v2.Y); } public static float Vector2Angle(Vector2 v1, Vector2 v2) { return MathF.Atan2(v2.Y, v2.X) - MathF.Atan2(v1.Y, v1.X); } public static Vector2 Vector2Scale(Vector2 v, float scale) { return new Vector2 { X = v.X * scale, Y = v.Y * scale }; } public static Vector2 Vector2Multiply(Vector2 v1, Vector2 v2) { return new Vector2 { X = v1.X * v2.X, Y = v1.Y * v2.Y }; } public static Vector2 Vector2Negate(Vector2 v) { return new Vector2 { X = 0f - v.X, Y = 0f - v.Y }; } public static Vector2 Vector2Divide(Vector2 v1, Vector2 v2) { return new Vector2 { X = v1.X / v2.X, Y = v1.Y / v2.Y }; } public static Vector2 Vector2Normalize(Vector2 v) { Vector2 result = new Vector2 { X = 0f }; float num = MathF.Sqrt(v.X * v.X + v.Y * v.Y); if (num > 0f) { float num2 = 1f / num; result.X = v.X * num2; result.Y = v.Y * num2; } return result; } public static Vector2 Vector2Transform(Vector2 v, Matrix4x4 mat) { Vector2 result = new Vector2 { X = 0f }; float x = v.X; float y = v.Y; float num = 0f; result.X = mat.M11 * x + mat.M21 * y + mat.M31 * num + mat.M41; result.Y = mat.M12 * x + mat.M22 * y + mat.M32 * num + mat.M42; return result; } public static Vector2 Vector2Lerp(Vector2 v1, Vector2 v2, float amount) { Vector2 result = new Vector2 { X = 0f }; result.X = v1.X + amount * (v2.X - v1.X); result.Y = v1.Y + amount * (v2.Y - v1.Y); return result; } public static Vector2 Vector2Reflect(Vector2 v, Vector2 normal) { Vector2 result = new Vector2 { X = 0f }; float num = v.X * normal.X + v.Y * normal.Y; result.X = v.X - 2f * normal.X * num; result.Y = v.Y - 2f * normal.Y * num; return result; } public static Vector2 Vector2Rotate(Vector2 v, float angle) { Vector2 result = new Vector2 { X = 0f }; float num = MathF.Cos(angle); float num2 = MathF.Sin(angle); result.X = v.X * num - v.Y * num2; result.Y = v.X * num2 + v.Y * num; return result; } public static Vector2 Vector2MoveTowards(Vector2 v, Vector2 target, float maxDistance) { Vector2 result = new Vector2 { X = 0f }; float num = target.X - v.X; float num2 = target.Y - v.Y; float num3 = num * num + num2 * num2; if (num3 == 0f || (maxDistance >= 0f && num3 <= maxDistance * maxDistance)) { return target; } float num4 = MathF.Sqrt(num3); result.X = v.X + num / num4 * maxDistance; result.Y = v.Y + num2 / num4 * maxDistance; return result; } public static Vector2 Vector2Invert(Vector2 v) { return new Vector2 { X = 1f / v.X, Y = 1f / v.Y }; } public static Vector2 Vector2Clamp(Vector2 v, Vector2 min, Vector2 max) { Vector2 result = new Vector2 { X = 0f }; result.X = MathF.Min(max.X, MathF.Max(min.X, v.X)); result.Y = MathF.Min(max.Y, MathF.Max(min.Y, v.Y)); return result; } public static Vector2 Vector2ClampValue(Vector2 v, float min, float max) { Vector2 result = v; float num = v.X * v.X + v.Y * v.Y; if (num > 0f) { num = MathF.Sqrt(num); if (num < min) { float num2 = min / num; result.X = v.X * num2; result.Y = v.Y * num2; } else if (num > max) { float num3 = max / num; result.X = v.X * num3; result.Y = v.Y * num3; } } return result; } public static int Vector2Equals(Vector2 p, Vector2 q) { if (!(fabsf(p.X - q.X) <= 1E-06f * MathF.Max(1f, MathF.Max(fabsf(p.X), fabsf(q.X)))) || !(fabsf(p.Y - q.Y) <= 1E-06f * MathF.Max(1f, MathF.Max(fabsf(p.Y), fabsf(q.Y))))) { return 0; } return 1; } public static Vector3 Vector3Zero() { return new Vector3 { X = 0f, Y = 0f, Z = 0f }; } public static Vector3 Vector3One() { return new Vector3 { X = 1f, Y = 1f, Z = 1f }; } public static Vector3 Vector3Add(Vector3 v1, Vector3 v2) { return new Vector3 { X = v1.X + v2.X, Y = v1.Y + v2.Y, Z = v1.Z + v2.Z }; } public static Vector3 Vector3AddValue(Vector3 v, float add) { return new Vector3 { X = v.X + add, Y = v.Y + add, Z = v.Z + add }; } public static Vector3 Vector3Subtract(Vector3 v1, Vector3 v2) { return new Vector3 { X = v1.X - v2.X, Y = v1.Y - v2.Y, Z = v1.Z - v2.Z }; } public static Vector3 Vector3SubtractValue(Vector3 v, float sub) { return new Vector3 { X = v.X - sub, Y = v.Y - sub, Z = v.Z - sub }; } public static Vector3 Vector3Scale(Vector3 v, float scalar) { return new Vector3 { X = v.X * scalar, Y = v.Y * scalar, Z = v.Z * scalar }; } public static Vector3 Vector3Multiply(Vector3 v1, Vector3 v2) { return new Vector3 { X = v1.X * v2.X, Y = v1.Y * v2.Y, Z = v1.Z * v2.Z }; } public static Vector3 Vector3CrossProduct(Vector3 v1, Vector3 v2) { return new Vector3 { X = v1.Y * v2.Z - v1.Z * v2.Y, Y = v1.Z * v2.X - v1.X * v2.Z, Z = v1.X * v2.Y - v1.Y * v2.X }; } public static Vector3 Vector3Perpendicular(Vector3 v) { Vector3 result = new Vector3 { X = 0f }; float num = MathF.Abs(v.X); Vector3 vector = new Vector3 { X = 1f, Y = 0f, Z = 0f }; if (fabsf(v.Y) < num) { num = MathF.Abs(v.Y); vector = new Vector3 { X = 0f, Y = 1f, Z = 0f }; } if (fabsf(v.Z) < num) { vector = new Vector3 { X = 0f, Y = 0f, Z = 1f }; } result.X = v.Y * vector.Z - v.Z * vector.Y; result.Y = v.Z * vector.X - v.X * vector.Z; result.Z = v.X * vector.Y - v.Y * vector.X; return result; } public static float Vector3Length(Vector3 v) { return MathF.Sqrt(v.X * v.X + v.Y * v.Y + v.Z * v.Z); } public static float Vector3LengthSqr(Vector3 v) { return v.X * v.X + v.Y * v.Y + v.Z * v.Z; } public static float Vector3DotProduct(Vector3 v1, Vector3 v2) { return v1.X * v2.X + v1.Y * v2.Y + v1.Z * v2.Z; } public static float Vector3Distance(Vector3 v1, Vector3 v2) { float num = v2.X - v1.X; float num2 = v2.Y - v1.Y; float num3 = v2.Z - v1.Z; return MathF.Sqrt(num * num + num2 * num2 + num3 * num3); } public static float Vector3DistanceSqr(Vector3 v1, Vector3 v2) { float num = v2.X - v1.X; float num2 = v2.Y - v1.Y; float num3 = v2.Z - v1.Z; return num * num + num2 * num2 + num3 * num3; } public static float Vector3Angle(Vector3 v1, Vector3 v2) { Vector3 vector = new Vector3 { X = v1.Y * v2.Z - v1.Z * v2.Y, Y = v1.Z * v2.X - v1.X * v2.Z, Z = v1.X * v2.Y - v1.Y * v2.X }; float y = MathF.Sqrt(vector.X * vector.X + vector.Y * vector.Y + vector.Z * vector.Z); float x = v1.X * v2.X + v1.Y * v2.Y + v1.Z * v2.Z; return MathF.Atan2(y, x); } public static Vector3 Vector3Negate(Vector3 v) { return new Vector3 { X = 0f - v.X, Y = 0f - v.Y, Z = 0f - v.Z }; } public static Vector3 Vector3Divide(Vector3 v1, Vector3 v2) { return new Vector3 { X = v1.X / v2.X, Y = v1.Y / v2.Y, Z = v1.Z / v2.Z }; } public static Vector3 Vector3Normalize(Vector3 v) { Vector3 result = v; float num = MathF.Sqrt(v.X * v.X + v.Y * v.Y + v.Z * v.Z); if (num == 0f) { num = 1f; } float num2 = 1f / num; result.X *= num2; result.Y *= num2; result.Z *= num2; return result; } public unsafe static void Vector3OrthoNormalize(Vector3* v1, Vector3* v2) { float num = 0f; float num2 = 0f; Vector3 vector = *v1; num = MathF.Sqrt(vector.X * vector.X + vector.Y * vector.Y + vector.Z * vector.Z); if (num == 0f) { num = 1f; } num2 = 1f / num; v1->X *= num2; v1->Y *= num2; v1->Z *= num2; Vector3 vector2 = new Vector3 { X = v1->Y * v2->Z - v1->Z * v2->Y, Y = v1->Z * v2->X - v1->X * v2->Z, Z = v1->X * v2->Y - v1->Y * v2->X }; vector = vector2; num = MathF.Sqrt(vector.X * vector.X + vector.Y * vector.Y + vector.Z * vector.Z); if (num == 0f) { num = 1f; } num2 = 1f / num; vector2.X *= num2; vector2.Y *= num2; vector2.Z *= num2; Vector3 vector3 = new Vector3 { X = vector2.Y * v1->Z - vector2.Z * v1->Y, Y = vector2.Z * v1->X - vector2.X * v1->Z, Z = vector2.X * v1->Y - vector2.Y * v1->X }; *v2 = vector3; } public static Vector3 Vector3Transform(Vector3 v, Matrix4x4 mat) { Vector3 result = new Vector3 { X = 0f }; float x = v.X; float y = v.Y; float z = v.Z; result.X = mat.M11 * x + mat.M21 * y + mat.M31 * z + mat.M41; result.Y = mat.M12 * x + mat.M22 * y + mat.M32 * z + mat.M42; result.Z = mat.M13 * x + mat.M23 * y + mat.M33 * z + mat.M43; return result; } public static Vector3 Vector3RotateByQuaternion(Vector3 v, Quaternion q) { Vector3 result = new Vector3 { X = 0f }; result.X = v.X * (q.X * q.X + q.W * q.W - q.Y * q.Y - q.Z * q.Z) + v.Y * (2f * q.X * q.Y - 2f * q.W * q.Z) + v.Z * (2f * q.X * q.Z + 2f * q.W * q.Y); result.Y = v.X * (2f * q.W * q.Z + 2f * q.X * q.Y) + v.Y * (q.W * q.W - q.X * q.X + q.Y * q.Y - q.Z * q.Z) + v.Z * (-2f * q.W * q.X + 2f * q.Y * q.Z); result.Z = v.X * (-2f * q.W * q.Y + 2f * q.X * q.Z) + v.Y * (2f * q.W * q.X + 2f * q.Y * q.Z) + v.Z * (q.W * q.W - q.X * q.X - q.Y * q.Y + q.Z * q.Z); return result; } public static Vector3 Vector3RotateByAxisAngle(Vector3 v, Vector3 axis, float angle) { Vector3 result = v; float num = MathF.Sqrt(axis.X * axis.X + axis.Y * axis.Y + axis.Z * axis.Z); if (num == 0f) { num = 1f; } float num2 = 1f / num; axis.X *= num2; axis.Y *= num2; axis.Z *= num2; angle /= 2f; float num3 = MathF.Sin(angle); float x = axis.X * num3; float y = axis.Y * num3; float z = axis.Z * num3; num3 = MathF.Cos(angle); Vector3 vector = new Vector3 { X = x, Y = y, Z = z }; Vector3 vector2 = new Vector3 { X = vector.Y * v.Z - vector.Z * v.Y, Y = vector.Z * v.X - vector.X * v.Z, Z = vector.X * v.Y - vector.Y * v.X }; Vector3 vector3 = new Vector3 { X = vector.Y * vector2.Z - vector.Z * vector2.Y, Y = vector.Z * vector2.X - vector.X * vector2.Z, Z = vector.X * vector2.Y - vector.Y * vector2.X }; num3 *= 2f; vector2.X *= num3; vector2.Y *= num3; vector2.Z *= num3; vector3.X *= 2f; vector3.Y *= 2f; vector3.Z *= 2f; result.X += vector2.X; result.Y += vector2.Y; result.Z += vector2.Z; result.X += vector3.X; result.Y += vector3.Y; result.Z += vector3.Z; return result; } public static Vector3 Vector3Lerp(Vector3 v1, Vector3 v2, float amount) { Vector3 result = new Vector3 { X = 0f }; result.X = v1.X + amount * (v2.X - v1.X); result.Y = v1.Y + amount * (v2.Y - v1.Y); result.Z = v1.Z + amount * (v2.Z - v1.Z); return result; } public static Vector3 Vector3Reflect(Vector3 v, Vector3 normal) { Vector3 result = new Vector3 { X = 0f }; float num = v.X * normal.X + v.Y * normal.Y + v.Z * normal.Z; result.X = v.X - 2f * normal.X * num; result.Y = v.Y - 2f * normal.Y * num; result.Z = v.Z - 2f * normal.Z * num; return result; } public static Vector3 Vector3Min(Vector3 v1, Vector3 v2) { Vector3 result = new Vector3 { X = 0f }; result.X = MathF.Min(v1.X, v2.X); result.Y = MathF.Min(v1.Y, v2.Y); result.Z = MathF.Min(v1.Z, v2.Z); return result; } public static Vector3 Vector3Max(Vector3 v1, Vector3 v2) { Vector3 result = new Vector3 { X = 0f }; result.X = MathF.Max(v1.X, v2.X); result.Y = MathF.Max(v1.Y, v2.Y); result.Z = MathF.Max(v1.Z, v2.Z); return result; } public static Vector3 Vector3Barycenter(Vector3 p, Vector3 a, Vector3 b, Vector3 c) { Vector3 result = new Vector3 { X = 0f }; Vector3 vector = new Vector3 { X = b.X - a.X, Y = b.Y - a.Y, Z = b.Z - a.Z }; Vector3 vector2 = new Vector3 { X = c.X - a.X, Y = c.Y - a.Y, Z = c.Z - a.Z }; Vector3 vector3 = new Vector3 { X = p.X - a.X, Y = p.Y - a.Y, Z = p.Z - a.Z }; float num = vector.X * vector.X + vector.Y * vector.Y + vector.Z * vector.Z; float num2 = vector.X * vector2.X + vector.Y * vector2.Y + vector.Z * vector2.Z; float num3 = vector2.X * vector2.X + vector2.Y * vector2.Y + vector2.Z * vector2.Z; float num4 = vector3.X * vector.X + vector3.Y * vector.Y + vector3.Z * vector.Z; float num5 = vector3.X * vector2.X + vector3.Y * vector2.Y + vector3.Z * vector2.Z; float num6 = num * num3 - num2 * num2; result.Y = (num3 * num4 - num2 * num5) / num6; result.Z = (num * num5 - num2 * num4) / num6; result.X = 1f - (result.Z + result.Y); return result; } public static Vector3 Vector3Unproject(Vector3 source, Matrix4x4 projection, Matrix4x4 view) { Vector3 result = new Vector3 { X = 0f }; Matrix4x4 obj = new Matrix4x4 { M11 = view.M11 * projection.M11 + view.M12 * projection.M21 + view.M13 * projection.M31 + view.M14 * projection.M41, M21 = view.M11 * projection.M12 + view.M12 * projection.M22 + view.M13 * projection.M32 + view.M14 * projection.M42, M31 = view.M11 * projection.M13 + view.M12 * projection.M23 + view.M13 * projection.M33 + view.M14 * projection.M43, M41 = view.M11 * projection.M14 + view.M12 * projection.M24 + view.M13 * projection.M34 + view.M14 * projection.M44, M12 = view.M21 * projection.M11 + view.M22 * projection.M21 + view.M23 * projection.M31 + view.M24 * projection.M41, M22 = view.M21 * projection.M12 + view.M22 * projection.M22 + view.M23 * projection.M32 + view.M24 * projection.M42, M32 = view.M21 * projection.M13 + view.M22 * projection.M23 + view.M23 * projection.M33 + view.M24 * projection.M43, M42 = view.M21 * projection.M14 + view.M22 * projection.M24 + view.M23 * projection.M34 + view.M24 * projection.M44, M13 = view.M31 * projection.M11 + view.M32 * projection.M21 + view.M33 * projection.M31 + view.M34 * projection.M41, M23 = view.M31 * projection.M12 + view.M32 * projection.M22 + view.M33 * projection.M32 + view.M34 * projection.M42, M33 = view.M31 * projection.M13 + view.M32 * projection.M23 + view.M33 * projection.M33 + view.M34 * projection.M43, M43 = view.M31 * projection.M14 + view.M32 * projection.M24 + view.M33 * projection.M34 + view.M34 * projection.M44, M14 = view.M41 * projection.M11 + view.M42 * projection.M21 + view.M43 * projection.M31 + view.M44 * projection.M41, M24 = view.M41 * projection.M12 + view.M42 * projection.M22 + view.M43 * projection.M32 + view.M44 * projection.M42, M34 = view.M41 * projection.M13 + view.M42 * projection.M23 + view.M43 * projection.M33 + view.M44 * projection.M43, M44 = view.M41 * projection.M14 + view.M42 * projection.M24 + view.M43 * projection.M34 + view.M44 * projection.M44 }; float m = obj.M11; float m2 = obj.M12; float m3 = obj.M13; float m4 = obj.M14; float m5 = obj.M21; float m6 = obj.M22; float m7 = obj.M23; float m8 = obj.M24; float m9 = obj.M31; float m10 = obj.M32; float m11 = obj.M33; float m12 = obj.M34; float m13 = obj.M41; float m14 = obj.M42; float m15 = obj.M43; float m16 = obj.M44; float num = m * m6 - m2 * m5; float num2 = m * m7 - m3 * m5; float num3 = m * m8 - m4 * m5; float num4 = m2 * m7 - m3 * m6; float num5 = m2 * m8 - m4 * m6; float num6 = m3 * m8 - m4 * m7; float num7 = m9 * m14 - m10 * m13; float num8 = m9 * m15 - m11 * m13; float num9 = m9 * m16 - m12 * m13; float num10 = m10 * m15 - m11 * m14; float num11 = m10 * m16 - m12 * m14; float num12 = m11 * m16 - m12 * m15; float num13 = 1f / (num * num12 - num2 * num11 + num3 * num10 + num4 * num9 - num5 * num8 + num6 * num7); Matrix4x4 matrix4x = new Matrix4x4 { M11 = (m6 * num12 - m7 * num11 + m8 * num10) * num13, M21 = ((0f - m2) * num12 + m3 * num11 - m4 * num10) * num13, M31 = (m14 * num6 - m15 * num5 + m16 * num4) * num13, M41 = ((0f - m10) * num6 + m11 * num5 - m12 * num4) * num13, M12 = ((0f - m5) * num12 + m7 * num9 - m8 * num8) * num13, M22 = (m * num12 - m3 * num9 + m4 * num8) * num13, M32 = ((0f - m13) * num6 + m15 * num3 - m16 * num2) * num13, M42 = (m9 * num6 - m11 * num3 + m12 * num2) * num13, M13 = (m5 * num11 - m6 * num9 + m8 * num7) * num13, M23 = ((0f - m) * num11 + m2 * num9 - m4 * num7) * num13, M33 = (m13 * num5 - m14 * num3 + m16 * num) * num13, M43 = ((0f - m9) * num5 + m10 * num3 - m12 * num) * num13, M14 = ((0f - m5) * num10 + m6 * num8 - m7 * num7) * num13, M24 = (m * num10 - m2 * num8 + m3 * num7) * num13, M34 = ((0f - m13) * num4 + m14 * num2 - m15 * num) * num13, M44 = (m9 * num4 - m10 * num2 + m11 * num) * num13 }; Quaternion quaternion = new Quaternion { X = source.X, Y = source.Y, Z = source.Z, W = 1f }; Quaternion quaternion2 = new Quaternion { X = matrix4x.M11 * quaternion.X + matrix4x.M21 * quaternion.Y + matrix4x.M31 * quaternion.Z + matrix4x.M41 * quaternion.W, Y = matrix4x.M12 * quaternion.X + matrix4x.M22 * quaternion.Y + matrix4x.M32 * quaternion.Z + matrix4x.M42 * quaternion.W, Z = matrix4x.M13 * quaternion.X + matrix4x.M23 * quaternion.Y + matrix4x.M33 * quaternion.Z + matrix4x.M43 * quaternion.W, W = matrix4x.M14 * quaternion.X + matrix4x.M24 * quaternion.Y + matrix4x.M34 * quaternion.Z + matrix4x.M44 * quaternion.W }; result.X = quaternion2.X / quaternion2.W; result.Y = quaternion2.Y / quaternion2.W; result.Z = quaternion2.Z / quaternion2.W; return result; } public static Vector3 Vector3Invert(Vector3 v) { return new Vector3 { X = 1f / v.X, Y = 1f / v.Y, Z = 1f / v.Z }; } public static Vector3 Vector3Clamp(Vector3 v, Vector3 min, Vector3 max) { Vector3 result = new Vector3 { X = 0f }; result.X = MathF.Min(max.X, MathF.Max(min.X, v.X)); result.Y = MathF.Min(max.Y, MathF.Max(min.Y, v.Y)); result.Z = MathF.Min(max.Z, MathF.Max(min.Z, v.Z)); return result; } public static Vector3 Vector3ClampValue(Vector3 v, float min, float max) { Vector3 result = v; float num = v.X * v.X + v.Y * v.Y + v.Z * v.Z; if (num > 0f) { num = MathF.Sqrt(num); if (num < min) { float num2 = min / num; result.X = v.X * num2; result.Y = v.Y * num2; result.Z = v.Z * num2; } else if (num > max) { float num3 = max / num; result.X = v.X * num3; result.Y = v.Y * num3; result.Z = v.Z * num3; } } return result; } public static int Vector3Equals(Vector3 p, Vector3 q) { if (!(fabsf(p.X - q.X) <= 1E-06f * MathF.Max(1f, MathF.Max(fabsf(p.X), fabsf(q.X)))) || !(fabsf(p.Y - q.Y) <= 1E-06f * MathF.Max(1f, MathF.Max(fabsf(p.Y), fabsf(q.Y)))) || !(fabsf(p.Z - q.Z) <= 1E-06f * MathF.Max(1f, MathF.Max(fabsf(p.Z), fabsf(q.Z))))) { return 0; } return 1; } public static Vector3 Vector3Refract(Vector3 v, Vector3 n, float r) { Vector3 result = new Vector3 { X = 0f }; float num = v.X * n.X + v.Y * n.Y + v.Z * n.Z; float num2 = 1f - r * r * (1f - num * num); if (num2 >= 0f) { num2 = MathF.Sqrt(num2); v.X = r * v.X - (r * num + num2) * n.X; v.Y = r * v.Y - (r * num + num2) * n.Y; v.Z = r * v.Z - (r * num + num2) * n.Z; result = v; } return result; } public static float MatrixDeterminant(Matrix4x4 mat) { float m = mat.M11; float m2 = mat.M12; float m3 = mat.M13; float m4 = mat.M14; float m5 = mat.M21; float m6 = mat.M22; float m7 = mat.M23; float m8 = mat.M24; float m9 = mat.M31; float m10 = mat.M32; float m11 = mat.M33; float m12 = mat.M34; float m13 = mat.M41; float m14 = mat.M42; float m15 = mat.M43; float m16 = mat.M44; return m13 * m10 * m7 * m4 - m9 * m14 * m7 * m4 - m13 * m6 * m11 * m4 + m5 * m14 * m11 * m4 + m9 * m6 * m15 * m4 - m5 * m10 * m15 * m4 - m13 * m10 * m3 * m8 + m9 * m14 * m3 * m8 + m13 * m2 * m11 * m8 - m * m14 * m11 * m8 - m9 * m2 * m15 * m8 + m * m10 * m15 * m8 + m13 * m6 * m3 * m12 - m5 * m14 * m3 * m12 - m13 * m2 * m7 * m12 + m * m14 * m7 * m12 + m5 * m2 * m15 * m12 - m * m6 * m15 * m12 - m9 * m6 * m3 * m16 + m5 * m10 * m3 * m16 + m9 * m2 * m7 * m16 - m * m10 * m7 * m16 - m5 * m2 * m11 * m16 + m * m6 * m11 * m16; } public static float MatrixTrace(Matrix4x4 mat) { return mat.M11 + mat.M22 + mat.M33 + mat.M44; } public static Matrix4x4 MatrixTranspose(Matrix4x4 mat) { Matrix4x4 result = new Matrix4x4 { M11 = 0f }; result.M11 = mat.M11; result.M12 = mat.M21; result.M13 = mat.M31; result.M14 = mat.M41; result.M21 = mat.M12; result.M22 = mat.M22; result.M23 = mat.M32; result.M24 = mat.M42; result.M31 = mat.M13; result.M32 = mat.M23; result.M33 = mat.M33; result.M34 = mat.M43; result.M41 = mat.M14; result.M42 = mat.M24; result.M43 = mat.M34; result.M44 = mat.M44; return result; } public static Matrix4x4 MatrixInvert(Matrix4x4 mat) { Matrix4x4 result = new Matrix4x4 { M11 = 0f }; float m = mat.M11; float m2 = mat.M12; float m3 = mat.M13; float m4 = mat.M14; float m5 = mat.M21; float m6 = mat.M22; float m7 = mat.M23; float m8 = mat.M24; float m9 = mat.M31; float m10 = mat.M32; float m11 = mat.M33; float m12 = mat.M34; float m13 = mat.M41; float m14 = mat.M42; float m15 = mat.M43; float m16 = mat.M44; float num = m * m6 - m2 * m5; float num2 = m * m7 - m3 * m5; float num3 = m * m8 - m4 * m5; float num4 = m2 * m7 - m3 * m6; float num5 = m2 * m8 - m4 * m6; float num6 = m3 * m8 - m4 * m7; float num7 = m9 * m14 - m10 * m13; float num8 = m9 * m15 - m11 * m13; float num9 = m9 * m16 - m12 * m13; float num10 = m10 * m15 - m11 * m14; float num11 = m10 * m16 - m12 * m14; float num12 = m11 * m16 - m12 * m15; float num13 = 1f / (num * num12 - num2 * num11 + num3 * num10 + num4 * num9 - num5 * num8 + num6 * num7); result.M11 = (m6 * num12 - m7 * num11 + m8 * num10) * num13; result.M12 = ((0f - m2) * num12 + m3 * num11 - m4 * num10) * num13; result.M13 = (m14 * num6 - m15 * num5 + m16 * num4) * num13; result.M14 = ((0f - m10) * num6 + m11 * num5 - m12 * num4) * num13; result.M21 = ((0f - m5) * num12 + m7 * num9 - m8 * num8) * num13; result.M22 = (m * num12 - m3 * num9 + m4 * num8) * num13; result.M23 = ((0f - m13) * num6 + m15 * num3 - m16 * num2) * num13; result.M24 = (m9 * num6 - m11 * num3 + m12 * num2) * num13; result.M31 = (m5 * num11 - m6 * num9 + m8 * num7) * num13; result.M32 = ((0f - m) * num11 + m2 * num9 - m4 * num7) * num13; result.M33 = (m13 * num5 - m14 * num3 + m16 * num) * num13; result.M34 = ((0f - m9) * num5 + m10 * num3 - m12 * num) * num13; result.M41 = ((0f - m5) * num10 + m6 * num8 - m7 * num7) * num13; result.M42 = (m * num10 - m2 * num8 + m3 * num7) * num13; result.M43 = ((0f - m13) * num4 + m14 * num2 - m15 * num) * num13; result.M44 = (m9 * num4 - m10 * num2 + m11 * num) * num13; return result; } public static Matrix4x4 MatrixIdentity() { return new Matrix4x4 { M11 = 1f, M21 = 0f, M31 = 0f, M41 = 0f, M12 = 0f, M22 = 1f, M32 = 0f, M42 = 0f, M13 = 0f, M23 = 0f, M33 = 1f, M43 = 0f, M14 = 0f, M24 = 0f, M34 = 0f, M44 = 1f }; } public static Matrix4x4 MatrixAdd(Matrix4x4 left, Matrix4x4 right) { Matrix4x4 result = new Matrix4x4 { M11 = 0f }; result.M11 = left.M11 + right.M11; result.M12 = left.M12 + right.M12; result.M13 = left.M13 + right.M13; result.M14 = left.M14 + right.M14; result.M21 = left.M21 + right.M21; result.M22 = left.M22 + right.M22; result.M23 = left.M23 + right.M23; result.M24 = left.M24 + right.M24; result.M31 = left.M31 + right.M31; result.M32 = left.M32 + right.M32; result.M33 = left.M33 + right.M33; result.M34 = left.M34 + right.M34; result.M41 = left.M41 + right.M41; result.M42 = left.M42 + right.M42; result.M43 = left.M43 + right.M43; result.M44 = left.M44 + right.M44; return result; } public static Matrix4x4 MatrixSubtract(Matrix4x4 left, Matrix4x4 right) { Matrix4x4 result = new Matrix4x4 { M11 = 0f }; result.M11 = left.M11 - right.M11; result.M12 = left.M12 - right.M12; result.M13 = left.M13 - right.M13; result.M14 = left.M14 - right.M14; result.M21 = left.M21 - right.M21; result.M22 = left.M22 - right.M22; result.M23 = left.M23 - right.M23; result.M24 = left.M24 - right.M24; result.M31 = left.M31 - right.M31; result.M32 = left.M32 - right.M32; result.M33 = left.M33 - right.M33; result.M34 = left.M34 - right.M34; result.M41 = left.M41 - right.M41; result.M42 = left.M42 - right.M42; result.M43 = left.M43 - right.M43; result.M44 = left.M44 - right.M44; return result; } public static Matrix4x4 MatrixMultiply(Matrix4x4 left, Matrix4x4 right) { Matrix4x4 result = new Matrix4x4 { M11 = 0f }; result.M11 = left.M11 * right.M11 + left.M12 * right.M21 + left.M13 * right.M31 + left.M14 * right.M41; result.M12 = left.M11 * right.M12 + left.M12 * right.M22 + left.M13 * right.M32 + left.M14 * right.M42; result.M13 = left.M11 * right.M13 + left.M12 * right.M23 + left.M13 * right.M33 + left.M14 * right.M43; result.M14 = left.M11 * right.M14 + left.M12 * right.M24 + left.M13 * right.M34 + left.M14 * right.M44; result.M21 = left.M21 * right.M11 + left.M22 * right.M21 + left.M23 * right.M31 + left.M24 * right.M41; result.M22 = left.M21 * right.M12 + left.M22 * right.M22 + left.M23 * right.M32 + left.M24 * right.M42; result.M23 = left.M21 * right.M13 + left.M22 * right.M23 + left.M23 * right.M33 + left.M24 * right.M43; result.M24 = left.M21 * right.M14 + left.M22 * right.M24 + left.M23 * right.M34 + left.M24 * right.M44; result.M31 = left.M31 * right.M11 + left.M32 * right.M21 + left.M33 * right.M31 + left.M34 * right.M41; result.M32 = left.M31 * right.M12 + left.M32 * right.M22 + left.M33 * right.M32 + left.M34 * right.M42; result.M33 = left.M31 * right.M13 + left.M32 * right.M23 + left.M33 * right.M33 + left.M34 * right.M43; result.M34 = left.M31 * right.M14 + left.M32 * right.M24 + left.M33 * right.M34 + left.M34 * right.M44; result.M41 = left.M41 * right.M11 + left.M42 * right.M21 + left.M43 * right.M31 + left.M44 * right.M41; result.M42 = left.M41 * right.M12 + left.M42 * right.M22 + left.M43 * right.M32 + left.M44 * right.M42; result.M43 = left.M41 * right.M13 + left.M42 * right.M23 + left.M43 * right.M33 + left.M44 * right.M43; result.M44 = left.M41 * right.M14 + left.M42 * right.M24 + left.M43 * right.M34 + left.M44 * right.M44; return result; } public static Matrix4x4 MatrixTranslate(float x, float y, float z) { return new Matrix4x4 { M11 = 1f, M21 = 0f, M31 = 0f, M41 = x, M12 = 0f, M22 = 1f, M32 = 0f, M42 = y, M13 = 0f, M23 = 0f, M33 = 1f, M43 = z, M14 = 0f, M24 = 0f, M34 = 0f, M44 = 1f }; } public static Matrix4x4 MatrixRotate(Vector3 axis, float angle) { Matrix4x4 result = new Matrix4x4 { M11 = 0f }; float num = axis.X; float num2 = axis.Y; float num3 = axis.Z; float num4 = num * num + num2 * num2 + num3 * num3; if (num4 != 1f && num4 != 0f) { float num5 = 1f / MathF.Sqrt(num4); num *= num5; num2 *= num5; num3 *= num5; } float num6 = MathF.Sin(angle); float num7 = MathF.Cos(angle); float num8 = 1f - num7; result.M11 = num * num * num8 + num7; result.M12 = num2 * num * num8 + num3 * num6; result.M13 = num3 * num * num8 - num2 * num6; result.M14 = 0f; result.M21 = num * num2 * num8 - num3 * num6; result.M22 = num2 * num2 * num8 + num7; result.M23 = num3 * num2 * num8 + num * num6; result.M24 = 0f; result.M31 = num * num3 * num8 + num2 * num6; result.M32 = num2 * num3 * num8 - num * num6; result.M33 = num3 * num3 * num8 + num7; result.M34 = 0f; result.M41 = 0f; result.M42 = 0f; result.M43 = 0f; result.M44 = 1f; return result; } public static Matrix4x4 MatrixRotateX(float angle) { Matrix4x4 result = new Matrix4x4 { M11 = 1f, M21 = 0f, M31 = 0f, M41 = 0f, M12 = 0f, M22 = 1f, M32 = 0f, M42 = 0f, M13 = 0f, M23 = 0f, M33 = 1f, M43 = 0f, M14 = 0f, M24 = 0f, M34 = 0f, M44 = 1f }; float num = MathF.Cos(angle); float num2 = MathF.Sin(angle); result.M22 = num; result.M23 = num2; result.M32 = 0f - num2; result.M33 = num; return result; } public static Matrix4x4 MatrixRotateY(float angle) { Matrix4x4 result = new Matrix4x4 { M11 = 1f, M21 = 0f, M31 = 0f, M41 = 0f, M12 = 0f, M22 = 1f, M32 = 0f, M42 = 0f, M13 = 0f, M23 = 0f, M33 = 1f, M43 = 0f, M14 = 0f, M24 = 0f, M34 = 0f, M44 = 1f }; float num = MathF.Cos(angle); float num2 = MathF.Sin(angle); result.M11 = num; result.M13 = 0f - num2; result.M31 = num2; result.M33 = num; return result; } public static Matrix4x4 MatrixRotateZ(float angle) { Matrix4x4 result = new Matrix4x4 { M11 = 1f, M21 = 0f, M31 = 0f, M41 = 0f, M12 = 0f, M22 = 1f, M32 = 0f, M42 = 0f, M13 = 0f, M23 = 0f, M33 = 1f, M43 = 0f, M14 = 0f, M24 = 0f, M34 = 0f, M44 = 1f }; float num = MathF.Cos(angle); float num2 = MathF.Sin(angle); result.M11 = num; result.M12 = num2; result.M21 = 0f - num2; result.M22 = num; return result; } public static Matrix4x4 MatrixRotateXYZ(Vector3 angle) { Matrix4x4 result = new Matrix4x4 { M11 = 1f, M21 = 0f, M31 = 0f, M41 = 0f, M12 = 0f, M22 = 1f, M32 = 0f, M42 = 0f, M13 = 0f, M23 = 0f, M33 = 1f, M43 = 0f, M14 = 0f, M24 = 0f, M34 = 0f, M44 = 1f }; float num = MathF.Cos(0f - angle.Z); float num2 = MathF.Sin(0f - angle.Z); float num3 = MathF.Cos(0f - angle.Y); float num4 = MathF.Sin(0f - angle.Y); float num5 = MathF.Cos(0f - angle.X); float num6 = MathF.Sin(0f - angle.X); result.M11 = num * num3; result.M12 = num * num4 * num6 - num2 * num5; result.M13 = num * num4 * num5 + num2 * num6; result.M21 = num2 * num3; result.M22 = num2 * num4 * num6 + num * num5; result.M23 = num2 * num4 * num5 - num * num6; result.M31 = 0f - num4; result.M32 = num3 * num6; result.M33 = num3 * num5; return result; } public static Matrix4x4 MatrixRotateZYX(Vector3 angle) { Matrix4x4 result = new Matrix4x4 { M11 = 0f }; float num = MathF.Cos(angle.Z); float num2 = MathF.Sin(angle.Z); float num3 = MathF.Cos(angle.Y); float num4 = MathF.Sin(angle.Y); float num5 = MathF.Cos(angle.X); float num6 = MathF.Sin(angle.X); result.M11 = num * num3; result.M21 = num * num4 * num6 - num5 * num2; result.M31 = num2 * num6 + num * num5 * num4; result.M41 = 0f; result.M12 = num3 * num2; result.M22 = num * num5 + num2 * num4 * num6; result.M32 = num5 * num2 * num4 - num * num6; result.M42 = 0f; result.M13 = 0f - num4; result.M23 = num3 * num6; result.M33 = num3 * num5; result.M43 = 0f; result.M14 = 0f; result.M24 = 0f; result.M34 = 0f; result.M44 = 1f; return result; } public static Matrix4x4 MatrixScale(float x, float y, float z) { return new Matrix4x4 { M11 = x, M21 = 0f, M31 = 0f, M41 = 0f, M12 = 0f, M22 = y, M32 = 0f, M42 = 0f, M13 = 0f, M23 = 0f, M33 = z, M43 = 0f, M14 = 0f, M24 = 0f, M34 = 0f, M44 = 1f }; } public static Matrix4x4 MatrixFrustum(double left, double right, double bottom, double top, double near, double far) { Matrix4x4 result = new Matrix4x4 { M11 = 0f }; float num = (float)(right - left); float num2 = (float)(top - bottom); float num3 = (float)(far - near); result.M11 = (float)near * 2f / num; result.M12 = 0f; result.M13 = 0f; result.M14 = 0f; result.M21 = 0f; result.M22 = (float)near * 2f / num2; result.M23 = 0f; result.M24 = 0f; result.M31 = ((float)right + (float)left) / num; result.M32 = ((float)top + (float)bottom) / num2; result.M33 = (0f - ((float)far + (float)near)) / num3; result.M34 = -1f; result.M41 = 0f; result.M42 = 0f; result.M43 = (0f - (float)far * (float)near * 2f) / num3; result.M44 = 0f; return result; } public static Matrix4x4 MatrixPerspective(double fovy, double aspect, double near, double far) { Matrix4x4 result = new Matrix4x4 { M11 = 0f }; double num = near * Math.Tan(fovy * 0.5); double num2 = 0.0 - num; double num3 = num * aspect; double num4 = 0.0 - num3; float num5 = (float)(num3 - num4); float num6 = (float)(num - num2); float num7 = (float)(far - near); result.M11 = (float)near * 2f / num5; result.M22 = (float)near * 2f / num6; result.M31 = ((float)num3 + (float)num4) / num5; result.M32 = ((float)num + (float)num2) / num6; result.M33 = (0f - ((float)far + (float)near)) / num7; result.M34 = -1f; result.M43 = (0f - (float)far * (float)near * 2f) / num7; return result; } public static Matrix4x4 MatrixOrtho(double left, double right, double bottom, double top, double near, double far) { Matrix4x4 result = new Matrix4x4 { M11 = 0f }; float num = (float)(right - left); float num2 = (float)(top - bottom); float num3 = (float)(far - near); result.M11 = 2f / num; result.M12 = 0f; result.M13 = 0f; result.M14 = 0f; result.M21 = 0f; result.M22 = 2f / num2; result.M23 = 0f; result.M24 = 0f; result.M31 = 0f; result.M32 = 0f; result.M33 = -2f / num3; result.M34 = 0f; result.M41 = (0f - ((float)left + (float)right)) / num; result.M42 = (0f - ((float)top + (float)bottom)) / num2; result.M43 = (0f - ((float)far + (float)near)) / num3; result.M44 = 1f; return result; } public static Matrix4x4 MatrixLookAt(Vector3 eye, Vector3 target, Vector3 up) { Matrix4x4 result = new Matrix4x4 { M11 = 0f }; float num = 0f; float num2 = 0f; Vector3 vector = new Vector3 { X = eye.X - target.X, Y = eye.Y - target.Y, Z = eye.Z - target.Z }; Vector3 vector2 = vector; num = MathF.Sqrt(vector2.X * vector2.X + vector2.Y * vector2.Y + vector2.Z * vector2.Z); if (num == 0f) { num = 1f; } num2 = 1f / num; vector.X *= num2; vector.Y *= num2; vector.Z *= num2; Vector3 vector3 = new Vector3 { X = up.Y * vector.Z - up.Z * vector.Y, Y = up.Z * vector.X - up.X * vector.Z, Z = up.X * vector.Y - up.Y * vector.X }; vector2 = vector3; num = MathF.Sqrt(vector2.X * vector2.X + vector2.Y * vector2.Y + vector2.Z * vector2.Z); if (num == 0f) { num = 1f; } num2 = 1f / num; vector3.X *= num2; vector3.Y *= num2; vector3.Z *= num2; Vector3 vector4 = new Vector3 { X = vector.Y * vector3.Z - vector.Z * vector3.Y, Y = vector.Z * vector3.X - vector.X * vector3.Z, Z = vector.X * vector3.Y - vector.Y * vector3.X }; result.M11 = vector3.X; result.M12 = vector4.X; result.M13 = vector.X; result.M14 = 0f; result.M21 = vector3.Y; result.M22 = vector4.Y; result.M23 = vector.Y; result.M24 = 0f; result.M31 = vector3.Z; result.M32 = vector4.Z; result.M33 = vector.Z; result.M34 = 0f; result.M41 = 0f - (vector3.X * eye.X + vector3.Y * eye.Y + vector3.Z * eye.Z); result.M42 = 0f - (vector4.X * eye.X + vector4.Y * eye.Y + vector4.Z * eye.Z); result.M43 = 0f - (vector.X * eye.X + vector.Y * eye.Y + vector.Z * eye.Z); result.M44 = 1f; return result; } public static Quaternion QuaternionAdd(Quaternion q1, Quaternion q2) { return new Quaternion { X = q1.X + q2.X, Y = q1.Y + q2.Y, Z = q1.Z + q2.Z, W = q1.W + q2.W }; } public static Quaternion QuaternionAddValue(Quaternion q, float add) { return new Quaternion { X = q.X + add, Y = q.Y + add, Z = q.Z + add, W = q.W + add }; } public static Quaternion QuaternionSubtract(Quaternion q1, Quaternion q2) { return new Quaternion { X = q1.X - q2.X, Y = q1.Y - q2.Y, Z = q1.Z - q2.Z, W = q1.W - q2.W }; } public static Quaternion QuaternionSubtractValue(Quaternion q, float sub) { return new Quaternion { X = q.X - sub, Y = q.Y - sub, Z = q.Z - sub, W = q.W - sub }; } public static Quaternion QuaternionIdentity() { return new Quaternion { X = 0f, Y = 0f, Z = 0f, W = 1f }; } public static float QuaternionLength(Quaternion q) { return MathF.Sqrt(q.X * q.X + q.Y * q.Y + q.Z * q.Z + q.W * q.W); } public static Quaternion QuaternionNormalize(Quaternion q) { Quaternion result = new Quaternion { X = 0f }; float num = MathF.Sqrt(q.X * q.X + q.Y * q.Y + q.Z * q.Z + q.W * q.W); if (num == 0f) { num = 1f; } float num2 = 1f / num; result.X = q.X * num2; result.Y = q.Y * num2; result.Z = q.Z * num2; result.W = q.W * num2; return result; } public static Quaternion QuaternionInvert(Quaternion q) { Quaternion result = q; float num = q.X * q.X + q.Y * q.Y + q.Z * q.Z + q.W * q.W; if (num != 0f) { float num2 = 1f / num; result.X *= 0f - num2; result.Y *= 0f - num2; result.Z *= 0f - num2; result.W *= num2; } return result; } public static Quaternion QuaternionMultiply(Quaternion q1, Quaternion q2) { Quaternion result = new Quaternion { X = 0f }; float x = q1.X; float y = q1.Y; float z = q1.Z; float w = q1.W; float x2 = q2.X; float y2 = q2.Y; float z2 = q2.Z; float w2 = q2.W; result.X = x * w2 + w * x2 + y * z2 - z * y2; result.Y = y * w2 + w * y2 + z * x2 - x * z2; result.Z = z * w2 + w * z2 + x * y2 - y * x2; result.W = w * w2 - x * x2 - y * y2 - z * z2; return result; } public static Quaternion QuaternionScale(Quaternion q, float mul) { Quaternion result = new Quaternion { X = 0f }; result.X = q.X * mul; result.Y = q.Y * mul; result.Z = q.Z * mul; result.W = q.W * mul; return result; } public static Quaternion QuaternionDivide(Quaternion q1, Quaternion q2) { return new Quaternion { X = q1.X / q2.X, Y = q1.Y / q2.Y, Z = q1.Z / q2.Z, W = q1.W / q2.W }; } public static Quaternion QuaternionLerp(Quaternion q1, Quaternion q2, float amount) { Quaternion result = new Quaternion { X = 0f }; result.X = q1.X + amount * (q2.X - q1.X); result.Y = q1.Y + amount * (q2.Y - q1.Y); result.Z = q1.Z + amount * (q2.Z - q1.Z); result.W = q1.W + amount * (q2.W - q1.W); return result; } public static Quaternion QuaternionNlerp(Quaternion q1, Quaternion q2, float amount) { Quaternion quaternion = new Quaternion { X = 0f }; quaternion.X = q1.X + amount * (q2.X - q1.X); quaternion.Y = q1.Y + amount * (q2.Y - q1.Y); quaternion.Z = q1.Z + amount * (q2.Z - q1.Z); quaternion.W = q1.W + amount * (q2.W - q1.W); Quaternion quaternion2 = quaternion; float num = MathF.Sqrt(quaternion2.X * quaternion2.X + quaternion2.Y * quaternion2.Y + quaternion2.Z * quaternion2.Z + quaternion2.W * quaternion2.W); if (num == 0f) { num = 1f; } float num2 = 1f / num; quaternion.X = quaternion2.X * num2; quaternion.Y = quaternion2.Y * num2; quaternion.Z = quaternion2.Z * num2; quaternion.W = quaternion2.W * num2; return quaternion; } public static Quaternion QuaternionSlerp(Quaternion q1, Quaternion q2, float amount) { Quaternion result = new Quaternion { X = 0f }; float num = q1.X * q2.X + q1.Y * q2.Y + q1.Z * q2.Z + q1.W * q2.W; if (num < 0f) { q2.X = 0f - q2.X; q2.Y = 0f - q2.Y; q2.Z = 0f - q2.Z; q2.W = 0f - q2.W; num = 0f - num; } if (fabsf(num) >= 1f) { result = q1; } else if (num > 0.95f) { result = QuaternionNlerp(q1, q2, amount); } else { float num2 = MathF.Acos(num); float num3 = MathF.Sqrt(1f - num * num); if (fabsf(num3) < 0.001f) { result.X = q1.X * 0.5f + q2.X * 0.5f; result.Y = q1.Y * 0.5f + q2.Y * 0.5f; result.Z = q1.Z * 0.5f + q2.Z * 0.5f; result.W = q1.W * 0.5f + q2.W * 0.5f; } else { float num4 = MathF.Sin((1f - amount) * num2) / num3; float num5 = MathF.Sin(amount * num2) / num3; result.X = q1.X * num4 + q2.X * num5; result.Y = q1.Y * num4 + q2.Y * num5; result.Z = q1.Z * num4 + q2.Z * num5; result.W = q1.W * num4 + q2.W * num5; } } return result; } public static Quaternion QuaternionFromVector3ToVector3(Vector3 from, Vector3 to) { Quaternion quaternion = new Quaternion { X = 0f }; float num = from.X * to.X + from.Y * to.Y + from.Z * to.Z; Vector3 vector = new Vector3 { X = from.Y * to.Z - from.Z * to.Y, Y = from.Z * to.X - from.X * to.Z, Z = from.X * to.Y - from.Y * to.X }; quaternion.X = vector.X; quaternion.Y = vector.Y; quaternion.Z = vector.Z; quaternion.W = 1f + num; Quaternion quaternion2 = quaternion; float num2 = MathF.Sqrt(quaternion2.X * quaternion2.X + quaternion2.Y * quaternion2.Y + quaternion2.Z * quaternion2.Z + quaternion2.W * quaternion2.W); if (num2 == 0f) { num2 = 1f; } float num3 = 1f / num2; quaternion.X = quaternion2.X * num3; quaternion.Y = quaternion2.Y * num3; quaternion.Z = quaternion2.Z * num3; quaternion.W = quaternion2.W * num3; return quaternion; } public static Quaternion QuaternionFromMatrix(Matrix4x4 mat) { Quaternion result = new Quaternion { X = 0f }; float num = mat.M11 + mat.M22 + mat.M33; float num2 = mat.M11 - mat.M22 - mat.M33; float num3 = mat.M22 - mat.M11 - mat.M33; float num4 = mat.M33 - mat.M11 - mat.M22; int num5 = 0; float num6 = num; if (num2 > num6) { num6 = num2; num5 = 1; } if (num3 > num6) { num6 = num3; num5 = 2; } if (num4 > num6) { num6 = num4; num5 = 3; } float num7 = MathF.Sqrt(num6 + 1f) * 0.5f; float num8 = 0.25f / num7; switch (num5) { case 0: result.W = num7; result.X = (mat.M23 - mat.M32) * num8; result.Y = (mat.M31 - mat.M13) * num8; result.Z = (mat.M12 - mat.M21) * num8; break; case 1: result.X = num7; result.W = (mat.M23 - mat.M32) * num8; result.Y = (mat.M12 + mat.M21) * num8; result.Z = (mat.M31 + mat.M13) * num8; break; case 2: result.Y = num7; result.W = (mat.M31 - mat.M13) * num8; result.X = (mat.M12 + mat.M21) * num8; result.Z = (mat.M23 + mat.M32) * num8; break; case 3: result.Z = num7; result.W = (mat.M12 - mat.M21) * num8; result.X = (mat.M31 + mat.M13) * num8; result.Y = (mat.M23 + mat.M32) * num8; break; } return result; } public static Matrix4x4 QuaternionToMatrix(Quaternion q) { Matrix4x4 result = new Matrix4x4 { M11 = 1f, M21 = 0f, M31 = 0f, M41 = 0f, M12 = 0f, M22 = 1f, M32 = 0f, M42 = 0f, M13 = 0f, M23 = 0f, M33 = 1f, M43 = 0f, M14 = 0f, M24 = 0f, M34 = 0f, M44 = 1f }; float num = q.X * q.X; float num2 = q.Y * q.Y; float num3 = q.Z * q.Z; float num4 = q.X * q.Z; float num5 = q.X * q.Y; float num6 = q.Y * q.Z; float num7 = q.W * q.X; float num8 = q.W * q.Y; float num9 = q.W * q.Z; result.M11 = 1f - 2f * (num2 + num3); result.M12 = 2f * (num5 + num9); result.M13 = 2f * (num4 - num8); result.M21 = 2f * (num5 - num9); result.M22 = 1f - 2f * (num + num3); result.M23 = 2f * (num6 + num7); result.M31 = 2f * (num4 + num8); result.M32 = 2f * (num6 - num7); result.M33 = 1f - 2f * (num + num2); return result; } public static Quaternion QuaternionFromAxisAngle(Vector3 axis, float angle) { Quaternion quaternion = new Quaternion { X = 0f, Y = 0f, Z = 0f, W = 1f }; if (MathF.Sqrt(axis.X * axis.X + axis.Y * axis.Y + axis.Z * axis.Z) != 0f) { angle *= 0.5f; float num = 0f; float num2 = 0f; Vector3 vector = axis; num = MathF.Sqrt(vector.X * vector.X + vector.Y * vector.Y + vector.Z * vector.Z); if (num == 0f) { num = 1f; } num2 = 1f / num; axis.X *= num2; axis.Y *= num2; axis.Z *= num2; float num3 = MathF.Sin(angle); float w = MathF.Cos(angle); quaternion.X = axis.X * num3; quaternion.Y = axis.Y * num3; quaternion.Z = axis.Z * num3; quaternion.W = w; Quaternion quaternion2 = quaternion; num = MathF.Sqrt(quaternion2.X * quaternion2.X + quaternion2.Y * quaternion2.Y + quaternion2.Z * quaternion2.Z + quaternion2.W * quaternion2.W); if (num == 0f) { num = 1f; } num2 = 1f / num; quaternion.X = quaternion2.X * num2; quaternion.Y = quaternion2.Y * num2; quaternion.Z = quaternion2.Z * num2; quaternion.W = quaternion2.W * num2; } return quaternion; } public unsafe static void QuaternionToAxisAngle(Quaternion q, Vector3* outAxis, float* outAngle) { if (fabsf(q.W) > 1f) { float num = MathF.Sqrt(q.X * q.X + q.Y * q.Y + q.Z * q.Z + q.W * q.W); if (num == 0f) { num = 1f; } float num2 = 1f / num; q.X *= num2; q.Y *= num2; q.Z *= num2; q.W *= num2; } Vector3 vector = new Vector3 { X = 0f, Y = 0f, Z = 0f }; float num3 = 2f * MathF.Acos(q.W); float num4 = MathF.Sqrt(1f - q.W * q.W); if (num4 > 0.0001f) { vector.X = q.X / num4; vector.Y = q.Y / num4; vector.Z = q.Z / num4; } else { vector.X = 1f; } *outAxis = vector; *outAngle = num3; } public static Quaternion QuaternionFromEuler(float pitch, float yaw, float roll) { Quaternion result = new Quaternion { X = 0f }; float num = MathF.Cos(pitch * 0.5f); float num2 = MathF.Sin(pitch * 0.5f); float num3 = MathF.Cos(yaw * 0.5f); float num4 = MathF.Sin(yaw * 0.5f); float num5 = MathF.Cos(roll * 0.5f); float num6 = MathF.Sin(roll * 0.5f); result.X = num2 * num3 * num5 - num * num4 * num6; result.Y = num * num4 * num5 + num2 * num3 * num6; result.Z = num * num3 * num6 - num2 * num4 * num5; result.W = num * num3 * num5 + num2 * num4 * num6; return result; } public static Vector3 QuaternionToEuler(Quaternion q) { Vector3 result = new Vector3 { X = 0f }; float y = 2f * (q.W * q.X + q.Y * q.Z); float x = 1f - 2f * (q.X * q.X + q.Y * q.Y); result.X = MathF.Atan2(y, x); float num = 2f * (q.W * q.Y - q.Z * q.X); num = ((num > 1f) ? 1f : num); num = ((num < -1f) ? (-1f) : num); result.Y = MathF.Asin(num); float y2 = 2f * (q.W * q.Z + q.X * q.Y); float x2 = 1f - 2f * (q.Y * q.Y + q.Z * q.Z); result.Z = MathF.Atan2(y2, x2); return result; } public static Quaternion QuaternionTransform(Quaternion q, Matrix4x4 mat) { Quaternion result = new Quaternion { X = 0f }; result.X = mat.M11 * q.X + mat.M21 * q.Y + mat.M31 * q.Z + mat.M41 * q.W; result.Y = mat.M12 * q.X + mat.M22 * q.Y + mat.M32 * q.Z + mat.M42 * q.W; result.Z = mat.M13 * q.X + mat.M23 * q.Y + mat.M33 * q.Z + mat.M43 * q.W; result.W = mat.M14 * q.X + mat.M24 * q.Y + mat.M34 * q.Z + mat.M44 * q.W; return result; } public static int QuaternionEquals(Quaternion p, Quaternion q) { if ((!(fabsf(p.X - q.X) <= 1E-06f * MathF.Max(1f, MathF.Max(fabsf(p.X), fabsf(q.X)))) || !(fabsf(p.Y - q.Y) <= 1E-06f * MathF.Max(1f, MathF.Max(fabsf(p.Y), fabsf(q.Y)))) || !(fabsf(p.Z - q.Z) <= 1E-06f * MathF.Max(1f, MathF.Max(fabsf(p.Z), fabsf(q.Z)))) || !(fabsf(p.W - q.W) <= 1E-06f * MathF.Max(1f, MathF.Max(fabsf(p.W), fabsf(q.W))))) && (!(fabsf(p.X + q.X) <= 1E-06f * MathF.Max(1f, MathF.Max(fabsf(p.X), fabsf(q.X)))) || !(fabsf(p.Y + q.Y) <= 1E-06f * MathF.Max(1f, MathF.Max(fabsf(p.Y), fabsf(q.Y)))) || !(fabsf(p.Z + q.Z) <= 1E-06f * MathF.Max(1f, MathF.Max(fabsf(p.Z), fabsf(q.Z)))) || !(fabsf(p.W + q.W) <= 1E-06f * MathF.Max(1f, MathF.Max(fabsf(p.W), fabsf(q.W)))))) { return 0; } return 1; } public static float floorf(float x) { return MathF.Floor(x); } public static float fabsf(float x) { return MathF.Abs(x); } } public struct Rectangle { public float x; public float y; public float width; public float height; public float X { get { return x; } set { x = value; } } public float Y { get { return y; } set { y = value; } } public Rectangle(float x, float y, float width, float height) { this.x = x; this.y = y; this.width = width; this.height = height; } } public struct RenderTexture { public uint id; public Texture texture; public Texture depth; } public enum rlBlendMode { RL_BLEND_ALPHA, RL_BLEND_ADDITIVE, RL_BLEND_MULTIPLIED, RL_BLEND_ADD_COLORS, RL_BLEND_SUBTRACT_COLORS, RL_BLEND_ALPHA_PREMULTIPLY, RL_BLEND_CUSTOM } public struct rlDrawCall { public int mode; public int vertexCount; public int vertexAlignment; public uint textureId; } public enum rlFramebufferAttachTextureType { RL_ATTACHMENT_CUBEMAP_POSITIVE_X = 0, RL_ATTACHMENT_CUBEMAP_NEGATIVE_X = 1, RL_ATTACHMENT_CUBEMAP_POSITIVE_Y = 2, RL_ATTACHMENT_CUBEMAP_NEGATIVE_Y = 3, RL_ATTACHMENT_CUBEMAP_POSITIVE_Z = 4, RL_ATTACHMENT_CUBEMAP_NEGATIVE_Z = 5, RL_ATTACHMENT_TEXTURE2D = 100, RL_ATTACHMENT_RENDERBUFFER = 200 } public enum rlFramebufferAttachType { RL_ATTACHMENT_COLOR_CHANNEL0 = 0, RL_ATTACHMENT_COLOR_CHANNEL1 = 1, RL_ATTACHMENT_COLOR_CHANNEL2 = 2, RL_ATTACHMENT_COLOR_CHANNEL3 = 3, RL_ATTACHMENT_COLOR_CHANNEL4 = 4, RL_ATTACHMENT_COLOR_CHANNEL5 = 5, RL_ATTACHMENT_COLOR_CHANNEL6 = 6, RL_ATTACHMENT_COLOR_CHANNEL7 = 7, RL_ATTACHMENT_DEPTH = 100, RL_ATTACHMENT_STENCIL = 200 } public static class RlGl { public const int RL_DEFAULT_BATCH_BUFFER_ELEMENTS = 8192; public const int RL_DEFAULT_BATCH_BUFFERS = 1; public const int RL_DEFAULT_BATCH_DRAWCALLS = 256; public const int RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS = 4; public const int RL_MAX_MATRIX_STACK_SIZE = 32; public const int RL_MAX_SHADER_LOCATIONS = 32; public const double RL_CULL_DISTANCE_NEAR = 0.01; public const double RL_CULL_DISTANCE_FAR = 1000.0; public const int RL_TEXTURE_WRAP_S = 10242; public const int RL_TEXTURE_WRAP_T = 10243; public const int RL_TEXTURE_MAG_FILTER = 10240; public const int RL_TEXTURE_MIN_FILTER = 10241; public const int RL_TEXTURE_FILTER_NEAREST = 9728; public const int RL_TEXTURE_FILTER_LINEAR = 9729; public const int RL_TEXTURE_FILTER_MIP_NEAREST = 9984; public const int RL_TEXTURE_FILTER_NEAREST_MIP_LINEAR = 9986; public const int RL_TEXTURE_FILTER_LINEAR_MIP_NEAREST = 9985; public const int RL_TEXTURE_FILTER_MIP_LINEAR = 9987; public const int RL_TEXTURE_FILTER_ANISOTROPIC = 12288; public const int RL_TEXTURE_MIPMAP_BIAS_RATIO = 16384; public const int RL_TEXTURE_WRAP_REPEAT = 10497; public const int RL_TEXTURE_WRAP_CLAMP = 33071; public const int RL_TEXTURE_WRAP_MIRROR_REPEAT = 33648; public const int RL_TEXTURE_WRAP_MIRROR_CLAMP = 34626; public const int RL_MODELVIEW = 5888; public const int RL_PROJECTION = 5889; public const int RL_TEXTURE = 5890; public const int RL_LINES = 1; public const int RL_TRIANGLES = 4; public const int RL_QUADS = 7; public const int RL_UNSIGNED_BYTE = 5121; public const int RL_FLOAT = 5126; public const int RL_STREAM_DRAW = 35040; public const int RL_STREAM_READ = 35041; public const int RL_STREAM_COPY = 35042; public const int RL_STATIC_DRAW = 35044; public const int RL_STATIC_READ = 35045; public const int RL_STATIC_COPY = 35046; public const int RL_DYNAMIC_DRAW = 35048; public const int RL_DYNAMIC_READ = 35049; public const int RL_DYNAMIC_COPY = 35050; public const int RL_FRAGMENT_SHADER = 35632; public const int RL_VERTEX_SHADER = 35633; public const int RL_COMPUTE_SHADER = 37305; public const rlShaderLocationIndex RL_SHADER_LOC_MAP_DIFFUSE = rlShaderLocationIndex.RL_SHADER_LOC_MAP_ALBEDO; public const rlShaderLocationIndex RL_SHADER_LOC_MAP_SPECULAR = rlShaderLocationIndex.RL_SHADER_LOC_MAP_METALNESS; public static ReadOnlySpan RLGL_VERSION => "4.2\0"u8; [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlMatrixMode(int mode); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlPushMatrix(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlPopMatrix(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlLoadIdentity(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlTranslatef(float x, float y, float z); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlRotatef(float angle, float x, float y, float z); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlScalef(float x, float y, float z); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void rlMultMatrixf(float* matf); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlFrustum(double left, double right, double bottom, double top, double znear, double zfar); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlOrtho(double left, double right, double bottom, double top, double znear, double zfar); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlViewport(int x, int y, int width, int height); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlBegin(int mode); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlEnd(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlVertex2i(int x, int y); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlVertex2f(float x, float y); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlVertex3f(float x, float y, float z); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlTexCoord2f(float x, float y); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlNormal3f(float x, float y, float z); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlColor4ub(byte r, byte g, byte b, byte a); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlColor3f(float x, float y, float z); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlColor4f(float x, float y, float z, float w); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool rlEnableVertexArray(uint vaoId); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlDisableVertexArray(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlEnableVertexBuffer(uint id); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlDisableVertexBuffer(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlEnableVertexBufferElement(uint id); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlDisableVertexBufferElement(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlEnableVertexAttribute(uint index); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlDisableVertexAttribute(uint index); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlActiveTextureSlot(int slot); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlEnableTexture(uint id); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlDisableTexture(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlEnableTextureCubemap(uint id); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlDisableTextureCubemap(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlTextureParameters(uint id, int param1, int value); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlEnableShader(uint id); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlDisableShader(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlEnableFramebuffer(uint id); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlDisableFramebuffer(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlActiveDrawBuffers(int count); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlEnableColorBlend(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlDisableColorBlend(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlEnableDepthTest(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlDisableDepthTest(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlEnableDepthMask(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlDisableDepthMask(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlEnableBackfaceCulling(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlDisableBackfaceCulling(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlEnableScissorTest(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlDisableScissorTest(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlScissor(int x, int y, int width, int height); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlEnableWireMode(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlDisableWireMode(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlSetLineWidth(float width); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern float rlGetLineWidth(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlEnableSmoothLines(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlDisableSmoothLines(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlEnableStereoRender(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlDisableStereoRender(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool rlIsStereoRenderEnabled(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlClearColor(byte r, byte g, byte b, byte a); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlClearScreenBuffers(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlCheckErrors(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlSetBlendMode(int mode); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlSetBlendFactors(int glSrcFactor, int glDstFactor, int glEquation); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlglInit(int width, int height); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlglClose(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void rlLoadExtensions(void* loader); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int rlGetVersion(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlSetFramebufferWidth(int width); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int rlGetFramebufferWidth(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlSetFramebufferHeight(int height); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int rlGetFramebufferHeight(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern uint rlGetTextureIdDefault(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern uint rlGetShaderIdDefault(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern int* rlGetShaderLocsDefault(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern rlRenderBatch rlLoadRenderBatch(int numBuffers, int bufferElements); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlUnloadRenderBatch(rlRenderBatch batch); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void rlDrawRenderBatch(rlRenderBatch* batch); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void rlSetRenderBatchActive(rlRenderBatch* batch); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlDrawRenderBatchActive(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool rlCheckRenderBatchLimit(int vCount); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlSetTexture(uint id); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern uint rlLoadVertexArray(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern uint rlLoadVertexBuffer(void* buffer, int size, [MarshalAs(UnmanagedType.U1)] bool dynamic); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern uint rlLoadVertexBufferElement(void* buffer, int size, [MarshalAs(UnmanagedType.U1)] bool dynamic); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void rlUpdateVertexBuffer(uint bufferId, void* data, int dataSize, int offset); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void rlUpdateVertexBufferElements(uint id, void* data, int dataSize, int offset); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlUnloadVertexArray(uint vaoId); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlUnloadVertexBuffer(uint vboId); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void rlSetVertexAttribute(uint index, int compSize, int type, [MarshalAs(UnmanagedType.U1)] bool normalized, int stride, void* pointer); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlSetVertexAttributeDivisor(uint index, int divisor); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void rlSetVertexAttributeDefault(int locIndex, void* value, int attribType, int count); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlDrawVertexArray(int offset, int count); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void rlDrawVertexArrayElements(int offset, int count, void* buffer); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlDrawVertexArrayInstanced(int offset, int count, int instances); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void rlDrawVertexArrayElementsInstanced(int offset, int count, void* buffer, int instances); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern uint rlLoadTexture(void* data, int width, int height, int format, int mipmapCount); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern uint rlLoadTextureDepth(int width, int height, [MarshalAs(UnmanagedType.U1)] bool useRenderBuffer); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern uint rlLoadTextureCubemap(void* data, int size, int format); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void rlUpdateTexture(uint id, int offsetX, int offsetY, int width, int height, int format, void* data); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void rlGetGlTextureFormats(int format, uint* glInternalFormat, uint* glFormat, uint* glType); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern sbyte* rlGetPixelFormatName(uint format); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlUnloadTexture(uint id); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void rlGenTextureMipmaps(uint id, int width, int height, int format, int* mipmaps); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void* rlReadTexturePixels(uint id, int width, int height, int format); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern byte* rlReadScreenPixels(int width, int height); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern uint rlLoadFramebuffer(int width, int height); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlFramebufferAttach(uint fboId, uint texId, int attachType, int texType, int mipLevel); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: MarshalAs(UnmanagedType.U1)] public static extern bool rlFramebufferComplete(uint id); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlUnloadFramebuffer(uint id); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern uint rlLoadShaderCode(sbyte* vsCode, sbyte* fsCode); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern uint rlCompileShader(sbyte* shaderCode, int type); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern uint rlLoadShaderProgram(uint vShaderId, uint fShaderId); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlUnloadShaderProgram(uint id); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern int rlGetLocationUniform(uint shaderId, sbyte* uniformName); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern int rlGetLocationAttrib(uint shaderId, sbyte* attribName); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void rlSetUniform(int locIndex, void* value, int uniformType, int count); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlSetUniformMatrix(int locIndex, Matrix4x4 mat); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlSetUniformSampler(int locIndex, uint textureId); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void rlSetShader(uint id, int* locs); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern uint rlLoadComputeShaderProgram(uint shaderId); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlComputeShaderDispatch(uint groupX, uint groupY, uint groupZ); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern uint rlLoadShaderBuffer(uint size, void* data, int usageHint); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlUnloadShaderBuffer(uint ssboId); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void rlUpdateShaderBuffer(uint id, void* data, uint dataSize, uint offset); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlBindShaderBuffer(uint id, uint index); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void rlReadShaderBuffer(uint id, void* dest, uint count, uint offset); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlCopyShaderBuffer(uint destId, uint srcId, uint destOffset, uint srcOffset, uint count); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern uint rlGetShaderBufferSize(uint id); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlBindImageTexture(uint id, uint index, uint format, int @readonly); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Matrix4x4 rlGetMatrixModelview(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Matrix4x4 rlGetMatrixProjection(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Matrix4x4 rlGetMatrixTransform(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Matrix4x4 rlGetMatrixProjectionStereo(int eye); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Matrix4x4 rlGetMatrixViewOffsetStereo(int eye); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlSetMatrixProjection(Matrix4x4 proj); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlSetMatrixModelview(Matrix4x4 view); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlSetMatrixProjectionStereo(Matrix4x4 right, Matrix4x4 left); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlSetMatrixViewOffsetStereo(Matrix4x4 right, Matrix4x4 left); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlLoadDrawCube(); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rlLoadDrawQuad(); public static void rlFramebufferAttach(uint fboId, uint texId, rlFramebufferAttachType attachType, rlFramebufferAttachTextureType texType, int mipLevel) { rlFramebufferAttach(fboId, texId, (int)attachType, (int)texType, mipLevel); } public unsafe static uint rlLoadTextureCubemap(void* data, int size, PixelFormat format) { return rlLoadTextureCubemap(data, size, (int)format); } public unsafe static void rlMultMatrixf(Matrix4x4 matrix) { rlMultMatrixf((float*)(&matrix)); } } public enum rlGlVersion { RL_OPENGL_11 = 1, RL_OPENGL_21, RL_OPENGL_33, RL_OPENGL_43, RL_OPENGL_ES_20 } public enum rlPixelFormat { RL_PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1, RL_PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA, RL_PIXELFORMAT_UNCOMPRESSED_R5G6B5, RL_PIXELFORMAT_UNCOMPRESSED_R8G8B8, RL_PIXELFORMAT_UNCOMPRESSED_R5G5B5A1, RL_PIXELFORMAT_UNCOMPRESSED_R4G4B4A4, RL_PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, RL_PIXELFORMAT_UNCOMPRESSED_R32, RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32, RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32A32, RL_PIXELFORMAT_COMPRESSED_DXT1_RGB, RL_PIXELFORMAT_COMPRESSED_DXT1_RGBA, RL_PIXELFORMAT_COMPRESSED_DXT3_RGBA, RL_PIXELFORMAT_COMPRESSED_DXT5_RGBA, RL_PIXELFORMAT_COMPRESSED_ETC1_RGB, RL_PIXELFORMAT_COMPRESSED_ETC2_RGB, RL_PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA, RL_PIXELFORMAT_COMPRESSED_PVRT_RGB, RL_PIXELFORMAT_COMPRESSED_PVRT_RGBA, RL_PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA, RL_PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA } public struct rlRenderBatch { public int bufferCount; public int currentBuffer; public unsafe rlVertexBuffer* vertexBuffer; public unsafe rlDrawCall* draws; public int drawCounter; public float currentDepth; } public enum rlShaderAttributeDataType { RL_SHADER_ATTRIB_FLOAT, RL_SHADER_ATTRIB_VEC2, RL_SHADER_ATTRIB_VEC3, RL_SHADER_ATTRIB_VEC4 } public enum rlShaderLocationIndex { RL_SHADER_LOC_VERTEX_POSITION, RL_SHADER_LOC_VERTEX_TEXCOORD01, RL_SHADER_LOC_VERTEX_TEXCOORD02, RL_SHADER_LOC_VERTEX_NORMAL, RL_SHADER_LOC_VERTEX_TANGENT, RL_SHADER_LOC_VERTEX_COLOR, RL_SHADER_LOC_MATRIX_MVP, RL_SHADER_LOC_MATRIX_VIEW, RL_SHADER_LOC_MATRIX_PROJECTION, RL_SHADER_LOC_MATRIX_MODEL, RL_SHADER_LOC_MATRIX_NORMAL, RL_SHADER_LOC_VECTOR_VIEW, RL_SHADER_LOC_COLOR_DIFFUSE, RL_SHADER_LOC_COLOR_SPECULAR, RL_SHADER_LOC_COLOR_AMBIENT, RL_SHADER_LOC_MAP_ALBEDO, RL_SHADER_LOC_MAP_METALNESS, RL_SHADER_LOC_MAP_NORMAL, RL_SHADER_LOC_MAP_ROUGHNESS, RL_SHADER_LOC_MAP_OCCLUSION, RL_SHADER_LOC_MAP_EMISSION, RL_SHADER_LOC_MAP_HEIGHT, RL_SHADER_LOC_MAP_CUBEMAP, RL_SHADER_LOC_MAP_IRRADIANCE, RL_SHADER_LOC_MAP_PREFILTER, RL_SHADER_LOC_MAP_BRDF } public enum rlShaderUniformDataType { RL_SHADER_UNIFORM_FLOAT, RL_SHADER_UNIFORM_VEC2, RL_SHADER_UNIFORM_VEC3, RL_SHADER_UNIFORM_VEC4, RL_SHADER_UNIFORM_INT, RL_SHADER_UNIFORM_IVEC2, RL_SHADER_UNIFORM_IVEC3, RL_SHADER_UNIFORM_IVEC4, RL_SHADER_UNIFORM_SAMPLER2D } public enum rlTextureFilter { RL_TEXTURE_FILTER_POINT, RL_TEXTURE_FILTER_BILINEAR, RL_TEXTURE_FILTER_TRILINEAR, RL_TEXTURE_FILTER_ANISOTROPIC_4X, RL_TEXTURE_FILTER_ANISOTROPIC_8X, RL_TEXTURE_FILTER_ANISOTROPIC_16X } public enum rlTraceLogLevel { RL_LOG_ALL, RL_LOG_TRACE, RL_LOG_DEBUG, RL_LOG_INFO, RL_LOG_WARNING, RL_LOG_ERROR, RL_LOG_FATAL, RL_LOG_NONE } public struct rlVertexBuffer { public int elementCount; public unsafe float* vertices; public unsafe float* texcoords; public unsafe byte* colors; public unsafe uint* indices; public uint vaoId; public unsafe fixed uint vboId[4]; } public static class RRes { public const int RRES_MAX_FILENAME_SIZE = 1024; [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern rresResourceChunk rresLoadResourceChunk(sbyte* fileName, int rresId); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rresUnloadResourceChunk(rresResourceChunk chunk); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern rresResourceMulti rresLoadResourceMulti(sbyte* fileName, int rresId); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rresUnloadResourceMulti(rresResourceMulti multi); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern rresResourceChunkInfo rresLoadResourceChunkInfo(sbyte* fileName, int rresId); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern rresResourceChunkInfo* rresLoadResourceChunkInfoAll(sbyte* fileName, uint* chunkCount); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern rresCentralDir rresLoadCentralDirectory(sbyte* fileName); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void rresUnloadCentralDirectory(rresCentralDir dir); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern uint rresGetDataType(byte* fourCC); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern int rresGetResourceId(rresCentralDir dir, sbyte* fileName); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern uint rresComputeCRC32(byte* data, int len); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern void rresSetCipherPassword(sbyte* pass); [DllImport("raylib", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public unsafe static extern sbyte* rresGetCipherPassword(); } public struct rresCentralDir { public uint count; public unsafe rresDirEntry* entries; } public enum rresCodeLang { RRES_CODE_LANG_UNDEFINED, RRES_CODE_LANG_C, RRES_CODE_LANG_CPP, RRES_CODE_LANG_CS, RRES_CODE_LANG_LUA, RRES_CODE_LANG_JS, RRES_CODE_LANG_PYTHON, RRES_CODE_LANG_RUST, RRES_CODE_LANG_ZIG, RRES_CODE_LANG_ODIN, RRES_CODE_LANG_JAI, RRES_CODE_LANG_GDSCRIPT, RRES_CODE_LANG_GLSL } public enum rresCompressionType { RRES_COMP_NONE = 0, RRES_COMP_RLE = 1, RRES_COMP_DEFLATE = 10, RRES_COMP_LZ4 = 20, RRES_COMP_LZMA2 = 30, RRES_COMP_QOI = 40 } public struct rresDirEntry { public uint id; public uint offset; public uint reserved; public uint fileNameSize; public unsafe fixed sbyte fileName[1024]; } public enum rresEncryptionType { RRES_CIPHER_NONE = 0, RRES_CIPHER_XOR = 1, RRES_CIPHER_DES = 10, RRES_CIPHER_TDES = 11, RRES_CIPHER_IDEA = 20, RRES_CIPHER_AES = 30, RRES_CIPHER_AES_GCM = 31, RRES_CIPHER_XTEA = 40, RRES_CIPHER_BLOWFISH = 50, RRES_CIPHER_RSA = 60, RRES_CIPHER_SALSA20 = 70, RRES_CIPHER_CHACHA20 = 71, RRES_CIPHER_XCHACHA20 = 72, RRES_CIPHER_XCHACHA20_POLY1305 = 73 } public enum rresErrorType { RRES_SUCCESS, RRES_ERROR_FILE_NOT_FOUND, RRES_ERROR_FILE_FORMAT, RRES_ERROR_MEMORY_ALLOC } public struct rresFileHeader { public unsafe fixed byte id[4]; public ushort version; public ushort chunkCount; public uint cdOffset; public uint reserved; } public struct rresFontGlyphInfo { public int x; public int y; public int width; public int height; public int value; public int offsetX; public int offsetY; public int advanceX; } public enum rresFontStyle { RRES_FONT_STYLE_UNDEFINED, RRES_FONT_STYLE_REGULAR, RRES_FONT_STYLE_BOLD, RRES_FONT_STYLE_ITALIC } public enum rresPixelFormat { RRES_PIXELFORMAT_UNDEFINED, RRES_PIXELFORMAT_UNCOMP_GRAYSCALE, RRES_PIXELFORMAT_UNCOMP_GRAY_ALPHA, RRES_PIXELFORMAT_UNCOMP_R5G6B5, RRES_PIXELFORMAT_UNCOMP_R8G8B8, RRES_PIXELFORMAT_UNCOMP_R5G5B5A1, RRES_PIXELFORMAT_UNCOMP_R4G4B4A4, RRES_PIXELFORMAT_UNCOMP_R8G8B8A8, RRES_PIXELFORMAT_UNCOMP_R32, RRES_PIXELFORMAT_UNCOMP_R32G32B32, RRES_PIXELFORMAT_UNCOMP_R32G32B32A32, RRES_PIXELFORMAT_COMP_DXT1_RGB, RRES_PIXELFORMAT_COMP_DXT1_RGBA, RRES_PIXELFORMAT_COMP_DXT3_RGBA, RRES_PIXELFORMAT_COMP_DXT5_RGBA, RRES_PIXELFORMAT_COMP_ETC1_RGB, RRES_PIXELFORMAT_COMP_ETC2_RGB, RRES_PIXELFORMAT_COMP_ETC2_EAC_RGBA, RRES_PIXELFORMAT_COMP_PVRT_RGB, RRES_PIXELFORMAT_COMP_PVRT_RGBA, RRES_PIXELFORMAT_COMP_ASTC_4x4_RGBA, RRES_PIXELFORMAT_COMP_ASTC_8x8_RGBA } public struct rresResourceChunk { public rresResourceChunkInfo info; public rresResourceChunkData data; } public struct rresResourceChunkData { public uint propCount; public unsafe uint* props; public unsafe void* raw; } public struct rresResourceChunkInfo { public unsafe fixed byte type[4]; public uint id; public byte compType; public byte cipherType; public ushort flags; public uint packedSize; public uint baseSize; public uint nextOffset; public uint reserved; public uint crc32; } public enum rresResourceDataType { RRES_DATA_NULL = 0, RRES_DATA_RAW = 1, RRES_DATA_TEXT = 2, RRES_DATA_IMAGE = 3, RRES_DATA_WAVE = 4, RRES_DATA_VERTEX = 5, RRES_DATA_FONT_GLYPHS = 6, RRES_DATA_LINK = 99, RRES_DATA_DIRECTORY = 100 } public struct rresResourceMulti { public uint count; public unsafe rresResourceChunk* chunks; } public enum rresTextEncoding { RRES_TEXT_ENCODING_UNDEFINED = 0, RRES_TEXT_ENCODING_UTF8 = 1, RRES_TEXT_ENCODING_UTF8_BOM = 2, RRES_TEXT_ENCODING_UTF16_LE = 10, RRES_TEXT_ENCODING_UTF16_BE = 11 } public enum rresVertexAttribute { RRES_VERTEX_ATTRIBUTE_POSITION = 0, RRES_VERTEX_ATTRIBUTE_TEXCOORD1 = 10, RRES_VERTEX_ATTRIBUTE_TEXCOORD2 = 11, RRES_VERTEX_ATTRIBUTE_TEXCOORD3 = 12, RRES_VERTEX_ATTRIBUTE_TEXCOORD4 = 13, RRES_VERTEX_ATTRIBUTE_NORMAL = 20, RRES_VERTEX_ATTRIBUTE_TANGENT = 30, RRES_VERTEX_ATTRIBUTE_COLOR = 40, RRES_VERTEX_ATTRIBUTE_INDEX = 100 } public enum rresVertexFormat { RRES_VERTEX_FORMAT_UBYTE, RRES_VERTEX_FORMAT_BYTE, RRES_VERTEX_FORMAT_USHORT, RRES_VERTEX_FORMAT_SHORT, RRES_VERTEX_FORMAT_UINT, RRES_VERTEX_FORMAT_INT, RRES_VERTEX_FORMAT_HFLOAT, RRES_VERTEX_FORMAT_FLOAT } public struct Shader { public uint id; public unsafe int* locs; } public enum ShaderAttributeDataType { SHADER_ATTRIB_FLOAT, SHADER_ATTRIB_VEC2, SHADER_ATTRIB_VEC3, SHADER_ATTRIB_VEC4 } public enum ShaderLocationIndex { SHADER_LOC_VERTEX_POSITION, SHADER_LOC_VERTEX_TEXCOORD01, SHADER_LOC_VERTEX_TEXCOORD02, SHADER_LOC_VERTEX_NORMAL, SHADER_LOC_VERTEX_TANGENT, SHADER_LOC_VERTEX_COLOR, SHADER_LOC_MATRIX_MVP, SHADER_LOC_MATRIX_VIEW, SHADER_LOC_MATRIX_PROJECTION, SHADER_LOC_MATRIX_MODEL, SHADER_LOC_MATRIX_NORMAL, SHADER_LOC_VECTOR_VIEW, SHADER_LOC_COLOR_DIFFUSE, SHADER_LOC_COLOR_SPECULAR, SHADER_LOC_COLOR_AMBIENT, SHADER_LOC_MAP_ALBEDO, SHADER_LOC_MAP_METALNESS, SHADER_LOC_MAP_NORMAL, SHADER_LOC_MAP_ROUGHNESS, SHADER_LOC_MAP_OCCLUSION, SHADER_LOC_MAP_EMISSION, SHADER_LOC_MAP_HEIGHT, SHADER_LOC_MAP_CUBEMAP, SHADER_LOC_MAP_IRRADIANCE, SHADER_LOC_MAP_PREFILTER, SHADER_LOC_MAP_BRDF } public enum ShaderUniformDataType { SHADER_UNIFORM_FLOAT, SHADER_UNIFORM_VEC2, SHADER_UNIFORM_VEC3, SHADER_UNIFORM_VEC4, SHADER_UNIFORM_INT, SHADER_UNIFORM_IVEC2, SHADER_UNIFORM_IVEC3, SHADER_UNIFORM_IVEC4, SHADER_UNIFORM_SAMPLER2D } public struct Sound { public AudioStream stream; public uint frameCount; } public struct Texture { public uint id; public int width; public int height; public int mipmaps; public int format; public PixelFormat format_ { get { return (PixelFormat)format; } set { format = (int)value; } } } public enum TextureFilter { TEXTURE_FILTER_POINT, TEXTURE_FILTER_BILINEAR, TEXTURE_FILTER_TRILINEAR, TEXTURE_FILTER_ANISOTROPIC_4X, TEXTURE_FILTER_ANISOTROPIC_8X, TEXTURE_FILTER_ANISOTROPIC_16X } public enum TextureWrap { TEXTURE_WRAP_REPEAT, TEXTURE_WRAP_CLAMP, TEXTURE_WRAP_MIRROR_REPEAT, TEXTURE_WRAP_MIRROR_CLAMP } public enum TraceLogLevel { LOG_ALL, LOG_TRACE, LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR, LOG_FATAL, LOG_NONE } public struct Transform { public Vector3 translation; public Quaternion rotation; public Vector3 scale; } public struct VrDeviceInfo { public int hResolution; public int vResolution; public float hScreenSize; public float vScreenSize; public float vScreenCenter; public float eyeToScreenDistance; public float lensSeparationDistance; public float interpupillaryDistance; public unsafe fixed float lensDistortionValues[4]; public unsafe fixed float chromaAbCorrection[4]; } public struct VrStereoConfig { public struct _projection_e__FixedBuffer { public Matrix4x4 e0; public Matrix4x4 e1; public ref Matrix4x4 this[int index] { [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return ref AsSpan()[index]; } } [MethodImpl(MethodImplOptions.AggressiveInlining)] public Span AsSpan() { return MemoryMarshal.CreateSpan(ref e0, 2); } } public struct _viewOffset_e__FixedBuffer { public Matrix4x4 e0; public Matrix4x4 e1; public ref Matrix4x4 this[int index] { [MethodImpl(MethodImplOptions.AggressiveInlining)] get { return ref AsSpan()[index]; } } [MethodImpl(MethodImplOptions.AggressiveInlining)] public Span AsSpan() { return MemoryMarshal.CreateSpan(ref e0, 2); } } public _projection_e__FixedBuffer projection; public _viewOffset_e__FixedBuffer viewOffset; public unsafe fixed float leftLensCenter[2]; public unsafe fixed float rightLensCenter[2]; public unsafe fixed float leftScreenCenter[2]; public unsafe fixed float rightScreenCenter[2]; public unsafe fixed float scale[2]; public unsafe fixed float scaleIn[2]; } [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] [Conditional("DEBUG")] internal sealed class VtblIndexAttribute : Attribute { private readonly uint _index; public uint Index => _index; public VtblIndexAttribute(uint index) { _index = index; } } public struct Wave { public uint frameCount; public uint sampleRate; public uint sampleSize; public uint channels; public unsafe void* data; } public static class CsLoSettings { public static bool openGl43; } } namespace Raylib_CsLo.InternalHelpers { [DebuggerDisplay("{ToString(),raw}")] public readonly struct Bool : IEquatable { [MarshalAs(UnmanagedType.U1)] private readonly byte _val; public Bool(bool value) { _val = Convert.ToByte(value); } public Bool(byte value) : this(Convert.ToBoolean(value)) { } public bool Equals(Bool other) { return Convert.ToBoolean(_val) == Convert.ToBoolean(other._val); } public override string ToString() { return Convert.ToBoolean(_val).ToString(); } public static implicit operator bool(Bool cb) { return Convert.ToBoolean(cb._val); } public static implicit operator Bool(bool value) { return new Bool(value); } } public static class Helpers { public unsafe static string Utf8ToString(T* utf8Text) where T : unmanaged { return Marshal.PtrToStringUTF8((IntPtr)utf8Text) ?? ""; } } public static class Printf { public static string sprintf(string format, params object[] args) { if (format == null) { throw new ArgumentNullException("format"); } try { FormatObject formatObject = new FormatObject(format); formatObject.SetArgs(args); return formatObject.ToString(); } catch (InvalidOperationException innerException) { throw new ArgumentException("Error in format string or arguments, see inner exception for details", innerException); } } public static void printf(string format, params object[] args) { if (format == null) { throw new ArgumentNullException("format"); } Console.Write(sprintf(format, args)); } public static void fprintf(TextWriter writer, string format, params object[] args) { if (format == null) { throw new ArgumentNullException("format"); } if (writer == null) { throw new ArgumentNullException("writer"); } writer.Write(sprintf(format, args)); } } internal class FormatObject { public class FormatStringPart { public int width; public int? precision; public char length; public char specifier; public bool LeftAlign; public bool ForcePlus; public bool BlankIfPlus; public bool HashMark; public bool PadWithZero; } private enum ParseMode { Static, Format } private enum FormatStep { Flags, Width, PrecisionStart, Precision, Length, Specifier } public delegate FormatResult Formatter(FormatStringPart part, object arg); public struct FormatResult { public string Sign { get; set; } public string Result { get; set; } public static implicit operator FormatResult(string s) { return new FormatResult { Sign = "", Result = s }; } } public const int DefaultPrecision = 6; private List args = new List(); private int argCount; private FormatStringPart[] parts; private string[] staticParts; private string? finalString; private Dictionary formatters = new Dictionary(); public FormatObject(string format) : this(format, useDefaultFormatters: true) { } public FormatObject(string format, bool useDefaultFormatters) { List list = new List(); List list2 = new List(); StringBuilder stringBuilder = new StringBuilder(); ParseMode parseMode = ParseMode.Static; FormatStringPart formatStringPart = null; FormatStep formatStep = FormatStep.Flags; StringBuilder stringBuilder2 = null; foreach (char c in format) { if (parseMode == ParseMode.Static) { if (c == '%') { parseMode = ParseMode.Format; formatStep = FormatStep.Flags; } else { stringBuilder.Append(c); } continue; } if (formatStringPart == null) { formatStringPart = new FormatStringPart(); } switch (formatStep) { case FormatStep.Flags: switch (c) { case '%': stringBuilder.Append('%'); parseMode = ParseMode.Static; continue; case '-': formatStringPart.LeftAlign = true; continue; case '+': formatStringPart.ForcePlus = true; continue; case ' ': formatStringPart.BlankIfPlus = true; continue; case '#': formatStringPart.HashMark = true; continue; case '0': formatStringPart.PadWithZero = true; continue; } formatStep = FormatStep.Width; goto case FormatStep.Width; case FormatStep.Width: if (stringBuilder2 != null) { if (c >= '0' && c <= '9') { stringBuilder2.Append(c); continue; } formatStringPart.width = int.Parse(stringBuilder2.ToString()); stringBuilder2 = null; formatStep = FormatStep.PrecisionStart; } else { switch (c) { case '*': formatStringPart.width = -1; argCount++; continue; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': stringBuilder2 = new StringBuilder(); stringBuilder2.Append(c); continue; } formatStep = FormatStep.PrecisionStart; } goto case FormatStep.PrecisionStart; case FormatStep.PrecisionStart: if (c != '.') { formatStep = FormatStep.Length; goto case FormatStep.Length; } formatStep = FormatStep.Precision; continue; case FormatStep.Precision: if (stringBuilder2 != null) { if (c >= '0' && c <= '9') { stringBuilder2.Append(c); continue; } formatStringPart.precision = int.Parse(stringBuilder2.ToString()); stringBuilder2 = null; formatStep = FormatStep.Length; } else { switch (c) { case '*': formatStringPart.precision = -1; argCount++; continue; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': stringBuilder2 = new StringBuilder(); stringBuilder2.Append(c); continue; } formatStringPart.precision = 0; formatStep = FormatStep.Length; } goto case FormatStep.Length; case FormatStep.Length: if ("hlL".IndexOf(c) != -1) { formatStringPart.length = c; formatStep = FormatStep.Specifier; continue; } formatStep = FormatStep.Specifier; break; case FormatStep.Specifier: break; default: continue; } argCount++; formatStringPart.specifier = c; list2.Add(stringBuilder.ToString()); stringBuilder = new StringBuilder(); list.Add(formatStringPart); formatStringPart = null; parseMode = ParseMode.Static; } if (parseMode == ParseMode.Format) { throw new ArgumentException("Invalid format string", "format"); } list2.Add(stringBuilder.ToString()); parts = list.ToArray(); staticParts = list2.ToArray(); if (useDefaultFormatters) { LoadDefaultFormatters(); } } public void SetArgs(params object[] objs) { for (int i = 0; i < objs.Length; i++) { args.Add(objs[i]); } finalString = null; } public void AddFormatter(char specifier, Formatter formatter) { formatters.Add(specifier, formatter); } private void DoFormat() { try { if (argCount > args.Count) { throw new InvalidOperationException($"Expected argument count: {argCount}, provided: {args.Count}"); } StringBuilder stringBuilder = new StringBuilder(); int num = 0; int num2 = 0; while (num < parts.Length) { stringBuilder.Append(staticParts[num]); FormatStringPart formatStringPart = parts[num2]; if (formatStringPart.width == -1) { formatStringPart.width = (int)args[num2]; num2++; } if (formatStringPart.precision == -1) { formatStringPart.width = (int)args[num2]; num2++; } FormatResult formatResult = formatters[formatStringPart.specifier](formatStringPart, args[num2]); int num3 = formatStringPart.width - formatResult.Result.Length - formatResult.Sign.Length; if (num3 > 0 && !formatStringPart.LeftAlign) { if (formatStringPart.PadWithZero) { stringBuilder.Append(formatResult.Sign); stringBuilder.Append(new string('0', num3)); } else { stringBuilder.Append(new string(' ', num3)); stringBuilder.Append(formatResult.Sign); } } else { stringBuilder.Append(formatResult.Sign); } stringBuilder.Append(formatResult.Result); if (num3 > 0 && formatStringPart.LeftAlign) { stringBuilder.Append(new string(' ', num3)); } num++; num2++; } stringBuilder.Append(staticParts[staticParts.Length - 1]); finalString = stringBuilder.ToString(); } catch (KeyNotFoundException innerException) { throw new InvalidOperationException("Invalid specifier in format string", innerException); } } public override string ToString() { if (finalString == null) { DoFormat(); } return finalString; } private string IntPrecision(string str, FormatStringPart part) { if (str.Equals("0") && part.precision == 0) { return ""; } if (str.Length < part.precision) { return new string('0', (part.precision ?? 1) - str.Length) + str; } return str; } private void LoadDefaultFormatters() { NumberFormatInfo format = new NumberFormatInfo(); format.NumberDecimalSeparator = "."; Formatter formatter = (FormatStringPart part, object arg) => ((char)arg).ToString(); AddFormatter('c', formatter); Formatter formatter2 = delegate(FormatStringPart part, object arg) { long num = Convert.ToInt64(arg); string sign = ""; if (num >= 0) { if (part.ForcePlus) { sign = "+"; } else if (part.BlankIfPlus) { sign = " "; } } else { num = -num; sign = "-"; } return new FormatResult { Result = IntPrecision(num.ToString(), part), Sign = sign }; }; AddFormatter('i', formatter2); AddFormatter('d', formatter2); Formatter formatter3 = delegate(FormatStringPart part, object arg) { ulong num = Convert.ToUInt64(arg); string sign = ""; if (num >= 0) { if (part.ForcePlus) { sign = "+"; } else if (part.BlankIfPlus) { sign = " "; } } return new FormatResult { Result = IntPrecision(num.ToString(), part), Sign = sign }; }; AddFormatter('u', formatter3); Formatter formatter4 = delegate(FormatStringPart part, object arg) { double num = Convert.ToDouble(arg); string sign = ""; if (num >= 0.0 || double.IsNaN(num)) { if (part.ForcePlus) { sign = "+"; } else if (part.BlankIfPlus) { sign = " "; } } else { num = 0.0 - num; sign = "-"; } string text = num.ToString("0." + new string('0', part.precision ?? 6) + part.specifier + "+000", format); if (part.HashMark && !text.Contains(format.NumberDecimalSeparator)) { text = string.Join(format.NumberDecimalSeparator + part.specifier, text.Split(part.specifier)); } return new FormatResult { Result = text, Sign = sign }; }; AddFormatter('e', formatter4); AddFormatter('E', formatter4); Formatter formatter5 = delegate(FormatStringPart part, object arg) { double num = Convert.ToDouble(arg); string sign = ""; if (num >= 0.0) { if (part.ForcePlus) { sign = "+"; } else if (part.BlankIfPlus) { sign = " "; } } else { num = 0.0 - num; sign = "-"; } format.NumberDecimalDigits = part.precision ?? 6; string text = num.ToString("f", format); if (part.HashMark && !text.Contains(format.NumberDecimalSeparator)) { text += format.NumberDecimalSeparator; } return new FormatResult { Result = text, Sign = sign }; }; AddFormatter('f', formatter5); Formatter formatter6 = delegate(FormatStringPart part, object arg) { double num = Convert.ToDouble(arg); string sign = ""; if (num >= 0.0) { if (part.ForcePlus) { sign = "+"; } else if (part.BlankIfPlus) { sign = " "; } } else { num = 0.0 - num; sign = "-"; } format.NumberDecimalDigits = part.precision ?? 6; string result = num.ToString(part.specifier.ToString() + part.precision, format); return new FormatResult { Result = result, Sign = sign }; }; AddFormatter('g', formatter6); AddFormatter('G', formatter6); Formatter formatter7 = delegate(FormatStringPart part, object arg) { long num = Convert.ToInt64(arg); string text = IntPrecision(Convert.ToString(num, 8), part); return part.HashMark ? ((FormatResult)("0" + text)) : ((FormatResult)text); }; AddFormatter('o', formatter7); Formatter formatter8 = delegate(FormatStringPart part, object arg) { string str; if (part.length == 'h') { short num = Convert.ToInt16(arg); str = string.Format((part.specifier == 'x') ? "{0:x}" : "{0:X}", num); } else if (part.length == 'l') { long num2 = Convert.ToInt64(arg); str = string.Format((part.specifier == 'x') ? "{0:x}" : "{0:X}", num2); } else { int num3 = Convert.ToInt32(arg); str = string.Format((part.specifier == 'x') ? "{0:x}" : "{0:X}", num3); } return new FormatResult { Result = IntPrecision(str, part), Sign = (part.HashMark ? ("0" + part.specifier) : "") }; }; AddFormatter('x', formatter8); AddFormatter('X', formatter8); Formatter formatter9 = delegate(FormatStringPart part, object arg) { if (arg == null) { arg = ""; } return part.precision.HasValue ? ((FormatResult)arg.ToString().Remove(part.precision.Value)) : ((FormatResult)arg.ToString()); }; AddFormatter('s', formatter9); Formatter formatter10 = (FormatStringPart part, object arg) => arg.GetHashCode().ToString(); AddFormatter('p', formatter10); AddFormatter('n', delegate { throw new NotSupportedException("Getting the number of characters is not supported"); }); } } public static class zz_Extensions { public static GCHandle GcPin(this object obj) { return GCHandle.Alloc(obj, GCHandleType.Pinned); } public static SpanOwner MarshalUtf8(this string? text) { //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_003a: 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) if (text == null) { return SpanOwner.Empty; } SpanOwner result = SpanOwner.Allocate(Encoding.UTF8.GetByteCount(text) + 1, (AllocationMode)1); Encoding.UTF8.GetBytes(text.AsSpan(), SpanExtensions.AsBytes(result.Span)); return result; } public unsafe static TPtr* AsPtr(this SpanOwner spanOwner) where TPtr : unmanaged { if (spanOwner.Length == 0) { return null; } return (TPtr*)Unsafe.AsPointer(ref spanOwner.DangerousGetReference()); } public static string SPrintF(this string format, params object[] args) { return Printf.sprintf(format, args); } public static void CreateYawPitchRoll(this Quaternion r, out float yaw, out float pitch, out float roll) { yaw = MathF.Atan2(2f * (r.Y * r.W + r.X * r.Z), 1f - 2f * (r.X * r.X + r.Y * r.Y)); pitch = MathF.Asin(2f * (r.X * r.W - r.Y * r.Z)); roll = MathF.Atan2(2f * (r.X * r.Y + r.Z * r.W), 1f - 2f * (r.X * r.X + r.Z * r.Z)); } public static Vector3 CreateYawPitchRoll(this Quaternion r) { float x = MathF.Atan2(2f * (r.Y * r.W + r.X * r.Z), 1f - 2f * (r.X * r.X + r.Y * r.Y)); float y = MathF.Asin(2f * (r.X * r.W - r.Y * r.Z)); float z = MathF.Atan2(2f * (r.X * r.Y + r.Z * r.W), 1f - 2f * (r.X * r.X + r.Z * r.Z)); return new Vector3(x, y, z); } } }