Made Vectors CRepr

This commit is contained in:
Simon Lübeß
2025-06-17 14:43:26 +02:00
parent 07faafd28d
commit 9b6bb2b8d8
9 changed files with 23 additions and 22 deletions
+1 -2
View File
@@ -4,8 +4,7 @@ using System;
namespace GlitchyEngine.Math namespace GlitchyEngine.Math
{ {
/// Represents a four component color with 8 bit per channel /// Represents a four component color with 8 bit per channel
[CRepr] [BonTarget, CRepr]
[BonTarget]
public struct Color public struct Color
{ {
// from DirectXColors.h // from DirectXColors.h
+1 -2
View File
@@ -6,8 +6,7 @@ using internal GlitchyEngine.Math;
namespace GlitchyEngine.Math namespace GlitchyEngine.Math
{ {
/// Represents an RGB color. /// Represents an RGB color.
[CRepr] [BonTarget, CRepr]
[BonTarget]
public struct ColorRGB public struct ColorRGB
{ {
/** /**
+1 -2
View File
@@ -14,8 +14,7 @@ namespace GlitchyEngine.Math
/** /**
Represents a four component floating point color Represents a four component floating point color
*/ */
[BonTarget] [BonTarget, CRepr]
[CRepr]
struct ColorRGBA struct ColorRGBA
{ {
// from DirectXColors.h // from DirectXColors.h
+1 -1
View File
@@ -3,7 +3,7 @@ using System;
namespace GlitchyEngine.Math namespace GlitchyEngine.Math
{ {
[BonTarget] [BonTarget, CRepr]
public struct Quaternion public struct Quaternion
{ {
public const Quaternion Zero = .(); public const Quaternion Zero = .();
+4 -3
View File
@@ -1,8 +1,9 @@
using Bon; using Bon;
using System;
namespace GlitchyEngine.Math; namespace GlitchyEngine.Math;
[BonTarget] [BonTarget, CRepr]
[Vector<bool, 2>] [Vector<bool, 2>]
[SwizzleVector(2, "GlitchyEngine.Math.bool")] [SwizzleVector(2, "GlitchyEngine.Math.bool")]
struct bool2 struct bool2
@@ -10,7 +11,7 @@ struct bool2
} }
[BonTarget] [BonTarget, CRepr]
[Vector<bool, 3>] [Vector<bool, 3>]
[SwizzleVector(3, "GlitchyEngine.Math.bool")] [SwizzleVector(3, "GlitchyEngine.Math.bool")]
struct bool3 struct bool3
@@ -18,7 +19,7 @@ struct bool3
} }
[BonTarget] [BonTarget, CRepr]
[Vector<bool, 4>] [Vector<bool, 4>]
[SwizzleVector(4, "GlitchyEngine.Math.bool")] [SwizzleVector(4, "GlitchyEngine.Math.bool")]
struct bool4 struct bool4
+3 -3
View File
@@ -3,7 +3,7 @@ using System;
namespace GlitchyEngine.Math; namespace GlitchyEngine.Math;
[BonTarget] [BonTarget, CRepr]
[Vector<double, 2>] [Vector<double, 2>]
[ComparableVector<double, 2>] [ComparableVector<double, 2>]
[VectorMath<double, 2>] [VectorMath<double, 2>]
@@ -36,7 +36,7 @@ public struct double2
} }
} }
[BonTarget] [BonTarget, CRepr]
[Vector<double, 3>] [Vector<double, 3>]
[ComparableVector<double, 3>] [ComparableVector<double, 3>]
[VectorMath<double, 3>] [VectorMath<double, 3>]
@@ -77,7 +77,7 @@ public struct double3
} }
} }
[BonTarget] [BonTarget, CRepr]
[Vector<double, 4>] [Vector<double, 4>]
[ComparableVector<double, 4>] [ComparableVector<double, 4>]
[VectorMath<double, 4>] [VectorMath<double, 4>]
+3 -3
View File
@@ -3,7 +3,7 @@ using System;
namespace GlitchyEngine.Math; namespace GlitchyEngine.Math;
[BonTarget] [BonTarget, CRepr]
[Vector<float, 2>] [Vector<float, 2>]
[ComparableVector<float, 2>] [ComparableVector<float, 2>]
[VectorMath<float, 2>] [VectorMath<float, 2>]
@@ -34,7 +34,7 @@ public struct float2
public static implicit operator Self(in Box2D.b2Vec2 value) => *(Self*)&value; public static implicit operator Self(in Box2D.b2Vec2 value) => *(Self*)&value;
} }
[BonTarget] [BonTarget, CRepr]
[Vector<float, 3>] [Vector<float, 3>]
[ComparableVector<float, 3>] [ComparableVector<float, 3>]
[VectorMath<float, 3>] [VectorMath<float, 3>]
@@ -65,7 +65,7 @@ public struct float3
} }
} }
[BonTarget] [BonTarget, CRepr]
[Vector<float, 4>] [Vector<float, 4>]
[ComparableVector<float, 4>] [ComparableVector<float, 4>]
[VectorMath<float, 4>] [VectorMath<float, 4>]
+3 -3
View File
@@ -3,7 +3,7 @@ using System;
namespace GlitchyEngine.Math; namespace GlitchyEngine.Math;
[BonTarget] [BonTarget, CRepr]
[Vector<half, 2>] [Vector<half, 2>]
[ComparableVector<half, 2>] [ComparableVector<half, 2>]
[VectorMath<half, 2>] [VectorMath<half, 2>]
@@ -16,7 +16,7 @@ public struct half2
} }
} }
[BonTarget] [BonTarget, CRepr]
[Vector<half, 3>] [Vector<half, 3>]
[ComparableVector<half, 3>] [ComparableVector<half, 3>]
[VectorMath<half, 3>] [VectorMath<half, 3>]
@@ -29,7 +29,7 @@ public struct half3
} }
} }
[BonTarget] [BonTarget, CRepr]
[Vector<half, 4>] [Vector<half, 4>]
[ComparableVector<half, 4>] [ComparableVector<half, 4>]
[VectorMath<half, 4>] [VectorMath<half, 4>]
+6 -3
View File
@@ -3,7 +3,7 @@ using System;
namespace GlitchyEngine.Math; namespace GlitchyEngine.Math;
[BonTarget] [BonTarget, CRepr]
[Vector<int32, 2>] [Vector<int32, 2>]
[ComparableVector<int32, 2>] [ComparableVector<int32, 2>]
[VectorMath<int32, 2>] [VectorMath<int32, 2>]
@@ -26,7 +26,7 @@ public struct int2
} }
} }
[BonTarget] [BonTarget, CRepr]
[Vector<int32, 3>] [Vector<int32, 3>]
[ComparableVector<int32, 3>] [ComparableVector<int32, 3>]
[VectorMath<int32, 3>] [VectorMath<int32, 3>]
@@ -50,7 +50,7 @@ public struct int3
} }
} }
[BonTarget] [BonTarget, CRepr]
[Vector<int32, 4>] [Vector<int32, 4>]
[ComparableVector<int32, 4>] [ComparableVector<int32, 4>]
[VectorMath<int32, 4>] [VectorMath<int32, 4>]
@@ -80,6 +80,7 @@ public struct int4
[ComparableVector<uint32, 2>] [ComparableVector<uint32, 2>]
//[VectorMath<uint32, 2>] //[VectorMath<uint32, 2>]
[SwizzleVector(2, "GlitchyEngine.Math.uint")] [SwizzleVector(2, "GlitchyEngine.Math.uint")]
[CRepr]
public struct uint2 public struct uint2
{ {
public const uint2 Zero = .(0, 0); public const uint2 Zero = .(0, 0);
@@ -103,6 +104,7 @@ public struct uint2
[ComparableVector<uint32, 3>] [ComparableVector<uint32, 3>]
//[VectorMath<uint32, 3>] //[VectorMath<uint32, 3>]
[SwizzleVector(3, "GlitchyEngine.Math.uint")] [SwizzleVector(3, "GlitchyEngine.Math.uint")]
[CRepr]
public struct uint3 public struct uint3
{ {
public const uint3 Zero = .(0, 0, 0); public const uint3 Zero = .(0, 0, 0);
@@ -127,6 +129,7 @@ public struct uint3
[ComparableVector<uint32, 4>] [ComparableVector<uint32, 4>]
//[VectorMath<uint32, 4>] //[VectorMath<uint32, 4>]
[SwizzleVector(4, "GlitchyEngine.Math.uint")] [SwizzleVector(4, "GlitchyEngine.Math.uint")]
[CRepr]
public struct uint4 public struct uint4
{ {
public const uint4 Zero = .(0, 0, 0, 0); public const uint4 Zero = .(0, 0, 0, 0);