Fork of mellinoe/ImGui.NET, an ImGui wrapper for .NET, which includes access to internal functions.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

41 lines
1.7 KiB

using System;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Text;
namespace ImGuiNET
{
public unsafe partial struct CustomRect
{
public uint ID;
public ushort Width;
public ushort Height;
public ushort X;
public ushort Y;
public float GlyphAdvanceX;
public Vector2 GlyphOffset;
public ImFont* Font;
}
public unsafe partial struct CustomRectPtr
{
public CustomRect* NativePtr { get; }
public CustomRectPtr(CustomRect* nativePtr) => NativePtr = nativePtr;
public CustomRectPtr(IntPtr nativePtr) => NativePtr = (CustomRect*)nativePtr;
public static implicit operator CustomRectPtr(CustomRect* nativePtr) => new CustomRectPtr(nativePtr);
public static implicit operator CustomRect* (CustomRectPtr wrappedPtr) => wrappedPtr.NativePtr;
public static implicit operator CustomRectPtr(IntPtr nativePtr) => new CustomRectPtr(nativePtr);
public ref uint ID => ref Unsafe.AsRef<uint>(&NativePtr->ID);
public ref ushort Width => ref Unsafe.AsRef<ushort>(&NativePtr->Width);
public ref ushort Height => ref Unsafe.AsRef<ushort>(&NativePtr->Height);
public ref ushort X => ref Unsafe.AsRef<ushort>(&NativePtr->X);
public ref ushort Y => ref Unsafe.AsRef<ushort>(&NativePtr->Y);
public ref float GlyphAdvanceX => ref Unsafe.AsRef<float>(&NativePtr->GlyphAdvanceX);
public ref Vector2 GlyphOffset => ref Unsafe.AsRef<Vector2>(&NativePtr->GlyphOffset);
public ImFontPtr Font => new ImFontPtr(NativePtr->Font);
public bool IsPacked()
{
byte ret = ImGuiNative.CustomRect_IsPacked(NativePtr);
return ret != 0;
}
}
}