From bb4b9c38c6bb5544ca2514a16c52a38470cdba9e Mon Sep 17 00:00:00 2001
From: ChrisDill <chris.rj.dill@gmail.com>
Date: Sat, 26 Dec 2020 10:50:32 +0000
Subject: [PATCH 01/14] Update Raylib.cs structs to 3.5.0 - Doing the update in
 stages to make it easier to manage.

---
 Raylib-cs/Raylib.cs | 150 ++++++++++++++------------------------------
 1 file changed, 48 insertions(+), 102 deletions(-)

diff --git a/Raylib-cs/Raylib.cs b/Raylib-cs/Raylib.cs
index 2037061..40e7f57 100644
--- a/Raylib-cs/Raylib.cs
+++ b/Raylib-cs/Raylib.cs
@@ -88,8 +88,7 @@ namespace Raylib_cs
     [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
     public struct Image
     {
-        // data refers to a void *
-        public IntPtr data;        // Image raw data
+        public IntPtr data;        // Image raw data (void *)
         public int width;          // Image base width
         public int height;         // Image base height
         public int mipmaps;        // Mipmap levels, 1 by default
@@ -115,9 +114,6 @@ namespace Raylib_cs
         public uint id;                  // OpenGL Framebuffer Object (FBO) id
         public Texture2D texture;        // Color buffer attachment texture
         public Texture2D depth;          // Depth buffer attachment texture
-
-        [MarshalAs(UnmanagedType.I1)]
-        public bool depthTexture;        // Track if depth attachment is a texture or renderbuffer
     }
 
     // N-Patch layout info
@@ -149,13 +145,10 @@ namespace Raylib_cs
     {
         public int baseSize;             // Base size (default chars height)
         public int charsCount;           // Number of characters
-        public Texture2D texture;        // Font texture
-
-        // recs refers to a Rectangle *
-        public IntPtr recs;              // Characters rectangles in texture
-
-        // chars refers to a CharInfo *
-        public IntPtr chars;             // Characters info data
+        int charsPadding;                // Padding around the chars
+        public Texture2D texture;        // Characters texture atals
+        public IntPtr recs;              // Characters rectangles in texture (Rectangle *)
+        public IntPtr chars;             // Characters info data (CharInfo *)
     }
 
     // Camera type, defines a camera position/orientation in 3d space
@@ -205,43 +198,23 @@ namespace Raylib_cs
         public int triangleCount;                  // Number of triangles stored (indexed or not)
 
         // Default vertex data
-        // vertices refers to a float *
-        public IntPtr vertices;                    // Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
-        // texcoords refers to a float *
-        public IntPtr texcoords;                   // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
-        // texcoords2 refers to a float *
-        public IntPtr texcoords2;                  // Vertex second texture coordinates (useful for lightmaps) (shader-location = 5)
-
-        // normals refers to a float *
-        public IntPtr normals;                     // Vertex normals (XYZ - 3 components per vertex) (shader-location = 2)
-
-        // tangents refers to a float *
-        public IntPtr tangents;                    // Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4)
-
-        // colors refers to a unsigned char *
-        public IntPtr colors;                      // Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
-
-        // indices refers to a unsigned short *
-        public IntPtr indices;                     // Vertex indices (in case vertex data comes indexed)
+        public IntPtr vertices;                    // Vertex position (XYZ - 3 components per vertex) (shader-location = 0, float *)
+        public IntPtr texcoords;                   // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1, float *)
+        public IntPtr texcoords2;                  // Vertex second texture coordinates (useful for lightmaps) (shader-location = 5, float *)
+        public IntPtr normals;                     // Vertex normals (XYZ - 3 components per vertex) (shader-location = 2, float *)
+        public IntPtr tangents;                    // Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4, float *)
+        public IntPtr colors;                      // Vertex colors (RGBA - 4 components per vertex) (shader-location = 3,  unsigned char *)
+        public IntPtr indices;                     // Vertex indices (in case vertex data comes indexed, unsigned short *)
 
         // Animation vertex data
-        // animVertices refers to a float *
-        public IntPtr animVertices;                // Animated vertex positions (after bones transformations)
-
-        // animNormals refers to a float *
-        public IntPtr animNormals;                 // Animated normals (after bones transformations)
-
-        // vertices refers to a int *
-        public IntPtr boneIds;                     // Vertex bone ids, up to 4 bones influence by vertex (skinning)
-
-        // boneWeights refers to a float *
-        public IntPtr boneWeights;                 // Vertex bone weight, up to 4 bones influence by vertex (skinning)
+        public IntPtr animVertices;                // Animated vertex positions (after bones transformations, float *)
+        public IntPtr animNormals;                 // Animated normals (after bones transformations, float *)
+        public IntPtr boneIds;                     // Vertex bone ids, up to 4 bones influence by vertex (skinning, int *)
+        public IntPtr boneWeights;                 // Vertex bone weight, up to 4 bones influence by vertex (skinning, float *)
 
         // OpenGL identifiers
         public uint vaoId;                         // OpenGL Vertex Array Object id
-
-        // vboId refers to a uint[]
-        public IntPtr vboId;                       // OpenGL Vertex Buffer Objects id (default vertex data)
+        public IntPtr vboId;                       // OpenGL Vertex Buffer Objects id (default vertex data, uint[])
     }
 
     // Shader type (generic)
@@ -249,9 +222,7 @@ namespace Raylib_cs
     public struct Shader
     {
         public uint id;            // Shader program id
-
-        // locs refers to a int *
-        public IntPtr locs;        // Shader locations array (MAX_SHADER_LOCATIONS)
+        public IntPtr locs;        // Shader locations array (MAX_SHADER_LOCATIONS,  int *)
     }
 
     // Material texture map
@@ -268,12 +239,8 @@ namespace Raylib_cs
     public struct Material
     {
         public Shader shader;             // Material shader
-
-        // maps refers to a MaterialMap *
-        public IntPtr maps;               // Material maps
-
-        // params refers to a float *
-        public IntPtr param;              // Material generic parameters (if required)
+        public IntPtr maps;               // Material maps (MaterialMap *)
+        public IntPtr param;              // Material generic parameters (if required, float *)
     }
 
     // Transformation properties
@@ -298,39 +265,25 @@ namespace Raylib_cs
     [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
     public struct Model
     {
-        public Matrix4x4 transform;           // Local transform matrix
+        public Matrix4x4 transform;        // Local transform matrix
         public int meshCount;              // Number of meshes
-
-        // meshes refers to a Mesh *
-        public IntPtr meshes;              // Meshes array
         public int materialCount;          // Number of materials
-
-        // materials refers to a Material *
-        public IntPtr materials;		   // Materials array refers to a Material *
-
-        // meshMaterial refers to a int *
-        public IntPtr meshMaterial;        // Mesh material number
+        public IntPtr meshes;              // Meshes array (Mesh *)
+        public IntPtr materials;		   // Materials array (Material *)
+        public IntPtr meshMaterial;        // Mesh material number (int *)
         public int boneCount;              // Number of bones
-
-        // bones refers to a BoneInfo *
-        public IntPtr bones;               // Bones information (skeleton)
-
-        // bindPose refers to a Transform *
-        public IntPtr bindPose;            // Bones base transformation (pose)
+        public IntPtr bones;               // Bones information (skeleton, BoneInfo *)
+        public IntPtr bindPose;            // Bones base transformation (pose, Transform *)
     }
 
     // Model animation
     [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
     public struct ModelAnimation
     {
-        public int boneCount;                 // Number of bones
-
-        // bones refers to a BoneInfo *
-        public IntPtr bones;                  // Bones information (skeleton)
-        public int frameCount;                // Number of animation frames
-
-        // framePoses refers to a Transform **
-        public IntPtr framePoses;      // Poses array by frame
+        public int boneCount;              // Number of bones
+        public int frameCount;             // Number of animation frames
+        public IntPtr bones;               // Bones information (skeleton, BoneInfo *)
+        public IntPtr framePoses;          // Poses array by frame (Transform **)
     }
 
     // Ray type (useful for raycast)
@@ -380,9 +333,7 @@ namespace Raylib_cs
         public uint sampleRate;         // Frequency (samples per second)
         public uint sampleSize;         // Bit depth (bits per sample): 8, 16, 32 (24 not supported)
         public uint channels;           // Number of channels (1-mono, 2-stereo)
-
-        // data refers to a void *
-        public IntPtr data;             // Buffer data pointer
+        public IntPtr data;             // Buffer data pointer (void *)
     }
 
     // Audio stream type
@@ -390,20 +341,18 @@ namespace Raylib_cs
     [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
     public struct AudioStream
     {
+        public IntPtr audioBuffer;     // Pointer to internal data(rAudioBuffer *) used by the audio system
         public uint sampleRate;        // Frequency (samples per second)
         public uint sampleSize;        // Bit depth (bits per sample): 8, 16, 32 (24 not supported)
         public uint channels;          // Number of channels (1-mono, 2-stereo)
-
-        // audioBuffer refers to a rAudioBuffer *
-        public IntPtr audioBuffer;     // Pointer to internal data used by the audio system
     }
 
     // Sound source type
     [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
     public struct Sound
     {
-        public uint sampleCount;          // Total number of samples
         public AudioStream stream;        // Audio stream
+        public uint sampleCount;          // Total number of samples
     }
 
     // Music stream type (audio file streaming from memory)
@@ -411,35 +360,32 @@ namespace Raylib_cs
     [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
     public struct Music
     {
-        public int ctxType;               // Type of music context (audio filetype)
-
-        // ctxData refers to a void *
-        public IntPtr ctxData;            // Audio context data, depends on type
-
-        public uint sampleCount;          // Total number of samples
-        public uint loopCount;            // Loops count (times music will play), 0 means infinite loop
-
         public AudioStream stream;        // Audio stream
+        public uint sampleCount;          // Total number of samples
+        [MarshalAs(UnmanagedType.I1)]
+        public bool looping;              // Music looping enable
+        public int ctxType;               // Type of music context (audio filetype)
+        public IntPtr ctxData;            // Audio context data, depends on type (void *)
     }
 
     // Head-Mounted-Display device parameters
     [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
     public struct VrDeviceInfo
     {
-        public int hResolution;                                                                                   // HMD horizontal resolution in pixels
-        public int vResolution;                                                                                   // HMD vertical resolution in pixels
-        public float hScreenSize;                                                                                 // HMD horizontal size in meters
-        public float vScreenSize;                                                                                 // HMD vertical size in meters
-        public float vScreenCenter;                                                                               // HMD screen center in meters
-        public float eyeToScreenDistance;                                                                         // HMD distance between eye and display in meters
-        public float lensSeparationDistance;                                                                      // HMD lens separation distance in meters
-        public float interpupillaryDistance;                                                                      // HMD IPD (distance between pupils) in meters
+        public int hResolution;                                         // HMD horizontal resolution in pixels
+        public int vResolution;                                         // HMD vertical resolution in pixels
+        public float hScreenSize;                                       // HMD horizontal size in meters
+        public float vScreenSize;                                       // HMD vertical size in meters
+        public float vScreenCenter;                                     // HMD screen center in meters
+        public float eyeToScreenDistance;                               // HMD distance between eye and display in meters
+        public float lensSeparationDistance;                            // HMD lens separation distance in meters
+        public float interpupillaryDistance;                            // HMD IPD (distance between pupils) in meters
 
         [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
-        public float[] lensDistortionValues;                                                                      // HMD lens distortion constant parameters
+        public float[] lensDistortionValues;                            // HMD lens distortion constant parameters
 
         [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
-        public float[] chromaAbCorrection;                                                                        // HMD chromatic aberration correction parameters
+        public float[] chromaAbCorrection;                              // HMD chromatic aberration correction parameters
     }
 
     // ----------------------------------------------------------------------------------

From 61e842ecfd6c3776539d679b45f7980d732e38a6 Mon Sep 17 00:00:00 2001
From: ChrisDill <chris.rj.dill@gmail.com>
Date: Sat, 26 Dec 2020 10:51:41 +0000
Subject: [PATCH 02/14] Update Raylib.cs enums to 3.5.0

---
 Raylib-cs/Raylib.cs | 80 ++++++++++++++++++++++++++++++---------------
 1 file changed, 54 insertions(+), 26 deletions(-)

diff --git a/Raylib-cs/Raylib.cs b/Raylib-cs/Raylib.cs
index 40e7f57..9dfc4a6 100644
--- a/Raylib-cs/Raylib.cs
+++ b/Raylib-cs/Raylib.cs
@@ -393,19 +393,25 @@ namespace Raylib_cs
     // ----------------------------------------------------------------------------------
 
     // System config flags
-    // NOTE: Used for bit masks
+    // NOTE: Every bit registers one state (use it with bit masks)
+    // By default all flags are set to 0
     [Flags]
     public enum ConfigFlag
     {
-        FLAG_RESERVED           = 1,    // Reserved
-        FLAG_FULLSCREEN_MODE    = 2,    // Set to run program in fullscreen
-        FLAG_WINDOW_RESIZABLE   = 4,    // Set to allow resizable window
-        FLAG_WINDOW_UNDECORATED = 8,    // Set to disable window decoration (frame and buttons)
-        FLAG_WINDOW_TRANSPARENT = 16,   // Set to allow transparent window
-        FLAG_WINDOW_HIDDEN      = 128,  // Set to create the window initially hidden
-        FLAG_WINDOW_ALWAYS_RUN  = 256,  // Set to allow windows running while minimized
-        FLAG_MSAA_4X_HINT       = 32,   // Set to try enabling MSAA 4X
-        FLAG_VSYNC_HINT         = 64    // Set to try enabling V-Sync on GPU
+        FLAG_VSYNC_HINT         = 0x00000040,   // Set to try enabling V-Sync on GPU
+        FLAG_FULLSCREEN_MODE    = 0x00000002,   // Set to run program in fullscreen
+        FLAG_WINDOW_RESIZABLE   = 0x00000004,   // Set to allow resizable window
+        FLAG_WINDOW_UNDECORATED = 0x00000008,   // Set to disable window decoration (frame and buttons)
+        FLAG_WINDOW_HIDDEN      = 0x00000080,   // Set to hide window
+        FLAG_WINDOW_MINIMIZED   = 0x00000200,   // Set to minimize window (iconify)
+        FLAG_WINDOW_MAXIMIZED   = 0x00000400,   // Set to maximize window (expanded to monitor)
+        FLAG_WINDOW_UNFOCUSED   = 0x00000800,   // Set to window non focused
+        FLAG_WINDOW_TOPMOST     = 0x00001000,   // Set to window always on top
+        FLAG_WINDOW_ALWAYS_RUN  = 0x00000100,   // Set to allow windows running while minimized
+        FLAG_WINDOW_TRANSPARENT = 0x00000010,   // Set to allow transparent framebuffer
+        FLAG_WINDOW_HIGHDPI     = 0x00002000,   // Set to support HighDPI
+        FLAG_MSAA_4X_HINT       = 0x00000020,   // Set to try enabling MSAA 4X
+        FLAG_INTERLACED_HINT    = 0x00010000,   // Set to try enabling interlaced video format (for V3D)
     }
 
     // Trace log type
@@ -421,7 +427,9 @@ namespace Raylib_cs
         LOG_NONE            // Disable logging
     }
 
-    // Keyboard keys
+    // Keyboard keys (US keyboard layout)
+    // NOTE: Use GetKeyPressed() to allow redefining
+    // required keys for alternative layouts
     public enum KeyboardKey
     {
         // Alphanumeric keys
@@ -553,6 +561,22 @@ namespace Raylib_cs
         MOUSE_MIDDLE_BUTTON = 2
     }
 
+    // Mouse cursor types
+    public enum MouseCursor
+    {
+        MOUSE_CURSOR_DEFAULT       = 0,
+        MOUSE_CURSOR_ARROW         = 1,
+        MOUSE_CURSOR_IBEAM         = 2,
+        MOUSE_CURSOR_CROSSHAIR     = 3,
+        MOUSE_CURSOR_POINTING_HAND = 4,
+        MOUSE_CURSOR_RESIZE_EW     = 5,     // The horizontal resize/move arrow shape
+        MOUSE_CURSOR_RESIZE_NS     = 6,     // The vertical resize/move arrow shape
+        MOUSE_CURSOR_RESIZE_NWSE   = 7,     // The top-left to bottom-right diagonal resize/move arrow shape
+        MOUSE_CURSOR_RESIZE_NESW   = 8,     // The top-right to bottom-left diagonal resize/move arrow shape
+        MOUSE_CURSOR_RESIZE_ALL    = 9,     // The omni-directional resize/move cursor shape
+        MOUSE_CURSOR_NOT_ALLOWED   = 10     // The operation-not-allowed shape
+    }
+
     // Gamepad number
     public enum GamepadNumber
     {
@@ -562,7 +586,7 @@ namespace Raylib_cs
         GAMEPAD_PLAYER4     = 3
     }
 
-    // Gamepad Buttons
+    // Gamepad buttons
     public enum GamepadButton
     {
         // This is here just for error checking
@@ -599,6 +623,7 @@ namespace Raylib_cs
         GAMEPAD_BUTTON_RIGHT_THUMB
     }
 
+    // Gamepad axis
     public enum GamepadAxis
     {
         // This is here just for error checking
@@ -617,7 +642,7 @@ namespace Raylib_cs
         GAMEPAD_AXIS_RIGHT_TRIGGER      // [1..-1] (pressure-level)
     }
 
-    // Shader location point type
+    // Shader location points
     public enum ShaderLocationIndex
     {
         LOC_VERTEX_POSITION = 0,
@@ -661,7 +686,7 @@ namespace Raylib_cs
         UNIFORM_SAMPLER2D
     }
 
-    // Material map type
+    // Material maps
     public enum MaterialMapType
     {
         MAP_ALBEDO    = 0,       // MAP_DIFFUSE
@@ -717,7 +742,16 @@ namespace Raylib_cs
         FILTER_ANISOTROPIC_16X,         // Anisotropic filtering 16x
     }
 
-    // Cubemap layout type
+    // Texture parameters: wrap mode
+    public enum TextureWrapMode
+    {
+        WRAP_REPEAT = 0,        // Repeats texture in tiled mode
+        WRAP_CLAMP,             // Clamps texture to edge pixel in tiled mode
+        WRAP_MIRROR_REPEAT,     // Mirrors and repeats the texture in tiled mode
+        WRAP_MIRROR_CLAMP       // Mirrors and clamps to border the texture in tiled mode
+    }
+
+    // Cubemap layouts
     public enum CubemapLayoutType
     {
         CUBEMAP_AUTO_DETECT = 0,        // Automatically detect layout type
@@ -728,15 +762,6 @@ namespace Raylib_cs
         CUBEMAP_PANORAMA                // Layout is defined by a panorama image (equirectangular map)
     }
 
-    // Texture parameters: wrap mode
-    public enum TextureWrapMode
-    {
-        WRAP_REPEAT = 0,        // Repeats texture in tiled mode
-        WRAP_CLAMP,             // Clamps texture to edge pixel in tiled mode
-        WRAP_MIRROR_REPEAT,     // Mirrors and repeats the texture in tiled mode
-        WRAP_MIRROR_CLAMP       // Mirrors and clamps to border the texture in tiled mode
-    }
-
     // Font type, defines generation method
     public enum FontType
     {
@@ -750,7 +775,10 @@ namespace Raylib_cs
     {
         BLEND_ALPHA = 0,        // Blend textures considering alpha (default)
         BLEND_ADDITIVE,         // Blend textures adding colors
-        BLEND_MULTIPLIED        // Blend textures multiplying colors
+        BLEND_MULTIPLIED,       // Blend textures multiplying colors
+        BLEND_ADD_COLORS,       // Blend textures adding colors (alternative)
+        BLEND_SUBTRACT_COLORS,  // Blend textures subtracting colors (alternative)
+        BLEND_CUSTOM            // Belnd textures using custom src/dst factors (use SetBlendModeCustom())
     }
 
     // Gestures type
@@ -788,7 +816,7 @@ namespace Raylib_cs
         CAMERA_ORTHOGRAPHIC
     }
 
-    // Type of n-patch
+    // N-patch types
     public enum NPatchType
     {
         NPT_9PATCH = 0,         // Npatch defined by 3x3 tiles

From 592bd9e0d2333e1e91c821980e804e73f23e32a8 Mon Sep 17 00:00:00 2001
From: ChrisDill <chris.rj.dill@gmail.com>
Date: Sat, 26 Dec 2020 12:27:24 +0000
Subject: [PATCH 03/14] Update Raylib.cs window and cursor related functions to
 3.5.0

---
 Raylib-cs/Raylib.cs | 85 ++++++++++++++++++++++++++++++++++-----------
 1 file changed, 65 insertions(+), 20 deletions(-)

diff --git a/Raylib-cs/Raylib.cs b/Raylib-cs/Raylib.cs
index 9dfc4a6..e8f02a1 100644
--- a/Raylib-cs/Raylib.cs
+++ b/Raylib-cs/Raylib.cs
@@ -830,7 +830,7 @@ namespace Raylib_cs
         // Used by DllImport to load the native library.
         public const string nativeLibName = "raylib";
 
-        public const string RAYLIB_VERSION = "3.0";
+        public const string RAYLIB_VERSION = "3.5";
 
         public const float DEG2RAD = MathF.PI / 180.0f;
         public const float RAD2DEG = 180.0f / MathF.PI;
@@ -866,37 +866,65 @@ namespace Raylib_cs
         [return: MarshalAs(UnmanagedType.I1)]
         public static extern bool IsWindowReady();
 
-        // Check if window has been minimized (or lost focus)
-        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        [return: MarshalAs(UnmanagedType.I1)]
-        public static extern bool IsWindowMinimized();
-
-        // Check if window has been resized
-        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        [return: MarshalAs(UnmanagedType.I1)]
-        public static extern bool IsWindowResized();
-
-        // Check if window is currently hidden
-        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        [return: MarshalAs(UnmanagedType.I1)]
-        public static extern bool IsWindowHidden();
-
         // Check if window is currently fullscreen
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         [return: MarshalAs(UnmanagedType.I1)]
         public static extern bool IsWindowFullscreen();
 
+        // Check if window is currently hidden (only PLATFORM_DESKTOP)
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        [return: MarshalAs(UnmanagedType.I1)]
+        public static extern bool IsWindowHidden();
+
+        // Check if window is currently minimized (only PLATFORM_DESKTOP)
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        [return: MarshalAs(UnmanagedType.I1)]
+        public static extern bool IsWindowMinimized();
+
+        // Check if window is currently maximized (only PLATFORM_DESKTOP)
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        [return: MarshalAs(UnmanagedType.I1)]
+        public static extern bool IsWindowMaximized();
+
+        // Check if window is currently focused (only PLATFORM_DESKTOP)
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        [return: MarshalAs(UnmanagedType.I1)]
+        public static extern bool IsWindowFocused();
+
+        // Check if window has been resized last frame
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        [return: MarshalAs(UnmanagedType.I1)]
+        public static extern bool IsWindowResized();
+
+        // Check if one specific window flag is enabled
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        [return: MarshalAs(UnmanagedType.I1)]
+        public static extern bool IsWindowState(ConfigFlag flag);
+
+        // Set window configuration state using flags
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        [return: MarshalAs(UnmanagedType.I1)]
+        public static extern bool SetWindowState(ConfigFlag flag);
+
+        // Clear window configuration state flags
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern void ClearWindowState();
+
         // Toggle fullscreen mode (only PLATFORM_DESKTOP)
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern void ToggleFullscreen();
 
-        // Show the window
+        // Set window state: maximized, if resizable (only PLATFORM_DESKTOP)
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern void UnhideWindow();
+        public static extern void MaximizeWindow();
 
-        // Hide the window
+        // Set window state: minimized, if resizable (only PLATFORM_DESKTOP)
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern void HideWindow();
+        public static extern void MinimizeWindow();
+
+        // Set window state: not minimized/maximized (only PLATFORM_DESKTOP)
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern void RestoreWindow();
 
         // Set icon for window (only PLATFORM_DESKTOP)
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -939,6 +967,10 @@ namespace Raylib_cs
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern int GetMonitorCount();
 
+        // Get specified monitor position
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern Vector2 GetMonitorPosition();
+
         // Get primary monitor width
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern int GetMonitorWidth(int monitor);
@@ -955,10 +987,18 @@ namespace Raylib_cs
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern int GetMonitorPhysicalHeight(int monitor);
 
+        // Get specified monitor refresh rate
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern int GetMonitorRefreshRate(int monitor);
+
         // Get window position XY on monitor
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern Vector2 GetWindowPosition();
 
+        // Get window scale DPI factor
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern Vector2 GetWindowScaleDPI();
+
         // Get the human-readable, UTF-8 encoded name of the primary monitor
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern string GetMonitorName(int monitor);
@@ -995,6 +1035,11 @@ namespace Raylib_cs
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern void DisableCursor();
 
+        // Disables cursor (lock cursor)
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        [return: MarshalAs(UnmanagedType.I1)]
+        public static extern bool IsCursorOnScreen();
+
 
         // Drawing-related functions
 

From 7be227a1157c5c4bd4c33d9d21498fb2ece737e8 Mon Sep 17 00:00:00 2001
From: ChrisDill <chris.rj.dill@gmail.com>
Date: Sat, 26 Dec 2020 13:08:17 +0000
Subject: [PATCH 04/14] Replace Image/Texture section with Color/Pixel and
 update those functions to 3.5.0

---
 Raylib-cs/Raylib.cs | 77 +++++++++++++++++++++++++--------------------
 1 file changed, 43 insertions(+), 34 deletions(-)

diff --git a/Raylib-cs/Raylib.cs b/Raylib-cs/Raylib.cs
index e8f02a1..85f2967 100644
--- a/Raylib-cs/Raylib.cs
+++ b/Raylib-cs/Raylib.cs
@@ -1138,37 +1138,6 @@ namespace Raylib_cs
         public static extern double GetTime();
 
 
-        // Color-related functions
-
-        // Returns hexadecimal value for a Color
-        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern int ColorToInt(Color color);
-
-        // Returns color normalized as float [0..1]
-        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern Vector4 ColorNormalize(Color color);
-
-        // Returns color from normalized values [0..1]
-        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern Color ColorFromNormalized(Vector4 normalized);
-
-        // Returns HSV values for a Color
-        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern Vector3 ColorToHSV(Color color);
-
-        // Returns a Color from HSV values
-        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern Color ColorFromHSV(Vector3 hsv);
-
-        // Returns a Color struct from hexadecimal value
-        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern Color GetColor(int hexValue);
-
-        // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f
-        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern Color Fade(Color color, float alpha);
-
-
         // Misc. functions
 
         // Setup window configuration flags (view FLAGS)
@@ -2049,11 +2018,51 @@ namespace Raylib_cs
         public static extern void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle destRec, Vector2 origin, float rotation, Color tint);
 
 
-        // Image/Texture misc functions
+        // Color/pixel related functions
 
-        // Get pixel data size in bytes (image or texture)
+        // Returns hexadecimal value for a Color
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern int GetPixelDataSize(int width, int height, int format);
+        public static extern int ColorToInt(Color color);
+
+        // Returns color normalized as float [0..1]
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern Vector4 ColorNormalize(Color color);
+
+        // Returns color from normalized values [0..1]
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern Color ColorFromNormalized(Vector4 normalized);
+
+        // Returns HSV values for a Color
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern Vector3 ColorToHSV(Color color);
+
+        // Returns a Color from HSV values
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern Color ColorFromHSV(float hue, float saturation, float value);
+
+        // Returns color with alpha applied, alpha goes from 0.0f to 1.0f
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern Color ColorAlpha(Color color, float alpha);
+
+        // Returns src alpha-blended into dst color with tint
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern Color ColorAlphaBlend(Color dst, Color src, Color tint);
+
+        // Get Color structure from hexadecimal value
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern Color GetColor(int hexValue);
+
+        // Get Color from a source pixel pointer of certain format
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern Color GetPixelColor(IntPtr srcPtr, PixelFormat format);
+
+        // Set color formatted into destination pixel pointer
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern void SetPixelColor(IntPtr srcPtr, Color color, PixelFormat format);
+
+        // Get pixel data size in bytes for certain format
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern int GetPixelDataSize(int width, int height, PixelFormat format);
 
         //------------------------------------------------------------------------------------
         // Font Loading and Text Drawing Functions (Module: text)

From 29fca9725fa9a876b29c2f014d6e15e70ab7fc36 Mon Sep 17 00:00:00 2001
From: ChrisDill <chris.rj.dill@gmail.com>
Date: Sat, 26 Dec 2020 13:24:48 +0000
Subject: [PATCH 05/14] Update Raylib.cs input related functions to 3.5.0

---
 Raylib-cs/Raylib.cs | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/Raylib-cs/Raylib.cs b/Raylib-cs/Raylib.cs
index 85f2967..1572dfc 100644
--- a/Raylib-cs/Raylib.cs
+++ b/Raylib-cs/Raylib.cs
@@ -1302,10 +1302,14 @@ namespace Raylib_cs
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern void SetExitKey(KeyboardKey key);
 
-        // Get key pressed, call it multiple times for chars queued
+        // Get key pressed (keycode), call it multiple times for keys queued
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern int GetKeyPressed();
 
+        // Get char pressed (unicode), call it multiple times for chars queued
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern int GetCharPressed();
+
 
         // Input-related functions: gamepads
 
@@ -1404,7 +1408,15 @@ namespace Raylib_cs
 
         // Returns mouse wheel movement Y
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern int GetMouseWheelMove();
+        public static extern float GetMouseWheelMove();
+
+        // Returns mouse cursor
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern MouseCursor GetMouseCursor();
+
+        // Set mouse cursor
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern void SetMouseCursor(MouseCursor cursor);
 
 
         // Input-related functions: touch

From 75050deeed8dcc0d679d8d7b067ec2c47d93f3d3 Mon Sep 17 00:00:00 2001
From: ChrisDill <chris.rj.dill@gmail.com>
Date: Sat, 26 Dec 2020 13:43:25 +0000
Subject: [PATCH 06/14] Update Raylib.cs drawing functions to 3.5.0 - Update
 Image drawing functions - Update Texture drawing functions - Update shape
 drawing functions

---
 Raylib-cs/Raylib.cs | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/Raylib-cs/Raylib.cs b/Raylib-cs/Raylib.cs
index 1572dfc..073265e 100644
--- a/Raylib-cs/Raylib.cs
+++ b/Raylib-cs/Raylib.cs
@@ -1930,18 +1930,13 @@ namespace Raylib_cs
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern void ImageDraw(ref Image dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint);
 
-        // Draw text (default font) within an image (destination)
+        // Draw text (using default font) within an image (destination)
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern void ImageDrawText(ref Image dst, Vector2 position, string text, int fontSize, Color color);
+        public static extern void ImageDrawText(ref Image dst, string text, int x, int y, int fontSize, Color color);
 
         // Draw text (custom sprite font) within an image (destination)
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern void ImageDrawTextEx(ref Image dst, Vector2 position, Font font, string text, float fontSize, float spacing, Color color);
-
-        // Draw a source image within a destination image (tint applied to source)
-        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern void ImageDraw(ref Image dst, Image src, Rectangle srcRec, Rectangle dstRec);
-
+        public static extern void ImageDrawTextEx(ref Image dst, Font font, string text, Vector2 position, float fontSize, float spacing, Color tint);
 
         // Texture loading functions
         // NOTE: These functions require GPU access
@@ -2021,6 +2016,10 @@ namespace Raylib_cs
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern void DrawTextureQuad(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangle quad, Color tint);
 
+        // Draw part of a texture (defined by a rectangle) with rotation and scale tiled into dest.
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern void DrawTextureTiled(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, float scale, Color tint);
+
         // Draw a part of a texture defined by a rectangle with 'pro' parameters
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, Color tint);
@@ -2216,6 +2215,14 @@ namespace Raylib_cs
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color);
 
+        // Draw a color-filled triangle (vertex in counter-clockwise order!)
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern void DrawTriangle3D(Vector3 v1, Vector3 v2, Vector3 v3, Color color);
+
+        // Draw a triangle strip defined by points
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern void DrawTriangleStrip3D(Vector3[] points, int pointsCount, Color color);
+
         // Draw cube
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern void DrawCube(Vector3 position, float width, float height, float length, Color color);

From 010db71473b5e31569c43b74c67bc245b2593990 Mon Sep 17 00:00:00 2001
From: ChrisDill <chris.rj.dill@gmail.com>
Date: Sat, 26 Dec 2020 14:00:39 +0000
Subject: [PATCH 07/14] Update Raylib.cs image, texture and font functions to
 3.5.0

---
 Raylib-cs/Raylib.cs | 74 +++++++++++++++++++++++++++++----------------
 1 file changed, 48 insertions(+), 26 deletions(-)

diff --git a/Raylib-cs/Raylib.cs b/Raylib-cs/Raylib.cs
index 073265e..632e694 100644
--- a/Raylib-cs/Raylib.cs
+++ b/Raylib-cs/Raylib.cs
@@ -1692,18 +1692,18 @@ namespace Raylib_cs
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern Image LoadImage(string fileName);
 
-        // Load image from Color array data (RGBA - 32bit)
-        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern Image LoadImageEx(Color[] pixels, int width, int height);
-
-        // Load image from raw data with parameters
-        // data refers to a void *
-        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern Image LoadImagePro(IntPtr data, int width, int height, int format);
-
         // Load image from RAW file data
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern Image LoadImageRaw(string fileName, int width, int height, int format, int headerSize);
+        public static extern Image LoadImageRaw(string fileName, int width, int height, PixelFormat format, int headerSize);
+
+        // Load image sequence from file (frames appended to image.data)
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern Image LoadImageAnim(string fileName, ref int frames);
+
+        // Load image from memory buffer, fileType refers to extension: i.e. "png"
+        // fileData refers to const unsigned char *
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern Image LoadImageFromMemory(string fileType, IntPtr fileData, int dataSize);
 
         // Unload image from CPU memory (RAM)
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -1717,16 +1717,6 @@ namespace Raylib_cs
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern void ExportImageAsCode(Image image, string fileName);
 
-        // Get pixel data from image as a Color struct array
-        // IntPtr refers to a Color *
-        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern IntPtr GetImageData(Image image);
-
-        // Get pixel data from image as Vector4 array (float normalized)
-        // IntPtr refers to a Vector4 *
-        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern IntPtr GetImageDataNormalized(Image image);
-
 
         // Image generation functions
 
@@ -1783,7 +1773,7 @@ namespace Raylib_cs
 
         // Convert image to POT (power-of-two)
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern void ImageToPOT(ref Image image, Color fillColor);
+        public static extern void ImageToPOT(ref Image image, Color fill);
 
         // Convert image data to desired format
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -1869,10 +1859,25 @@ namespace Raylib_cs
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern void ImageColorReplace(ref Image image, Color color, Color replace);
 
-        // Extract color palette from image to maximum size (memory should be freed)
-        // IntPtr refers to a Color *
+        // Load color data from image as a Color array (RGBA - 32bit)
+        // IntPtr refers to Color *
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern IntPtr ImageExtractPalette(Image image, int maxPaletteSize, ref int extractCount);
+        public static extern IntPtr LoadImageColors(Image image);
+
+        // Load colors palette from image as a Color array (RGBA - 32bit)
+        // IntPtr refers to Color *
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern IntPtr LoadImagePaletee(Image image, int maxPaletteSize, ref int colorsCount);
+
+        // Unload color data loaded with LoadImageColors()
+        // colors refers to Color *
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern void UnloadImageColors(IntPtr colors);
+
+        // Unload colors palette loaded with LoadImagePalette()
+        // colors refers to Color *
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern void UnloadImagePaletee(IntPtr colors);
 
         // Get image alpha border rectangle
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -1970,6 +1975,11 @@ namespace Raylib_cs
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern void UpdateTexture(Texture2D texture, IntPtr pixels);
 
+        // Update GPU texture rectangle with new data
+        // pixels refers to a const void *
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern void UpdateTextureRec(Texture2D texture, Rectangle rec, IntPtr pixels);
+
         // Get pixel data from GPU texture and return an Image
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern Image GetTextureData(Texture2D texture);
@@ -2097,14 +2107,26 @@ namespace Raylib_cs
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern Font LoadFontFromImage(Image image, Color key, int firstChar);
 
-        // Load font data for further use
+        // Load font from memory buffer, fileType refers to extension: i.e. "ttf"
+        // fileData refers to const unsigned char *
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern IntPtr LoadFontData(string fileName, int fontSize, int[] fontChars, int charsCount, FontType type);
+        public static extern Font LoadFontFromMemory(string fileType, IntPtr fileData, int dataSize, int fontSize, int[] fontChars, int charsCount);
+
+        // Load font data for further use
+        // fileData refers to const unsigned char *
+        // IntPtr refers to CharInfo *
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern IntPtr LoadFontData(IntPtr fileData, int fontSize, int[] fontChars, int charsCount, FontType type);
 
         // Generate image font atlas using chars info
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern Image GenImageFontAtlas(IntPtr chars, ref IntPtr recs, int charsCount, int fontSize, int padding, int packMethod);
 
+        // Unload font chars info data (RAM)
+        // chars refers to CharInfo *
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern void UnloadFontData(IntPtr chars, int charsCount);
+
         // Unload Font from GPU memory (VRAM)
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern void UnloadFont(Font font);

From cfde708bd89a8a6ab268a17a883b32c384e478b0 Mon Sep 17 00:00:00 2001
From: ChrisDill <chris.rj.dill@gmail.com>
Date: Sat, 26 Dec 2020 15:18:27 +0000
Subject: [PATCH 08/14] Update Raylib.cs model functions to 3.5.0

---
 Raylib-cs/Raylib.cs | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/Raylib-cs/Raylib.cs b/Raylib-cs/Raylib.cs
index 632e694..e9157d6 100644
--- a/Raylib-cs/Raylib.cs
+++ b/Raylib-cs/Raylib.cs
@@ -2319,6 +2319,9 @@ namespace Raylib_cs
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern void UnloadModel(Model model);
 
+        // Unload model (but not meshes) from memory (RAM and/or VRAM)
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern void UnloadModelKeepMeshes(Model model);
 
         // Mesh loading/unloading functions
 
@@ -2326,14 +2329,14 @@ namespace Raylib_cs
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern Mesh[] LoadMeshes(string fileName, ref int meshCount);
 
-        // Export mesh data to file
-        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern void ExportMesh(Mesh mesh, string fileName);
-
         // Unload mesh from memory (RAM and/or VRAM)
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern void UnloadMesh(ref Mesh mesh);
 
+        // Export mesh data to file, returns true on success
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        [return: MarshalAs(UnmanagedType.I1)]
+        public static extern bool ExportMesh(Mesh mesh, string fileName);
 
         // Material loading/unloading functions
 
@@ -2436,6 +2439,9 @@ namespace Raylib_cs
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern void MeshBinormals(ref Mesh mesh);
 
+        // Smooth (average) vertex normals
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern void MeshNormalsSmooth(ref Mesh mesh);
 
         // Model drawing functions
 

From 2e0b2d93eb70fe2c005e8ed68c634187a6670a0d Mon Sep 17 00:00:00 2001
From: ChrisDill <chris.rj.dill@gmail.com>
Date: Sat, 26 Dec 2020 15:18:59 +0000
Subject: [PATCH 09/14] Update Raylib.cs audio functions to 3.5.0

---
 Raylib-cs/Raylib.cs | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/Raylib-cs/Raylib.cs b/Raylib-cs/Raylib.cs
index e9157d6..6bbd367 100644
--- a/Raylib-cs/Raylib.cs
+++ b/Raylib-cs/Raylib.cs
@@ -2713,10 +2713,10 @@ namespace Raylib_cs
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern Wave LoadWave(string fileName);
 
-        // Load wave data from raw array data
-        // data refers to a void *
+        // Load wave from memory buffer, fileType refers to extension: i.e. "wav"
+        // fileData refers to a const unsigned char *
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern Wave LoadWaveEx(IntPtr data, int sampleCount, int sampleRate, int sampleSize, int channels);
+        public static extern Wave LoadWaveFromMemory(string fileType, IntPtr fileData, int dataSize);
 
         // Load sound from file
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -2804,9 +2804,14 @@ namespace Raylib_cs
         public static extern void WaveCrop(ref Wave wave, int initSample, int finalSample);
 
         // Get samples data from wave as a floats array
+        // IntPtr refers to float *
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern float[] GetWaveData(Wave wave);
+        public static extern IntPtr LoadWaveSamples(Wave wave);
 
+        // Unload samples data loaded with LoadWaveSamples()
+        // samples refers to float *
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern void UnloadWaveSamples(IntPtr samples);
 
         // Music management functions
 
@@ -2851,10 +2856,6 @@ namespace Raylib_cs
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern void SetMusicPitch(Music music, float pitch);
 
-        // Set music loop count (loop repeats)
-        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern void SetMusicLoopCount(Music music, int count);
-
         // Get music time length (in seconds)
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern float GetMusicTimeLength(Music music);
@@ -2912,5 +2913,9 @@ namespace Raylib_cs
         // Set pitch for audio stream (1.0 is base level)
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern void SetAudioStreamPitch(AudioStream stream, float pitch);
+
+        // Default size for new audio streams
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern void SetAudioStreamBufferSizeDefault(int size);
     }
 }

From 75a4d9bf2723f83480a5ccabf90e8532a3602802 Mon Sep 17 00:00:00 2001
From: ChrisDill <chris.rj.dill@gmail.com>
Date: Sat, 26 Dec 2020 15:44:19 +0000
Subject: [PATCH 10/14] Update Rlgl.cs to 3.5.0 and rename GetExtension to
 GetFileExtension

---
 Raylib-cs/Raylib.cs |  2 +-
 Raylib-cs/Rlgl.cs   | 61 +++++++++++++++++++++++++++------------------
 2 files changed, 38 insertions(+), 25 deletions(-)

diff --git a/Raylib-cs/Raylib.cs b/Raylib-cs/Raylib.cs
index 6bbd367..7bb4506 100644
--- a/Raylib-cs/Raylib.cs
+++ b/Raylib-cs/Raylib.cs
@@ -1197,7 +1197,7 @@ namespace Raylib_cs
 
         // Get pointer to extension for a filename string
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern string GetExtension(string fileName);
+        public static extern string GetFileExtension(string fileName);
 
         // Get pointer to filename for a path string
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
diff --git a/Raylib-cs/Rlgl.cs b/Raylib-cs/Rlgl.cs
index 71f1b05..5645e3c 100644
--- a/Raylib-cs/Rlgl.cs
+++ b/Raylib-cs/Rlgl.cs
@@ -201,25 +201,21 @@ namespace Raylib_cs
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern void rlDisableWireMode();
 
-        // Delete OpenGL texture from GPU
+        // Set the line drawing width
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern void rlDeleteTextures(uint id);
+        public static extern void rlSetLineWidth(float width);
 
-        // Delete render textures (fbo) from GPU
+        // Get the line drawing width
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern void rlDeleteRenderTextures(RenderTexture2D target);
+        public static extern float rlGetLineWidth();
 
-        // Delete OpenGL shader program from GPU
+        // Enable line aliasing
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern void rlDeleteShader(uint id);
+        public static extern void rlEnableSmoothLines();
 
-        // Unload vertex data (VAO) from GPU memory
+        // Disable line aliasing
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern void rlDeleteVertexArrays(uint id);
-
-        // Unload vertex data (VBO) from GPU memory
-        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern void rlDeleteBuffers(uint id);
+        public static extern void rlDisableSmoothLines();
 
         // Clear color buffer with color
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -255,6 +251,10 @@ namespace Raylib_cs
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern void rlglDraw();
 
+        // Check and log OpenGL error codes
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern void rlCheckErrors();
+
         // Returns current OpenGL version
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern GlVersion rlGetVersion();
@@ -268,16 +268,18 @@ namespace Raylib_cs
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern void rlSetDebugMarker(string text);
 
+        // Set blending mode factor and equation (using OpenGL factors)
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern void rlSetBlendMode(int glSrcFactor, int glDstFactor, int glEquation);
+
         // Load OpenGL extensions
         // loader refers to a void *
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern void rlLoadExtensions(IntPtr loader);
 
-        // Get world coordinates from screen coordinates
-        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern Vector3 rlUnproject(Vector3 source, Matrix4x4 proj, Matrix4x4 view);
 
         // Textures data management
+
         // Load texture in GPU
         // data refers to a void *
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -318,19 +320,26 @@ namespace Raylib_cs
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern byte[] rlReadScreenPixels(int width, int height);
 
-        // Render texture management (fbo)
-        // Load a render texture (with color and depth attachments)
-        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern RenderTexture2D rlLoadRenderTexture(int width, int height, int format, int depthBits, bool useDepthTexture);
 
-        // Attach texture/renderbuffer to an fbo
-        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern void rlRenderTextureAttach(RenderTexture2D target, uint id, int attachType);
+        // Framebuffer management (fbo)
 
-        // Verify render texture is complete
+        // Load an empty framebuffer
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern uint rlLoadFrameBuffer(int width, int height);
+
+        // Attach texture/renderbuffer to a framebuffer
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern void rlFrameBufferAttach(uint fboId, uint texId, int attachType, int texType);
+
+        // Verify framebuffer is complete
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         [return: MarshalAs(UnmanagedType.I1)]
-        public static extern bool rlRenderTextureComplete(RenderTexture2D target);
+        public static extern bool rlFrameBufferComplete(uint id);
+
+        // Delete framebuffer from GPU
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        [return: MarshalAs(UnmanagedType.I1)]
+        public static extern bool rlUnloadFrameBuffer(uint id);
 
         // Vertex data management
         // Upload vertex data into GPU and provided VAO/VBO ids
@@ -349,6 +358,10 @@ namespace Raylib_cs
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern void rlDrawMesh(Mesh mesh, Material material, Matrix4x4 transform);
 
+        // Draw a 3d mesh with material and transform
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern void rlDrawMeshInstanced(Mesh mesh, Material material, Matrix4x4[] transforms, int count);
+
         // Unload mesh data from CPU and GPU
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern void rlUnloadMesh(Mesh mesh);

From 71610bc8e5a8c192739295107b00e1e92043b38c Mon Sep 17 00:00:00 2001
From: ChrisDill <chris.rj.dill@gmail.com>
Date: Sun, 27 Dec 2020 12:49:13 +0000
Subject: [PATCH 11/14] Add missing format argument to GenTetxureCubemap

---
 Raylib-cs/Raylib.cs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Raylib-cs/Raylib.cs b/Raylib-cs/Raylib.cs
index 7bb4506..1e8c422 100644
--- a/Raylib-cs/Raylib.cs
+++ b/Raylib-cs/Raylib.cs
@@ -2614,7 +2614,7 @@ namespace Raylib_cs
 
         // Generate cubemap texture from HDR texture
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern Texture2D GenTextureCubemap(Shader shader, Texture2D skyHDR, int size);
+        public static extern Texture2D GenTextureCubemap(Shader shader, Texture2D skyHDR, int size, PixelFormat format);
 
         // Generate irradiance texture using cubemap data
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]

From 5d266806eb0d8682ace35674979489ee5c90199a Mon Sep 17 00:00:00 2001
From: ChrisDill <chris.rj.dill@gmail.com>
Date: Sun, 27 Dec 2020 15:31:43 +0000
Subject: [PATCH 12/14] Add missing ConfigFlag flag argument to
 ClearWindowState

---
 Raylib-cs/Raylib.cs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Raylib-cs/Raylib.cs b/Raylib-cs/Raylib.cs
index 1e8c422..8b1a068 100644
--- a/Raylib-cs/Raylib.cs
+++ b/Raylib-cs/Raylib.cs
@@ -908,7 +908,7 @@ namespace Raylib_cs
 
         // Clear window configuration state flags
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
-        public static extern void ClearWindowState();
+        public static extern void ClearWindowState(ConfigFlag flag);
 
         // Toggle fullscreen mode (only PLATFORM_DESKTOP)
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]

From 1e362c5e64048d10a6fcc57f9a1d43f1e138ce97 Mon Sep 17 00:00:00 2001
From: ChrisDill <chris.rj.dill@gmail.com>
Date: Sun, 27 Dec 2020 15:47:01 +0000
Subject: [PATCH 13/14] Add GetShaderLocationAttrib function - Used by the
 example shaders_rlgl_mesh_instanced.

---
 Raylib-cs/Raylib.cs | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Raylib-cs/Raylib.cs b/Raylib-cs/Raylib.cs
index 8b1a068..872feb7 100644
--- a/Raylib-cs/Raylib.cs
+++ b/Raylib-cs/Raylib.cs
@@ -2564,6 +2564,10 @@ namespace Raylib_cs
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
         public static extern int GetShaderLocation(Shader shader, string uniformName);
 
+        // Get shader attribute location
+        [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
+        public static extern int GetShaderLocationAttrib(Shader shader, string attribName);
+
         // Set shader uniform value
         // value refers to a const void *
         [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]

From b87362fd28f00268b98d0fcb0e73447609826d45 Mon Sep 17 00:00:00 2001
From: ChrisDill <chris.rj.dill@gmail.com>
Date: Sun, 27 Dec 2020 17:10:30 +0000
Subject: [PATCH 14/14] Update workflow and README.md ready to merge into
 master - Should be able to run workflow manually and pushes will only run it
 if they are on master. - Update README.md with new version + note about the
 nuget package being out of date.

---
 .github/workflows/dotnetcore.yml |  2 ++
 README.md                        | 12 +++++++-----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml
index db45349..e11a5f8 100644
--- a/.github/workflows/dotnetcore.yml
+++ b/.github/workflows/dotnetcore.yml
@@ -1,8 +1,10 @@
 name: .NET Core
 on:
   push:
+    branches: master
   pull_request:
     branches: master
+  workflow_dispatch:
 
 jobs:
   build:
diff --git a/README.md b/README.md
index 72dd621..0878ae1 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
 
 # Raylib-cs
 
-C# bindings for raylib 3.0, a simple and easy-to-use library to learn videogames programming (www.raylib.com)
+C# bindings for raylib 3.5.0, a simple and easy-to-use library to learn videogames programming (www.raylib.com)
 
 [![GitHub contributors](https://img.shields.io/github/contributors/ChrisDill/Raylib-cs)](https://github.com/ChrisDill/Raylib-cs/graphs/contributors)
 [![License](https://img.shields.io/badge/license-zlib%2Flibpng-blue.svg)](LICENSE.md)
@@ -15,7 +15,9 @@ Raylib-cs targets netstandard2.1 and supports netcoreapp3.0+ and net5.0.
 
 ## Installation - NuGet
 
-This is the prefered method to get started - The package is still new so please report any [issues](https://github.com/ChrisDill/Raylib-cs/issues).
+This is the prefered method to get started - The package is still new so please report any [issues](https://github.com/ChrisDill/Raylib-cs/issues). 
+
+**NOTE** The nuget package uses raylib 3.0. It will soon be updated to raylib 3.5.0.
 
 ```
 dotnet add package Raylib-cs --version 3.1.5
@@ -31,10 +33,10 @@ If you need to edit Raylib-cs source then you will need to add the bindings as a
 
 2. Add Raylib-cs/Raylib-cs.csproj to your project as an existing project.
 
-3. Download the native libraries for the platforms you want to build for using the [official 3.0 release](https://github.com/raysan5/raylib/releases/tag/3.0.0).    
-   **NOTE: the MSVC version is required for Windows platforms**  
+3. Download the native libraries for the platforms you want to build for using the [official 3.5.0 release](https://github.com/raysan5/raylib/releases/tag/3.5.0).
+   **NOTE: the MSVC version is required for Windows platforms**
 
-4. **(Recommended)** Put the native library for each platform under `Raylib-cs/runtimes/{platform}/native/`  
+4. **(Recommended)** Put the native library for each platform under `Raylib-cs/runtimes/{platform}/native/`
    **(Optional)** If you want to handle the native libraries yourself, make sure they are either in the same directory as the executable and/or can be found in the search path. See https://www.mono-project.com/docs/advanced/pinvoke/ for details.
 
 5. Start coding!