mirror of
https://github.com/ZuneDev/MicrosoftIris.git
synced 2026-07-27 13:13:29 -07:00
More engine API work
This commit is contained in:
@@ -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));
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user