More engine API work

This commit is contained in:
Yoshi Askharoun
2026-07-22 18:34:57 -05:00
parent f8e3051d07
commit 679d2bb902
58 changed files with 5540 additions and 80 deletions
+21
View File
@@ -0,0 +1,21 @@
using System.Runtime.InteropServices;
namespace Microsoft.Iris.Render.Interop.Drawing;
// Bit-for-bit mirror of Microsoft.Iris.Drawing.Color (UIX/Microsoft/Iris/Drawing/Color.cs)
// -- a single packed 0xAARRGGBB uint, not four separate byte fields.
[StructLayout(LayoutKind.Sequential)]
public struct Color
{
public uint value;
public Color(uint value) => this.value = value;
public byte A => (byte)(value >> 24);
public byte R => (byte)(value >> 16);
public byte G => (byte)(value >> 8);
public byte B => (byte)value;
public static Color FromArgb(byte a, byte r, byte g, byte b) =>
new((uint)((a << 24) | (r << 16) | (g << 8) | b));
}
+13
View File
@@ -0,0 +1,13 @@
using System.Runtime.InteropServices;
namespace Microsoft.Iris.Render.Interop.Drawing;
// Bit-for-bit mirror of Microsoft.Iris.Render.ColorF (UIX.RenderApi/Microsoft/Iris/Render/ColorF.cs).
[StructLayout(LayoutKind.Sequential)]
public struct ColorF
{
public float a;
public float r;
public float g;
public float b;
}
+11
View File
@@ -0,0 +1,11 @@
using System.Runtime.InteropServices;
namespace Microsoft.Iris.Render.Interop.Drawing;
// Bit-for-bit mirror of Microsoft.Iris.Render.Point (UIX.RenderApi/Microsoft/Iris/Render/Point.cs).
[StructLayout(LayoutKind.Sequential)]
public struct Point
{
public int x;
public int y;
}
+24
View File
@@ -0,0 +1,24 @@
using System.Runtime.InteropServices;
namespace Microsoft.Iris.Render.Interop.Drawing;
// Bit-for-bit mirror of Microsoft.Iris.Render.Rectangle (UIX.RenderApi/Microsoft/Iris/Render/Rectangle.cs).
[StructLayout(LayoutKind.Sequential)]
public struct Rectangle
{
public int x;
public int y;
public int width;
public int height;
}
// Bit-for-bit mirror of Microsoft.Iris.RenderAPI.Drawing.RectangleF
// (UIX/Microsoft/Iris/RenderAPI/Drawing/RectangleF.cs).
[StructLayout(LayoutKind.Sequential)]
public struct RectangleF
{
public float x;
public float y;
public float width;
public float height;
}
+17
View File
@@ -0,0 +1,17 @@
using System.Runtime.InteropServices;
namespace Microsoft.Iris.Render.Interop.Drawing;
// Bit-for-bit mirror of Microsoft.Iris.Render.Size (UIX.RenderApi/Microsoft/Iris/Render/Size.cs).
[StructLayout(LayoutKind.Sequential)]
public struct Size
{
public int width;
public int height;
public Size(int width, int height)
{
this.width = width;
this.height = height;
}
}
+11
View File
@@ -0,0 +1,11 @@
using System.Runtime.InteropServices;
namespace Microsoft.Iris.Render.Interop.Drawing;
// Bit-for-bit mirror of Microsoft.Iris.RenderAPI.Drawing.SizeF (UIX/Microsoft/Iris/RenderAPI/Drawing/SizeF.cs).
[StructLayout(LayoutKind.Sequential)]
public struct SizeF
{
public float width;
public float height;
}