2
0
mirror of https://github.com/raylib-cs/raylib-cs synced 2025-04-05 11:19:39 -04:00

Add .editorconfig and apply formatting

This commit is contained in:
ChrisDill 2023-08-27 15:20:26 +01:00
parent d1f0b9fd91
commit 696955463f
32 changed files with 7217 additions and 7194 deletions

51
.editorconfig Normal file
View File

@ -0,0 +1,51 @@
# EditorConfig is awesome: http://EditorConfig.org
root = true
[*]
indent_style = space
# General
[*.{cs,csx,vb,vbx}]
indent_size = 4
insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true
# C# styles
[*.cs]
# Indentation preferences
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = true
csharp_indent_switch_labels = true
csharp_indent_labels = flush_left
csharp_style_namespace_declarations = file_scoped:warning
# Newline settings
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_between_query_expression_clauses = true
# Spacing
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_around_binary_operators = before_and_after
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
# Blocks are allowed
csharp_prefer_braces = true:error
csharp_preserve_single_line_blocks = false
csharp_preserve_single_line_statements = false

View File

@ -30,10 +30,10 @@ using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Runtime.Serialization; using System.Runtime.Serialization;
namespace Raylib_cs.Tests namespace Raylib_cs.Tests;
public static class BlittableHelper
{ {
public static class BlittableHelper
{
public static bool IsBlittable<T>() public static bool IsBlittable<T>()
{ {
return IsBlittableCache<T>.VALUE; return IsBlittableCache<T>.VALUE;
@ -66,5 +66,4 @@ namespace Raylib_cs.Tests
{ {
public static readonly bool VALUE = IsBlittable(typeof(T)); public static readonly bool VALUE = IsBlittable(typeof(T));
} }
}
} }

View File

@ -1,10 +1,10 @@
using System; using System;
using Xunit; using Xunit;
namespace Raylib_cs.Tests namespace Raylib_cs.Tests;
public class RaylibTests
{ {
public class RaylibTests
{
private unsafe void CheckType<T>() where T : unmanaged private unsafe void CheckType<T>() where T : unmanaged
{ {
Assert.True(BlittableHelper.IsBlittable<T>()); Assert.True(BlittableHelper.IsBlittable<T>());
@ -42,5 +42,4 @@ namespace Raylib_cs.Tests
CheckType<VrStereoConfig>(); CheckType<VrStereoConfig>();
CheckType<RenderBatch>(); CheckType<RenderBatch>();
} }
}
} }

View File

@ -3,11 +3,11 @@ using System.Numerics;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Security; using System.Security;
namespace Raylib_cs namespace Raylib_cs;
[SuppressUnmanagedCodeSecurity]
public static unsafe partial class Raylib
{ {
[SuppressUnmanagedCodeSecurity]
public static unsafe partial class Raylib
{
/// <summary> /// <summary>
/// Used by DllImport to load the native library /// Used by DllImport to load the native library
/// </summary> /// </summary>
@ -2682,5 +2682,4 @@ namespace Raylib_cs
public static extern void DetachAudioMixedProcessor( public static extern void DetachAudioMixedProcessor(
delegate* unmanaged[Cdecl]<void*, uint, void> processor delegate* unmanaged[Cdecl]<void*, uint, void> processor
); );
}
} }

View File

@ -2,22 +2,22 @@ using System.Numerics;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Security; using System.Security;
namespace Raylib_cs namespace Raylib_cs;
// NOTE: Helper types to be used instead of array return types for *ToFloat functions
public unsafe struct Float3
{ {
// NOTE: Helper types to be used instead of array return types for *ToFloat functions
public unsafe struct Float3
{
public fixed float v[3]; public fixed float v[3];
} }
public unsafe struct Float16 public unsafe struct Float16
{ {
public fixed float v[16]; public fixed float v[16];
} }
[SuppressUnmanagedCodeSecurity] [SuppressUnmanagedCodeSecurity]
public static unsafe partial class Raymath public static unsafe partial class Raymath
{ {
/// <summary> /// <summary>
/// Used by DllImport to load the native library /// Used by DllImport to load the native library
/// </summary> /// </summary>
@ -540,5 +540,4 @@ namespace Raylib_cs
/// <summary>Check whether two given quaternions are almost equal</summary> /// <summary>Check whether two given quaternions are almost equal</summary>
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int QuaternionEquals(Quaternion p, Quaternion q); public static extern int QuaternionEquals(Quaternion p, Quaternion q);
}
} }

View File

@ -2,11 +2,11 @@ using System.Numerics;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Security; using System.Security;
namespace Raylib_cs namespace Raylib_cs;
[SuppressUnmanagedCodeSecurity]
public static unsafe partial class Rlgl
{ {
[SuppressUnmanagedCodeSecurity]
public static unsafe partial class Rlgl
{
/// <summary> /// <summary>
/// Used by DllImport to load the native library /// Used by DllImport to load the native library
/// </summary> /// </summary>
@ -803,5 +803,4 @@ namespace Raylib_cs
/// <summary>Load and draw a quad</summary> /// <summary>Load and draw a quad</summary>
[DllImport(NativeLibName, EntryPoint = "rlLoadDrawQuad", CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, EntryPoint = "rlLoadDrawQuad", CallingConvention = CallingConvention.Cdecl)]
public static extern void LoadDrawQuad(); public static extern void LoadDrawQuad();
}
} }

View File

@ -1,14 +1,14 @@
using System; using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Raylib_cs namespace Raylib_cs;
/// <summary>
/// Wave type, defines audio wave data
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public unsafe partial struct Wave
{ {
/// <summary>
/// Wave type, defines audio wave data
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public unsafe partial struct Wave
{
/// <summary> /// <summary>
/// Number of samples /// Number of samples
/// </summary> /// </summary>
@ -34,15 +34,15 @@ namespace Raylib_cs
/// Buffer data pointer /// Buffer data pointer
/// </summary> /// </summary>
public void* Data; public void* Data;
} }
/// <summary> /// <summary>
/// Audio stream type<br/> /// Audio stream type<br/>
/// NOTE: Useful to create custom audio streams not bound to a specific file /// NOTE: Useful to create custom audio streams not bound to a specific file
/// </summary> /// </summary>
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public partial struct AudioStream public partial struct AudioStream
{ {
//TODO: convert //TODO: convert
/// <summary> /// <summary>
/// Pointer to internal data(rAudioBuffer *) used by the audio system /// Pointer to internal data(rAudioBuffer *) used by the audio system
@ -68,14 +68,14 @@ namespace Raylib_cs
/// Number of channels (1-mono, 2-stereo) /// Number of channels (1-mono, 2-stereo)
/// </summary> /// </summary>
public uint Channels; public uint Channels;
} }
/// <summary> /// <summary>
/// Sound source type /// Sound source type
/// </summary> /// </summary>
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public partial struct Sound public partial struct Sound
{ {
/// <summary> /// <summary>
/// Audio stream /// Audio stream
/// </summary> /// </summary>
@ -85,15 +85,15 @@ namespace Raylib_cs
/// Total number of frames (considering channels) /// Total number of frames (considering channels)
/// </summary> /// </summary>
public uint FrameCount; public uint FrameCount;
} }
/// <summary> /// <summary>
/// Music stream type (audio file streaming from memory)<br/> /// Music stream type (audio file streaming from memory)<br/>
/// NOTE: Anything longer than ~10 seconds should be streamed /// NOTE: Anything longer than ~10 seconds should be streamed
/// </summary> /// </summary>
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public unsafe partial struct Music public unsafe partial struct Music
{ {
/// <summary> /// <summary>
/// Audio stream /// Audio stream
/// </summary> /// </summary>
@ -119,5 +119,4 @@ namespace Raylib_cs
/// Audio context data, depends on type /// Audio context data, depends on type
/// </summary> /// </summary>
public void* CtxData; public void* CtxData;
}
} }

View File

@ -1,12 +1,12 @@
using System.Numerics; using System.Numerics;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Raylib_cs namespace Raylib_cs;
/// <summary>Bounding box type</summary>
[StructLayout(LayoutKind.Sequential)]
public partial struct BoundingBox
{ {
/// <summary>Bounding box type</summary>
[StructLayout(LayoutKind.Sequential)]
public partial struct BoundingBox
{
/// <summary> /// <summary>
/// Minimum vertex box-corner /// Minimum vertex box-corner
/// </summary> /// </summary>
@ -22,5 +22,4 @@ namespace Raylib_cs
this.Min = min; this.Min = min;
this.Max = max; this.Max = max;
} }
}
} }

View File

@ -1,14 +1,14 @@
using System.Numerics; using System.Numerics;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Raylib_cs namespace Raylib_cs;
/// <summary>
/// Camera2D, defines position/orientation in 2d space
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public partial struct Camera2D
{ {
/// <summary>
/// Camera2D, defines position/orientation in 2d space
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public partial struct Camera2D
{
/// <summary> /// <summary>
/// Camera offset (displacement from target) /// Camera offset (displacement from target)
/// </summary> /// </summary>
@ -36,5 +36,4 @@ namespace Raylib_cs
this.Rotation = rotation; this.Rotation = rotation;
this.Zoom = zoom; this.Zoom = zoom;
} }
}
} }

View File

@ -1,35 +1,35 @@
using System.Numerics; using System.Numerics;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Raylib_cs namespace Raylib_cs;
/// <summary>
/// Camera system modes
/// </summary>
public enum CameraMode
{ {
/// <summary>
/// Camera system modes
/// </summary>
public enum CameraMode
{
CAMERA_CUSTOM = 0, CAMERA_CUSTOM = 0,
CAMERA_FREE, CAMERA_FREE,
CAMERA_ORBITAL, CAMERA_ORBITAL,
CAMERA_FIRST_PERSON, CAMERA_FIRST_PERSON,
CAMERA_THIRD_PERSON CAMERA_THIRD_PERSON
} }
/// <summary> /// <summary>
/// Camera projection /// Camera projection
/// </summary> /// </summary>
public enum CameraProjection public enum CameraProjection
{ {
CAMERA_PERSPECTIVE = 0, CAMERA_PERSPECTIVE = 0,
CAMERA_ORTHOGRAPHIC CAMERA_ORTHOGRAPHIC
} }
/// <summary> /// <summary>
/// Camera3D, defines position/orientation in 3d space /// Camera3D, defines position/orientation in 3d space
/// </summary> /// </summary>
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public partial struct Camera3D public partial struct Camera3D
{ {
/// <summary> /// <summary>
/// Camera position /// Camera position
/// </summary> /// </summary>
@ -63,5 +63,4 @@ namespace Raylib_cs
this.FovY = fovY; this.FovY = fovY;
this.Projection = projection; this.Projection = projection;
} }
}
} }

View File

@ -1,14 +1,14 @@
using System; using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Raylib_cs namespace Raylib_cs;
/// <summary>
/// Color type, RGBA (32bit)
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public partial struct Color
{ {
/// <summary>
/// Color type, RGBA (32bit)
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public partial struct Color
{
public byte R; public byte R;
public byte G; public byte G;
public byte B; public byte B;
@ -63,5 +63,4 @@ namespace Raylib_cs
{ {
return $"{{R:{R} G:{G} B:{B} A:{A}}}"; return $"{{R:{R} G:{G} B:{B} A:{A}}}";
} }
}
} }

View File

@ -1,15 +1,15 @@
using System; using System;
namespace Raylib_cs namespace Raylib_cs;
/// <summary>
/// System config flags<br/>
/// NOTE: Every bit registers one state (use it with bit masks)<br/>
/// By default all flags are set to 0
/// </summary>
[Flags]
public enum ConfigFlags : uint
{ {
/// <summary>
/// System config flags<br/>
/// NOTE: Every bit registers one state (use it with bit masks)<br/>
/// By default all flags are set to 0
/// </summary>
[Flags]
public enum ConfigFlags : uint
{
/// <summary> /// <summary>
/// Set to try enabling V-Sync on GPU /// Set to try enabling V-Sync on GPU
/// </summary> /// </summary>
@ -84,14 +84,14 @@ namespace Raylib_cs
/// Set to try enabling interlaced video format (for V3D) /// Set to try enabling interlaced video format (for V3D)
/// </summary> /// </summary>
FLAG_INTERLACED_HINT = 0x00010000, FLAG_INTERLACED_HINT = 0x00010000,
} }
/// <summary> /// <summary>
/// Trace log level<br/> /// Trace log level<br/>
/// NOTE: Organized by priority level /// NOTE: Organized by priority level
/// </summary> /// </summary>
public enum TraceLogLevel public enum TraceLogLevel
{ {
/// <summary> /// <summary>
/// Display all logs /// Display all logs
/// </summary> /// </summary>
@ -131,13 +131,13 @@ namespace Raylib_cs
/// Disable logging /// Disable logging
/// </summary> /// </summary>
LOG_NONE LOG_NONE
} }
/// <summary> /// <summary>
/// Color blending modes (pre-defined) /// Color blending modes (pre-defined)
/// </summary> /// </summary>
public enum BlendMode public enum BlendMode
{ {
/// <summary> /// <summary>
/// Blend textures considering alpha (default) /// Blend textures considering alpha (default)
/// </summary> /// </summary>
@ -177,5 +177,4 @@ namespace Raylib_cs
/// Blend textures using custom rgb/alpha separate src/dst factors (use rlSetBlendFactorsSeparate()) /// Blend textures using custom rgb/alpha separate src/dst factors (use rlSetBlendFactorsSeparate())
/// </summary> /// </summary>
BLEND_CUSTOM_SEPARATE BLEND_CUSTOM_SEPARATE
}
} }

View File

@ -1,12 +1,12 @@
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Raylib_cs namespace Raylib_cs;
/// <summary>
/// Font type, defines generation method
/// </summary>
public enum FontType
{ {
/// <summary>
/// Font type, defines generation method
/// </summary>
public enum FontType
{
/// <summary> /// <summary>
/// Default font generation, anti-aliased /// Default font generation, anti-aliased
/// </summary> /// </summary>
@ -21,14 +21,14 @@ namespace Raylib_cs
/// SDF font generation, requires external shader /// SDF font generation, requires external shader
/// </summary> /// </summary>
FONT_SDF FONT_SDF
} }
/// <summary> /// <summary>
/// GlyphInfo, font characters glyphs info /// GlyphInfo, font characters glyphs info
/// </summary> /// </summary>
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public partial struct GlyphInfo public partial struct GlyphInfo
{ {
/// <summary> /// <summary>
/// Character value (Unicode) /// Character value (Unicode)
/// </summary> /// </summary>
@ -53,14 +53,14 @@ namespace Raylib_cs
/// Character image data /// Character image data
/// </summary> /// </summary>
public Image Image; public Image Image;
} }
/// <summary> /// <summary>
/// Font, font texture and GlyphInfo array data /// Font, font texture and GlyphInfo array data
/// </summary> /// </summary>
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public unsafe partial struct Font public unsafe partial struct Font
{ {
/// <summary> /// <summary>
/// Base size (default chars height) /// Base size (default chars height)
/// </summary> /// </summary>
@ -90,5 +90,4 @@ namespace Raylib_cs
/// Glyphs info data /// Glyphs info data
/// </summary> /// </summary>
public GlyphInfo* Glyphs; public GlyphInfo* Glyphs;
}
} }

View File

@ -1,13 +1,13 @@
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Raylib_cs namespace Raylib_cs;
/// <summary>
/// Pixel formats<br/>
/// NOTE: Support depends on OpenGL version and platform
/// </summary>
public enum PixelFormat
{ {
/// <summary>
/// Pixel formats<br/>
/// NOTE: Support depends on OpenGL version and platform
/// </summary>
public enum PixelFormat
{
/// <summary> /// <summary>
/// 8 bit per pixel (no alpha) /// 8 bit per pixel (no alpha)
/// </summary> /// </summary>
@ -112,14 +112,14 @@ namespace Raylib_cs
/// 2 bpp /// 2 bpp
/// </summary> /// </summary>
PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA
} }
/// <summary> /// <summary>
/// Image, pixel data stored in CPU memory (RAM) /// Image, pixel data stored in CPU memory (RAM)
/// </summary> /// </summary>
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public unsafe partial struct Image public unsafe partial struct Image
{ {
/// <summary> /// <summary>
/// Image raw data /// Image raw data
/// </summary> /// </summary>
@ -144,5 +144,4 @@ namespace Raylib_cs
/// Data format (PixelFormat type) /// Data format (PixelFormat type)
/// </summary> /// </summary>
public PixelFormat Format; public PixelFormat Format;
}
} }

View File

@ -2,14 +2,14 @@ using System;
using System.Numerics; using System.Numerics;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Raylib_cs namespace Raylib_cs;
/// <summary>
/// Keyboard keys (US keyboard layout)<br/>
/// NOTE: Use GetKeyPressed() to allow redefining required keys for alternative layouts
/// </summary>
public enum KeyboardKey
{ {
/// <summary>
/// Keyboard keys (US keyboard layout)<br/>
/// NOTE: Use GetKeyPressed() to allow redefining required keys for alternative layouts
/// </summary>
public enum KeyboardKey
{
/// <summary> /// <summary>
/// NULL, used for no key pressed /// NULL, used for no key pressed
/// </summary> /// </summary>
@ -131,13 +131,13 @@ namespace Raylib_cs
KEY_MENU = 82, KEY_MENU = 82,
KEY_VOLUME_UP = 24, KEY_VOLUME_UP = 24,
KEY_VOLUME_DOWN = 25 KEY_VOLUME_DOWN = 25
} }
/// <summary> /// <summary>
/// Mouse buttons /// Mouse buttons
/// </summary> /// </summary>
public enum MouseButton public enum MouseButton
{ {
/// <summary> /// <summary>
/// Mouse button left /// Mouse button left
/// </summary> /// </summary>
@ -176,13 +176,13 @@ namespace Raylib_cs
MOUSE_LEFT_BUTTON = MOUSE_BUTTON_LEFT, MOUSE_LEFT_BUTTON = MOUSE_BUTTON_LEFT,
MOUSE_RIGHT_BUTTON = MOUSE_BUTTON_RIGHT, MOUSE_RIGHT_BUTTON = MOUSE_BUTTON_RIGHT,
MOUSE_MIDDLE_BUTTON = MOUSE_BUTTON_MIDDLE, MOUSE_MIDDLE_BUTTON = MOUSE_BUTTON_MIDDLE,
} }
/// <summary> /// <summary>
/// Mouse cursor /// Mouse cursor
/// </summary> /// </summary>
public enum MouseCursor public enum MouseCursor
{ {
/// <summary> /// <summary>
/// Default pointer shape /// Default pointer shape
/// </summary> /// </summary>
@ -237,11 +237,11 @@ namespace Raylib_cs
/// The operation-not-allowed shape /// The operation-not-allowed shape
/// </summary> /// </summary>
MOUSE_CURSOR_NOT_ALLOWED = 10 MOUSE_CURSOR_NOT_ALLOWED = 10
} }
/// <summary>Gamepad axis</summary> /// <summary>Gamepad axis</summary>
public enum GamepadAxis public enum GamepadAxis
{ {
/// <summary> /// <summary>
/// Gamepad left stick X axis /// Gamepad left stick X axis
/// </summary> /// </summary>
@ -271,13 +271,13 @@ namespace Raylib_cs
/// Gamepad back trigger right, pressure level: [1..-1] /// Gamepad back trigger right, pressure level: [1..-1]
/// </summary> /// </summary>
GAMEPAD_AXIS_RIGHT_TRIGGER = 5 GAMEPAD_AXIS_RIGHT_TRIGGER = 5
} }
/// <summary> /// <summary>
/// Gamepad buttons /// Gamepad buttons
/// </summary> /// </summary>
public enum GamepadButton public enum GamepadButton
{ {
/// <summary> /// <summary>
/// Unknown button, just for error checking /// Unknown button, just for error checking
/// </summary> /// </summary>
@ -367,15 +367,15 @@ namespace Raylib_cs
/// Gamepad joystick pressed button right /// Gamepad joystick pressed button right
/// </summary> /// </summary>
GAMEPAD_BUTTON_RIGHT_THUMB GAMEPAD_BUTTON_RIGHT_THUMB
} }
/// <summary> /// <summary>
/// Gesture /// Gesture
/// NOTE: It could be used as flags to enable only some gestures /// NOTE: It could be used as flags to enable only some gestures
/// </summary> /// </summary>
[Flags] [Flags]
public enum Gesture : uint public enum Gesture : uint
{ {
GESTURE_NONE = 0, GESTURE_NONE = 0,
GESTURE_TAP = 1, GESTURE_TAP = 1,
GESTURE_DOUBLETAP = 2, GESTURE_DOUBLETAP = 2,
@ -387,14 +387,14 @@ namespace Raylib_cs
GESTURE_SWIPE_DOWN = 128, GESTURE_SWIPE_DOWN = 128,
GESTURE_PINCH_IN = 256, GESTURE_PINCH_IN = 256,
GESTURE_PINCH_OUT = 512 GESTURE_PINCH_OUT = 512
} }
/// <summary> /// <summary>
/// Head-Mounted-Display device parameters /// Head-Mounted-Display device parameters
/// </summary> /// </summary>
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public unsafe partial struct VrDeviceInfo public unsafe partial struct VrDeviceInfo
{ {
/// <summary> /// <summary>
/// HMD horizontal resolution in pixels /// HMD horizontal resolution in pixels
/// </summary> /// </summary>
@ -444,14 +444,14 @@ namespace Raylib_cs
/// HMD chromatic aberration correction parameters /// HMD chromatic aberration correction parameters
/// </summary> /// </summary>
public fixed float ChromaAbCorrection[4]; public fixed float ChromaAbCorrection[4];
} }
/// <summary> /// <summary>
/// VR Stereo rendering configuration for simulator /// VR Stereo rendering configuration for simulator
/// </summary> /// </summary>
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public partial struct VrStereoConfig public partial struct VrStereoConfig
{ {
/// <summary> /// <summary>
/// VR projection matrices (per eye) /// VR projection matrices (per eye)
/// </summary> /// </summary>
@ -501,5 +501,4 @@ namespace Raylib_cs
/// VR distortion scale in /// VR distortion scale in
/// </summary> /// </summary>
public Vector2 ScaleIn; public Vector2 ScaleIn;
}
} }

View File

@ -4,10 +4,10 @@
using System; using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Raylib_cs namespace Raylib_cs;
internal readonly struct Native
{ {
internal readonly struct Native
{
internal const string Msvcrt = "msvcrt"; internal const string Msvcrt = "msvcrt";
internal const string Libc = "libc"; internal const string Libc = "libc";
internal const string LibSystem = "libSystem"; internal const string LibSystem = "libSystem";
@ -26,22 +26,22 @@ namespace Raylib_cs
[DllImport(Msvcrt, EntryPoint = "vsnprintf", CallingConvention = CallingConvention.Cdecl)] [DllImport(Msvcrt, EntryPoint = "vsnprintf", CallingConvention = CallingConvention.Cdecl)]
public static extern int VsnPrintfWindows(IntPtr buffer, UIntPtr size, IntPtr format, IntPtr args); public static extern int VsnPrintfWindows(IntPtr buffer, UIntPtr size, IntPtr format, IntPtr args);
} }
[StructLayout(LayoutKind.Sequential, Pack = 4)] [StructLayout(LayoutKind.Sequential, Pack = 4)]
struct VaListLinuxX64 struct VaListLinuxX64
{ {
uint _gpOffset; uint _gpOffset;
uint _fpOffset; uint _fpOffset;
IntPtr _overflowArgArea; IntPtr _overflowArgArea;
IntPtr _regSaveArea; IntPtr _regSaveArea;
} }
/// <summary> /// <summary>
/// Logging workaround for formatting strings from native code /// Logging workaround for formatting strings from native code
/// </summary> /// </summary>
public static unsafe class Logging public static unsafe class Logging
{ {
[UnmanagedCallersOnly(CallConvs = new[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] [UnmanagedCallersOnly(CallConvs = new[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
public static unsafe void LogConsole(int msgType, sbyte* text, sbyte* args) public static unsafe void LogConsole(int msgType, sbyte* text, sbyte* args)
{ {
@ -160,5 +160,4 @@ namespace Raylib_cs
} }
return -1; return -1;
} }
}
} }

View File

@ -1,12 +1,12 @@
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Raylib_cs namespace Raylib_cs;
/// <summary>
/// Material map index
/// </summary>
public enum MaterialMapIndex
{ {
/// <summary>
/// Material map index
/// </summary>
public enum MaterialMapIndex
{
/// <summary> /// <summary>
/// NOTE: Same as MATERIAL_MAP_DIFFUSE /// NOTE: Same as MATERIAL_MAP_DIFFUSE
/// </summary> /// </summary>
@ -42,14 +42,14 @@ namespace Raylib_cs
MATERIAL_MAP_DIFFUSE = MATERIAL_MAP_ALBEDO, MATERIAL_MAP_DIFFUSE = MATERIAL_MAP_ALBEDO,
MATERIAL_MAP_SPECULAR = MATERIAL_MAP_METALNESS, MATERIAL_MAP_SPECULAR = MATERIAL_MAP_METALNESS,
} }
/// <summary> /// <summary>
/// Material texture map /// Material texture map
/// </summary> /// </summary>
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public partial struct MaterialMap public partial struct MaterialMap
{ {
/// <summary> /// <summary>
/// Material map texture /// Material map texture
/// </summary> /// </summary>
@ -64,14 +64,14 @@ namespace Raylib_cs
/// Material map value /// Material map value
/// </summary> /// </summary>
public float Value; public float Value;
} }
/// <summary> /// <summary>
/// Material type (generic) /// Material type (generic)
/// </summary> /// </summary>
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public unsafe partial struct Material public unsafe partial struct Material
{ {
/// <summary> /// <summary>
/// Material shader /// Material shader
/// </summary> /// </summary>
@ -87,5 +87,4 @@ namespace Raylib_cs
/// Material generic parameters (if required) /// Material generic parameters (if required)
/// </summary> /// </summary>
public fixed float Param[4]; public fixed float Param[4];
}
} }

View File

@ -1,14 +1,14 @@
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Raylib_cs namespace Raylib_cs;
/// <summary>
/// Vertex data definning a mesh<br/>
/// NOTE: Data stored in CPU memory (and GPU)
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public unsafe partial struct Mesh
{ {
/// <summary>
/// Vertex data definning a mesh<br/>
/// NOTE: Data stored in CPU memory (and GPU)
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public unsafe partial struct Mesh
{
/// <summary> /// <summary>
/// Number of vertices stored in arrays /// Number of vertices stored in arrays
/// </summary> /// </summary>
@ -95,5 +95,4 @@ namespace Raylib_cs
public uint* VboId; public uint* VboId;
#endregion #endregion
}
} }

View File

@ -2,14 +2,14 @@ using System;
using System.Numerics; using System.Numerics;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Raylib_cs namespace Raylib_cs;
/// <summary>
/// Bone information
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public unsafe partial struct BoneInfo
{ {
/// <summary>
/// Bone information
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public unsafe partial struct BoneInfo
{
/// <summary> /// <summary>
/// Bone name (char[32]) /// Bone name (char[32])
/// </summary> /// </summary>
@ -19,14 +19,14 @@ namespace Raylib_cs
/// Bone parent /// Bone parent
/// </summary> /// </summary>
public int Parent; public int Parent;
} }
/// <summary> /// <summary>
/// Model type /// Model type
/// </summary> /// </summary>
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public unsafe partial struct Model public unsafe partial struct Model
{ {
/// <summary> /// <summary>
/// Local transform matrix /// Local transform matrix
/// </summary> /// </summary>
@ -73,14 +73,14 @@ namespace Raylib_cs
/// Bones base transformation (pose, Transform *) /// Bones base transformation (pose, Transform *)
/// </summary> /// </summary>
public Transform* BindPose; public Transform* BindPose;
} }
/// <summary> /// <summary>
/// Model animation /// Model animation
/// </summary> /// </summary>
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public readonly unsafe partial struct ModelAnimation public readonly unsafe partial struct ModelAnimation
{ {
/// <summary> /// <summary>
/// Number of bones /// Number of bones
/// </summary> /// </summary>
@ -126,10 +126,10 @@ namespace Raylib_cs
this._boneCount = boneCount; this._boneCount = boneCount;
} }
} }
} }
public unsafe struct FramePoses public unsafe struct FramePoses
{ {
readonly Transform* _poses; readonly Transform* _poses;
readonly int _count; readonly int _count;
@ -141,5 +141,4 @@ namespace Raylib_cs
this._poses = poses; this._poses = poses;
this._count = count; this._count = count;
} }
}
} }

View File

@ -1,12 +1,12 @@
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Raylib_cs namespace Raylib_cs;
/// <summary>
/// N-patch layout
/// </summary>
public enum NPatchLayout
{ {
/// <summary>
/// N-patch layout
/// </summary>
public enum NPatchLayout
{
/// <summary> /// <summary>
/// Npatch defined by 3x3 tiles /// Npatch defined by 3x3 tiles
/// </summary> /// </summary>
@ -21,14 +21,14 @@ namespace Raylib_cs
/// Npatch defined by 3x1 tiles /// Npatch defined by 3x1 tiles
/// </summary> /// </summary>
NPATCH_THREE_PATCH_HORIZONTAL NPATCH_THREE_PATCH_HORIZONTAL
} }
/// <summary> /// <summary>
/// N-Patch layout info /// N-Patch layout info
/// </summary> /// </summary>
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public partial struct NPatchInfo public partial struct NPatchInfo
{ {
/// <summary> /// <summary>
/// Texture source rectangle /// Texture source rectangle
/// </summary> /// </summary>
@ -58,5 +58,4 @@ namespace Raylib_cs
/// Layout of the n-patch: 3x3, 1x3 or 3x1 /// Layout of the n-patch: 3x3, 1x3 or 3x1
/// </summary> /// </summary>
public NPatchLayout Layout; public NPatchLayout Layout;
}
} }

View File

@ -1,14 +1,14 @@
using System.Numerics; using System.Numerics;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Raylib_cs namespace Raylib_cs;
/// <summary>
/// Ray, ray for raycasting
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public partial struct Ray
{ {
/// <summary>
/// Ray, ray for raycasting
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public partial struct Ray
{
/// <summary> /// <summary>
/// Ray position (origin) /// Ray position (origin)
/// </summary> /// </summary>
@ -24,14 +24,14 @@ namespace Raylib_cs
this.Position = position; this.Position = position;
this.Direction = direction; this.Direction = direction;
} }
} }
/// <summary> /// <summary>
/// Raycast hit information /// Raycast hit information
/// </summary> /// </summary>
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public partial struct RayCollision public partial struct RayCollision
{ {
/// <summary> /// <summary>
/// Did the ray hit something? /// Did the ray hit something?
/// </summary> /// </summary>
@ -51,5 +51,4 @@ namespace Raylib_cs
/// Surface normal of hit /// Surface normal of hit
/// </summary> /// </summary>
public Vector3 Normal; public Vector3 Normal;
}
} }

View File

@ -2,10 +2,10 @@ using System;
using System.Numerics; using System.Numerics;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Raylib_cs namespace Raylib_cs;
public static unsafe partial class Raylib
{ {
public static unsafe partial class Raylib
{
/// <summary>Initialize window and OpenGL context</summary> /// <summary>Initialize window and OpenGL context</summary>
public static void InitWindow(int width, int height, string title) public static void InitWindow(int width, int height, string title)
{ {
@ -1102,5 +1102,4 @@ namespace Raylib_cs
{ {
model.Materials[materialIndex].Shader = shader; model.Materials[materialIndex].Shader = shader;
} }
}
} }

View File

@ -1,13 +1,13 @@
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Raylib_cs namespace Raylib_cs;
/// <summary>
/// Rectangle type
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public partial struct Rectangle
{ {
/// <summary>
/// Rectangle type
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public partial struct Rectangle
{
public float X; public float X;
public float Y; public float Y;
public float Width; public float Width;
@ -25,5 +25,4 @@ namespace Raylib_cs
{ {
return $"{{X:{X} Y:{Y} Width:{Width} Height:{Height}}}"; return $"{{X:{X} Y:{Y} Width:{Width} Height:{Height}}}";
} }
}
} }

View File

@ -1,13 +1,13 @@
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Raylib_cs namespace Raylib_cs;
/// <summary>
/// RenderBatch type
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public unsafe partial struct RenderBatch
{ {
/// <summary>
/// RenderBatch type
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public unsafe partial struct RenderBatch
{
/// <summary> /// <summary>
/// Number of vertex buffers (multi-buffering support) /// Number of vertex buffers (multi-buffering support)
/// </summary> /// </summary>
@ -37,14 +37,14 @@ namespace Raylib_cs
/// Current depth value for next draw /// Current depth value for next draw
/// </summary> /// </summary>
float _currentDepth; float _currentDepth;
} }
/// <summary> /// <summary>
/// Dynamic vertex buffers (position + texcoords + colors + indices arrays) /// Dynamic vertex buffers (position + texcoords + colors + indices arrays)
/// </summary> /// </summary>
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public unsafe partial struct VertexBuffer public unsafe partial struct VertexBuffer
{ {
/// <summary> /// <summary>
/// Number of elements in the buffer (QUADS) /// Number of elements in the buffer (QUADS)
/// </summary> /// </summary>
@ -81,14 +81,14 @@ namespace Raylib_cs
/// OpenGL Vertex Buffer Objects id (4 types of vertex data) /// OpenGL Vertex Buffer Objects id (4 types of vertex data)
/// </summary> /// </summary>
public fixed uint VboId[4]; public fixed uint VboId[4];
} }
/// <summary> /// <summary>
/// Dynamic vertex buffers (position + texcoords + colors + indices arrays) /// Dynamic vertex buffers (position + texcoords + colors + indices arrays)
/// </summary> /// </summary>
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public partial struct DrawCall public partial struct DrawCall
{ {
/// <summary> /// <summary>
/// Drawing mode: LINES, TRIANGLES, QUADS /// Drawing mode: LINES, TRIANGLES, QUADS
/// </summary> /// </summary>
@ -108,19 +108,19 @@ namespace Raylib_cs
/// Texture id to be used on the draw -> Use to create new draw call if changes /// Texture id to be used on the draw -> Use to create new draw call if changes
/// </summary> /// </summary>
uint _textureId; uint _textureId;
} }
public enum GlVersion public enum GlVersion
{ {
OPENGL_11 = 1, OPENGL_11 = 1,
OPENGL_21, OPENGL_21,
OPENGL_33, OPENGL_33,
OPENGL_43, OPENGL_43,
OPENGL_ES_20 OPENGL_ES_20
} }
public enum FramebufferAttachType public enum FramebufferAttachType
{ {
RL_ATTACHMENT_COLOR_CHANNEL0 = 0, RL_ATTACHMENT_COLOR_CHANNEL0 = 0,
RL_ATTACHMENT_COLOR_CHANNEL1, RL_ATTACHMENT_COLOR_CHANNEL1,
RL_ATTACHMENT_COLOR_CHANNEL2, RL_ATTACHMENT_COLOR_CHANNEL2,
@ -131,10 +131,10 @@ namespace Raylib_cs
RL_ATTACHMENT_COLOR_CHANNEL7, RL_ATTACHMENT_COLOR_CHANNEL7,
RL_ATTACHMENT_DEPTH = 100, RL_ATTACHMENT_DEPTH = 100,
RL_ATTACHMENT_STENCIL = 200, RL_ATTACHMENT_STENCIL = 200,
} }
public enum FramebufferAttachTextureType public enum FramebufferAttachTextureType
{ {
RL_ATTACHMENT_CUBEMAP_POSITIVE_X = 0, RL_ATTACHMENT_CUBEMAP_POSITIVE_X = 0,
RL_ATTACHMENT_CUBEMAP_NEGATIVE_X, RL_ATTACHMENT_CUBEMAP_NEGATIVE_X,
RL_ATTACHMENT_CUBEMAP_POSITIVE_Y, RL_ATTACHMENT_CUBEMAP_POSITIVE_Y,
@ -143,13 +143,13 @@ namespace Raylib_cs
RL_ATTACHMENT_CUBEMAP_NEGATIVE_Z, RL_ATTACHMENT_CUBEMAP_NEGATIVE_Z,
RL_ATTACHMENT_TEXTURE2D = 100, RL_ATTACHMENT_TEXTURE2D = 100,
RL_ATTACHMENT_RENDERBUFFER = 200, RL_ATTACHMENT_RENDERBUFFER = 200,
} }
/// <summary> /// <summary>
/// Matrix Modes (equivalent to OpenGL) /// Matrix Modes (equivalent to OpenGL)
/// </summary> /// </summary>
public enum MatrixMode public enum MatrixMode
{ {
/// <summary> /// <summary>
/// GL_MODELVIEW /// GL_MODELVIEW
/// </summary> /// </summary>
@ -164,13 +164,13 @@ namespace Raylib_cs
/// GL_TEXTURE /// GL_TEXTURE
/// </summary> /// </summary>
TEXTURE = 0x1702 TEXTURE = 0x1702
} }
/// <summary> /// <summary>
/// Primitive assembly draw modes /// Primitive assembly draw modes
/// </summary> /// </summary>
public enum DrawMode public enum DrawMode
{ {
/// <summary> /// <summary>
/// GL_LINES /// GL_LINES
/// </summary> /// </summary>
@ -185,13 +185,13 @@ namespace Raylib_cs
/// GL_QUADS /// GL_QUADS
/// </summary> /// </summary>
QUADS = 0x0007 QUADS = 0x0007
} }
/// <summary> /// <summary>
/// Texture parameters (equivalent to OpenGL defines) /// Texture parameters (equivalent to OpenGL defines)
/// </summary> /// </summary>
public enum TextureFilters public enum TextureFilters
{ {
/// <summary> /// <summary>
/// RL_TEXTURE_FILTER_NEAREST /// RL_TEXTURE_FILTER_NEAREST
/// <br/> /// <br/>
@ -240,13 +240,13 @@ namespace Raylib_cs
/// Anisotropic filter (custom identifier) /// Anisotropic filter (custom identifier)
/// </summary> /// </summary>
ANISOTROPIC = 0x3000 ANISOTROPIC = 0x3000
} }
/// <summary> /// <summary>
/// GL Shader type /// GL Shader type
/// </summary> /// </summary>
public enum ShaderType public enum ShaderType
{ {
/// <summary> /// <summary>
/// RL_FRAGMENT_SHADER /// RL_FRAGMENT_SHADER
/// <br/> /// <br/>
@ -267,5 +267,4 @@ namespace Raylib_cs
/// GL_COMPUTE_SHADER /// GL_COMPUTE_SHADER
/// </summary> /// </summary>
COMPUTE = 0x91b9 COMPUTE = 0x91b9
}
} }

View File

@ -1,13 +1,13 @@
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Raylib_cs namespace Raylib_cs;
/// <summary>
/// RenderTexture2D type, for texture rendering
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public partial struct RenderTexture2D
{ {
/// <summary>
/// RenderTexture2D type, for texture rendering
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public partial struct RenderTexture2D
{
/// <summary> /// <summary>
/// OpenGL Framebuffer Object (FBO) id /// OpenGL Framebuffer Object (FBO) id
/// </summary> /// </summary>
@ -22,5 +22,4 @@ namespace Raylib_cs
/// Depth buffer attachment texture /// Depth buffer attachment texture
/// </summary> /// </summary>
public Texture2D Depth; public Texture2D Depth;
}
} }

View File

@ -1,12 +1,12 @@
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Raylib_cs namespace Raylib_cs;
/// <summary>
/// Shader location index
/// </summary>
public enum ShaderLocationIndex
{ {
/// <summary>
/// Shader location index
/// </summary>
public enum ShaderLocationIndex
{
SHADER_LOC_VERTEX_POSITION = 0, SHADER_LOC_VERTEX_POSITION = 0,
SHADER_LOC_VERTEX_TEXCOORD01, SHADER_LOC_VERTEX_TEXCOORD01,
SHADER_LOC_VERTEX_TEXCOORD02, SHADER_LOC_VERTEX_TEXCOORD02,
@ -36,24 +36,24 @@ namespace Raylib_cs
SHADER_LOC_MAP_DIFFUSE = SHADER_LOC_MAP_ALBEDO, SHADER_LOC_MAP_DIFFUSE = SHADER_LOC_MAP_ALBEDO,
SHADER_LOC_MAP_SPECULAR = SHADER_LOC_MAP_METALNESS, SHADER_LOC_MAP_SPECULAR = SHADER_LOC_MAP_METALNESS,
} }
/// <summary> /// <summary>
/// Shader attribute data types /// Shader attribute data types
/// </summary> /// </summary>
public enum ShaderAttributeDataType public enum ShaderAttributeDataType
{ {
SHADER_ATTRIB_FLOAT = 0, SHADER_ATTRIB_FLOAT = 0,
SHADER_ATTRIB_VEC2, SHADER_ATTRIB_VEC2,
SHADER_ATTRIB_VEC3, SHADER_ATTRIB_VEC3,
SHADER_ATTRIB_VEC4 SHADER_ATTRIB_VEC4
} }
/// <summary> /// <summary>
/// Shader uniform data type /// Shader uniform data type
/// </summary> /// </summary>
public enum ShaderUniformDataType public enum ShaderUniformDataType
{ {
SHADER_UNIFORM_FLOAT = 0, SHADER_UNIFORM_FLOAT = 0,
SHADER_UNIFORM_VEC2, SHADER_UNIFORM_VEC2,
SHADER_UNIFORM_VEC3, SHADER_UNIFORM_VEC3,
@ -63,14 +63,14 @@ namespace Raylib_cs
SHADER_UNIFORM_IVEC3, SHADER_UNIFORM_IVEC3,
SHADER_UNIFORM_IVEC4, SHADER_UNIFORM_IVEC4,
SHADER_UNIFORM_SAMPLER2D SHADER_UNIFORM_SAMPLER2D
} }
/// <summary> /// <summary>
/// Shader type (generic) /// Shader type (generic)
/// </summary> /// </summary>
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public unsafe partial struct Shader public unsafe partial struct Shader
{ {
/// <summary> /// <summary>
/// Shader program id /// Shader program id
/// </summary> /// </summary>
@ -80,5 +80,4 @@ namespace Raylib_cs
/// Shader locations array (MAX_SHADER_LOCATIONS, int *) /// Shader locations array (MAX_SHADER_LOCATIONS, int *)
/// </summary> /// </summary>
public int* Locs; public int* Locs;
}
} }

View File

@ -1,14 +1,14 @@
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Raylib_cs namespace Raylib_cs;
/// <summary>
/// Texture parameters: filter mode<br/>
/// NOTE 1: Filtering considers mipmaps if available in the texture<br/>
/// NOTE 2: Filter is accordingly set for minification and magnification
/// </summary>
public enum TextureFilter
{ {
/// <summary>
/// Texture parameters: filter mode<br/>
/// NOTE 1: Filtering considers mipmaps if available in the texture<br/>
/// NOTE 2: Filter is accordingly set for minification and magnification
/// </summary>
public enum TextureFilter
{
/// <summary> /// <summary>
/// No filter, just pixel aproximation /// No filter, just pixel aproximation
/// </summary> /// </summary>
@ -38,13 +38,13 @@ namespace Raylib_cs
/// Anisotropic filtering 16x /// Anisotropic filtering 16x
/// </summary> /// </summary>
TEXTURE_FILTER_ANISOTROPIC_16X, TEXTURE_FILTER_ANISOTROPIC_16X,
} }
/// <summary> /// <summary>
/// Texture parameters: wrap mode /// Texture parameters: wrap mode
/// </summary> /// </summary>
public enum TextureWrap public enum TextureWrap
{ {
/// <summary> /// <summary>
/// Repeats texture in tiled mode /// Repeats texture in tiled mode
/// </summary> /// </summary>
@ -64,13 +64,13 @@ namespace Raylib_cs
/// Mirrors and clamps to border the texture in tiled mode /// Mirrors and clamps to border the texture in tiled mode
/// </summary> /// </summary>
TEXTURE_WRAP_MIRROR_CLAMP TEXTURE_WRAP_MIRROR_CLAMP
} }
/// <summary> /// <summary>
/// Cubemap layouts /// Cubemap layouts
/// </summary> /// </summary>
public enum CubemapLayout public enum CubemapLayout
{ {
/// <summary> /// <summary>
/// Automatically detect layout type /// Automatically detect layout type
/// </summary> /// </summary>
@ -100,15 +100,15 @@ namespace Raylib_cs
/// Layout is defined by a panorama image (equirectangular map) /// Layout is defined by a panorama image (equirectangular map)
/// </summary> /// </summary>
CUBEMAP_LAYOUT_PANORAMA CUBEMAP_LAYOUT_PANORAMA
} }
/// <summary> /// <summary>
/// Texture2D type<br/> /// Texture2D type<br/>
/// NOTE: Data stored in GPU memory /// NOTE: Data stored in GPU memory
/// </summary> /// </summary>
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public partial struct Texture2D public partial struct Texture2D
{ {
/// <summary> /// <summary>
/// OpenGL texture id /// OpenGL texture id
/// </summary> /// </summary>
@ -133,5 +133,4 @@ namespace Raylib_cs
/// Data format (PixelFormat type) /// Data format (PixelFormat type)
/// </summary> /// </summary>
public PixelFormat Format; public PixelFormat Format;
}
} }

View File

@ -1,14 +1,14 @@
using System.Numerics; using System.Numerics;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Raylib_cs namespace Raylib_cs;
/// <summary>
/// Transform, vectex transformation data
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public partial struct Transform
{ {
/// <summary>
/// Transform, vectex transformation data
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public partial struct Transform
{
/// <summary> /// <summary>
/// Translation /// Translation
/// </summary> /// </summary>
@ -23,5 +23,4 @@ namespace Raylib_cs
/// Scale /// Scale
/// </summary> /// </summary>
public Vector3 Scale; public Vector3 Scale;
}
} }

View File

@ -1,13 +1,13 @@
using System; using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Raylib_cs namespace Raylib_cs;
/// <summary>
/// Converts text to a Ansi buffer for passing to native code
/// </summary>
public readonly ref struct AnsiBuffer
{ {
/// <summary>
/// Converts text to a Ansi buffer for passing to native code
/// </summary>
public readonly ref struct AnsiBuffer
{
private readonly IntPtr _data; private readonly IntPtr _data;
public AnsiBuffer(string text) public AnsiBuffer(string text)
@ -24,13 +24,12 @@ namespace Raylib_cs
{ {
Marshal.FreeHGlobal(_data); Marshal.FreeHGlobal(_data);
} }
} }
public static class AnsiStringUtils public static class AnsiStringUtils
{ {
public static AnsiBuffer ToAnsiBuffer(this string text) public static AnsiBuffer ToAnsiBuffer(this string text)
{ {
return new AnsiBuffer(text); return new AnsiBuffer(text);
} }
}
} }

View File

@ -1,11 +1,11 @@
using System; using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Raylib_cs namespace Raylib_cs;
[StructLayout(LayoutKind.Sequential)]
public readonly struct CBool
{ {
[StructLayout(LayoutKind.Sequential)]
public readonly struct CBool
{
/* The values of booleans in C++ are stored in a single byte, which means it /* The values of booleans in C++ are stored in a single byte, which means it
* only supports values from -128 to 127. It is possible to argument that * only supports values from -128 to 127. It is possible to argument that
* they only support a single bit, yes, but the minimum storage unit of a * they only support a single bit, yes, but the minimum storage unit of a
@ -20,7 +20,10 @@ namespace Raylib_cs
* *
* 'value' is visible and constructable (if necessary), but impossible to modify or access. * 'value' is visible and constructable (if necessary), but impossible to modify or access.
*/ */
public sbyte Value { init; private get; } public sbyte Value
{
init; private get;
}
// Constructors for easier usage. // Constructors for easier usage.
public CBool(bool value) public CBool(bool value)
@ -83,5 +86,4 @@ namespace Raylib_cs
{ {
return ((bool)this).ToString(); return ((bool)this).ToString();
} }
}
} }

View File

@ -1,13 +1,13 @@
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Raylib_cs namespace Raylib_cs;
/// <summary>
/// File path list
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public unsafe struct FilePathList
{ {
/// <summary>
/// File path list
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public unsafe struct FilePathList
{
/// <summary> /// <summary>
/// Filepaths max entries /// Filepaths max entries
/// </summary> /// </summary>
@ -22,5 +22,4 @@ namespace Raylib_cs
/// Filepaths entries /// Filepaths entries
/// </summary> /// </summary>
public byte** Paths; public byte** Paths;
}
} }

View File

@ -1,14 +1,14 @@
using System; using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Text; using System.Text;
namespace Raylib_cs namespace Raylib_cs;
/// <summary>
/// Converts text to a UTF8 buffer for passing to native code
/// </summary>
public readonly ref struct Utf8Buffer
{ {
/// <summary>
/// Converts text to a UTF8 buffer for passing to native code
/// </summary>
public readonly ref struct Utf8Buffer
{
private readonly IntPtr _data; private readonly IntPtr _data;
public Utf8Buffer(string text) public Utf8Buffer(string text)
@ -25,10 +25,10 @@ namespace Raylib_cs
{ {
Marshal.ZeroFreeCoTaskMemUTF8(_data); Marshal.ZeroFreeCoTaskMemUTF8(_data);
} }
} }
public static class Utf8StringUtils public static class Utf8StringUtils
{ {
public static Utf8Buffer ToUtf8Buffer(this string text) public static Utf8Buffer ToUtf8Buffer(this string text)
{ {
return new Utf8Buffer(text); return new Utf8Buffer(text);
@ -59,5 +59,4 @@ namespace Raylib_cs
{ {
return Encoding.UTF8.GetBytes(text); return Encoding.UTF8.GetBytes(text);
} }
}
} }