From 7f531ff27a65c5478bf475ead33e2370ffc26673 Mon Sep 17 00:00:00 2001 From: Ben Parsons <9parsonsb@gmail.com> Date: Sun, 24 Oct 2021 20:59:05 +1100 Subject: [PATCH] Split Enums, Structs & Classes into own files --- Raylib-cs/AudioStream.cs | 31 + Raylib-cs/BlendMode.cs | 36 + Raylib-cs/BoneInfo.cs | 22 + Raylib-cs/BoundingBox.cs | 26 + Raylib-cs/Camera2D.cs | 38 + Raylib-cs/Camera3D.cs | 46 + Raylib-cs/CameraMode.cs | 12 + Raylib-cs/CameraProjection.cs | 9 + Raylib-cs/Color.cs | 67 + Raylib-cs/ConfigFlags.cs | 81 ++ Raylib-cs/CubemapLayout.cs | 36 + Raylib-cs/Font.cs | 42 + Raylib-cs/FontType.cs | 21 + Raylib-cs/GamepadAxis.cs | 36 + Raylib-cs/GamepadButton.cs | 84 ++ Raylib-cs/Gestures.cs | 22 + Raylib-cs/GlyphInfo.cs | 36 + Raylib-cs/Image.cs | 39 + Raylib-cs/KeyboardKey.cs | 130 ++ Raylib-cs/Material.cs | 27 + Raylib-cs/MaterialMap.cs | 26 + Raylib-cs/MaterialMapIndex.cs | 42 + Raylib-cs/Mesh.cs | 100 ++ Raylib-cs/Model.cs | 58 + Raylib-cs/ModelAnimation.cs | 30 + Raylib-cs/MouseButton.cs | 45 + Raylib-cs/MouseCursor.cs | 61 + Raylib-cs/Music.cs | 36 + Raylib-cs/NPatchInfo.cs | 41 + Raylib-cs/NPatchLayout.cs | 21 + Raylib-cs/PixelFormat.cs | 112 ++ Raylib-cs/Ray.cs | 26 + Raylib-cs/RayCollision.cs | 30 + Raylib-cs/Raylib-cs.csproj | 10 +- Raylib-cs/Raylib.cs | 1777 -------------------------- Raylib-cs/Rectangle.cs | 24 + Raylib-cs/RenderTexture2D.cs | 26 + Raylib-cs/Shader.cs | 22 + Raylib-cs/ShaderAttributeDataType.cs | 10 + Raylib-cs/ShaderLocationIndex.cs | 36 + Raylib-cs/ShaderUniformDataType.cs | 16 + Raylib-cs/Sound.cs | 19 + Raylib-cs/Texture2D.cs | 38 + Raylib-cs/TextureFilter.cs | 38 + Raylib-cs/TextureWrap.cs | 26 + Raylib-cs/TraceLogLevel.cs | 47 + Raylib-cs/Transform.cs | 27 + Raylib-cs/VrDeviceInfo.cs | 59 + Raylib-cs/VrStereoConfig.cs | 60 + Raylib-cs/Wave.cs | 35 + 50 files changed, 1956 insertions(+), 1783 deletions(-) create mode 100644 Raylib-cs/AudioStream.cs create mode 100644 Raylib-cs/BlendMode.cs create mode 100644 Raylib-cs/BoneInfo.cs create mode 100644 Raylib-cs/BoundingBox.cs create mode 100644 Raylib-cs/Camera2D.cs create mode 100644 Raylib-cs/Camera3D.cs create mode 100644 Raylib-cs/CameraMode.cs create mode 100644 Raylib-cs/CameraProjection.cs create mode 100644 Raylib-cs/Color.cs create mode 100644 Raylib-cs/ConfigFlags.cs create mode 100644 Raylib-cs/CubemapLayout.cs create mode 100644 Raylib-cs/Font.cs create mode 100644 Raylib-cs/FontType.cs create mode 100644 Raylib-cs/GamepadAxis.cs create mode 100644 Raylib-cs/GamepadButton.cs create mode 100644 Raylib-cs/Gestures.cs create mode 100644 Raylib-cs/GlyphInfo.cs create mode 100644 Raylib-cs/Image.cs create mode 100644 Raylib-cs/KeyboardKey.cs create mode 100644 Raylib-cs/Material.cs create mode 100644 Raylib-cs/MaterialMap.cs create mode 100644 Raylib-cs/MaterialMapIndex.cs create mode 100644 Raylib-cs/Mesh.cs create mode 100644 Raylib-cs/Model.cs create mode 100644 Raylib-cs/ModelAnimation.cs create mode 100644 Raylib-cs/MouseButton.cs create mode 100644 Raylib-cs/MouseCursor.cs create mode 100644 Raylib-cs/Music.cs create mode 100644 Raylib-cs/NPatchInfo.cs create mode 100644 Raylib-cs/NPatchLayout.cs create mode 100644 Raylib-cs/PixelFormat.cs create mode 100644 Raylib-cs/Ray.cs create mode 100644 Raylib-cs/RayCollision.cs create mode 100644 Raylib-cs/Rectangle.cs create mode 100644 Raylib-cs/RenderTexture2D.cs create mode 100644 Raylib-cs/Shader.cs create mode 100644 Raylib-cs/ShaderAttributeDataType.cs create mode 100644 Raylib-cs/ShaderLocationIndex.cs create mode 100644 Raylib-cs/ShaderUniformDataType.cs create mode 100644 Raylib-cs/Sound.cs create mode 100644 Raylib-cs/Texture2D.cs create mode 100644 Raylib-cs/TextureFilter.cs create mode 100644 Raylib-cs/TextureWrap.cs create mode 100644 Raylib-cs/TraceLogLevel.cs create mode 100644 Raylib-cs/Transform.cs create mode 100644 Raylib-cs/VrDeviceInfo.cs create mode 100644 Raylib-cs/VrStereoConfig.cs create mode 100644 Raylib-cs/Wave.cs diff --git a/Raylib-cs/AudioStream.cs b/Raylib-cs/AudioStream.cs new file mode 100644 index 0000000..275e614 --- /dev/null +++ b/Raylib-cs/AudioStream.cs @@ -0,0 +1,31 @@ +using System; +using System.Runtime.InteropServices; + +namespace Raylib_cs +{ + /// Audio stream type + /// NOTE: Useful to create custom audio streams not bound to a specific file + [StructLayout(LayoutKind.Sequential)] + public struct AudioStream + { + /// + /// Pointer to internal data(rAudioBuffer *) used by the audio system + /// + public IntPtr audioBuffer; + + /// + /// Frequency (samples per second) + /// + public uint sampleRate; + + /// + /// Bit depth (bits per sample): 8, 16, 32 (24 not supported) + /// + public uint sampleSize; + + /// + /// Number of channels (1-mono, 2-stereo) + /// + public uint channels; + } +} \ No newline at end of file diff --git a/Raylib-cs/BlendMode.cs b/Raylib-cs/BlendMode.cs new file mode 100644 index 0000000..08ca39e --- /dev/null +++ b/Raylib-cs/BlendMode.cs @@ -0,0 +1,36 @@ +namespace Raylib_cs +{ + /// Color blending modes (pre-defined) + public enum BlendMode + { + /// + /// Blend textures considering alpha (default) + /// + BLEND_ALPHA = 0, + + /// + /// Blend textures adding colors + /// + BLEND_ADDITIVE, + + /// + /// Blend textures multiplying colors + /// + BLEND_MULTIPLIED, + + /// + /// Blend textures adding colors (alternative) + /// + BLEND_ADD_COLORS, + + /// + /// Blend textures subtracting colors (alternative) + /// + BLEND_SUBTRACT_COLORS, + + /// + /// Blend textures using custom src/dst factors (use rlSetBlendMode()) + /// + BLEND_CUSTOM + } +} \ No newline at end of file diff --git a/Raylib-cs/BoneInfo.cs b/Raylib-cs/BoneInfo.cs new file mode 100644 index 0000000..6c9dc3c --- /dev/null +++ b/Raylib-cs/BoneInfo.cs @@ -0,0 +1,22 @@ +using System; +using System.Runtime.InteropServices; + +namespace Raylib_cs +{ + /// + /// Bone information + /// + [StructLayout(LayoutKind.Sequential)] + public struct BoneInfo + { + /// + /// Bone name (char[32]) + /// + public IntPtr name; + + /// + /// Bone parent + /// + public int parent; + } +} \ No newline at end of file diff --git a/Raylib-cs/BoundingBox.cs b/Raylib-cs/BoundingBox.cs new file mode 100644 index 0000000..e2458b3 --- /dev/null +++ b/Raylib-cs/BoundingBox.cs @@ -0,0 +1,26 @@ +using System.Numerics; +using System.Runtime.InteropServices; + +namespace Raylib_cs +{ + /// Bounding box type + [StructLayout(LayoutKind.Sequential)] + public struct BoundingBox + { + /// + /// Minimum vertex box-corner + /// + public Vector3 min; + + /// + /// Maximum vertex box-corner + /// + public Vector3 max; + + public BoundingBox(Vector3 min, Vector3 max) + { + this.min = min; + this.max = max; + } + } +} \ No newline at end of file diff --git a/Raylib-cs/Camera2D.cs b/Raylib-cs/Camera2D.cs new file mode 100644 index 0000000..4b4c3de --- /dev/null +++ b/Raylib-cs/Camera2D.cs @@ -0,0 +1,38 @@ +using System.Numerics; +using System.Runtime.InteropServices; + +namespace Raylib_cs +{ + /// Camera2D, defines position/orientation in 2d space + [StructLayout(LayoutKind.Sequential)] + public struct Camera2D + { + /// + /// Camera offset (displacement from target) + /// + public Vector2 offset; + + /// + /// Camera target (rotation and zoom origin) + /// + public Vector2 target; + + /// + /// Camera rotation in degrees + /// + public float rotation; + + /// + /// Camera zoom (scaling), should be 1.0f by default + /// + public float zoom; + + public Camera2D(Vector2 offset, Vector2 target, float rotation, float zoom) + { + this.offset = offset; + this.target = target; + this.rotation = rotation; + this.zoom = zoom; + } + } +} \ No newline at end of file diff --git a/Raylib-cs/Camera3D.cs b/Raylib-cs/Camera3D.cs new file mode 100644 index 0000000..2ee5f13 --- /dev/null +++ b/Raylib-cs/Camera3D.cs @@ -0,0 +1,46 @@ +using System.Numerics; +using System.Runtime.InteropServices; + +namespace Raylib_cs +{ + /// + /// Camera3D, defines position/orientation in 3d space + /// + [StructLayout(LayoutKind.Sequential)] + public struct Camera3D + { + /// + /// Camera position + /// + public Vector3 position; + + /// + /// Camera target it looks-at + /// + public Vector3 target; + + /// + /// Camera up vector (rotation over its axis) + /// + public Vector3 up; + + /// + /// Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic + /// + public float fovy; + + /// + /// Camera type, defines projection type: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC + /// + public CameraProjection projection; + + 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 = projection; + } + } +} \ No newline at end of file diff --git a/Raylib-cs/CameraMode.cs b/Raylib-cs/CameraMode.cs new file mode 100644 index 0000000..4b004d0 --- /dev/null +++ b/Raylib-cs/CameraMode.cs @@ -0,0 +1,12 @@ +namespace Raylib_cs +{ + /// Camera system modes + public enum CameraMode + { + CAMERA_CUSTOM = 0, + CAMERA_FREE, + CAMERA_ORBITAL, + CAMERA_FIRST_PERSON, + CAMERA_THIRD_PERSON + } +} \ No newline at end of file diff --git a/Raylib-cs/CameraProjection.cs b/Raylib-cs/CameraProjection.cs new file mode 100644 index 0000000..fd45ac3 --- /dev/null +++ b/Raylib-cs/CameraProjection.cs @@ -0,0 +1,9 @@ +namespace Raylib_cs +{ + /// Camera projection + public enum CameraProjection + { + CAMERA_PERSPECTIVE = 0, + CAMERA_ORTHOGRAPHIC + } +} \ No newline at end of file diff --git a/Raylib-cs/Color.cs b/Raylib-cs/Color.cs new file mode 100644 index 0000000..13f05bc --- /dev/null +++ b/Raylib-cs/Color.cs @@ -0,0 +1,67 @@ +using System; +using System.Runtime.InteropServices; + +namespace Raylib_cs +{ + /// + /// Color type, RGBA (32bit) + /// + [StructLayout(LayoutKind.Sequential)] + public struct Color + { + public byte r; + public byte g; + public byte b; + public byte a; + + // Example - Color.RED instead of RED + // Custom raylib color palette for amazing visuals + public static Color LIGHTGRAY = new Color(200, 200, 200, 255); + public static Color GRAY = new Color(130, 130, 130, 255); + public static Color DARKGRAY = new Color(80, 80, 80, 255); + public static Color YELLOW = new Color(253, 249, 0, 255); + public static Color GOLD = new Color(255, 203, 0, 255); + public static Color ORANGE = new Color(255, 161, 0, 255); + public static Color PINK = new Color(255, 109, 194, 255); + public static Color RED = new Color(230, 41, 55, 255); + public static Color MAROON = new Color(190, 33, 55, 255); + public static Color GREEN = new Color(0, 228, 48, 255); + public static Color LIME = new Color(0, 158, 47, 255); + public static Color DARKGREEN = new Color(0, 117, 44, 255); + public static Color SKYBLUE = new Color(102, 191, 255, 255); + public static Color BLUE = new Color(0, 121, 241, 255); + public static Color DARKBLUE = new Color(0, 82, 172, 255); + public static Color PURPLE = new Color(200, 122, 255, 255); + public static Color VIOLET = new Color(135, 60, 190, 255); + public static Color DARKPURPLE = new Color(112, 31, 126, 255); + public static Color BEIGE = new Color(211, 176, 131, 255); + public static Color BROWN = new Color(127, 106, 79, 255); + public static Color DARKBROWN = new Color(76, 63, 47, 255); + public static Color WHITE = new Color(255, 255, 255, 255); + public static Color BLACK = new Color(0, 0, 0, 255); + public static Color BLANK = new Color(0, 0, 0, 0); + public static Color MAGENTA = new Color(255, 0, 255, 255); + public static Color RAYWHITE = new Color(245, 245, 245, 255); + + 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 = Convert.ToByte(r); + this.g = Convert.ToByte(g); + this.b = Convert.ToByte(b); + this.a = Convert.ToByte(a); + } + + public override string ToString() + { + return string.Concat(r.ToString(), " ", g.ToString(), " ", b.ToString(), " ", a.ToString()); + } + } +} \ No newline at end of file diff --git a/Raylib-cs/ConfigFlags.cs b/Raylib-cs/ConfigFlags.cs new file mode 100644 index 0000000..61b5819 --- /dev/null +++ b/Raylib-cs/ConfigFlags.cs @@ -0,0 +1,81 @@ +using System; + +namespace Raylib_cs +{ + /// System config flags + /// NOTE: Every bit registers one state (use it with bit masks) + /// By default all flags are set to 0 + [Flags] + public enum ConfigFlags + { + /// + /// Set to try enabling V-Sync on GPU + /// + FLAG_VSYNC_HINT = 0x00000040, + + /// + /// Set to run program in fullscreen + /// + FLAG_FULLSCREEN_MODE = 0x00000002, + + /// + /// Set to allow resizable window + /// + FLAG_WINDOW_RESIZABLE = 0x00000004, + + /// + /// Set to disable window decoration (frame and buttons) + /// + FLAG_WINDOW_UNDECORATED = 0x00000008, + + /// + /// Set to hide window + /// + FLAG_WINDOW_HIDDEN = 0x00000080, + + /// + /// Set to minimize window (iconify) + /// + FLAG_WINDOW_MINIMIZED = 0x00000200, + + /// + /// Set to maximize window (expanded to monitor) + /// + FLAG_WINDOW_MAXIMIZED = 0x00000400, + + /// + /// Set to window non focused + /// + FLAG_WINDOW_UNFOCUSED = 0x00000800, + + /// + /// Set to window always on top + /// + FLAG_WINDOW_TOPMOST = 0x00001000, + + /// + /// Set to allow windows running while minimized + /// + FLAG_WINDOW_ALWAYS_RUN = 0x00000100, + + /// + /// Set to allow transparent framebuffer + /// + FLAG_WINDOW_TRANSPARENT = 0x00000010, + + /// + /// Set to support HighDPI + /// + FLAG_WINDOW_HIGHDPI = 0x00002000, + + /// + /// Set to try enabling MSAA 4X + /// + FLAG_MSAA_4X_HINT = 0x00000020, + + /// + /// Set to try enabling interlaced video format (for V3D) + /// + FLAG_INTERLACED_HINT = 0x00010000, + } +} \ No newline at end of file diff --git a/Raylib-cs/CubemapLayout.cs b/Raylib-cs/CubemapLayout.cs new file mode 100644 index 0000000..89c9924 --- /dev/null +++ b/Raylib-cs/CubemapLayout.cs @@ -0,0 +1,36 @@ +namespace Raylib_cs +{ + /// Cubemap layouts + public enum CubemapLayout + { + /// + /// Automatically detect layout type + /// + CUBEMAP_LAYOUT_AUTO_DETECT = 0, + + /// + /// Layout is defined by a vertical line with faces + /// + CUBEMAP_LAYOUT_LINE_VERTICAL, + + /// + /// Layout is defined by an horizontal line with faces + /// + CUBEMAP_LAYOUT_LINE_HORIZONTAL, + + /// + /// Layout is defined by a 3x4 cross with cubemap faces + /// + CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR, + + /// + /// Layout is defined by a 4x3 cross with cubemap faces + /// + CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE, + + /// + /// Layout is defined by a panorama image (equirectangular map) + /// + CUBEMAP_LAYOUT_PANORAMA + } +} \ No newline at end of file diff --git a/Raylib-cs/Font.cs b/Raylib-cs/Font.cs new file mode 100644 index 0000000..da325bd --- /dev/null +++ b/Raylib-cs/Font.cs @@ -0,0 +1,42 @@ +using System; +using System.Runtime.InteropServices; + +namespace Raylib_cs +{ + /// + /// Font, font texture and GlyphInfo array data + /// + [StructLayout(LayoutKind.Sequential)] + public struct Font + { + /// + /// Base size (default chars height) + /// + public int baseSize; + + /// + /// Number of characters + /// + public int glyphCount; + + /// + /// Padding around the glyph characters + /// + public int glyphPadding; + + /// + /// Texture atlas containing the glyphs + /// + public Texture2D texture; + + /// + /// Rectangles in texture for the glyphs + /// + public IntPtr recs; + + /// + /// Glyphs info data + /// + public IntPtr glyphs; + } +} \ No newline at end of file diff --git a/Raylib-cs/FontType.cs b/Raylib-cs/FontType.cs new file mode 100644 index 0000000..a91cb80 --- /dev/null +++ b/Raylib-cs/FontType.cs @@ -0,0 +1,21 @@ +namespace Raylib_cs +{ + /// Font type, defines generation method + public enum FontType + { + /// + /// Default font generation, anti-aliased + /// + FONT_DEFAULT = 0, + + /// + /// Bitmap font generation, no anti-aliasing + /// + FONT_BITMAP, + + /// + /// SDF font generation, requires external shader + /// + FONT_SDF + } +} \ No newline at end of file diff --git a/Raylib-cs/GamepadAxis.cs b/Raylib-cs/GamepadAxis.cs new file mode 100644 index 0000000..ccd107c --- /dev/null +++ b/Raylib-cs/GamepadAxis.cs @@ -0,0 +1,36 @@ +namespace Raylib_cs +{ + /// Gamepad axis + public enum GamepadAxis + { + /// + /// Gamepad left stick X axis + /// + GAMEPAD_AXIS_LEFT_X = 0, + + /// + /// Gamepad left stick Y axis + /// + GAMEPAD_AXIS_LEFT_Y = 1, + + /// + /// Gamepad right stick X axis + /// + GAMEPAD_AXIS_RIGHT_X = 2, + + /// + /// Gamepad right stick Y axis + /// + GAMEPAD_AXIS_RIGHT_Y = 3, + + /// + /// Gamepad back trigger left, pressure level: [1..-1] + /// + GAMEPAD_AXIS_LEFT_TRIGGER = 4, + + /// + /// Gamepad back trigger right, pressure level: [1..-1] + /// + GAMEPAD_AXIS_RIGHT_TRIGGER = 5 + } +} \ No newline at end of file diff --git a/Raylib-cs/GamepadButton.cs b/Raylib-cs/GamepadButton.cs new file mode 100644 index 0000000..af27391 --- /dev/null +++ b/Raylib-cs/GamepadButton.cs @@ -0,0 +1,84 @@ +namespace Raylib_cs +{ + /// Gamepad buttons + public enum GamepadButton + { + /// + /// This is here just for error checking + /// + GAMEPAD_BUTTON_UNKNOWN = 0, + + /// + /// Gamepad left DPAD up button + /// + GAMEPAD_BUTTON_LEFT_FACE_UP, + + /// + /// Gamepad left DPAD right button + /// + GAMEPAD_BUTTON_LEFT_FACE_RIGHT, + + /// + /// Gamepad left DPAD down button + /// + GAMEPAD_BUTTON_LEFT_FACE_DOWN, + + /// + /// Gamepad left DPAD left button + /// + GAMEPAD_BUTTON_LEFT_FACE_LEFT, + + /// + /// Gamepad right button up (i.e. PS3: Triangle, Xbox: Y) + /// + GAMEPAD_BUTTON_RIGHT_FACE_UP, + + /// + /// Gamepad right button right (i.e. PS3: Square, Xbox: X) + /// + GAMEPAD_BUTTON_RIGHT_FACE_RIGHT, + + /// + /// Gamepad right button down (i.e. PS3: Cross, Xbox: A) + /// + GAMEPAD_BUTTON_RIGHT_FACE_DOWN, + + /// + /// Gamepad right button left (i.e. PS3: Circle, Xbox: B) + /// + GAMEPAD_BUTTON_RIGHT_FACE_LEFT, + + // Triggers + GAMEPAD_BUTTON_LEFT_TRIGGER_1, + GAMEPAD_BUTTON_LEFT_TRIGGER_2, + GAMEPAD_BUTTON_RIGHT_TRIGGER_1, + GAMEPAD_BUTTON_RIGHT_TRIGGER_2, + + // These are buttons in the center of the gamepad + + /// + /// PS3 Select + /// + GAMEPAD_BUTTON_MIDDLE_LEFT, + + /// + /// PS Button/XBOX Button + /// + GAMEPAD_BUTTON_MIDDLE, + + /// + /// PS3 Start + /// + GAMEPAD_BUTTON_MIDDLE_RIGHT, + + /// + /// Left joystick press button + /// + GAMEPAD_BUTTON_LEFT_THUMB, + + /// + /// Right joystick press button + /// + GAMEPAD_BUTTON_RIGHT_THUMB + } +} \ No newline at end of file diff --git a/Raylib-cs/Gestures.cs b/Raylib-cs/Gestures.cs new file mode 100644 index 0000000..efe4995 --- /dev/null +++ b/Raylib-cs/Gestures.cs @@ -0,0 +1,22 @@ +using System; + +namespace Raylib_cs +{ + /// Gestures + /// NOTE: It could be used as flags to enable only some gestures + [Flags] + public enum Gestures + { + GESTURE_NONE = 0, + GESTURE_TAP = 1, + GESTURE_DOUBLETAP = 2, + GESTURE_HOLD = 4, + GESTURE_DRAG = 8, + GESTURE_SWIPE_RIGHT = 16, + GESTURE_SWIPE_LEFT = 32, + GESTURE_SWIPE_UP = 64, + GESTURE_SWIPE_DOWN = 128, + GESTURE_PINCH_IN = 256, + GESTURE_PINCH_OUT = 512 + } +} \ No newline at end of file diff --git a/Raylib-cs/GlyphInfo.cs b/Raylib-cs/GlyphInfo.cs new file mode 100644 index 0000000..891e154 --- /dev/null +++ b/Raylib-cs/GlyphInfo.cs @@ -0,0 +1,36 @@ +using System.Runtime.InteropServices; + +namespace Raylib_cs +{ + /// + /// GlyphInfo, font characters glyphs info + /// + [StructLayout(LayoutKind.Sequential)] + public struct GlyphInfo + { + /// + /// Character value (Unicode) + /// + public int value; + + /// + /// Character offset X when drawing + /// + public int offsetX; + + /// + /// Character offset Y when drawing + /// + public int offsetY; + + /// + /// Character advance position X + /// + public int advanceX; + + /// + /// Character image data + /// + public Image image; + } +} \ No newline at end of file diff --git a/Raylib-cs/Image.cs b/Raylib-cs/Image.cs new file mode 100644 index 0000000..54be815 --- /dev/null +++ b/Raylib-cs/Image.cs @@ -0,0 +1,39 @@ +using System; +using System.Runtime.InteropServices; + +namespace Raylib_cs +{ + /// + /// Image type, bpp always RGBA (32bit) + ///
+ /// NOTE: Data stored in CPU memory (RAM) + ///
+ [StructLayout(LayoutKind.Sequential)] + public struct Image + { + /// + /// Image raw data (void *) + /// + public IntPtr data; + + /// + /// Image base width + /// + public int width; + + /// + /// Image base height + /// + public int height; + + /// + /// Mipmap levels, 1 by default + /// + public int mipmaps; + + /// + /// Data format (PixelFormat type) + /// + public PixelFormat format; + } +} \ No newline at end of file diff --git a/Raylib-cs/KeyboardKey.cs b/Raylib-cs/KeyboardKey.cs new file mode 100644 index 0000000..edd1100 --- /dev/null +++ b/Raylib-cs/KeyboardKey.cs @@ -0,0 +1,130 @@ +namespace Raylib_cs +{ + /// Keyboard keys (US keyboard layout) + /// NOTE: Use GetKeyPressed() to allow redefining + /// required keys for alternative layouts + public enum KeyboardKey + { + /// + /// NULL, used for no key pressed + /// + KEY_NULL = 0, + + // Alphanumeric keys + 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, + + // Function keys + 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_LEFT_BRACKET = 91, + KEY_BACKSLASH = 92, + KEY_RIGHT_BRACKET = 93, + KEY_GRAVE = 96, + + // Keypad keys + 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, + + // Android key buttons + KEY_BACK = 4, + KEY_MENU = 82, + KEY_VOLUME_UP = 24, + KEY_VOLUME_DOWN = 25 + } +} \ No newline at end of file diff --git a/Raylib-cs/Material.cs b/Raylib-cs/Material.cs new file mode 100644 index 0000000..d853f74 --- /dev/null +++ b/Raylib-cs/Material.cs @@ -0,0 +1,27 @@ +using System; +using System.Runtime.InteropServices; + +namespace Raylib_cs +{ + /// + /// Material type (generic) + /// + [StructLayout(LayoutKind.Sequential)] + public struct Material + { + /// + /// Material shader + /// + public Shader shader; + + /// + /// Material maps (MaterialMap *) + /// + public IntPtr maps; + + /// + /// Material generic parameters (if required, float *) + /// + public IntPtr param; + } +} \ No newline at end of file diff --git a/Raylib-cs/MaterialMap.cs b/Raylib-cs/MaterialMap.cs new file mode 100644 index 0000000..8324de9 --- /dev/null +++ b/Raylib-cs/MaterialMap.cs @@ -0,0 +1,26 @@ +using System.Runtime.InteropServices; + +namespace Raylib_cs +{ + /// + /// Material texture map + /// + [StructLayout(LayoutKind.Sequential)] + public struct MaterialMap + { + /// + /// Material map texture + /// + public Texture2D texture; + + /// + /// Material map color + /// + public Color color; + + /// + /// Material map value + /// + public float value; + } +} \ No newline at end of file diff --git a/Raylib-cs/MaterialMapIndex.cs b/Raylib-cs/MaterialMapIndex.cs new file mode 100644 index 0000000..47f17af --- /dev/null +++ b/Raylib-cs/MaterialMapIndex.cs @@ -0,0 +1,42 @@ +namespace Raylib_cs +{ + /// Material map index + public enum MaterialMapIndex + { + /// + /// MAP_DIFFUSE + /// + MATERIAL_MAP_ALBEDO = 0, + + /// + /// MAP_SPECULAR + /// + MATERIAL_MAP_METALNESS = 1, + + MATERIAL_MAP_NORMAL = 2, + MATERIAL_MAP_ROUGHNESS = 3, + MATERIAL_MAP_OCCLUSION, + MATERIAL_MAP_EMISSION, + MATERIAL_MAP_HEIGHT, + + /// + /// NOTE: Uses GL_TEXTURE_CUBE_MAP + /// + MATERIAL_MAP_CUBEMAP, + + /// + /// NOTE: Uses GL_TEXTURE_CUBE_MAP + /// + MATERIAL_MAP_IRRADIANCE, + + /// + /// NOTE: Uses GL_TEXTURE_CUBE_MAP + /// + MATERIAL_MAP_PREFILTER, + + MATERIAL_MAP_BRDF, + + MATERIAL_MAP_DIFFUSE = MATERIAL_MAP_ALBEDO, + MATERIAL_MAP_SPECULAR = MATERIAL_MAP_METALNESS, + } +} \ No newline at end of file diff --git a/Raylib-cs/Mesh.cs b/Raylib-cs/Mesh.cs new file mode 100644 index 0000000..5e2b9d8 --- /dev/null +++ b/Raylib-cs/Mesh.cs @@ -0,0 +1,100 @@ +using System; +using System.Runtime.InteropServices; + +namespace Raylib_cs +{ + /// + /// Vertex data definning a mesh + /// NOTE: Data stored in CPU memory (and GPU) + /// + [StructLayout(LayoutKind.Sequential)] + public struct Mesh + { + /// + /// Number of vertices stored in arrays + /// + public int vertexCount; + + /// + /// Number of triangles stored (indexed or not) + /// + public int triangleCount; + + #region Default vertex data + + /// + /// Vertex position (XYZ - 3 components per vertex) (shader-location = 0, float *) + /// + public IntPtr vertices; + + /// + /// Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1, float *) + /// + public IntPtr texcoords; + + /// + /// Vertex second texture coordinates (useful for lightmaps) (shader-location = 5, float *) + /// + public IntPtr texcoords2; + + /// + /// Vertex normals (XYZ - 3 components per vertex) (shader-location = 2, float *) + /// + public IntPtr normals; + + /// + /// Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4, float *) + /// + public IntPtr tangents; + + /// + /// Vertex colors (RGBA - 4 components per vertex) (shader-location = 3, unsigned char *) + /// + public IntPtr colors; + + /// + /// Vertex indices (in case vertex data comes indexed, unsigned short *) + /// + public IntPtr indices; + + #endregion + + #region Animation vertex data + + /// + /// Animated vertex positions (after bones transformations, float *) + /// + public IntPtr animVertices; + + /// + /// Animated normals (after bones transformations, float *) + /// + public IntPtr animNormals; + + /// + /// Vertex bone ids, up to 4 bones influence by vertex (skinning, int *) + /// + public IntPtr boneIds; + + /// + /// Vertex bone weight, up to 4 bones influence by vertex (skinning, float *) + /// + public IntPtr boneWeights; + + #endregion + + #region OpenGL identifiers + + /// + /// OpenGL Vertex Array Object id + /// + public uint vaoId; + + /// + /// OpenGL Vertex Buffer Objects id (default vertex data, uint[]) + /// + public IntPtr vboId; + + #endregion + } +} \ No newline at end of file diff --git a/Raylib-cs/Model.cs b/Raylib-cs/Model.cs new file mode 100644 index 0000000..1e4eed2 --- /dev/null +++ b/Raylib-cs/Model.cs @@ -0,0 +1,58 @@ +using System; +using System.Numerics; +using System.Runtime.InteropServices; + +namespace Raylib_cs +{ + /// + /// Model type + /// + [StructLayout(LayoutKind.Sequential)] + public struct Model + { + /// + /// Local transform matrix + /// + public Matrix4x4 transform; + + /// + /// Number of meshes + /// + public int meshCount; + + /// + /// Number of materials + /// + public int materialCount; + + /// + /// Meshes array (Mesh *) + /// + public IntPtr meshes; + + /// + /// Materials array (Material *) + /// + public IntPtr materials; + + /// + /// Mesh material number (int *) + /// + public IntPtr meshMaterial; + + /// + /// Number of bones + /// + public int boneCount; + + /// + /// Bones information (skeleton, BoneInfo *) + /// + public IntPtr bones; + + /// + /// Bones base transformation (pose, Transform *) + /// + public IntPtr bindPose; + } +} \ No newline at end of file diff --git a/Raylib-cs/ModelAnimation.cs b/Raylib-cs/ModelAnimation.cs new file mode 100644 index 0000000..8b5b4e3 --- /dev/null +++ b/Raylib-cs/ModelAnimation.cs @@ -0,0 +1,30 @@ +using System; +using System.Runtime.InteropServices; + +namespace Raylib_cs +{ + /// Model animation + [StructLayout(LayoutKind.Sequential)] + public struct ModelAnimation + { + /// + /// Number of bones + /// + public int boneCount; + + /// + /// Number of animation frames + /// + public int frameCount; + + /// + /// Bones information (skeleton, BoneInfo *) + /// + public IntPtr bones; + + /// + /// Poses array by frame (Transform **) + /// + public IntPtr framePoses; + } +} \ No newline at end of file diff --git a/Raylib-cs/MouseButton.cs b/Raylib-cs/MouseButton.cs new file mode 100644 index 0000000..19abbae --- /dev/null +++ b/Raylib-cs/MouseButton.cs @@ -0,0 +1,45 @@ +namespace Raylib_cs +{ + /// Mouse buttons + public enum MouseButton + { + /// + /// Mouse button left + /// + MOUSE_BUTTON_LEFT = 0, + + /// + /// Mouse button right + /// + MOUSE_BUTTON_RIGHT = 1, + + /// + /// Mouse button middle (pressed wheel) + /// + MOUSE_BUTTON_MIDDLE = 2, + + /// + /// Mouse button side (advanced mouse device) + /// + MOUSE_BUTTON_SIDE = 3, + + /// + /// Mouse button extra (advanced mouse device) + /// + MOUSE_BUTTON_EXTRA = 4, + + /// + /// Mouse button fordward (advanced mouse device) + /// + MOUSE_BUTTON_FORWARD = 5, + + /// + /// Mouse button back (advanced mouse device) + /// + MOUSE_BUTTON_BACK = 6, + + MOUSE_LEFT_BUTTON = MOUSE_BUTTON_LEFT, + MOUSE_RIGHT_BUTTON = MOUSE_BUTTON_RIGHT, + MOUSE_MIDDLE_BUTTON = MOUSE_BUTTON_MIDDLE, + } +} \ No newline at end of file diff --git a/Raylib-cs/MouseCursor.cs b/Raylib-cs/MouseCursor.cs new file mode 100644 index 0000000..b47373f --- /dev/null +++ b/Raylib-cs/MouseCursor.cs @@ -0,0 +1,61 @@ +namespace Raylib_cs +{ + /// Mouse cursor + public enum MouseCursor + { + /// + /// Default pointer shape + /// + MOUSE_CURSOR_DEFAULT = 0, + + /// + /// Arrow shape + /// + MOUSE_CURSOR_ARROW = 1, + + /// + /// Text writing cursor shape + /// + MOUSE_CURSOR_IBEAM = 2, + + /// + /// Cross shape + /// + MOUSE_CURSOR_CROSSHAIR = 3, + + /// + /// Pointing hand cursor + /// + MOUSE_CURSOR_POINTING_HAND = 4, + + /// + /// Horizontal resize/move arrow shape + /// + MOUSE_CURSOR_RESIZE_EW = 5, + + /// + /// Vertical resize/move arrow shape + /// + MOUSE_CURSOR_RESIZE_NS = 6, + + /// + /// Top-left to bottom-right diagonal resize/move arrow shape + /// + MOUSE_CURSOR_RESIZE_NWSE = 7, + + /// + /// The top-right to bottom-left diagonal resize/move arrow shape + /// + MOUSE_CURSOR_RESIZE_NESW = 8, + + /// + /// The omni-directional resize/move cursor shape + /// + MOUSE_CURSOR_RESIZE_ALL = 9, + + /// + /// The operation-not-allowed shape + /// + MOUSE_CURSOR_NOT_ALLOWED = 10 + } +} \ No newline at end of file diff --git a/Raylib-cs/Music.cs b/Raylib-cs/Music.cs new file mode 100644 index 0000000..f75f86c --- /dev/null +++ b/Raylib-cs/Music.cs @@ -0,0 +1,36 @@ +using System; +using System.Runtime.InteropServices; + +namespace Raylib_cs +{ + /// Music stream type (audio file streaming from memory) + /// NOTE: Anything longer than ~10 seconds should be streamed + [StructLayout(LayoutKind.Sequential)] + public struct Music + { + /// + /// Audio stream + /// + public AudioStream stream; + + /// + /// Total number of samples + /// + public uint frameCount; + + /// + /// Music looping enable + /// + public byte looping; + + /// + /// Type of music context (audio filetype) + /// + public int ctxType; + + /// + /// Audio context data, depends on type (void *) + /// + public IntPtr ctxData; + } +} \ No newline at end of file diff --git a/Raylib-cs/NPatchInfo.cs b/Raylib-cs/NPatchInfo.cs new file mode 100644 index 0000000..c9534ad --- /dev/null +++ b/Raylib-cs/NPatchInfo.cs @@ -0,0 +1,41 @@ +using System.Runtime.InteropServices; + +namespace Raylib_cs +{ + /// + /// N-Patch layout info + /// + [StructLayout(LayoutKind.Sequential)] + public struct NPatchInfo + { + /// + /// Texture source rectangle + /// + public Rectangle source; + + /// + /// Left border offset + /// + public int left; + + /// + /// Top border offset + /// + public int top; + + /// + /// Right border offset + /// + public int right; + + /// + /// Bottom border offset + /// + public int bottom; + + /// + /// Layout of the n-patch: 3x3, 1x3 or 3x1 + /// + public NPatchLayout layout; + } +} \ No newline at end of file diff --git a/Raylib-cs/NPatchLayout.cs b/Raylib-cs/NPatchLayout.cs new file mode 100644 index 0000000..2c81f38 --- /dev/null +++ b/Raylib-cs/NPatchLayout.cs @@ -0,0 +1,21 @@ +namespace Raylib_cs +{ + /// N-patch layout + public enum NPatchLayout + { + /// + /// Npatch defined by 3x3 tiles + /// + NPATCH_NINE_PATCH = 0, + + /// + /// Npatch defined by 1x3 tiles + /// + NPATCH_THREE_PATCH_VERTICAL, + + /// + /// Npatch defined by 3x1 tiles + /// + NPATCH_THREE_PATCH_HORIZONTAL + } +} \ No newline at end of file diff --git a/Raylib-cs/PixelFormat.cs b/Raylib-cs/PixelFormat.cs new file mode 100644 index 0000000..b301b19 --- /dev/null +++ b/Raylib-cs/PixelFormat.cs @@ -0,0 +1,112 @@ +namespace Raylib_cs +{ + /// Pixel formats + /// NOTE: Support depends on OpenGL version and platform + public enum PixelFormat + { + /// + /// 8 bit per pixel (no alpha) + /// + PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1, + + /// + /// 8*2 bpp (2 channels) + /// + PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA, + + /// + /// 16 bpp + /// + PIXELFORMAT_UNCOMPRESSED_R5G6B5, + + /// + /// 24 bpp + /// + PIXELFORMAT_UNCOMPRESSED_R8G8B8, + + /// + /// 16 bpp (1 bit alpha) + /// + PIXELFORMAT_UNCOMPRESSED_R5G5B5A1, + + /// + /// 16 bpp (4 bit alpha) + /// + PIXELFORMAT_UNCOMPRESSED_R4G4B4A4, + + /// + /// 32 bpp + /// + PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, + + /// + /// 32 bpp (1 channel - float) + /// + PIXELFORMAT_UNCOMPRESSED_R32, + + /// + /// 32*3 bpp (3 channels - float) + /// + PIXELFORMAT_UNCOMPRESSED_R32G32B32, + + /// + /// 32*4 bpp (4 channels - float) + /// + PIXELFORMAT_UNCOMPRESSED_R32G32B32A32, + + /// + /// 4 bpp (no alpha) + /// + PIXELFORMAT_COMPRESSED_DXT1_RGB, + + /// + /// 4 bpp (1 bit alpha) + /// + PIXELFORMAT_COMPRESSED_DXT1_RGBA, + + /// + /// 8 bpp + /// + PIXELFORMAT_COMPRESSED_DXT3_RGBA, + + /// + /// 8 bpp + /// + PIXELFORMAT_COMPRESSED_DXT5_RGBA, + + /// + /// 4 bpp + /// + PIXELFORMAT_COMPRESSED_ETC1_RGB, + + /// + /// 4 bpp + /// + PIXELFORMAT_COMPRESSED_ETC2_RGB, + + /// + /// 8 bpp + /// + PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA, + + /// + /// 4 bpp + /// + PIXELFORMAT_COMPRESSED_PVRT_RGB, + + /// + /// 4 bpp + /// + PIXELFORMAT_COMPRESSED_PVRT_RGBA, + + /// + /// 8 bpp + /// + PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA, + + /// + /// 2 bpp + /// + PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA + } +} \ No newline at end of file diff --git a/Raylib-cs/Ray.cs b/Raylib-cs/Ray.cs new file mode 100644 index 0000000..a74b4e9 --- /dev/null +++ b/Raylib-cs/Ray.cs @@ -0,0 +1,26 @@ +using System.Numerics; +using System.Runtime.InteropServices; + +namespace Raylib_cs +{ + /// Ray, ray for raycasting + [StructLayout(LayoutKind.Sequential)] + public struct Ray + { + /// + /// Ray position (origin) + /// + public Vector3 position; + + /// + /// Ray direction + /// + public Vector3 direction; + + public Ray(Vector3 position, Vector3 direction) + { + this.position = position; + this.direction = direction; + } + } +} \ No newline at end of file diff --git a/Raylib-cs/RayCollision.cs b/Raylib-cs/RayCollision.cs new file mode 100644 index 0000000..6af1b09 --- /dev/null +++ b/Raylib-cs/RayCollision.cs @@ -0,0 +1,30 @@ +using System.Numerics; +using System.Runtime.InteropServices; + +namespace Raylib_cs +{ + /// Raycast hit information + [StructLayout(LayoutKind.Sequential)] + public struct RayCollision + { + /// + /// Did the ray hit something? + /// + public byte hit; + + /// + /// Distance to nearest hit + /// + public float distance; + + /// + /// Position of nearest hit + /// + public Vector3 point; + + /// + /// Surface normal of hit + /// + public Vector3 normal; + } +} \ No newline at end of file diff --git a/Raylib-cs/Raylib-cs.csproj b/Raylib-cs/Raylib-cs.csproj index cc4816b..9b5b2c5 100644 --- a/Raylib-cs/Raylib-cs.csproj +++ b/Raylib-cs/Raylib-cs.csproj @@ -28,15 +28,13 @@ - - - - - + + + - + diff --git a/Raylib-cs/Raylib.cs b/Raylib-cs/Raylib.cs index 77323ce..bb58ace 100644 --- a/Raylib-cs/Raylib.cs +++ b/Raylib-cs/Raylib.cs @@ -5,1784 +5,7 @@ using System.Security; namespace Raylib_cs { - /// - /// Color type, RGBA (32bit) - /// - [StructLayout(LayoutKind.Sequential)] - public struct Color - { - public byte r; - public byte g; - public byte b; - public byte a; - - // Example - Color.RED instead of RED - // Custom raylib color palette for amazing visuals - public static Color LIGHTGRAY = new Color(200, 200, 200, 255); - public static Color GRAY = new Color(130, 130, 130, 255); - public static Color DARKGRAY = new Color(80, 80, 80, 255); - public static Color YELLOW = new Color(253, 249, 0, 255); - public static Color GOLD = new Color(255, 203, 0, 255); - public static Color ORANGE = new Color(255, 161, 0, 255); - public static Color PINK = new Color(255, 109, 194, 255); - public static Color RED = new Color(230, 41, 55, 255); - public static Color MAROON = new Color(190, 33, 55, 255); - public static Color GREEN = new Color(0, 228, 48, 255); - public static Color LIME = new Color(0, 158, 47, 255); - public static Color DARKGREEN = new Color(0, 117, 44, 255); - public static Color SKYBLUE = new Color(102, 191, 255, 255); - public static Color BLUE = new Color(0, 121, 241, 255); - public static Color DARKBLUE = new Color(0, 82, 172, 255); - public static Color PURPLE = new Color(200, 122, 255, 255); - public static Color VIOLET = new Color(135, 60, 190, 255); - public static Color DARKPURPLE = new Color(112, 31, 126, 255); - public static Color BEIGE = new Color(211, 176, 131, 255); - public static Color BROWN = new Color(127, 106, 79, 255); - public static Color DARKBROWN = new Color(76, 63, 47, 255); - public static Color WHITE = new Color(255, 255, 255, 255); - public static Color BLACK = new Color(0, 0, 0, 255); - public static Color BLANK = new Color(0, 0, 0, 0); - public static Color MAGENTA = new Color(255, 0, 255, 255); - public static Color RAYWHITE = new Color(245, 245, 245, 255); - - 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 = Convert.ToByte(r); - this.g = Convert.ToByte(g); - this.b = Convert.ToByte(b); - this.a = Convert.ToByte(a); - } - - public override string ToString() - { - return string.Concat(r.ToString(), " ", g.ToString(), " ", b.ToString(), " ", a.ToString()); - } - } - - /// - /// Rectangle type - /// - [StructLayout(LayoutKind.Sequential)] - public struct Rectangle - { - public float x; - public float y; - public float width; - public float height; - - public Rectangle(float x, float y, float width, float height) - { - this.x = x; - this.y = y; - this.width = width; - this.height = height; - } - } - - /// - /// Image type, bpp always RGBA (32bit) - ///
- /// NOTE: Data stored in CPU memory (RAM) - ///
- [StructLayout(LayoutKind.Sequential)] - public struct Image - { - /// - /// Image raw data (void *) - /// - public IntPtr data; - - /// - /// Image base width - /// - public int width; - - /// - /// Image base height - /// - public int height; - - /// - /// Mipmap levels, 1 by default - /// - public int mipmaps; - - /// - /// Data format (PixelFormat type) - /// - public PixelFormat format; - } - - /// - /// Texture2D type - ///
- /// NOTE: Data stored in GPU memory - ///
- [StructLayout(LayoutKind.Sequential)] - public struct Texture2D - { - /// - /// OpenGL texture id - /// - public uint id; - - /// - /// Texture base width - /// - public int width; - - /// - /// Texture base height - /// - public int height; - - /// - /// Mipmap levels, 1 by default - /// - public int mipmaps; - - /// - /// Data format (PixelFormat type) - /// - public PixelFormat format; - } - - /// - /// RenderTexture2D type, for texture rendering - /// - [StructLayout(LayoutKind.Sequential)] - public struct RenderTexture2D - { - /// - /// OpenGL Framebuffer Object (FBO) id - /// - public uint id; - - /// - /// Color buffer attachment texture - /// - public Texture2D texture; - - /// - /// Depth buffer attachment texture - /// - public Texture2D depth; - } - - /// - /// N-Patch layout info - /// - [StructLayout(LayoutKind.Sequential)] - public struct NPatchInfo - { - /// - /// Texture source rectangle - /// - public Rectangle source; - - /// - /// Left border offset - /// - public int left; - - /// - /// Top border offset - /// - public int top; - - /// - /// Right border offset - /// - public int right; - - /// - /// Bottom border offset - /// - public int bottom; - - /// - /// Layout of the n-patch: 3x3, 1x3 or 3x1 - /// - public NPatchLayout layout; - } - - /// - /// GlyphInfo, font characters glyphs info - /// - [StructLayout(LayoutKind.Sequential)] - public struct GlyphInfo - { - /// - /// Character value (Unicode) - /// - public int value; - - /// - /// Character offset X when drawing - /// - public int offsetX; - - /// - /// Character offset Y when drawing - /// - public int offsetY; - - /// - /// Character advance position X - /// - public int advanceX; - - /// - /// Character image data - /// - public Image image; - } - - /// - /// Font, font texture and GlyphInfo array data - /// - [StructLayout(LayoutKind.Sequential)] - public struct Font - { - /// - /// Base size (default chars height) - /// - public int baseSize; - - /// - /// Number of characters - /// - public int glyphCount; - - /// - /// Padding around the glyph characters - /// - public int glyphPadding; - - /// - /// Texture atlas containing the glyphs - /// - public Texture2D texture; - - /// - /// Rectangles in texture for the glyphs - /// - public IntPtr recs; - - /// - /// Glyphs info data - /// - public IntPtr glyphs; - } - - /// - /// Camera3D, defines position/orientation in 3d space - /// - [StructLayout(LayoutKind.Sequential)] - public struct Camera3D - { - /// - /// Camera position - /// - public Vector3 position; - - /// - /// Camera target it looks-at - /// - public Vector3 target; - - /// - /// Camera up vector (rotation over its axis) - /// - public Vector3 up; - - /// - /// Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic - /// - public float fovy; - - /// - /// Camera type, defines projection type: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC - /// - public CameraProjection projection; - - 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 = projection; - } - } - - /// Camera2D, defines position/orientation in 2d space - [StructLayout(LayoutKind.Sequential)] - public struct Camera2D - { - /// - /// Camera offset (displacement from target) - /// - public Vector2 offset; - - /// - /// Camera target (rotation and zoom origin) - /// - public Vector2 target; - - /// - /// Camera rotation in degrees - /// - public float rotation; - - /// - /// Camera zoom (scaling), should be 1.0f by default - /// - public float zoom; - - public Camera2D(Vector2 offset, Vector2 target, float rotation, float zoom) - { - this.offset = offset; - this.target = target; - this.rotation = rotation; - this.zoom = zoom; - } - } - - /// - /// Vertex data definning a mesh - /// NOTE: Data stored in CPU memory (and GPU) - /// - [StructLayout(LayoutKind.Sequential)] - public struct Mesh - { - /// - /// Number of vertices stored in arrays - /// - public int vertexCount; - - /// - /// Number of triangles stored (indexed or not) - /// - public int triangleCount; - - #region Default vertex data - - /// - /// Vertex position (XYZ - 3 components per vertex) (shader-location = 0, float *) - /// - public IntPtr vertices; - - /// - /// Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1, float *) - /// - public IntPtr texcoords; - - /// - /// Vertex second texture coordinates (useful for lightmaps) (shader-location = 5, float *) - /// - public IntPtr texcoords2; - - /// - /// Vertex normals (XYZ - 3 components per vertex) (shader-location = 2, float *) - /// - public IntPtr normals; - - /// - /// Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4, float *) - /// - public IntPtr tangents; - - /// - /// Vertex colors (RGBA - 4 components per vertex) (shader-location = 3, unsigned char *) - /// - public IntPtr colors; - - /// - /// Vertex indices (in case vertex data comes indexed, unsigned short *) - /// - public IntPtr indices; - - #endregion - - #region Animation vertex data - - /// - /// Animated vertex positions (after bones transformations, float *) - /// - public IntPtr animVertices; - - /// - /// Animated normals (after bones transformations, float *) - /// - public IntPtr animNormals; - - /// - /// Vertex bone ids, up to 4 bones influence by vertex (skinning, int *) - /// - public IntPtr boneIds; - - /// - /// Vertex bone weight, up to 4 bones influence by vertex (skinning, float *) - /// - public IntPtr boneWeights; - - #endregion - - #region OpenGL identifiers - - /// - /// OpenGL Vertex Array Object id - /// - public uint vaoId; - - /// - /// OpenGL Vertex Buffer Objects id (default vertex data, uint[]) - /// - public IntPtr vboId; - - #endregion - } - - /// - /// Shader type (generic) - /// - [StructLayout(LayoutKind.Sequential)] - public struct Shader - { - /// - /// Shader program id - /// - public uint id; - - /// - /// Shader locations array (MAX_SHADER_LOCATIONS, int *) - /// - public IntPtr locs; - } - - /// - /// Material texture map - /// - [StructLayout(LayoutKind.Sequential)] - public struct MaterialMap - { - /// - /// Material map texture - /// - public Texture2D texture; - - /// - /// Material map color - /// - public Color color; - - /// - /// Material map value - /// - public float value; - } - - /// - /// Material type (generic) - /// - [StructLayout(LayoutKind.Sequential)] - public struct Material - { - /// - /// Material shader - /// - public Shader shader; - - /// - /// Material maps (MaterialMap *) - /// - public IntPtr maps; - - /// - /// Material generic parameters (if required, float *) - /// - public IntPtr param; - } - - /// - /// Transform, vectex transformation data - /// - [StructLayout(LayoutKind.Sequential)] - public struct Transform - { - /// - /// Translation - /// - public Vector3 translation; - - /// - /// Rotation - /// - public Vector4 rotation; - - /// - /// Scale - /// - public Vector3 scale; - } - - /// - /// Bone information - /// - [StructLayout(LayoutKind.Sequential)] - public struct BoneInfo - { - /// - /// Bone name (char[32]) - /// - public IntPtr name; - - /// - /// Bone parent - /// - public int parent; - } - - /// - /// Model type - /// - [StructLayout(LayoutKind.Sequential)] - public struct Model - { - /// - /// Local transform matrix - /// - public Matrix4x4 transform; - - /// - /// Number of meshes - /// - public int meshCount; - - /// - /// Number of materials - /// - public int materialCount; - - /// - /// Meshes array (Mesh *) - /// - public IntPtr meshes; - - /// - /// Materials array (Material *) - /// - public IntPtr materials; - - /// - /// Mesh material number (int *) - /// - public IntPtr meshMaterial; - - /// - /// Number of bones - /// - public int boneCount; - - /// - /// Bones information (skeleton, BoneInfo *) - /// - public IntPtr bones; - - /// - /// Bones base transformation (pose, Transform *) - /// - public IntPtr bindPose; - } - - /// Model animation - [StructLayout(LayoutKind.Sequential)] - public struct ModelAnimation - { - /// - /// Number of bones - /// - public int boneCount; - - /// - /// Number of animation frames - /// - public int frameCount; - - /// - /// Bones information (skeleton, BoneInfo *) - /// - public IntPtr bones; - - /// - /// Poses array by frame (Transform **) - /// - public IntPtr framePoses; - } - - /// Ray, ray for raycasting - [StructLayout(LayoutKind.Sequential)] - public struct Ray - { - /// - /// Ray position (origin) - /// - public Vector3 position; - - /// - /// Ray direction - /// - public Vector3 direction; - - public Ray(Vector3 position, Vector3 direction) - { - this.position = position; - this.direction = direction; - } - } - - /// Raycast hit information - [StructLayout(LayoutKind.Sequential)] - public struct RayCollision - { - /// - /// Did the ray hit something? - /// - public byte hit; - - /// - /// Distance to nearest hit - /// - public float distance; - - /// - /// Position of nearest hit - /// - public Vector3 point; - - /// - /// Surface normal of hit - /// - public Vector3 normal; - } - - /// Bounding box type - [StructLayout(LayoutKind.Sequential)] - public struct BoundingBox - { - /// - /// Minimum vertex box-corner - /// - public Vector3 min; - - /// - /// Maximum vertex box-corner - /// - public Vector3 max; - - public BoundingBox(Vector3 min, Vector3 max) - { - this.min = min; - this.max = max; - } - } - - /// Wave type, defines audio wave data - [StructLayout(LayoutKind.Sequential)] - public struct Wave - { - /// - /// Number of samples - /// - public uint sampleCount; - - /// - /// Frequency (samples per second) - /// - public uint sampleRate; - - /// - /// Bit depth (bits per sample): 8, 16, 32 (24 not supported) - /// - public uint sampleSize; - - /// - /// Number of channels (1-mono, 2-stereo) - /// - public uint channels; - - /// - /// Buffer data pointer (void *) - /// - public IntPtr data; - } - - /// Audio stream type - /// NOTE: Useful to create custom audio streams not bound to a specific file - [StructLayout(LayoutKind.Sequential)] - public struct AudioStream - { - /// - /// Pointer to internal data(rAudioBuffer *) used by the audio system - /// - public IntPtr audioBuffer; - - /// - /// Frequency (samples per second) - /// - public uint sampleRate; - - /// - /// Bit depth (bits per sample): 8, 16, 32 (24 not supported) - /// - public uint sampleSize; - - /// - /// Number of channels (1-mono, 2-stereo) - /// - public uint channels; - } - - /// Sound source type - [StructLayout(LayoutKind.Sequential)] - public struct Sound - { - /// - /// Audio stream - /// - public AudioStream stream; - - /// - /// Total number of frames (considering channels) - /// - public uint frameCount; - } - - /// Music stream type (audio file streaming from memory) - /// NOTE: Anything longer than ~10 seconds should be streamed - [StructLayout(LayoutKind.Sequential)] - public struct Music - { - /// - /// Audio stream - /// - public AudioStream stream; - - /// - /// Total number of samples - /// - public uint frameCount; - - /// - /// Music looping enable - /// - public byte looping; - - /// - /// Type of music context (audio filetype) - /// - public int ctxType; - - /// - /// Audio context data, depends on type (void *) - /// - public IntPtr ctxData; - } - - /// Head-Mounted-Display device parameters - [StructLayout(LayoutKind.Sequential)] - public unsafe struct VrDeviceInfo - { - /// - /// HMD horizontal resolution in pixels - /// - public int hResolution; - - /// - /// HMD vertical resolution in pixels - /// - public int vResolution; - - /// - /// HMD horizontal size in meters - /// - public float hScreenSize; - - /// - /// HMD vertical size in meters - /// - public float vScreenSize; - - /// - /// HMD screen center in meters - /// - public float vScreenCenter; - - /// - /// HMD distance between eye and display in meters - /// - public float eyeToScreenDistance; - - /// - /// HMD lens separation distance in meters - /// - public float lensSeparationDistance; - - /// - /// HMD IPD (distance between pupils) in meters - /// - public float interpupillaryDistance; - - /// - /// HMD lens distortion constant parameters - /// - public fixed float lensDistortionValues[4]; - - /// - /// HMD chromatic aberration correction parameters - /// - public fixed float chromaAbCorrection[4]; - } - - /// VR Stereo rendering configuration for simulator - [StructLayout(LayoutKind.Sequential)] - public struct VrStereoConfig - { - /// - /// VR projection matrices (per eye) - /// - public Matrix4x4 projection1; - - /// - /// VR projection matrices (per eye) - /// - public Matrix4x4 projection2; - - /// - /// VR view offset matrices (per eye) - /// - public Matrix4x4 viewOffset1; - - /// - /// VR view offset matrices (per eye) - /// - public Matrix4x4 viewOffset2; - - /// - /// VR left lens center - /// - public Vector2 leftLensCenter; - - /// - /// VR right lens center - /// - public Vector2 rightLensCenter; - - /// - /// VR left screen center - /// - public Vector2 leftScreenCenter; - - /// - /// VR right screen center - /// - public Vector2 rightScreenCenter; - - /// - /// VR distortion scale - /// - public Vector2 scale; - - /// - /// VR distortion scale in - /// - public Vector2 scaleIn; - } - - /// System config flags - /// NOTE: Every bit registers one state (use it with bit masks) - /// By default all flags are set to 0 - [Flags] - public enum ConfigFlags - { - /// - /// Set to try enabling V-Sync on GPU - /// - FLAG_VSYNC_HINT = 0x00000040, - - /// - /// Set to run program in fullscreen - /// - FLAG_FULLSCREEN_MODE = 0x00000002, - - /// - /// Set to allow resizable window - /// - FLAG_WINDOW_RESIZABLE = 0x00000004, - - /// - /// Set to disable window decoration (frame and buttons) - /// - FLAG_WINDOW_UNDECORATED = 0x00000008, - - /// - /// Set to hide window - /// - FLAG_WINDOW_HIDDEN = 0x00000080, - - /// - /// Set to minimize window (iconify) - /// - FLAG_WINDOW_MINIMIZED = 0x00000200, - - /// - /// Set to maximize window (expanded to monitor) - /// - FLAG_WINDOW_MAXIMIZED = 0x00000400, - - /// - /// Set to window non focused - /// - FLAG_WINDOW_UNFOCUSED = 0x00000800, - - /// - /// Set to window always on top - /// - FLAG_WINDOW_TOPMOST = 0x00001000, - - /// - /// Set to allow windows running while minimized - /// - FLAG_WINDOW_ALWAYS_RUN = 0x00000100, - - /// - /// Set to allow transparent framebuffer - /// - FLAG_WINDOW_TRANSPARENT = 0x00000010, - - /// - /// Set to support HighDPI - /// - FLAG_WINDOW_HIGHDPI = 0x00002000, - - /// - /// Set to try enabling MSAA 4X - /// - FLAG_MSAA_4X_HINT = 0x00000020, - - /// - /// Set to try enabling interlaced video format (for V3D) - /// - FLAG_INTERLACED_HINT = 0x00010000, - } - - /// Trace log level - /// NOTE: Organized by priority level - public enum TraceLogLevel - { - /// - /// Display all logs - /// - LOG_ALL = 0, - - /// - /// Trace logging, intended for internal use only - /// - LOG_TRACE, - - /// - /// Debug logging, used for internal debugging, it should be disabled on release builds - /// - LOG_DEBUG, - - /// - /// Info logging, used for program execution info - /// - LOG_INFO, - - /// - /// Warning logging, used on recoverable failures - /// - LOG_WARNING, - - /// - /// Error logging, used on unrecoverable failures - /// - LOG_ERROR, - - /// - /// Fatal logging, used to abort program: exit(EXIT_FAILURE) - /// - LOG_FATAL, - - /// - /// Disable logging - /// - LOG_NONE - } - - /// Keyboard keys (US keyboard layout) - /// NOTE: Use GetKeyPressed() to allow redefining - /// required keys for alternative layouts - public enum KeyboardKey - { - /// - /// NULL, used for no key pressed - /// - KEY_NULL = 0, - - // Alphanumeric keys - 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, - - // Function keys - 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_LEFT_BRACKET = 91, - KEY_BACKSLASH = 92, - KEY_RIGHT_BRACKET = 93, - KEY_GRAVE = 96, - - // Keypad keys - 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, - - // Android key buttons - KEY_BACK = 4, - KEY_MENU = 82, - KEY_VOLUME_UP = 24, - KEY_VOLUME_DOWN = 25 - } - - /// Mouse buttons - public enum MouseButton - { - /// - /// Mouse button left - /// - MOUSE_BUTTON_LEFT = 0, - - /// - /// Mouse button right - /// - MOUSE_BUTTON_RIGHT = 1, - - /// - /// Mouse button middle (pressed wheel) - /// - MOUSE_BUTTON_MIDDLE = 2, - - /// - /// Mouse button side (advanced mouse device) - /// - MOUSE_BUTTON_SIDE = 3, - - /// - /// Mouse button extra (advanced mouse device) - /// - MOUSE_BUTTON_EXTRA = 4, - - /// - /// Mouse button fordward (advanced mouse device) - /// - MOUSE_BUTTON_FORWARD = 5, - - /// - /// Mouse button back (advanced mouse device) - /// - MOUSE_BUTTON_BACK = 6, - - MOUSE_LEFT_BUTTON = MOUSE_BUTTON_LEFT, - MOUSE_RIGHT_BUTTON = MOUSE_BUTTON_RIGHT, - MOUSE_MIDDLE_BUTTON = MOUSE_BUTTON_MIDDLE, - } - - /// Mouse cursor - public enum MouseCursor - { - /// - /// Default pointer shape - /// - MOUSE_CURSOR_DEFAULT = 0, - - /// - /// Arrow shape - /// - MOUSE_CURSOR_ARROW = 1, - - /// - /// Text writing cursor shape - /// - MOUSE_CURSOR_IBEAM = 2, - - /// - /// Cross shape - /// - MOUSE_CURSOR_CROSSHAIR = 3, - - /// - /// Pointing hand cursor - /// - MOUSE_CURSOR_POINTING_HAND = 4, - - /// - /// Horizontal resize/move arrow shape - /// - MOUSE_CURSOR_RESIZE_EW = 5, - - /// - /// Vertical resize/move arrow shape - /// - MOUSE_CURSOR_RESIZE_NS = 6, - - /// - /// Top-left to bottom-right diagonal resize/move arrow shape - /// - MOUSE_CURSOR_RESIZE_NWSE = 7, - - /// - /// The top-right to bottom-left diagonal resize/move arrow shape - /// - MOUSE_CURSOR_RESIZE_NESW = 8, - - /// - /// The omni-directional resize/move cursor shape - /// - MOUSE_CURSOR_RESIZE_ALL = 9, - - /// - /// The operation-not-allowed shape - /// - MOUSE_CURSOR_NOT_ALLOWED = 10 - } - - /// Gamepad buttons - public enum GamepadButton - { - /// - /// This is here just for error checking - /// - GAMEPAD_BUTTON_UNKNOWN = 0, - - /// - /// Gamepad left DPAD up button - /// - GAMEPAD_BUTTON_LEFT_FACE_UP, - - /// - /// Gamepad left DPAD right button - /// - GAMEPAD_BUTTON_LEFT_FACE_RIGHT, - - /// - /// Gamepad left DPAD down button - /// - GAMEPAD_BUTTON_LEFT_FACE_DOWN, - - /// - /// Gamepad left DPAD left button - /// - GAMEPAD_BUTTON_LEFT_FACE_LEFT, - - /// - /// Gamepad right button up (i.e. PS3: Triangle, Xbox: Y) - /// - GAMEPAD_BUTTON_RIGHT_FACE_UP, - - /// - /// Gamepad right button right (i.e. PS3: Square, Xbox: X) - /// - GAMEPAD_BUTTON_RIGHT_FACE_RIGHT, - - /// - /// Gamepad right button down (i.e. PS3: Cross, Xbox: A) - /// - GAMEPAD_BUTTON_RIGHT_FACE_DOWN, - - /// - /// Gamepad right button left (i.e. PS3: Circle, Xbox: B) - /// - GAMEPAD_BUTTON_RIGHT_FACE_LEFT, - - // Triggers - GAMEPAD_BUTTON_LEFT_TRIGGER_1, - GAMEPAD_BUTTON_LEFT_TRIGGER_2, - GAMEPAD_BUTTON_RIGHT_TRIGGER_1, - GAMEPAD_BUTTON_RIGHT_TRIGGER_2, - - // These are buttons in the center of the gamepad - - /// - /// PS3 Select - /// - GAMEPAD_BUTTON_MIDDLE_LEFT, - - /// - /// PS Button/XBOX Button - /// - GAMEPAD_BUTTON_MIDDLE, - - /// - /// PS3 Start - /// - GAMEPAD_BUTTON_MIDDLE_RIGHT, - - /// - /// Left joystick press button - /// - GAMEPAD_BUTTON_LEFT_THUMB, - - /// - /// Right joystick press button - /// - GAMEPAD_BUTTON_RIGHT_THUMB - } - - /// Gamepad axis - public enum GamepadAxis - { - /// - /// Gamepad left stick X axis - /// - GAMEPAD_AXIS_LEFT_X = 0, - - /// - /// Gamepad left stick Y axis - /// - GAMEPAD_AXIS_LEFT_Y = 1, - - /// - /// Gamepad right stick X axis - /// - GAMEPAD_AXIS_RIGHT_X = 2, - - /// - /// Gamepad right stick Y axis - /// - GAMEPAD_AXIS_RIGHT_Y = 3, - - /// - /// Gamepad back trigger left, pressure level: [1..-1] - /// - GAMEPAD_AXIS_LEFT_TRIGGER = 4, - - /// - /// Gamepad back trigger right, pressure level: [1..-1] - /// - GAMEPAD_AXIS_RIGHT_TRIGGER = 5 - } - - /// Material map index - public enum MaterialMapIndex - { - /// - /// MAP_DIFFUSE - /// - MATERIAL_MAP_ALBEDO = 0, - - /// - /// MAP_SPECULAR - /// - MATERIAL_MAP_METALNESS = 1, - - MATERIAL_MAP_NORMAL = 2, - MATERIAL_MAP_ROUGHNESS = 3, - MATERIAL_MAP_OCCLUSION, - MATERIAL_MAP_EMISSION, - MATERIAL_MAP_HEIGHT, - - /// - /// NOTE: Uses GL_TEXTURE_CUBE_MAP - /// - MATERIAL_MAP_CUBEMAP, - - /// - /// NOTE: Uses GL_TEXTURE_CUBE_MAP - /// - MATERIAL_MAP_IRRADIANCE, - - /// - /// NOTE: Uses GL_TEXTURE_CUBE_MAP - /// - MATERIAL_MAP_PREFILTER, - - MATERIAL_MAP_BRDF, - - MATERIAL_MAP_DIFFUSE = MATERIAL_MAP_ALBEDO, - MATERIAL_MAP_SPECULAR = MATERIAL_MAP_METALNESS, - } - - /// Shader location index - public enum ShaderLocationIndex - { - SHADER_LOC_VERTEX_POSITION = 0, - 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, - - SHADER_LOC_MAP_DIFFUSE = SHADER_LOC_MAP_ALBEDO, - SHADER_LOC_MAP_SPECULAR = SHADER_LOC_MAP_METALNESS, - } - - /// Shader uniform data type - public enum ShaderUniformDataType - { - SHADER_UNIFORM_FLOAT = 0, - SHADER_UNIFORM_VEC2, - SHADER_UNIFORM_VEC3, - SHADER_UNIFORM_VEC4, - SHADER_UNIFORM_INT, - SHADER_UNIFORM_IVEC2, - SHADER_UNIFORM_IVEC3, - SHADER_UNIFORM_IVEC4, - SHADER_UNIFORM_SAMPLER2D - } - // Shader attribute data types - public enum ShaderAttributeDataType - { - SHADER_ATTRIB_FLOAT = 0, - SHADER_ATTRIB_VEC2, - SHADER_ATTRIB_VEC3, - SHADER_ATTRIB_VEC4 - } - - /// Pixel formats - /// NOTE: Support depends on OpenGL version and platform - public enum PixelFormat - { - /// - /// 8 bit per pixel (no alpha) - /// - PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1, - - /// - /// 8*2 bpp (2 channels) - /// - PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA, - - /// - /// 16 bpp - /// - PIXELFORMAT_UNCOMPRESSED_R5G6B5, - - /// - /// 24 bpp - /// - PIXELFORMAT_UNCOMPRESSED_R8G8B8, - - /// - /// 16 bpp (1 bit alpha) - /// - PIXELFORMAT_UNCOMPRESSED_R5G5B5A1, - - /// - /// 16 bpp (4 bit alpha) - /// - PIXELFORMAT_UNCOMPRESSED_R4G4B4A4, - - /// - /// 32 bpp - /// - PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, - - /// - /// 32 bpp (1 channel - float) - /// - PIXELFORMAT_UNCOMPRESSED_R32, - - /// - /// 32*3 bpp (3 channels - float) - /// - PIXELFORMAT_UNCOMPRESSED_R32G32B32, - - /// - /// 32*4 bpp (4 channels - float) - /// - PIXELFORMAT_UNCOMPRESSED_R32G32B32A32, - - /// - /// 4 bpp (no alpha) - /// - PIXELFORMAT_COMPRESSED_DXT1_RGB, - - /// - /// 4 bpp (1 bit alpha) - /// - PIXELFORMAT_COMPRESSED_DXT1_RGBA, - - /// - /// 8 bpp - /// - PIXELFORMAT_COMPRESSED_DXT3_RGBA, - - /// - /// 8 bpp - /// - PIXELFORMAT_COMPRESSED_DXT5_RGBA, - - /// - /// 4 bpp - /// - PIXELFORMAT_COMPRESSED_ETC1_RGB, - - /// - /// 4 bpp - /// - PIXELFORMAT_COMPRESSED_ETC2_RGB, - - /// - /// 8 bpp - /// - PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA, - - /// - /// 4 bpp - /// - PIXELFORMAT_COMPRESSED_PVRT_RGB, - - /// - /// 4 bpp - /// - PIXELFORMAT_COMPRESSED_PVRT_RGBA, - - /// - /// 8 bpp - /// - PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA, - - /// - /// 2 bpp - /// - PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA - } - - /// Texture parameters: filter mode - /// NOTE 1: Filtering considers mipmaps if available in the texture - /// NOTE 2: Filter is accordingly set for minification and magnification - public enum TextureFilter - { - /// - /// No filter, just pixel aproximation - /// - TEXTURE_FILTER_POINT = 0, - - /// - /// Linear filtering - /// - TEXTURE_FILTER_BILINEAR, - - /// - /// Trilinear filtering (linear with mipmaps) - /// - TEXTURE_FILTER_TRILINEAR, - - /// - /// Anisotropic filtering 4x - /// - TEXTURE_FILTER_ANISOTROPIC_4X, - - /// - /// Anisotropic filtering 8x - /// - TEXTURE_FILTER_ANISOTROPIC_8X, - - /// - /// Anisotropic filtering 16x - /// - TEXTURE_FILTER_ANISOTROPIC_16X, - } - - /// Texture parameters: wrap mode - public enum TextureWrap - { - /// - /// Repeats texture in tiled mode - /// - TEXTURE_WRAP_REPEAT = 0, - - /// - /// Clamps texture to edge pixel in tiled mode - /// - TEXTURE_WRAP_CLAMP, - - /// - /// Mirrors and repeats the texture in tiled mode - /// - TEXTURE_WRAP_MIRROR_REPEAT, - - /// - /// Mirrors and clamps to border the texture in tiled mode - /// - TEXTURE_WRAP_MIRROR_CLAMP - } - - /// Cubemap layouts - public enum CubemapLayout - { - /// - /// Automatically detect layout type - /// - CUBEMAP_LAYOUT_AUTO_DETECT = 0, - - /// - /// Layout is defined by a vertical line with faces - /// - CUBEMAP_LAYOUT_LINE_VERTICAL, - - /// - /// Layout is defined by an horizontal line with faces - /// - CUBEMAP_LAYOUT_LINE_HORIZONTAL, - - /// - /// Layout is defined by a 3x4 cross with cubemap faces - /// - CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR, - - /// - /// Layout is defined by a 4x3 cross with cubemap faces - /// - CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE, - - /// - /// Layout is defined by a panorama image (equirectangular map) - /// - CUBEMAP_LAYOUT_PANORAMA - } - - /// Font type, defines generation method - public enum FontType - { - /// - /// Default font generation, anti-aliased - /// - FONT_DEFAULT = 0, - - /// - /// Bitmap font generation, no anti-aliasing - /// - FONT_BITMAP, - - /// - /// SDF font generation, requires external shader - /// - FONT_SDF - } - - /// Color blending modes (pre-defined) - public enum BlendMode - { - /// - /// Blend textures considering alpha (default) - /// - BLEND_ALPHA = 0, - - /// - /// Blend textures adding colors - /// - BLEND_ADDITIVE, - - /// - /// Blend textures multiplying colors - /// - BLEND_MULTIPLIED, - - /// - /// Blend textures adding colors (alternative) - /// - BLEND_ADD_COLORS, - - /// - /// Blend textures subtracting colors (alternative) - /// - BLEND_SUBTRACT_COLORS, - - /// - /// Blend textures using custom src/dst factors (use rlSetBlendMode()) - /// - BLEND_CUSTOM - } - - /// Gestures - /// NOTE: It could be used as flags to enable only some gestures - [Flags] - public enum Gestures - { - GESTURE_NONE = 0, - GESTURE_TAP = 1, - GESTURE_DOUBLETAP = 2, - GESTURE_HOLD = 4, - GESTURE_DRAG = 8, - GESTURE_SWIPE_RIGHT = 16, - GESTURE_SWIPE_LEFT = 32, - GESTURE_SWIPE_UP = 64, - GESTURE_SWIPE_DOWN = 128, - GESTURE_PINCH_IN = 256, - GESTURE_PINCH_OUT = 512 - } - - /// Camera system modes - public enum CameraMode - { - CAMERA_CUSTOM = 0, - CAMERA_FREE, - CAMERA_ORBITAL, - CAMERA_FIRST_PERSON, - CAMERA_THIRD_PERSON - } - - /// Camera projection - public enum CameraProjection - { - CAMERA_PERSPECTIVE = 0, - CAMERA_ORTHOGRAPHIC - } - - /// N-patch layout - public enum NPatchLayout - { - /// - /// Npatch defined by 3x3 tiles - /// - NPATCH_NINE_PATCH = 0, - - /// - /// Npatch defined by 1x3 tiles - /// - NPATCH_THREE_PATCH_VERTICAL, - - /// - /// Npatch defined by 3x1 tiles - /// - NPATCH_THREE_PATCH_HORIZONTAL - } [SuppressUnmanagedCodeSecurity] public static class Raylib diff --git a/Raylib-cs/Rectangle.cs b/Raylib-cs/Rectangle.cs new file mode 100644 index 0000000..f27ba44 --- /dev/null +++ b/Raylib-cs/Rectangle.cs @@ -0,0 +1,24 @@ +using System.Runtime.InteropServices; + +namespace Raylib_cs +{ + /// + /// Rectangle type + /// + [StructLayout(LayoutKind.Sequential)] + public struct Rectangle + { + public float x; + public float y; + public float width; + public float height; + + public Rectangle(float x, float y, float width, float height) + { + this.x = x; + this.y = y; + this.width = width; + this.height = height; + } + } +} \ No newline at end of file diff --git a/Raylib-cs/RenderTexture2D.cs b/Raylib-cs/RenderTexture2D.cs new file mode 100644 index 0000000..6d1ccc4 --- /dev/null +++ b/Raylib-cs/RenderTexture2D.cs @@ -0,0 +1,26 @@ +using System.Runtime.InteropServices; + +namespace Raylib_cs +{ + /// + /// RenderTexture2D type, for texture rendering + /// + [StructLayout(LayoutKind.Sequential)] + public struct RenderTexture2D + { + /// + /// OpenGL Framebuffer Object (FBO) id + /// + public uint id; + + /// + /// Color buffer attachment texture + /// + public Texture2D texture; + + /// + /// Depth buffer attachment texture + /// + public Texture2D depth; + } +} \ No newline at end of file diff --git a/Raylib-cs/Shader.cs b/Raylib-cs/Shader.cs new file mode 100644 index 0000000..94d8fd6 --- /dev/null +++ b/Raylib-cs/Shader.cs @@ -0,0 +1,22 @@ +using System; +using System.Runtime.InteropServices; + +namespace Raylib_cs +{ + /// + /// Shader type (generic) + /// + [StructLayout(LayoutKind.Sequential)] + public struct Shader + { + /// + /// Shader program id + /// + public uint id; + + /// + /// Shader locations array (MAX_SHADER_LOCATIONS, int *) + /// + public IntPtr locs; + } +} \ No newline at end of file diff --git a/Raylib-cs/ShaderAttributeDataType.cs b/Raylib-cs/ShaderAttributeDataType.cs new file mode 100644 index 0000000..b985ea8 --- /dev/null +++ b/Raylib-cs/ShaderAttributeDataType.cs @@ -0,0 +1,10 @@ +namespace Raylib_cs +{ + public enum ShaderAttributeDataType + { + SHADER_ATTRIB_FLOAT = 0, + SHADER_ATTRIB_VEC2, + SHADER_ATTRIB_VEC3, + SHADER_ATTRIB_VEC4 + } +} \ No newline at end of file diff --git a/Raylib-cs/ShaderLocationIndex.cs b/Raylib-cs/ShaderLocationIndex.cs new file mode 100644 index 0000000..c8c6435 --- /dev/null +++ b/Raylib-cs/ShaderLocationIndex.cs @@ -0,0 +1,36 @@ +namespace Raylib_cs +{ + /// Shader location index + public enum ShaderLocationIndex + { + SHADER_LOC_VERTEX_POSITION = 0, + 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, + + SHADER_LOC_MAP_DIFFUSE = SHADER_LOC_MAP_ALBEDO, + SHADER_LOC_MAP_SPECULAR = SHADER_LOC_MAP_METALNESS, + } +} \ No newline at end of file diff --git a/Raylib-cs/ShaderUniformDataType.cs b/Raylib-cs/ShaderUniformDataType.cs new file mode 100644 index 0000000..e3c9e35 --- /dev/null +++ b/Raylib-cs/ShaderUniformDataType.cs @@ -0,0 +1,16 @@ +namespace Raylib_cs +{ + /// Shader uniform data type + public enum ShaderUniformDataType + { + SHADER_UNIFORM_FLOAT = 0, + SHADER_UNIFORM_VEC2, + SHADER_UNIFORM_VEC3, + SHADER_UNIFORM_VEC4, + SHADER_UNIFORM_INT, + SHADER_UNIFORM_IVEC2, + SHADER_UNIFORM_IVEC3, + SHADER_UNIFORM_IVEC4, + SHADER_UNIFORM_SAMPLER2D + } +} \ No newline at end of file diff --git a/Raylib-cs/Sound.cs b/Raylib-cs/Sound.cs new file mode 100644 index 0000000..1ac229b --- /dev/null +++ b/Raylib-cs/Sound.cs @@ -0,0 +1,19 @@ +using System.Runtime.InteropServices; + +namespace Raylib_cs +{ + /// Sound source type + [StructLayout(LayoutKind.Sequential)] + public struct Sound + { + /// + /// Audio stream + /// + public AudioStream stream; + + /// + /// Total number of frames (considering channels) + /// + public uint frameCount; + } +} \ No newline at end of file diff --git a/Raylib-cs/Texture2D.cs b/Raylib-cs/Texture2D.cs new file mode 100644 index 0000000..d857a12 --- /dev/null +++ b/Raylib-cs/Texture2D.cs @@ -0,0 +1,38 @@ +using System.Runtime.InteropServices; + +namespace Raylib_cs +{ + /// + /// Texture2D type + ///
+ /// NOTE: Data stored in GPU memory + ///
+ [StructLayout(LayoutKind.Sequential)] + public struct Texture2D + { + /// + /// OpenGL texture id + /// + public uint id; + + /// + /// Texture base width + /// + public int width; + + /// + /// Texture base height + /// + public int height; + + /// + /// Mipmap levels, 1 by default + /// + public int mipmaps; + + /// + /// Data format (PixelFormat type) + /// + public PixelFormat format; + } +} \ No newline at end of file diff --git a/Raylib-cs/TextureFilter.cs b/Raylib-cs/TextureFilter.cs new file mode 100644 index 0000000..505a0b9 --- /dev/null +++ b/Raylib-cs/TextureFilter.cs @@ -0,0 +1,38 @@ +namespace Raylib_cs +{ + /// Texture parameters: filter mode + /// NOTE 1: Filtering considers mipmaps if available in the texture + /// NOTE 2: Filter is accordingly set for minification and magnification + public enum TextureFilter + { + /// + /// No filter, just pixel aproximation + /// + TEXTURE_FILTER_POINT = 0, + + /// + /// Linear filtering + /// + TEXTURE_FILTER_BILINEAR, + + /// + /// Trilinear filtering (linear with mipmaps) + /// + TEXTURE_FILTER_TRILINEAR, + + /// + /// Anisotropic filtering 4x + /// + TEXTURE_FILTER_ANISOTROPIC_4X, + + /// + /// Anisotropic filtering 8x + /// + TEXTURE_FILTER_ANISOTROPIC_8X, + + /// + /// Anisotropic filtering 16x + /// + TEXTURE_FILTER_ANISOTROPIC_16X, + } +} \ No newline at end of file diff --git a/Raylib-cs/TextureWrap.cs b/Raylib-cs/TextureWrap.cs new file mode 100644 index 0000000..7a5cda0 --- /dev/null +++ b/Raylib-cs/TextureWrap.cs @@ -0,0 +1,26 @@ +namespace Raylib_cs +{ + /// Texture parameters: wrap mode + public enum TextureWrap + { + /// + /// Repeats texture in tiled mode + /// + TEXTURE_WRAP_REPEAT = 0, + + /// + /// Clamps texture to edge pixel in tiled mode + /// + TEXTURE_WRAP_CLAMP, + + /// + /// Mirrors and repeats the texture in tiled mode + /// + TEXTURE_WRAP_MIRROR_REPEAT, + + /// + /// Mirrors and clamps to border the texture in tiled mode + /// + TEXTURE_WRAP_MIRROR_CLAMP + } +} \ No newline at end of file diff --git a/Raylib-cs/TraceLogLevel.cs b/Raylib-cs/TraceLogLevel.cs new file mode 100644 index 0000000..28543bd --- /dev/null +++ b/Raylib-cs/TraceLogLevel.cs @@ -0,0 +1,47 @@ +namespace Raylib_cs +{ + /// Trace log level + /// NOTE: Organized by priority level + public enum TraceLogLevel + { + /// + /// Display all logs + /// + LOG_ALL = 0, + + /// + /// Trace logging, intended for internal use only + /// + LOG_TRACE, + + /// + /// Debug logging, used for internal debugging, it should be disabled on release builds + /// + LOG_DEBUG, + + /// + /// Info logging, used for program execution info + /// + LOG_INFO, + + /// + /// Warning logging, used on recoverable failures + /// + LOG_WARNING, + + /// + /// Error logging, used on unrecoverable failures + /// + LOG_ERROR, + + /// + /// Fatal logging, used to abort program: exit(EXIT_FAILURE) + /// + LOG_FATAL, + + /// + /// Disable logging + /// + LOG_NONE + } +} \ No newline at end of file diff --git a/Raylib-cs/Transform.cs b/Raylib-cs/Transform.cs new file mode 100644 index 0000000..ded8ecb --- /dev/null +++ b/Raylib-cs/Transform.cs @@ -0,0 +1,27 @@ +using System.Numerics; +using System.Runtime.InteropServices; + +namespace Raylib_cs +{ + /// + /// Transform, vectex transformation data + /// + [StructLayout(LayoutKind.Sequential)] + public struct Transform + { + /// + /// Translation + /// + public Vector3 translation; + + /// + /// Rotation + /// + public Vector4 rotation; + + /// + /// Scale + /// + public Vector3 scale; + } +} \ No newline at end of file diff --git a/Raylib-cs/VrDeviceInfo.cs b/Raylib-cs/VrDeviceInfo.cs new file mode 100644 index 0000000..7bec209 --- /dev/null +++ b/Raylib-cs/VrDeviceInfo.cs @@ -0,0 +1,59 @@ +using System.Runtime.InteropServices; + +namespace Raylib_cs +{ + /// Head-Mounted-Display device parameters + [StructLayout(LayoutKind.Sequential)] + public unsafe struct VrDeviceInfo + { + /// + /// HMD horizontal resolution in pixels + /// + public int hResolution; + + /// + /// HMD vertical resolution in pixels + /// + public int vResolution; + + /// + /// HMD horizontal size in meters + /// + public float hScreenSize; + + /// + /// HMD vertical size in meters + /// + public float vScreenSize; + + /// + /// HMD screen center in meters + /// + public float vScreenCenter; + + /// + /// HMD distance between eye and display in meters + /// + public float eyeToScreenDistance; + + /// + /// HMD lens separation distance in meters + /// + public float lensSeparationDistance; + + /// + /// HMD IPD (distance between pupils) in meters + /// + public float interpupillaryDistance; + + /// + /// HMD lens distortion constant parameters + /// + public fixed float lensDistortionValues[4]; + + /// + /// HMD chromatic aberration correction parameters + /// + public fixed float chromaAbCorrection[4]; + } +} \ No newline at end of file diff --git a/Raylib-cs/VrStereoConfig.cs b/Raylib-cs/VrStereoConfig.cs new file mode 100644 index 0000000..7b570e1 --- /dev/null +++ b/Raylib-cs/VrStereoConfig.cs @@ -0,0 +1,60 @@ +using System.Numerics; +using System.Runtime.InteropServices; + +namespace Raylib_cs +{ + /// VR Stereo rendering configuration for simulator + [StructLayout(LayoutKind.Sequential)] + public struct VrStereoConfig + { + /// + /// VR projection matrices (per eye) + /// + public Matrix4x4 projection1; + + /// + /// VR projection matrices (per eye) + /// + public Matrix4x4 projection2; + + /// + /// VR view offset matrices (per eye) + /// + public Matrix4x4 viewOffset1; + + /// + /// VR view offset matrices (per eye) + /// + public Matrix4x4 viewOffset2; + + /// + /// VR left lens center + /// + public Vector2 leftLensCenter; + + /// + /// VR right lens center + /// + public Vector2 rightLensCenter; + + /// + /// VR left screen center + /// + public Vector2 leftScreenCenter; + + /// + /// VR right screen center + /// + public Vector2 rightScreenCenter; + + /// + /// VR distortion scale + /// + public Vector2 scale; + + /// + /// VR distortion scale in + /// + public Vector2 scaleIn; + } +} \ No newline at end of file diff --git a/Raylib-cs/Wave.cs b/Raylib-cs/Wave.cs new file mode 100644 index 0000000..b8e6024 --- /dev/null +++ b/Raylib-cs/Wave.cs @@ -0,0 +1,35 @@ +using System; +using System.Runtime.InteropServices; + +namespace Raylib_cs +{ + /// Wave type, defines audio wave data + [StructLayout(LayoutKind.Sequential)] + public struct Wave + { + /// + /// Number of samples + /// + public uint sampleCount; + + /// + /// Frequency (samples per second) + /// + public uint sampleRate; + + /// + /// Bit depth (bits per sample): 8, 16, 32 (24 not supported) + /// + public uint sampleSize; + + /// + /// Number of channels (1-mono, 2-stereo) + /// + public uint channels; + + /// + /// Buffer data pointer (void *) + /// + public IntPtr data; + } +} \ No newline at end of file