This change overhauls ImGui.NET to be almost entirely auto-generated. It parses data files from cimgui, which contain pre-processed information about Dear ImGui's structures, enums, and functions. The code generator spits out identical C# types and functions, and also generates a safe, friendly wrapper layer. --- This is a combination of 22 commits. --- Initial attempt at auto-generating the native bindings. More WIP generator stuff. Mostly-working bindings with some TODO's left. More WIP stuff for safe wrappers and bindings. WIP Update cimgui definitions and even better safe wrappers. Fix "nonUDT" overloads and add a "RangeAccessor" struct. Remove constructor methods from wrapper types. More WIP Grab latest structs_and_enums.json file Attempted improvements Very good state, everything working. Correct cimgui.dll (win-x64) Rework how ref/out parameters are marshalled. Remove problematic string begin/end parameter pairs. Update native deps to 1.0.65, update ImGui.NET.csproj. Fix sample program compilation. Fix up XNA sample program with new binding changes. Add several more manual ImGui overloads to ease the upgrade. Add [Flags] to flags enums. Change version to 1.65.0. Capitalize "Dear ImGui".internals
parent
b5407eeba5
commit
94908a2890
118 changed files with 28448 additions and 5440 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,65 @@ |
|||||||
|
param ( |
||||||
|
[Parameter(Mandatory=$true)][string]$tag |
||||||
|
) |
||||||
|
|
||||||
|
Write-Host Downloading native binaries from GitHub Releases... |
||||||
|
|
||||||
|
if (Test-Path $PSScriptRoot\deps\cimgui\) |
||||||
|
{ |
||||||
|
Remove-Item $PSScriptRoot\deps\cimgui\ -Force -Recurse | Out-Null |
||||||
|
} |
||||||
|
New-Item -ItemType Directory -Force -Path $PSScriptRoot\deps\cimgui\linux-x64 | Out-Null |
||||||
|
New-Item -ItemType Directory -Force -Path $PSScriptRoot\deps\cimgui\osx-x64 | Out-Null |
||||||
|
New-Item -ItemType Directory -Force -Path $PSScriptRoot\deps\cimgui\win-x86 | Out-Null |
||||||
|
New-Item -ItemType Directory -Force -Path $PSScriptRoot\deps\cimgui\win-x64 | Out-Null |
||||||
|
|
||||||
|
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 |
||||||
|
|
||||||
|
$client = New-Object System.Net.WebClient |
||||||
|
$client.DownloadFile( |
||||||
|
"https://github.com/mellinoe/imgui.net-nativebuild/releases/download/$tag/cimgui.win-x86.dll", |
||||||
|
"$PSScriptRoot/deps/cimgui/win-x86/cimgui.dll") |
||||||
|
if( -not $? ) |
||||||
|
{ |
||||||
|
$msg = $Error[0].Exception.Message |
||||||
|
Write-Error "Couldn't download x86 cimgui.dll. This most likely indicates the Windows native build failed." |
||||||
|
exit |
||||||
|
} |
||||||
|
|
||||||
|
Write-Host "- cimgui.dll (x86)" |
||||||
|
|
||||||
|
$client.DownloadFile( |
||||||
|
"https://github.com/mellinoe/imgui.net-nativebuild/releases/download/$tag/cimgui.win-x64.dll", |
||||||
|
"$PSScriptRoot/deps/cimgui/win-x64/$configuration/cimgui.dll") |
||||||
|
if( -not $? ) |
||||||
|
{ |
||||||
|
$msg = $Error[0].Exception.Message |
||||||
|
Write-Error "Couldn't download x64 cimgui.dll. This most likely indicates the Windows native build failed." |
||||||
|
exit |
||||||
|
} |
||||||
|
|
||||||
|
Write-Host "- cimgui.dll (x64)" |
||||||
|
|
||||||
|
$client.DownloadFile( |
||||||
|
"https://github.com/mellinoe/imgui.net-nativebuild/releases/download/$tag/cimgui.so", |
||||||
|
"$PSScriptRoot/deps/cimgui/linux-x64/cimgui.so") |
||||||
|
if( -not $? ) |
||||||
|
{ |
||||||
|
$msg = $Error[0].Exception.Message |
||||||
|
Write-Error "Couldn't download cimgui.so. This most likely indicates the Linux native build failed." |
||||||
|
exit |
||||||
|
} |
||||||
|
|
||||||
|
Write-Host - cimgui.so |
||||||
|
|
||||||
|
$client.DownloadFile( |
||||||
|
"https://github.com/mellinoe/imgui.net-nativebuild/releases/download/$tag/cimgui.dylib", |
||||||
|
"$PSScriptRoot/deps/cimgui/osx-x64/cimgui.dylib") |
||||||
|
if( -not $? ) |
||||||
|
{ |
||||||
|
$msg = $Error[0].Exception.Message |
||||||
|
Write-Error "Couldn't download cimgui.dylib. This most likely indicates the macOS native build failed." |
||||||
|
exit |
||||||
|
} |
||||||
|
|
||||||
|
Write-Host - cimgui.dylib |
@ -0,0 +1,17 @@ |
|||||||
|
<Project Sdk="Microsoft.NET.Sdk"> |
||||||
|
|
||||||
|
<PropertyGroup> |
||||||
|
<OutputType>Exe</OutputType> |
||||||
|
<TargetFramework>netcoreapp2.1</TargetFramework> |
||||||
|
</PropertyGroup> |
||||||
|
|
||||||
|
<ItemGroup> |
||||||
|
<Content Include="structs_and_enums.json" CopyToOutputDirectory="PreserveNewest" /> |
||||||
|
<Content Include="definitions.json" CopyToOutputDirectory="PreserveNewest" /> |
||||||
|
</ItemGroup> |
||||||
|
|
||||||
|
<ItemGroup> |
||||||
|
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" /> |
||||||
|
</ItemGroup> |
||||||
|
|
||||||
|
</Project> |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,8 @@ |
|||||||
|
{ |
||||||
|
"profiles": { |
||||||
|
"CodeGenerator": { |
||||||
|
"commandName": "Project", |
||||||
|
"commandLineArgs": "E:\\projects\\imgui.net\\src\\ImGui.NET\\Generated" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,41 @@ |
|||||||
|
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; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,61 @@ |
|||||||
|
using System; |
||||||
|
using System.Numerics; |
||||||
|
using System.Runtime.CompilerServices; |
||||||
|
using System.Text; |
||||||
|
|
||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
public unsafe partial struct GlyphRangesBuilder |
||||||
|
{ |
||||||
|
public ImVector/*<unsigned char>*/ UsedChars; |
||||||
|
} |
||||||
|
public unsafe partial struct GlyphRangesBuilderPtr |
||||||
|
{ |
||||||
|
public GlyphRangesBuilder* NativePtr { get; } |
||||||
|
public GlyphRangesBuilderPtr(GlyphRangesBuilder* nativePtr) => NativePtr = nativePtr; |
||||||
|
public GlyphRangesBuilderPtr(IntPtr nativePtr) => NativePtr = (GlyphRangesBuilder*)nativePtr; |
||||||
|
public static implicit operator GlyphRangesBuilderPtr(GlyphRangesBuilder* nativePtr) => new GlyphRangesBuilderPtr(nativePtr); |
||||||
|
public static implicit operator GlyphRangesBuilder* (GlyphRangesBuilderPtr wrappedPtr) => wrappedPtr.NativePtr; |
||||||
|
public static implicit operator GlyphRangesBuilderPtr(IntPtr nativePtr) => new GlyphRangesBuilderPtr(nativePtr); |
||||||
|
public ImVector<byte> UsedChars => new ImVector<byte>(NativePtr->UsedChars); |
||||||
|
public void SetBit(int n) |
||||||
|
{ |
||||||
|
ImGuiNative.GlyphRangesBuilder_SetBit(NativePtr, n); |
||||||
|
} |
||||||
|
public void AddText(string text) |
||||||
|
{ |
||||||
|
int text_byteCount = Encoding.UTF8.GetByteCount(text); |
||||||
|
byte* native_text = stackalloc byte[text_byteCount + 1]; |
||||||
|
fixed (char* text_ptr = text) |
||||||
|
{ |
||||||
|
int native_text_offset = Encoding.UTF8.GetBytes(text_ptr, text.Length, native_text, text_byteCount); |
||||||
|
native_text[native_text_offset] = 0; |
||||||
|
} |
||||||
|
byte* native_text_end = null; |
||||||
|
ImGuiNative.GlyphRangesBuilder_AddText(NativePtr, native_text, native_text_end); |
||||||
|
} |
||||||
|
public void AddRanges(ref ushort ranges) |
||||||
|
{ |
||||||
|
fixed (ushort* native_ranges = &ranges) |
||||||
|
{ |
||||||
|
ImGuiNative.GlyphRangesBuilder_AddRanges(NativePtr, native_ranges); |
||||||
|
} |
||||||
|
} |
||||||
|
public void BuildRanges(out ImVector out_ranges) |
||||||
|
{ |
||||||
|
fixed (ImVector* native_out_ranges = &out_ranges) |
||||||
|
{ |
||||||
|
ImGuiNative.GlyphRangesBuilder_BuildRanges(NativePtr, native_out_ranges); |
||||||
|
} |
||||||
|
} |
||||||
|
public bool GetBit(int n) |
||||||
|
{ |
||||||
|
byte ret = ImGuiNative.GlyphRangesBuilder_GetBit(NativePtr, n); |
||||||
|
return ret != 0; |
||||||
|
} |
||||||
|
public void AddChar(ushort c) |
||||||
|
{ |
||||||
|
ImGuiNative.GlyphRangesBuilder_AddChar(NativePtr, c); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,42 @@ |
|||||||
|
using System; |
||||||
|
using System.Numerics; |
||||||
|
using System.Runtime.CompilerServices; |
||||||
|
using System.Text; |
||||||
|
|
||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
public unsafe partial struct ImColor |
||||||
|
{ |
||||||
|
public Vector4 Value; |
||||||
|
} |
||||||
|
public unsafe partial struct ImColorPtr |
||||||
|
{ |
||||||
|
public ImColor* NativePtr { get; } |
||||||
|
public ImColorPtr(ImColor* nativePtr) => NativePtr = nativePtr; |
||||||
|
public ImColorPtr(IntPtr nativePtr) => NativePtr = (ImColor*)nativePtr; |
||||||
|
public static implicit operator ImColorPtr(ImColor* nativePtr) => new ImColorPtr(nativePtr); |
||||||
|
public static implicit operator ImColor* (ImColorPtr wrappedPtr) => wrappedPtr.NativePtr; |
||||||
|
public static implicit operator ImColorPtr(IntPtr nativePtr) => new ImColorPtr(nativePtr); |
||||||
|
public ref Vector4 Value => ref Unsafe.AsRef<Vector4>(&NativePtr->Value); |
||||||
|
public void SetHSV(float h, float s, float v) |
||||||
|
{ |
||||||
|
float a = 1.0f; |
||||||
|
ImGuiNative.ImColor_SetHSV(NativePtr, h, s, v, a); |
||||||
|
} |
||||||
|
public void SetHSV(float h, float s, float v, float a) |
||||||
|
{ |
||||||
|
ImGuiNative.ImColor_SetHSV(NativePtr, h, s, v, a); |
||||||
|
} |
||||||
|
public ImColor HSV(float h, float s, float v) |
||||||
|
{ |
||||||
|
float a = 1.0f; |
||||||
|
ImColor ret = ImGuiNative.ImColor_HSV(NativePtr, h, s, v, a); |
||||||
|
return ret; |
||||||
|
} |
||||||
|
public ImColor HSV(float h, float s, float v, float a) |
||||||
|
{ |
||||||
|
ImColor ret = ImGuiNative.ImColor_HSV(NativePtr, h, s, v, a); |
||||||
|
return ret; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,24 @@ |
|||||||
|
using System; |
||||||
|
using System.Numerics; |
||||||
|
using System.Runtime.CompilerServices; |
||||||
|
using System.Text; |
||||||
|
|
||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
public unsafe partial struct ImDrawChannel |
||||||
|
{ |
||||||
|
public ImVector/*<ImDrawCmd>*/ CmdBuffer; |
||||||
|
public ImVector/*<ImDrawIdx>*/ IdxBuffer; |
||||||
|
} |
||||||
|
public unsafe partial struct ImDrawChannelPtr |
||||||
|
{ |
||||||
|
public ImDrawChannel* NativePtr { get; } |
||||||
|
public ImDrawChannelPtr(ImDrawChannel* nativePtr) => NativePtr = nativePtr; |
||||||
|
public ImDrawChannelPtr(IntPtr nativePtr) => NativePtr = (ImDrawChannel*)nativePtr; |
||||||
|
public static implicit operator ImDrawChannelPtr(ImDrawChannel* nativePtr) => new ImDrawChannelPtr(nativePtr); |
||||||
|
public static implicit operator ImDrawChannel* (ImDrawChannelPtr wrappedPtr) => wrappedPtr.NativePtr; |
||||||
|
public static implicit operator ImDrawChannelPtr(IntPtr nativePtr) => new ImDrawChannelPtr(nativePtr); |
||||||
|
public ImPtrVector<ImDrawCmdPtr> CmdBuffer => new ImPtrVector<ImDrawCmdPtr>(NativePtr->CmdBuffer, Unsafe.SizeOf<ImDrawCmd>()); |
||||||
|
public ImVector<ushort> IdxBuffer => new ImVector<ushort>(NativePtr->IdxBuffer); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,30 @@ |
|||||||
|
using System; |
||||||
|
using System.Numerics; |
||||||
|
using System.Runtime.CompilerServices; |
||||||
|
using System.Text; |
||||||
|
|
||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
public unsafe partial struct ImDrawCmd |
||||||
|
{ |
||||||
|
public uint ElemCount; |
||||||
|
public Vector4 ClipRect; |
||||||
|
public IntPtr TextureId; |
||||||
|
public IntPtr UserCallback; |
||||||
|
public void* UserCallbackData; |
||||||
|
} |
||||||
|
public unsafe partial struct ImDrawCmdPtr |
||||||
|
{ |
||||||
|
public ImDrawCmd* NativePtr { get; } |
||||||
|
public ImDrawCmdPtr(ImDrawCmd* nativePtr) => NativePtr = nativePtr; |
||||||
|
public ImDrawCmdPtr(IntPtr nativePtr) => NativePtr = (ImDrawCmd*)nativePtr; |
||||||
|
public static implicit operator ImDrawCmdPtr(ImDrawCmd* nativePtr) => new ImDrawCmdPtr(nativePtr); |
||||||
|
public static implicit operator ImDrawCmd* (ImDrawCmdPtr wrappedPtr) => wrappedPtr.NativePtr; |
||||||
|
public static implicit operator ImDrawCmdPtr(IntPtr nativePtr) => new ImDrawCmdPtr(nativePtr); |
||||||
|
public ref uint ElemCount => ref Unsafe.AsRef<uint>(&NativePtr->ElemCount); |
||||||
|
public ref Vector4 ClipRect => ref Unsafe.AsRef<Vector4>(&NativePtr->ClipRect); |
||||||
|
public ref IntPtr TextureId => ref Unsafe.AsRef<IntPtr>(&NativePtr->TextureId); |
||||||
|
public ref IntPtr UserCallback => ref Unsafe.AsRef<IntPtr>(&NativePtr->UserCallback); |
||||||
|
public IntPtr UserCallbackData { get => (IntPtr)NativePtr->UserCallbackData; set => NativePtr->UserCallbackData = (void*)value; } |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,16 @@ |
|||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
[System.Flags] |
||||||
|
public enum ImDrawCornerFlags |
||||||
|
{ |
||||||
|
TopLeft = 1 << 0, |
||||||
|
TopRight = 1 << 1, |
||||||
|
BotLeft = 1 << 2, |
||||||
|
BotRight = 1 << 3, |
||||||
|
Top = TopLeft | TopRight, |
||||||
|
Bot = BotLeft | BotRight, |
||||||
|
Left = TopLeft | BotLeft, |
||||||
|
Right = TopRight | BotRight, |
||||||
|
All = 0xF, |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,46 @@ |
|||||||
|
using System; |
||||||
|
using System.Numerics; |
||||||
|
using System.Runtime.CompilerServices; |
||||||
|
using System.Text; |
||||||
|
|
||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
public unsafe partial struct ImDrawData |
||||||
|
{ |
||||||
|
public byte Valid; |
||||||
|
public ImDrawList** CmdLists; |
||||||
|
public int CmdListsCount; |
||||||
|
public int TotalIdxCount; |
||||||
|
public int TotalVtxCount; |
||||||
|
public Vector2 DisplayPos; |
||||||
|
public Vector2 DisplaySize; |
||||||
|
} |
||||||
|
public unsafe partial struct ImDrawDataPtr |
||||||
|
{ |
||||||
|
public ImDrawData* NativePtr { get; } |
||||||
|
public ImDrawDataPtr(ImDrawData* nativePtr) => NativePtr = nativePtr; |
||||||
|
public ImDrawDataPtr(IntPtr nativePtr) => NativePtr = (ImDrawData*)nativePtr; |
||||||
|
public static implicit operator ImDrawDataPtr(ImDrawData* nativePtr) => new ImDrawDataPtr(nativePtr); |
||||||
|
public static implicit operator ImDrawData* (ImDrawDataPtr wrappedPtr) => wrappedPtr.NativePtr; |
||||||
|
public static implicit operator ImDrawDataPtr(IntPtr nativePtr) => new ImDrawDataPtr(nativePtr); |
||||||
|
public ref Bool8 Valid => ref Unsafe.AsRef<Bool8>(&NativePtr->Valid); |
||||||
|
public IntPtr CmdLists { get => (IntPtr)NativePtr->CmdLists; set => NativePtr->CmdLists = (ImDrawList**)value; } |
||||||
|
public ref int CmdListsCount => ref Unsafe.AsRef<int>(&NativePtr->CmdListsCount); |
||||||
|
public ref int TotalIdxCount => ref Unsafe.AsRef<int>(&NativePtr->TotalIdxCount); |
||||||
|
public ref int TotalVtxCount => ref Unsafe.AsRef<int>(&NativePtr->TotalVtxCount); |
||||||
|
public ref Vector2 DisplayPos => ref Unsafe.AsRef<Vector2>(&NativePtr->DisplayPos); |
||||||
|
public ref Vector2 DisplaySize => ref Unsafe.AsRef<Vector2>(&NativePtr->DisplaySize); |
||||||
|
public void ScaleClipRects(Vector2 sc) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawData_ScaleClipRects(NativePtr, sc); |
||||||
|
} |
||||||
|
public void DeIndexAllBuffers() |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawData_DeIndexAllBuffers(NativePtr); |
||||||
|
} |
||||||
|
public void Clear() |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawData_Clear(NativePtr); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,414 @@ |
|||||||
|
using System; |
||||||
|
using System.Numerics; |
||||||
|
using System.Runtime.CompilerServices; |
||||||
|
using System.Text; |
||||||
|
|
||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
public unsafe partial struct ImDrawList |
||||||
|
{ |
||||||
|
public ImVector/*<ImDrawCmd>*/ CmdBuffer; |
||||||
|
public ImVector/*<ImDrawIdx>*/ IdxBuffer; |
||||||
|
public ImVector/*<ImDrawVert>*/ VtxBuffer; |
||||||
|
public ImDrawListFlags Flags; |
||||||
|
public IntPtr _Data; |
||||||
|
public byte* _OwnerName; |
||||||
|
public uint _VtxCurrentIdx; |
||||||
|
public ImDrawVert* _VtxWritePtr; |
||||||
|
public ushort* _IdxWritePtr; |
||||||
|
public ImVector/*<ImVec4>*/ _ClipRectStack; |
||||||
|
public ImVector/*<ImTextureID>*/ _TextureIdStack; |
||||||
|
public ImVector/*<ImVec2>*/ _Path; |
||||||
|
public int _ChannelsCurrent; |
||||||
|
public int _ChannelsCount; |
||||||
|
public ImVector/*<ImDrawChannel>*/ _Channels; |
||||||
|
} |
||||||
|
public unsafe partial struct ImDrawListPtr |
||||||
|
{ |
||||||
|
public ImDrawList* NativePtr { get; } |
||||||
|
public ImDrawListPtr(ImDrawList* nativePtr) => NativePtr = nativePtr; |
||||||
|
public ImDrawListPtr(IntPtr nativePtr) => NativePtr = (ImDrawList*)nativePtr; |
||||||
|
public static implicit operator ImDrawListPtr(ImDrawList* nativePtr) => new ImDrawListPtr(nativePtr); |
||||||
|
public static implicit operator ImDrawList* (ImDrawListPtr wrappedPtr) => wrappedPtr.NativePtr; |
||||||
|
public static implicit operator ImDrawListPtr(IntPtr nativePtr) => new ImDrawListPtr(nativePtr); |
||||||
|
public ImPtrVector<ImDrawCmdPtr> CmdBuffer => new ImPtrVector<ImDrawCmdPtr>(NativePtr->CmdBuffer, Unsafe.SizeOf<ImDrawCmd>()); |
||||||
|
public ImVector<ushort> IdxBuffer => new ImVector<ushort>(NativePtr->IdxBuffer); |
||||||
|
public ImPtrVector<ImDrawVertPtr> VtxBuffer => new ImPtrVector<ImDrawVertPtr>(NativePtr->VtxBuffer, Unsafe.SizeOf<ImDrawVert>()); |
||||||
|
public ref ImDrawListFlags Flags => ref Unsafe.AsRef<ImDrawListFlags>(&NativePtr->Flags); |
||||||
|
public ref IntPtr _Data => ref Unsafe.AsRef<IntPtr>(&NativePtr->_Data); |
||||||
|
public NullTerminatedString _OwnerName => new NullTerminatedString(NativePtr->_OwnerName); |
||||||
|
public ref uint _VtxCurrentIdx => ref Unsafe.AsRef<uint>(&NativePtr->_VtxCurrentIdx); |
||||||
|
public ImDrawVertPtr _VtxWritePtr => new ImDrawVertPtr(NativePtr->_VtxWritePtr); |
||||||
|
public IntPtr _IdxWritePtr { get => (IntPtr)NativePtr->_IdxWritePtr; set => NativePtr->_IdxWritePtr = (ushort*)value; } |
||||||
|
public ImVector<Vector4> _ClipRectStack => new ImVector<Vector4>(NativePtr->_ClipRectStack); |
||||||
|
public ImVector<IntPtr> _TextureIdStack => new ImVector<IntPtr>(NativePtr->_TextureIdStack); |
||||||
|
public ImVector<Vector2> _Path => new ImVector<Vector2>(NativePtr->_Path); |
||||||
|
public ref int _ChannelsCurrent => ref Unsafe.AsRef<int>(&NativePtr->_ChannelsCurrent); |
||||||
|
public ref int _ChannelsCount => ref Unsafe.AsRef<int>(&NativePtr->_ChannelsCount); |
||||||
|
public ImPtrVector<ImDrawChannelPtr> _Channels => new ImPtrVector<ImDrawChannelPtr>(NativePtr->_Channels, Unsafe.SizeOf<ImDrawChannel>()); |
||||||
|
public void ChannelsSetCurrent(int channel_index) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_ChannelsSetCurrent(NativePtr, channel_index); |
||||||
|
} |
||||||
|
public void ChannelsSplit(int channels_count) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_ChannelsSplit(NativePtr, channels_count); |
||||||
|
} |
||||||
|
public void AddPolyline(ref Vector2 points, int num_points, uint col, bool closed, float thickness) |
||||||
|
{ |
||||||
|
byte native_closed = closed ? (byte)1 : (byte)0; |
||||||
|
fixed (Vector2* native_points = &points) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_AddPolyline(NativePtr, native_points, num_points, col, native_closed, thickness); |
||||||
|
} |
||||||
|
} |
||||||
|
public void PopClipRect() |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_PopClipRect(NativePtr); |
||||||
|
} |
||||||
|
public void PushClipRect(Vector2 clip_rect_min, Vector2 clip_rect_max) |
||||||
|
{ |
||||||
|
byte intersect_with_current_clip_rect = 0; |
||||||
|
ImGuiNative.ImDrawList_PushClipRect(NativePtr, clip_rect_min, clip_rect_max, intersect_with_current_clip_rect); |
||||||
|
} |
||||||
|
public void PushClipRect(Vector2 clip_rect_min, Vector2 clip_rect_max, bool intersect_with_current_clip_rect) |
||||||
|
{ |
||||||
|
byte native_intersect_with_current_clip_rect = intersect_with_current_clip_rect ? (byte)1 : (byte)0; |
||||||
|
ImGuiNative.ImDrawList_PushClipRect(NativePtr, clip_rect_min, clip_rect_max, native_intersect_with_current_clip_rect); |
||||||
|
} |
||||||
|
public void PathBezierCurveTo(Vector2 p1, Vector2 p2, Vector2 p3) |
||||||
|
{ |
||||||
|
int num_segments = 0; |
||||||
|
ImGuiNative.ImDrawList_PathBezierCurveTo(NativePtr, p1, p2, p3, num_segments); |
||||||
|
} |
||||||
|
public void PathBezierCurveTo(Vector2 p1, Vector2 p2, Vector2 p3, int num_segments) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_PathBezierCurveTo(NativePtr, p1, p2, p3, num_segments); |
||||||
|
} |
||||||
|
public void UpdateTextureID() |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_UpdateTextureID(NativePtr); |
||||||
|
} |
||||||
|
public void Clear() |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_Clear(NativePtr); |
||||||
|
} |
||||||
|
public void AddBezierCurve(Vector2 pos0, Vector2 cp0, Vector2 cp1, Vector2 pos1, uint col, float thickness) |
||||||
|
{ |
||||||
|
int num_segments = 0; |
||||||
|
ImGuiNative.ImDrawList_AddBezierCurve(NativePtr, pos0, cp0, cp1, pos1, col, thickness, num_segments); |
||||||
|
} |
||||||
|
public void AddBezierCurve(Vector2 pos0, Vector2 cp0, Vector2 cp1, Vector2 pos1, uint col, float thickness, int num_segments) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_AddBezierCurve(NativePtr, pos0, cp0, cp1, pos1, col, thickness, num_segments); |
||||||
|
} |
||||||
|
public void PushTextureID(IntPtr texture_id) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_PushTextureID(NativePtr, texture_id); |
||||||
|
} |
||||||
|
public void AddRectFilled(Vector2 a, Vector2 b, uint col) |
||||||
|
{ |
||||||
|
float rounding = 0.0f; |
||||||
|
int rounding_corners_flags = (int)ImDrawCornerFlags.All; |
||||||
|
ImGuiNative.ImDrawList_AddRectFilled(NativePtr, a, b, col, rounding, rounding_corners_flags); |
||||||
|
} |
||||||
|
public void AddRectFilled(Vector2 a, Vector2 b, uint col, float rounding) |
||||||
|
{ |
||||||
|
int rounding_corners_flags = (int)ImDrawCornerFlags.All; |
||||||
|
ImGuiNative.ImDrawList_AddRectFilled(NativePtr, a, b, col, rounding, rounding_corners_flags); |
||||||
|
} |
||||||
|
public void AddRectFilled(Vector2 a, Vector2 b, uint col, float rounding, int rounding_corners_flags) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_AddRectFilled(NativePtr, a, b, col, rounding, rounding_corners_flags); |
||||||
|
} |
||||||
|
public void AddDrawCmd() |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_AddDrawCmd(NativePtr); |
||||||
|
} |
||||||
|
public void UpdateClipRect() |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_UpdateClipRect(NativePtr); |
||||||
|
} |
||||||
|
public void PrimVtx(Vector2 pos, Vector2 uv, uint col) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_PrimVtx(NativePtr, pos, uv, col); |
||||||
|
} |
||||||
|
public void PrimRect(Vector2 a, Vector2 b, uint col) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_PrimRect(NativePtr, a, b, col); |
||||||
|
} |
||||||
|
public void AddQuad(Vector2 a, Vector2 b, Vector2 c, Vector2 d, uint col) |
||||||
|
{ |
||||||
|
float thickness = 1.0f; |
||||||
|
ImGuiNative.ImDrawList_AddQuad(NativePtr, a, b, c, d, col, thickness); |
||||||
|
} |
||||||
|
public void AddQuad(Vector2 a, Vector2 b, Vector2 c, Vector2 d, uint col, float thickness) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_AddQuad(NativePtr, a, b, c, d, col, thickness); |
||||||
|
} |
||||||
|
public void ClearFreeMemory() |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_ClearFreeMemory(NativePtr); |
||||||
|
} |
||||||
|
public ImDrawListPtr CloneOutput() |
||||||
|
{ |
||||||
|
ImDrawList* ret = ImGuiNative.ImDrawList_CloneOutput(NativePtr); |
||||||
|
return new ImDrawListPtr(ret); |
||||||
|
} |
||||||
|
public void AddRect(Vector2 a, Vector2 b, uint col) |
||||||
|
{ |
||||||
|
float rounding = 0.0f; |
||||||
|
int rounding_corners_flags = (int)ImDrawCornerFlags.All; |
||||||
|
float thickness = 1.0f; |
||||||
|
ImGuiNative.ImDrawList_AddRect(NativePtr, a, b, col, rounding, rounding_corners_flags, thickness); |
||||||
|
} |
||||||
|
public void AddRect(Vector2 a, Vector2 b, uint col, float rounding) |
||||||
|
{ |
||||||
|
int rounding_corners_flags = (int)ImDrawCornerFlags.All; |
||||||
|
float thickness = 1.0f; |
||||||
|
ImGuiNative.ImDrawList_AddRect(NativePtr, a, b, col, rounding, rounding_corners_flags, thickness); |
||||||
|
} |
||||||
|
public void AddRect(Vector2 a, Vector2 b, uint col, float rounding, int rounding_corners_flags) |
||||||
|
{ |
||||||
|
float thickness = 1.0f; |
||||||
|
ImGuiNative.ImDrawList_AddRect(NativePtr, a, b, col, rounding, rounding_corners_flags, thickness); |
||||||
|
} |
||||||
|
public void AddRect(Vector2 a, Vector2 b, uint col, float rounding, int rounding_corners_flags, float thickness) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_AddRect(NativePtr, a, b, col, rounding, rounding_corners_flags, thickness); |
||||||
|
} |
||||||
|
public void AddCallback(IntPtr callback, IntPtr callback_data) |
||||||
|
{ |
||||||
|
void* native_callback_data = callback_data.ToPointer(); |
||||||
|
ImGuiNative.ImDrawList_AddCallback(NativePtr, callback, native_callback_data); |
||||||
|
} |
||||||
|
public void PathRect(Vector2 rect_min, Vector2 rect_max) |
||||||
|
{ |
||||||
|
float rounding = 0.0f; |
||||||
|
int rounding_corners_flags = (int)ImDrawCornerFlags.All; |
||||||
|
ImGuiNative.ImDrawList_PathRect(NativePtr, rect_min, rect_max, rounding, rounding_corners_flags); |
||||||
|
} |
||||||
|
public void PathRect(Vector2 rect_min, Vector2 rect_max, float rounding) |
||||||
|
{ |
||||||
|
int rounding_corners_flags = (int)ImDrawCornerFlags.All; |
||||||
|
ImGuiNative.ImDrawList_PathRect(NativePtr, rect_min, rect_max, rounding, rounding_corners_flags); |
||||||
|
} |
||||||
|
public void PathRect(Vector2 rect_min, Vector2 rect_max, float rounding, int rounding_corners_flags) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_PathRect(NativePtr, rect_min, rect_max, rounding, rounding_corners_flags); |
||||||
|
} |
||||||
|
public void PathArcToFast(Vector2 centre, float radius, int a_min_of_12, int a_max_of_12) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_PathArcToFast(NativePtr, centre, radius, a_min_of_12, a_max_of_12); |
||||||
|
} |
||||||
|
public void PathStroke(uint col, bool closed) |
||||||
|
{ |
||||||
|
byte native_closed = closed ? (byte)1 : (byte)0; |
||||||
|
float thickness = 1.0f; |
||||||
|
ImGuiNative.ImDrawList_PathStroke(NativePtr, col, native_closed, thickness); |
||||||
|
} |
||||||
|
public void PathStroke(uint col, bool closed, float thickness) |
||||||
|
{ |
||||||
|
byte native_closed = closed ? (byte)1 : (byte)0; |
||||||
|
ImGuiNative.ImDrawList_PathStroke(NativePtr, col, native_closed, thickness); |
||||||
|
} |
||||||
|
public void PathFillConvex(uint col) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_PathFillConvex(NativePtr, col); |
||||||
|
} |
||||||
|
public void PathLineToMergeDuplicate(Vector2 pos) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_PathLineToMergeDuplicate(NativePtr, pos); |
||||||
|
} |
||||||
|
public void PathArcTo(Vector2 centre, float radius, float a_min, float a_max) |
||||||
|
{ |
||||||
|
int num_segments = 10; |
||||||
|
ImGuiNative.ImDrawList_PathArcTo(NativePtr, centre, radius, a_min, a_max, num_segments); |
||||||
|
} |
||||||
|
public void PathArcTo(Vector2 centre, float radius, float a_min, float a_max, int num_segments) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_PathArcTo(NativePtr, centre, radius, a_min, a_max, num_segments); |
||||||
|
} |
||||||
|
public void AddConvexPolyFilled(ref Vector2 points, int num_points, uint col) |
||||||
|
{ |
||||||
|
fixed (Vector2* native_points = &points) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_AddConvexPolyFilled(NativePtr, native_points, num_points, col); |
||||||
|
} |
||||||
|
} |
||||||
|
public void AddImageQuad(IntPtr user_texture_id, Vector2 a, Vector2 b, Vector2 c, Vector2 d) |
||||||
|
{ |
||||||
|
Vector2 uv_a = new Vector2(); |
||||||
|
Vector2 uv_b = new Vector2(1, 0); |
||||||
|
Vector2 uv_c = new Vector2(1, 1); |
||||||
|
Vector2 uv_d = new Vector2(0, 1); |
||||||
|
uint col = 0xFFFFFFFF; |
||||||
|
ImGuiNative.ImDrawList_AddImageQuad(NativePtr, user_texture_id, a, b, c, d, uv_a, uv_b, uv_c, uv_d, col); |
||||||
|
} |
||||||
|
public void AddImageQuad(IntPtr user_texture_id, Vector2 a, Vector2 b, Vector2 c, Vector2 d, Vector2 uv_a) |
||||||
|
{ |
||||||
|
Vector2 uv_b = new Vector2(1, 0); |
||||||
|
Vector2 uv_c = new Vector2(1, 1); |
||||||
|
Vector2 uv_d = new Vector2(0, 1); |
||||||
|
uint col = 0xFFFFFFFF; |
||||||
|
ImGuiNative.ImDrawList_AddImageQuad(NativePtr, user_texture_id, a, b, c, d, uv_a, uv_b, uv_c, uv_d, col); |
||||||
|
} |
||||||
|
public void AddImageQuad(IntPtr user_texture_id, Vector2 a, Vector2 b, Vector2 c, Vector2 d, Vector2 uv_a, Vector2 uv_b) |
||||||
|
{ |
||||||
|
Vector2 uv_c = new Vector2(1, 1); |
||||||
|
Vector2 uv_d = new Vector2(0, 1); |
||||||
|
uint col = 0xFFFFFFFF; |
||||||
|
ImGuiNative.ImDrawList_AddImageQuad(NativePtr, user_texture_id, a, b, c, d, uv_a, uv_b, uv_c, uv_d, col); |
||||||
|
} |
||||||
|
public void AddImageQuad(IntPtr user_texture_id, Vector2 a, Vector2 b, Vector2 c, Vector2 d, Vector2 uv_a, Vector2 uv_b, Vector2 uv_c) |
||||||
|
{ |
||||||
|
Vector2 uv_d = new Vector2(0, 1); |
||||||
|
uint col = 0xFFFFFFFF; |
||||||
|
ImGuiNative.ImDrawList_AddImageQuad(NativePtr, user_texture_id, a, b, c, d, uv_a, uv_b, uv_c, uv_d, col); |
||||||
|
} |
||||||
|
public void AddImageQuad(IntPtr user_texture_id, Vector2 a, Vector2 b, Vector2 c, Vector2 d, Vector2 uv_a, Vector2 uv_b, Vector2 uv_c, Vector2 uv_d) |
||||||
|
{ |
||||||
|
uint col = 0xFFFFFFFF; |
||||||
|
ImGuiNative.ImDrawList_AddImageQuad(NativePtr, user_texture_id, a, b, c, d, uv_a, uv_b, uv_c, uv_d, col); |
||||||
|
} |
||||||
|
public void AddImageQuad(IntPtr user_texture_id, Vector2 a, Vector2 b, Vector2 c, Vector2 d, Vector2 uv_a, Vector2 uv_b, Vector2 uv_c, Vector2 uv_d, uint col) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_AddImageQuad(NativePtr, user_texture_id, a, b, c, d, uv_a, uv_b, uv_c, uv_d, col); |
||||||
|
} |
||||||
|
public void AddImage(IntPtr user_texture_id, Vector2 a, Vector2 b) |
||||||
|
{ |
||||||
|
Vector2 uv_a = new Vector2(); |
||||||
|
Vector2 uv_b = new Vector2(1, 1); |
||||||
|
uint col = 0xFFFFFFFF; |
||||||
|
ImGuiNative.ImDrawList_AddImage(NativePtr, user_texture_id, a, b, uv_a, uv_b, col); |
||||||
|
} |
||||||
|
public void AddImage(IntPtr user_texture_id, Vector2 a, Vector2 b, Vector2 uv_a) |
||||||
|
{ |
||||||
|
Vector2 uv_b = new Vector2(1, 1); |
||||||
|
uint col = 0xFFFFFFFF; |
||||||
|
ImGuiNative.ImDrawList_AddImage(NativePtr, user_texture_id, a, b, uv_a, uv_b, col); |
||||||
|
} |
||||||
|
public void AddImage(IntPtr user_texture_id, Vector2 a, Vector2 b, Vector2 uv_a, Vector2 uv_b) |
||||||
|
{ |
||||||
|
uint col = 0xFFFFFFFF; |
||||||
|
ImGuiNative.ImDrawList_AddImage(NativePtr, user_texture_id, a, b, uv_a, uv_b, col); |
||||||
|
} |
||||||
|
public void AddImage(IntPtr user_texture_id, Vector2 a, Vector2 b, Vector2 uv_a, Vector2 uv_b, uint col) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_AddImage(NativePtr, user_texture_id, a, b, uv_a, uv_b, col); |
||||||
|
} |
||||||
|
public void AddCircleFilled(Vector2 centre, float radius, uint col) |
||||||
|
{ |
||||||
|
int num_segments = 12; |
||||||
|
ImGuiNative.ImDrawList_AddCircleFilled(NativePtr, centre, radius, col, num_segments); |
||||||
|
} |
||||||
|
public void AddCircleFilled(Vector2 centre, float radius, uint col, int num_segments) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_AddCircleFilled(NativePtr, centre, radius, col, num_segments); |
||||||
|
} |
||||||
|
public void AddCircle(Vector2 centre, float radius, uint col) |
||||||
|
{ |
||||||
|
int num_segments = 12; |
||||||
|
float thickness = 1.0f; |
||||||
|
ImGuiNative.ImDrawList_AddCircle(NativePtr, centre, radius, col, num_segments, thickness); |
||||||
|
} |
||||||
|
public void AddCircle(Vector2 centre, float radius, uint col, int num_segments) |
||||||
|
{ |
||||||
|
float thickness = 1.0f; |
||||||
|
ImGuiNative.ImDrawList_AddCircle(NativePtr, centre, radius, col, num_segments, thickness); |
||||||
|
} |
||||||
|
public void AddCircle(Vector2 centre, float radius, uint col, int num_segments, float thickness) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_AddCircle(NativePtr, centre, radius, col, num_segments, thickness); |
||||||
|
} |
||||||
|
public void AddTriangleFilled(Vector2 a, Vector2 b, Vector2 c, uint col) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_AddTriangleFilled(NativePtr, a, b, c, col); |
||||||
|
} |
||||||
|
public void AddTriangle(Vector2 a, Vector2 b, Vector2 c, uint col) |
||||||
|
{ |
||||||
|
float thickness = 1.0f; |
||||||
|
ImGuiNative.ImDrawList_AddTriangle(NativePtr, a, b, c, col, thickness); |
||||||
|
} |
||||||
|
public void AddTriangle(Vector2 a, Vector2 b, Vector2 c, uint col, float thickness) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_AddTriangle(NativePtr, a, b, c, col, thickness); |
||||||
|
} |
||||||
|
public void AddQuadFilled(Vector2 a, Vector2 b, Vector2 c, Vector2 d, uint col) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_AddQuadFilled(NativePtr, a, b, c, d, col); |
||||||
|
} |
||||||
|
public void PrimReserve(int idx_count, int vtx_count) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_PrimReserve(NativePtr, idx_count, vtx_count); |
||||||
|
} |
||||||
|
public void AddRectFilledMultiColor(Vector2 a, Vector2 b, uint col_upr_left, uint col_upr_right, uint col_bot_right, uint col_bot_left) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_AddRectFilledMultiColor(NativePtr, a, b, col_upr_left, col_upr_right, col_bot_right, col_bot_left); |
||||||
|
} |
||||||
|
public void AddLine(Vector2 a, Vector2 b, uint col) |
||||||
|
{ |
||||||
|
float thickness = 1.0f; |
||||||
|
ImGuiNative.ImDrawList_AddLine(NativePtr, a, b, col, thickness); |
||||||
|
} |
||||||
|
public void AddLine(Vector2 a, Vector2 b, uint col, float thickness) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_AddLine(NativePtr, a, b, col, thickness); |
||||||
|
} |
||||||
|
public Vector2 GetClipRectMin() |
||||||
|
{ |
||||||
|
Vector2 ret = ImGuiNative.ImDrawList_GetClipRectMin(NativePtr); |
||||||
|
return ret; |
||||||
|
} |
||||||
|
public void PopTextureID() |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_PopTextureID(NativePtr); |
||||||
|
} |
||||||
|
public void PrimWriteVtx(Vector2 pos, Vector2 uv, uint col) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_PrimWriteVtx(NativePtr, pos, uv, col); |
||||||
|
} |
||||||
|
public Vector2 GetClipRectMax() |
||||||
|
{ |
||||||
|
Vector2 ret = ImGuiNative.ImDrawList_GetClipRectMax(NativePtr); |
||||||
|
return ret; |
||||||
|
} |
||||||
|
public void AddImageRounded(IntPtr user_texture_id, Vector2 a, Vector2 b, Vector2 uv_a, Vector2 uv_b, uint col, float rounding) |
||||||
|
{ |
||||||
|
int rounding_corners = (int)ImDrawCornerFlags.All; |
||||||
|
ImGuiNative.ImDrawList_AddImageRounded(NativePtr, user_texture_id, a, b, uv_a, uv_b, col, rounding, rounding_corners); |
||||||
|
} |
||||||
|
public void AddImageRounded(IntPtr user_texture_id, Vector2 a, Vector2 b, Vector2 uv_a, Vector2 uv_b, uint col, float rounding, int rounding_corners) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_AddImageRounded(NativePtr, user_texture_id, a, b, uv_a, uv_b, col, rounding, rounding_corners); |
||||||
|
} |
||||||
|
public void PrimQuadUV(Vector2 a, Vector2 b, Vector2 c, Vector2 d, Vector2 uv_a, Vector2 uv_b, Vector2 uv_c, Vector2 uv_d, uint col) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_PrimQuadUV(NativePtr, a, b, c, d, uv_a, uv_b, uv_c, uv_d, col); |
||||||
|
} |
||||||
|
public void PathClear() |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_PathClear(NativePtr); |
||||||
|
} |
||||||
|
public void PrimWriteIdx(ushort idx) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_PrimWriteIdx(NativePtr, idx); |
||||||
|
} |
||||||
|
public void PushClipRectFullScreen() |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_PushClipRectFullScreen(NativePtr); |
||||||
|
} |
||||||
|
public void ChannelsMerge() |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_ChannelsMerge(NativePtr); |
||||||
|
} |
||||||
|
public void PathLineTo(Vector2 pos) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_PathLineTo(NativePtr, pos); |
||||||
|
} |
||||||
|
public void PrimRectUV(Vector2 a, Vector2 b, Vector2 uv_a, Vector2 uv_b, uint col) |
||||||
|
{ |
||||||
|
ImGuiNative.ImDrawList_PrimRectUV(NativePtr, a, b, uv_a, uv_b, col); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,9 @@ |
|||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
[System.Flags] |
||||||
|
public enum ImDrawListFlags |
||||||
|
{ |
||||||
|
AntiAliasedLines = 1 << 0, |
||||||
|
AntiAliasedFill = 1 << 1, |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,26 @@ |
|||||||
|
using System; |
||||||
|
using System.Numerics; |
||||||
|
using System.Runtime.CompilerServices; |
||||||
|
using System.Text; |
||||||
|
|
||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
public unsafe partial struct ImDrawVert |
||||||
|
{ |
||||||
|
public Vector2 pos; |
||||||
|
public Vector2 uv; |
||||||
|
public uint col; |
||||||
|
} |
||||||
|
public unsafe partial struct ImDrawVertPtr |
||||||
|
{ |
||||||
|
public ImDrawVert* NativePtr { get; } |
||||||
|
public ImDrawVertPtr(ImDrawVert* nativePtr) => NativePtr = nativePtr; |
||||||
|
public ImDrawVertPtr(IntPtr nativePtr) => NativePtr = (ImDrawVert*)nativePtr; |
||||||
|
public static implicit operator ImDrawVertPtr(ImDrawVert* nativePtr) => new ImDrawVertPtr(nativePtr); |
||||||
|
public static implicit operator ImDrawVert* (ImDrawVertPtr wrappedPtr) => wrappedPtr.NativePtr; |
||||||
|
public static implicit operator ImDrawVertPtr(IntPtr nativePtr) => new ImDrawVertPtr(nativePtr); |
||||||
|
public ref Vector2 pos => ref Unsafe.AsRef<Vector2>(&NativePtr->pos); |
||||||
|
public ref Vector2 uv => ref Unsafe.AsRef<Vector2>(&NativePtr->uv); |
||||||
|
public ref uint col => ref Unsafe.AsRef<uint>(&NativePtr->col); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,112 @@ |
|||||||
|
using System; |
||||||
|
using System.Numerics; |
||||||
|
using System.Runtime.CompilerServices; |
||||||
|
using System.Text; |
||||||
|
|
||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
public unsafe partial struct ImFont |
||||||
|
{ |
||||||
|
public float FontSize; |
||||||
|
public float Scale; |
||||||
|
public Vector2 DisplayOffset; |
||||||
|
public ImVector/*<ImFontGlyph>*/ Glyphs; |
||||||
|
public ImVector/*<float>*/ IndexAdvanceX; |
||||||
|
public ImVector/*<unsigned short>*/ IndexLookup; |
||||||
|
public ImFontGlyph* FallbackGlyph; |
||||||
|
public float FallbackAdvanceX; |
||||||
|
public ushort FallbackChar; |
||||||
|
public short ConfigDataCount; |
||||||
|
public ImFontConfig* ConfigData; |
||||||
|
public ImFontAtlas* ContainerAtlas; |
||||||
|
public float Ascent; |
||||||
|
public float Descent; |
||||||
|
public byte DirtyLookupTables; |
||||||
|
public int MetricsTotalSurface; |
||||||
|
} |
||||||
|
public unsafe partial struct ImFontPtr |
||||||
|
{ |
||||||
|
public ImFont* NativePtr { get; } |
||||||
|
public ImFontPtr(ImFont* nativePtr) => NativePtr = nativePtr; |
||||||
|
public ImFontPtr(IntPtr nativePtr) => NativePtr = (ImFont*)nativePtr; |
||||||
|
public static implicit operator ImFontPtr(ImFont* nativePtr) => new ImFontPtr(nativePtr); |
||||||
|
public static implicit operator ImFont* (ImFontPtr wrappedPtr) => wrappedPtr.NativePtr; |
||||||
|
public static implicit operator ImFontPtr(IntPtr nativePtr) => new ImFontPtr(nativePtr); |
||||||
|
public ref float FontSize => ref Unsafe.AsRef<float>(&NativePtr->FontSize); |
||||||
|
public ref float Scale => ref Unsafe.AsRef<float>(&NativePtr->Scale); |
||||||
|
public ref Vector2 DisplayOffset => ref Unsafe.AsRef<Vector2>(&NativePtr->DisplayOffset); |
||||||
|
public ImPtrVector<ImFontGlyphPtr> Glyphs => new ImPtrVector<ImFontGlyphPtr>(NativePtr->Glyphs, Unsafe.SizeOf<ImFontGlyph>()); |
||||||
|
public ImVector<float> IndexAdvanceX => new ImVector<float>(NativePtr->IndexAdvanceX); |
||||||
|
public ImVector<ushort> IndexLookup => new ImVector<ushort>(NativePtr->IndexLookup); |
||||||
|
public ImFontGlyphPtr FallbackGlyph => new ImFontGlyphPtr(NativePtr->FallbackGlyph); |
||||||
|
public ref float FallbackAdvanceX => ref Unsafe.AsRef<float>(&NativePtr->FallbackAdvanceX); |
||||||
|
public ref ushort FallbackChar => ref Unsafe.AsRef<ushort>(&NativePtr->FallbackChar); |
||||||
|
public ref short ConfigDataCount => ref Unsafe.AsRef<short>(&NativePtr->ConfigDataCount); |
||||||
|
public ImFontConfigPtr ConfigData => new ImFontConfigPtr(NativePtr->ConfigData); |
||||||
|
public ImFontAtlasPtr ContainerAtlas => new ImFontAtlasPtr(NativePtr->ContainerAtlas); |
||||||
|
public ref float Ascent => ref Unsafe.AsRef<float>(&NativePtr->Ascent); |
||||||
|
public ref float Descent => ref Unsafe.AsRef<float>(&NativePtr->Descent); |
||||||
|
public ref Bool8 DirtyLookupTables => ref Unsafe.AsRef<Bool8>(&NativePtr->DirtyLookupTables); |
||||||
|
public ref int MetricsTotalSurface => ref Unsafe.AsRef<int>(&NativePtr->MetricsTotalSurface); |
||||||
|
public void AddRemapChar(ushort dst, ushort src) |
||||||
|
{ |
||||||
|
byte overwrite_dst = 1; |
||||||
|
ImGuiNative.ImFont_AddRemapChar(NativePtr, dst, src, overwrite_dst); |
||||||
|
} |
||||||
|
public void AddRemapChar(ushort dst, ushort src, bool overwrite_dst) |
||||||
|
{ |
||||||
|
byte native_overwrite_dst = overwrite_dst ? (byte)1 : (byte)0; |
||||||
|
ImGuiNative.ImFont_AddRemapChar(NativePtr, dst, src, native_overwrite_dst); |
||||||
|
} |
||||||
|
public void AddGlyph(ushort c, float x0, float y0, float x1, float y1, float u0, float v0, float u1, float v1, float advance_x) |
||||||
|
{ |
||||||
|
ImGuiNative.ImFont_AddGlyph(NativePtr, c, x0, y0, x1, y1, u0, v0, u1, v1, advance_x); |
||||||
|
} |
||||||
|
public void GrowIndex(int new_size) |
||||||
|
{ |
||||||
|
ImGuiNative.ImFont_GrowIndex(NativePtr, new_size); |
||||||
|
} |
||||||
|
public ImFontGlyphPtr FindGlyphNoFallback(ushort c) |
||||||
|
{ |
||||||
|
ImFontGlyph* ret = ImGuiNative.ImFont_FindGlyphNoFallback(NativePtr, c); |
||||||
|
return new ImFontGlyphPtr(ret); |
||||||
|
} |
||||||
|
public bool IsLoaded() |
||||||
|
{ |
||||||
|
byte ret = ImGuiNative.ImFont_IsLoaded(NativePtr); |
||||||
|
return ret != 0; |
||||||
|
} |
||||||
|
public float GetCharAdvance(ushort c) |
||||||
|
{ |
||||||
|
float ret = ImGuiNative.ImFont_GetCharAdvance(NativePtr, c); |
||||||
|
return ret; |
||||||
|
} |
||||||
|
public void SetFallbackChar(ushort c) |
||||||
|
{ |
||||||
|
ImGuiNative.ImFont_SetFallbackChar(NativePtr, c); |
||||||
|
} |
||||||
|
public void RenderChar(ImDrawListPtr draw_list, float size, Vector2 pos, uint col, ushort c) |
||||||
|
{ |
||||||
|
ImDrawList* native_draw_list = draw_list.NativePtr; |
||||||
|
ImGuiNative.ImFont_RenderChar(NativePtr, native_draw_list, size, pos, col, c); |
||||||
|
} |
||||||
|
public ImFontGlyphPtr FindGlyph(ushort c) |
||||||
|
{ |
||||||
|
ImFontGlyph* ret = ImGuiNative.ImFont_FindGlyph(NativePtr, c); |
||||||
|
return new ImFontGlyphPtr(ret); |
||||||
|
} |
||||||
|
public string GetDebugName() |
||||||
|
{ |
||||||
|
byte* ret = ImGuiNative.ImFont_GetDebugName(NativePtr); |
||||||
|
return Util.StringFromPtr(ret); |
||||||
|
} |
||||||
|
public void BuildLookupTable() |
||||||
|
{ |
||||||
|
ImGuiNative.ImFont_BuildLookupTable(NativePtr); |
||||||
|
} |
||||||
|
public void ClearOutputData() |
||||||
|
{ |
||||||
|
ImGuiNative.ImFont_ClearOutputData(NativePtr); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,386 @@ |
|||||||
|
using System; |
||||||
|
using System.Numerics; |
||||||
|
using System.Runtime.CompilerServices; |
||||||
|
using System.Text; |
||||||
|
|
||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
public unsafe partial struct ImFontAtlas |
||||||
|
{ |
||||||
|
public byte Locked; |
||||||
|
public ImFontAtlasFlags Flags; |
||||||
|
public IntPtr TexID; |
||||||
|
public int TexDesiredWidth; |
||||||
|
public int TexGlyphPadding; |
||||||
|
public byte* TexPixelsAlpha8; |
||||||
|
public uint* TexPixelsRGBA32; |
||||||
|
public int TexWidth; |
||||||
|
public int TexHeight; |
||||||
|
public Vector2 TexUvScale; |
||||||
|
public Vector2 TexUvWhitePixel; |
||||||
|
public ImVector/*<ImFont*>*/ Fonts; |
||||||
|
public ImVector/*<CustomRect>*/ CustomRects; |
||||||
|
public ImVector/*<ImFontConfig>*/ ConfigData; |
||||||
|
public fixed int CustomRectIds[1]; |
||||||
|
} |
||||||
|
public unsafe partial struct ImFontAtlasPtr |
||||||
|
{ |
||||||
|
public ImFontAtlas* NativePtr { get; } |
||||||
|
public ImFontAtlasPtr(ImFontAtlas* nativePtr) => NativePtr = nativePtr; |
||||||
|
public ImFontAtlasPtr(IntPtr nativePtr) => NativePtr = (ImFontAtlas*)nativePtr; |
||||||
|
public static implicit operator ImFontAtlasPtr(ImFontAtlas* nativePtr) => new ImFontAtlasPtr(nativePtr); |
||||||
|
public static implicit operator ImFontAtlas* (ImFontAtlasPtr wrappedPtr) => wrappedPtr.NativePtr; |
||||||
|
public static implicit operator ImFontAtlasPtr(IntPtr nativePtr) => new ImFontAtlasPtr(nativePtr); |
||||||
|
public ref Bool8 Locked => ref Unsafe.AsRef<Bool8>(&NativePtr->Locked); |
||||||
|
public ref ImFontAtlasFlags Flags => ref Unsafe.AsRef<ImFontAtlasFlags>(&NativePtr->Flags); |
||||||
|
public ref IntPtr TexID => ref Unsafe.AsRef<IntPtr>(&NativePtr->TexID); |
||||||
|
public ref int TexDesiredWidth => ref Unsafe.AsRef<int>(&NativePtr->TexDesiredWidth); |
||||||
|
public ref int TexGlyphPadding => ref Unsafe.AsRef<int>(&NativePtr->TexGlyphPadding); |
||||||
|
public IntPtr TexPixelsAlpha8 { get => (IntPtr)NativePtr->TexPixelsAlpha8; set => NativePtr->TexPixelsAlpha8 = (byte*)value; } |
||||||
|
public IntPtr TexPixelsRGBA32 { get => (IntPtr)NativePtr->TexPixelsRGBA32; set => NativePtr->TexPixelsRGBA32 = (uint*)value; } |
||||||
|
public ref int TexWidth => ref Unsafe.AsRef<int>(&NativePtr->TexWidth); |
||||||
|
public ref int TexHeight => ref Unsafe.AsRef<int>(&NativePtr->TexHeight); |
||||||
|
public ref Vector2 TexUvScale => ref Unsafe.AsRef<Vector2>(&NativePtr->TexUvScale); |
||||||
|
public ref Vector2 TexUvWhitePixel => ref Unsafe.AsRef<Vector2>(&NativePtr->TexUvWhitePixel); |
||||||
|
public ImVector<ImFontPtr> Fonts => new ImVector<ImFontPtr>(NativePtr->Fonts); |
||||||
|
public ImVector<CustomRect> CustomRects => new ImVector<CustomRect>(NativePtr->CustomRects); |
||||||
|
public ImPtrVector<ImFontConfigPtr> ConfigData => new ImPtrVector<ImFontConfigPtr>(NativePtr->ConfigData, Unsafe.SizeOf<ImFontConfig>()); |
||||||
|
public RangeAccessor<int> CustomRectIds => new RangeAccessor<int>(NativePtr->CustomRectIds, 1); |
||||||
|
public ImFontPtr AddFontFromMemoryCompressedBase85TTF(string compressed_font_data_base85, float size_pixels) |
||||||
|
{ |
||||||
|
int compressed_font_data_base85_byteCount = Encoding.UTF8.GetByteCount(compressed_font_data_base85); |
||||||
|
byte* native_compressed_font_data_base85 = stackalloc byte[compressed_font_data_base85_byteCount + 1]; |
||||||
|
fixed (char* compressed_font_data_base85_ptr = compressed_font_data_base85) |
||||||
|
{ |
||||||
|
int native_compressed_font_data_base85_offset = Encoding.UTF8.GetBytes(compressed_font_data_base85_ptr, compressed_font_data_base85.Length, native_compressed_font_data_base85, compressed_font_data_base85_byteCount); |
||||||
|
native_compressed_font_data_base85[native_compressed_font_data_base85_offset] = 0; |
||||||
|
} |
||||||
|
ImFontConfig* font_cfg = null; |
||||||
|
ushort* glyph_ranges = null; |
||||||
|
ImFont* ret = ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(NativePtr, native_compressed_font_data_base85, size_pixels, font_cfg, glyph_ranges); |
||||||
|
return new ImFontPtr(ret); |
||||||
|
} |
||||||
|
public ImFontPtr AddFontFromMemoryCompressedBase85TTF(string compressed_font_data_base85, float size_pixels, ImFontConfigPtr font_cfg) |
||||||
|
{ |
||||||
|
int compressed_font_data_base85_byteCount = Encoding.UTF8.GetByteCount(compressed_font_data_base85); |
||||||
|
byte* native_compressed_font_data_base85 = stackalloc byte[compressed_font_data_base85_byteCount + 1]; |
||||||
|
fixed (char* compressed_font_data_base85_ptr = compressed_font_data_base85) |
||||||
|
{ |
||||||
|
int native_compressed_font_data_base85_offset = Encoding.UTF8.GetBytes(compressed_font_data_base85_ptr, compressed_font_data_base85.Length, native_compressed_font_data_base85, compressed_font_data_base85_byteCount); |
||||||
|
native_compressed_font_data_base85[native_compressed_font_data_base85_offset] = 0; |
||||||
|
} |
||||||
|
ImFontConfig* native_font_cfg = font_cfg.NativePtr; |
||||||
|
ushort* glyph_ranges = null; |
||||||
|
ImFont* ret = ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(NativePtr, native_compressed_font_data_base85, size_pixels, native_font_cfg, glyph_ranges); |
||||||
|
return new ImFontPtr(ret); |
||||||
|
} |
||||||
|
public ImFontPtr AddFontFromMemoryCompressedBase85TTF(string compressed_font_data_base85, float size_pixels, ImFontConfigPtr font_cfg, ref ushort glyph_ranges) |
||||||
|
{ |
||||||
|
int compressed_font_data_base85_byteCount = Encoding.UTF8.GetByteCount(compressed_font_data_base85); |
||||||
|
byte* native_compressed_font_data_base85 = stackalloc byte[compressed_font_data_base85_byteCount + 1]; |
||||||
|
fixed (char* compressed_font_data_base85_ptr = compressed_font_data_base85) |
||||||
|
{ |
||||||
|
int native_compressed_font_data_base85_offset = Encoding.UTF8.GetBytes(compressed_font_data_base85_ptr, compressed_font_data_base85.Length, native_compressed_font_data_base85, compressed_font_data_base85_byteCount); |
||||||
|
native_compressed_font_data_base85[native_compressed_font_data_base85_offset] = 0; |
||||||
|
} |
||||||
|
ImFontConfig* native_font_cfg = font_cfg.NativePtr; |
||||||
|
fixed (ushort* native_glyph_ranges = &glyph_ranges) |
||||||
|
{ |
||||||
|
ImFont* ret = ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(NativePtr, native_compressed_font_data_base85, size_pixels, native_font_cfg, native_glyph_ranges); |
||||||
|
return new ImFontPtr(ret); |
||||||
|
} |
||||||
|
} |
||||||
|
public bool Build() |
||||||
|
{ |
||||||
|
byte ret = ImGuiNative.ImFontAtlas_Build(NativePtr); |
||||||
|
return ret != 0; |
||||||
|
} |
||||||
|
public ImFontPtr AddFont(ImFontConfigPtr font_cfg) |
||||||
|
{ |
||||||
|
ImFontConfig* native_font_cfg = font_cfg.NativePtr; |
||||||
|
ImFont* ret = ImGuiNative.ImFontAtlas_AddFont(NativePtr, native_font_cfg); |
||||||
|
return new ImFontPtr(ret); |
||||||
|
} |
||||||
|
public void CalcCustomRectUV(ref CustomRect rect, out Vector2 out_uv_min, out Vector2 out_uv_max) |
||||||
|
{ |
||||||
|
fixed (CustomRect* native_rect = &rect) |
||||||
|
{ |
||||||
|
fixed (Vector2* native_out_uv_min = &out_uv_min) |
||||||
|
{ |
||||||
|
fixed (Vector2* native_out_uv_max = &out_uv_max) |
||||||
|
{ |
||||||
|
ImGuiNative.ImFontAtlas_CalcCustomRectUV(NativePtr, native_rect, native_out_uv_min, native_out_uv_max); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
public CustomRect* GetCustomRectByIndex(int index) |
||||||
|
{ |
||||||
|
CustomRect* ret = ImGuiNative.ImFontAtlas_GetCustomRectByIndex(NativePtr, index); |
||||||
|
return ret; |
||||||
|
} |
||||||
|
public int AddCustomRectRegular(uint id, int width, int height) |
||||||
|
{ |
||||||
|
int ret = ImGuiNative.ImFontAtlas_AddCustomRectRegular(NativePtr, id, width, height); |
||||||
|
return ret; |
||||||
|
} |
||||||
|
public bool IsBuilt() |
||||||
|
{ |
||||||
|
byte ret = ImGuiNative.ImFontAtlas_IsBuilt(NativePtr); |
||||||
|
return ret != 0; |
||||||
|
} |
||||||
|
public ushort* GetGlyphRangesThai() |
||||||
|
{ |
||||||
|
ushort* ret = ImGuiNative.ImFontAtlas_GetGlyphRangesThai(NativePtr); |
||||||
|
return ret; |
||||||
|
} |
||||||
|
public ushort* GetGlyphRangesCyrillic() |
||||||
|
{ |
||||||
|
ushort* ret = ImGuiNative.ImFontAtlas_GetGlyphRangesCyrillic(NativePtr); |
||||||
|
return ret; |
||||||
|
} |
||||||
|
public ushort* GetGlyphRangesChineseSimplifiedCommon() |
||||||
|
{ |
||||||
|
ushort* ret = ImGuiNative.ImFontAtlas_GetGlyphRangesChineseSimplifiedCommon(NativePtr); |
||||||
|
return ret; |
||||||
|
} |
||||||
|
public ushort* GetGlyphRangesChineseFull() |
||||||
|
{ |
||||||
|
ushort* ret = ImGuiNative.ImFontAtlas_GetGlyphRangesChineseFull(NativePtr); |
||||||
|
return ret; |
||||||
|
} |
||||||
|
public ushort* GetGlyphRangesDefault() |
||||||
|
{ |
||||||
|
ushort* ret = ImGuiNative.ImFontAtlas_GetGlyphRangesDefault(NativePtr); |
||||||
|
return ret; |
||||||
|
} |
||||||
|
public void SetTexID(IntPtr id) |
||||||
|
{ |
||||||
|
ImGuiNative.ImFontAtlas_SetTexID(NativePtr, id); |
||||||
|
} |
||||||
|
public void ClearTexData() |
||||||
|
{ |
||||||
|
ImGuiNative.ImFontAtlas_ClearTexData(NativePtr); |
||||||
|
} |
||||||
|
public void ClearFonts() |
||||||
|
{ |
||||||
|
ImGuiNative.ImFontAtlas_ClearFonts(NativePtr); |
||||||
|
} |
||||||
|
public void Clear() |
||||||
|
{ |
||||||
|
ImGuiNative.ImFontAtlas_Clear(NativePtr); |
||||||
|
} |
||||||
|
public ImFontPtr AddFontFromMemoryCompressedTTF(IntPtr compressed_font_data, int compressed_font_size, float size_pixels) |
||||||
|
{ |
||||||
|
void* native_compressed_font_data = compressed_font_data.ToPointer(); |
||||||
|
ImFontConfig* font_cfg = null; |
||||||
|
ushort* glyph_ranges = null; |
||||||
|
ImFont* ret = ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedTTF(NativePtr, native_compressed_font_data, compressed_font_size, size_pixels, font_cfg, glyph_ranges); |
||||||
|
return new ImFontPtr(ret); |
||||||
|
} |
||||||
|
public ImFontPtr AddFontFromMemoryCompressedTTF(IntPtr compressed_font_data, int compressed_font_size, float size_pixels, ImFontConfigPtr font_cfg) |
||||||
|
{ |
||||||
|
void* native_compressed_font_data = compressed_font_data.ToPointer(); |
||||||
|
ImFontConfig* native_font_cfg = font_cfg.NativePtr; |
||||||
|
ushort* glyph_ranges = null; |
||||||
|
ImFont* ret = ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedTTF(NativePtr, native_compressed_font_data, compressed_font_size, size_pixels, native_font_cfg, glyph_ranges); |
||||||
|
return new ImFontPtr(ret); |
||||||
|
} |
||||||
|
public ImFontPtr AddFontFromMemoryCompressedTTF(IntPtr compressed_font_data, int compressed_font_size, float size_pixels, ImFontConfigPtr font_cfg, ref ushort glyph_ranges) |
||||||
|
{ |
||||||
|
void* native_compressed_font_data = compressed_font_data.ToPointer(); |
||||||
|
ImFontConfig* native_font_cfg = font_cfg.NativePtr; |
||||||
|
fixed (ushort* native_glyph_ranges = &glyph_ranges) |
||||||
|
{ |
||||||
|
ImFont* ret = ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedTTF(NativePtr, native_compressed_font_data, compressed_font_size, size_pixels, native_font_cfg, native_glyph_ranges); |
||||||
|
return new ImFontPtr(ret); |
||||||
|
} |
||||||
|
} |
||||||
|
public ImFontPtr AddFontFromMemoryTTF(IntPtr font_data, int font_size, float size_pixels) |
||||||
|
{ |
||||||
|
void* native_font_data = font_data.ToPointer(); |
||||||
|
ImFontConfig* font_cfg = null; |
||||||
|
ushort* glyph_ranges = null; |
||||||
|
ImFont* ret = ImGuiNative.ImFontAtlas_AddFontFromMemoryTTF(NativePtr, native_font_data, font_size, size_pixels, font_cfg, glyph_ranges); |
||||||
|
return new ImFontPtr(ret); |
||||||
|
} |
||||||
|
public ImFontPtr AddFontFromMemoryTTF(IntPtr font_data, int font_size, float size_pixels, ImFontConfigPtr font_cfg) |
||||||
|
{ |
||||||
|
void* native_font_data = font_data.ToPointer(); |
||||||
|
ImFontConfig* native_font_cfg = font_cfg.NativePtr; |
||||||
|
ushort* glyph_ranges = null; |
||||||
|
ImFont* ret = ImGuiNative.ImFontAtlas_AddFontFromMemoryTTF(NativePtr, native_font_data, font_size, size_pixels, native_font_cfg, glyph_ranges); |
||||||
|
return new ImFontPtr(ret); |
||||||
|
} |
||||||
|
public ImFontPtr AddFontFromMemoryTTF(IntPtr font_data, int font_size, float size_pixels, ImFontConfigPtr font_cfg, ref ushort glyph_ranges) |
||||||
|
{ |
||||||
|
void* native_font_data = font_data.ToPointer(); |
||||||
|
ImFontConfig* native_font_cfg = font_cfg.NativePtr; |
||||||
|
fixed (ushort* native_glyph_ranges = &glyph_ranges) |
||||||
|
{ |
||||||
|
ImFont* ret = ImGuiNative.ImFontAtlas_AddFontFromMemoryTTF(NativePtr, native_font_data, font_size, size_pixels, native_font_cfg, native_glyph_ranges); |
||||||
|
return new ImFontPtr(ret); |
||||||
|
} |
||||||
|
} |
||||||
|
public ImFontPtr AddFontFromFileTTF(string filename, float size_pixels) |
||||||
|
{ |
||||||
|
int filename_byteCount = Encoding.UTF8.GetByteCount(filename); |
||||||
|
byte* native_filename = stackalloc byte[filename_byteCount + 1]; |
||||||
|
fixed (char* filename_ptr = filename) |
||||||
|
{ |
||||||
|
int native_filename_offset = Encoding.UTF8.GetBytes(filename_ptr, filename.Length, native_filename, filename_byteCount); |
||||||
|
native_filename[native_filename_offset] = 0; |
||||||
|
} |
||||||
|
ImFontConfig* font_cfg = null; |
||||||
|
ushort* glyph_ranges = null; |
||||||
|
ImFont* ret = ImGuiNative.ImFontAtlas_AddFontFromFileTTF(NativePtr, native_filename, size_pixels, font_cfg, glyph_ranges); |
||||||
|
return new ImFontPtr(ret); |
||||||
|
} |
||||||
|
public ImFontPtr AddFontFromFileTTF(string filename, float size_pixels, ImFontConfigPtr font_cfg) |
||||||
|
{ |
||||||
|
int filename_byteCount = Encoding.UTF8.GetByteCount(filename); |
||||||
|
byte* native_filename = stackalloc byte[filename_byteCount + 1]; |
||||||
|
fixed (char* filename_ptr = filename) |
||||||
|
{ |
||||||
|
int native_filename_offset = Encoding.UTF8.GetBytes(filename_ptr, filename.Length, native_filename, filename_byteCount); |
||||||
|
native_filename[native_filename_offset] = 0; |
||||||
|
} |
||||||
|
ImFontConfig* native_font_cfg = font_cfg.NativePtr; |
||||||
|
ushort* glyph_ranges = null; |
||||||
|
ImFont* ret = ImGuiNative.ImFontAtlas_AddFontFromFileTTF(NativePtr, native_filename, size_pixels, native_font_cfg, glyph_ranges); |
||||||
|
return new ImFontPtr(ret); |
||||||
|
} |
||||||
|
public ImFontPtr AddFontFromFileTTF(string filename, float size_pixels, ImFontConfigPtr font_cfg, ref ushort glyph_ranges) |
||||||
|
{ |
||||||
|
int filename_byteCount = Encoding.UTF8.GetByteCount(filename); |
||||||
|
byte* native_filename = stackalloc byte[filename_byteCount + 1]; |
||||||
|
fixed (char* filename_ptr = filename) |
||||||
|
{ |
||||||
|
int native_filename_offset = Encoding.UTF8.GetBytes(filename_ptr, filename.Length, native_filename, filename_byteCount); |
||||||
|
native_filename[native_filename_offset] = 0; |
||||||
|
} |
||||||
|
ImFontConfig* native_font_cfg = font_cfg.NativePtr; |
||||||
|
fixed (ushort* native_glyph_ranges = &glyph_ranges) |
||||||
|
{ |
||||||
|
ImFont* ret = ImGuiNative.ImFontAtlas_AddFontFromFileTTF(NativePtr, native_filename, size_pixels, native_font_cfg, native_glyph_ranges); |
||||||
|
return new ImFontPtr(ret); |
||||||
|
} |
||||||
|
} |
||||||
|
public ImFontPtr AddFontDefault() |
||||||
|
{ |
||||||
|
ImFontConfig* font_cfg = null; |
||||||
|
ImFont* ret = ImGuiNative.ImFontAtlas_AddFontDefault(NativePtr, font_cfg); |
||||||
|
return new ImFontPtr(ret); |
||||||
|
} |
||||||
|
public ImFontPtr AddFontDefault(ImFontConfigPtr font_cfg) |
||||||
|
{ |
||||||
|
ImFontConfig* native_font_cfg = font_cfg.NativePtr; |
||||||
|
ImFont* ret = ImGuiNative.ImFontAtlas_AddFontDefault(NativePtr, native_font_cfg); |
||||||
|
return new ImFontPtr(ret); |
||||||
|
} |
||||||
|
public ushort* GetGlyphRangesJapanese() |
||||||
|
{ |
||||||
|
ushort* ret = ImGuiNative.ImFontAtlas_GetGlyphRangesJapanese(NativePtr); |
||||||
|
return ret; |
||||||
|
} |
||||||
|
public void GetTexDataAsAlpha8(out byte* out_pixels, out int out_width, out int out_height) |
||||||
|
{ |
||||||
|
int* out_bytes_per_pixel = null; |
||||||
|
fixed (byte** native_out_pixels = &out_pixels) |
||||||
|
{ |
||||||
|
fixed (int* native_out_width = &out_width) |
||||||
|
{ |
||||||
|
fixed (int* native_out_height = &out_height) |
||||||
|
{ |
||||||
|
ImGuiNative.ImFontAtlas_GetTexDataAsAlpha8(NativePtr, native_out_pixels, native_out_width, native_out_height, out_bytes_per_pixel); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
public void GetTexDataAsAlpha8(out byte* out_pixels, out int out_width, out int out_height, out int out_bytes_per_pixel) |
||||||
|
{ |
||||||
|
fixed (byte** native_out_pixels = &out_pixels) |
||||||
|
{ |
||||||
|
fixed (int* native_out_width = &out_width) |
||||||
|
{ |
||||||
|
fixed (int* native_out_height = &out_height) |
||||||
|
{ |
||||||
|
fixed (int* native_out_bytes_per_pixel = &out_bytes_per_pixel) |
||||||
|
{ |
||||||
|
ImGuiNative.ImFontAtlas_GetTexDataAsAlpha8(NativePtr, native_out_pixels, native_out_width, native_out_height, native_out_bytes_per_pixel); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
public void ClearInputData() |
||||||
|
{ |
||||||
|
ImGuiNative.ImFontAtlas_ClearInputData(NativePtr); |
||||||
|
} |
||||||
|
public bool GetMouseCursorTexData(ImGuiMouseCursor cursor, out Vector2 out_offset, out Vector2 out_size, out Vector2 out_uv_border, out Vector2 out_uv_fill) |
||||||
|
{ |
||||||
|
fixed (Vector2* native_out_offset = &out_offset) |
||||||
|
{ |
||||||
|
fixed (Vector2* native_out_size = &out_size) |
||||||
|
{ |
||||||
|
fixed (Vector2* native_out_uv_border = &out_uv_border) |
||||||
|
{ |
||||||
|
fixed (Vector2* native_out_uv_fill = &out_uv_fill) |
||||||
|
{ |
||||||
|
byte ret = ImGuiNative.ImFontAtlas_GetMouseCursorTexData(NativePtr, cursor, native_out_offset, native_out_size, native_out_uv_border, native_out_uv_fill); |
||||||
|
return ret != 0; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
public ushort* GetGlyphRangesKorean() |
||||||
|
{ |
||||||
|
ushort* ret = ImGuiNative.ImFontAtlas_GetGlyphRangesKorean(NativePtr); |
||||||
|
return ret; |
||||||
|
} |
||||||
|
public void GetTexDataAsRGBA32(out byte* out_pixels, out int out_width, out int out_height) |
||||||
|
{ |
||||||
|
int* out_bytes_per_pixel = null; |
||||||
|
fixed (byte** native_out_pixels = &out_pixels) |
||||||
|
{ |
||||||
|
fixed (int* native_out_width = &out_width) |
||||||
|
{ |
||||||
|
fixed (int* native_out_height = &out_height) |
||||||
|
{ |
||||||
|
ImGuiNative.ImFontAtlas_GetTexDataAsRGBA32(NativePtr, native_out_pixels, native_out_width, native_out_height, out_bytes_per_pixel); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
public void GetTexDataAsRGBA32(out byte* out_pixels, out int out_width, out int out_height, out int out_bytes_per_pixel) |
||||||
|
{ |
||||||
|
fixed (byte** native_out_pixels = &out_pixels) |
||||||
|
{ |
||||||
|
fixed (int* native_out_width = &out_width) |
||||||
|
{ |
||||||
|
fixed (int* native_out_height = &out_height) |
||||||
|
{ |
||||||
|
fixed (int* native_out_bytes_per_pixel = &out_bytes_per_pixel) |
||||||
|
{ |
||||||
|
ImGuiNative.ImFontAtlas_GetTexDataAsRGBA32(NativePtr, native_out_pixels, native_out_width, native_out_height, native_out_bytes_per_pixel); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
public int AddCustomRectFontGlyph(ImFontPtr font, ushort id, int width, int height, float advance_x) |
||||||
|
{ |
||||||
|
ImFont* native_font = font.NativePtr; |
||||||
|
Vector2 offset = new Vector2(); |
||||||
|
int ret = ImGuiNative.ImFontAtlas_AddCustomRectFontGlyph(NativePtr, native_font, id, width, height, advance_x, offset); |
||||||
|
return ret; |
||||||
|
} |
||||||
|
public int AddCustomRectFontGlyph(ImFontPtr font, ushort id, int width, int height, float advance_x, Vector2 offset) |
||||||
|
{ |
||||||
|
ImFont* native_font = font.NativePtr; |
||||||
|
int ret = ImGuiNative.ImFontAtlas_AddCustomRectFontGlyph(NativePtr, native_font, id, width, height, advance_x, offset); |
||||||
|
return ret; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,10 @@ |
|||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
[System.Flags] |
||||||
|
public enum ImFontAtlasFlags |
||||||
|
{ |
||||||
|
None = 0, |
||||||
|
NoPowerOfTwoHeight = 1 << 0, |
||||||
|
NoMouseCursors = 1 << 1, |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,56 @@ |
|||||||
|
using System; |
||||||
|
using System.Numerics; |
||||||
|
using System.Runtime.CompilerServices; |
||||||
|
using System.Text; |
||||||
|
|
||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
public unsafe partial struct ImFontConfig |
||||||
|
{ |
||||||
|
public void* FontData; |
||||||
|
public int FontDataSize; |
||||||
|
public byte FontDataOwnedByAtlas; |
||||||
|
public int FontNo; |
||||||
|
public float SizePixels; |
||||||
|
public int OversampleH; |
||||||
|
public int OversampleV; |
||||||
|
public byte PixelSnapH; |
||||||
|
public Vector2 GlyphExtraSpacing; |
||||||
|
public Vector2 GlyphOffset; |
||||||
|
public ushort* GlyphRanges; |
||||||
|
public float GlyphMinAdvanceX; |
||||||
|
public float GlyphMaxAdvanceX; |
||||||
|
public byte MergeMode; |
||||||
|
public uint RasterizerFlags; |
||||||
|
public float RasterizerMultiply; |
||||||
|
public fixed byte Name[40]; |
||||||
|
public ImFont* DstFont; |
||||||
|
} |
||||||
|
public unsafe partial struct ImFontConfigPtr |
||||||
|
{ |
||||||
|
public ImFontConfig* NativePtr { get; } |
||||||
|
public ImFontConfigPtr(ImFontConfig* nativePtr) => NativePtr = nativePtr; |
||||||
|
public ImFontConfigPtr(IntPtr nativePtr) => NativePtr = (ImFontConfig*)nativePtr; |
||||||
|
public static implicit operator ImFontConfigPtr(ImFontConfig* nativePtr) => new ImFontConfigPtr(nativePtr); |
||||||
|
public static implicit operator ImFontConfig* (ImFontConfigPtr wrappedPtr) => wrappedPtr.NativePtr; |
||||||
|
public static implicit operator ImFontConfigPtr(IntPtr nativePtr) => new ImFontConfigPtr(nativePtr); |
||||||
|
public IntPtr FontData { get => (IntPtr)NativePtr->FontData; set => NativePtr->FontData = (void*)value; } |
||||||
|
public ref int FontDataSize => ref Unsafe.AsRef<int>(&NativePtr->FontDataSize); |
||||||
|
public ref Bool8 FontDataOwnedByAtlas => ref Unsafe.AsRef<Bool8>(&NativePtr->FontDataOwnedByAtlas); |
||||||
|
public ref int FontNo => ref Unsafe.AsRef<int>(&NativePtr->FontNo); |
||||||
|
public ref float SizePixels => ref Unsafe.AsRef<float>(&NativePtr->SizePixels); |
||||||
|
public ref int OversampleH => ref Unsafe.AsRef<int>(&NativePtr->OversampleH); |
||||||
|
public ref int OversampleV => ref Unsafe.AsRef<int>(&NativePtr->OversampleV); |
||||||
|
public ref Bool8 PixelSnapH => ref Unsafe.AsRef<Bool8>(&NativePtr->PixelSnapH); |
||||||
|
public ref Vector2 GlyphExtraSpacing => ref Unsafe.AsRef<Vector2>(&NativePtr->GlyphExtraSpacing); |
||||||
|
public ref Vector2 GlyphOffset => ref Unsafe.AsRef<Vector2>(&NativePtr->GlyphOffset); |
||||||
|
public IntPtr GlyphRanges { get => (IntPtr)NativePtr->GlyphRanges; set => NativePtr->GlyphRanges = (ushort*)value; } |
||||||
|
public ref float GlyphMinAdvanceX => ref Unsafe.AsRef<float>(&NativePtr->GlyphMinAdvanceX); |
||||||
|
public ref float GlyphMaxAdvanceX => ref Unsafe.AsRef<float>(&NativePtr->GlyphMaxAdvanceX); |
||||||
|
public ref Bool8 MergeMode => ref Unsafe.AsRef<Bool8>(&NativePtr->MergeMode); |
||||||
|
public ref uint RasterizerFlags => ref Unsafe.AsRef<uint>(&NativePtr->RasterizerFlags); |
||||||
|
public ref float RasterizerMultiply => ref Unsafe.AsRef<float>(&NativePtr->RasterizerMultiply); |
||||||
|
public RangeAccessor<byte> Name => new RangeAccessor<byte>(NativePtr->Name, 40); |
||||||
|
public ImFontPtr DstFont => new ImFontPtr(NativePtr->DstFont); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,40 @@ |
|||||||
|
using System; |
||||||
|
using System.Numerics; |
||||||
|
using System.Runtime.CompilerServices; |
||||||
|
using System.Text; |
||||||
|
|
||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
public unsafe partial struct ImFontGlyph |
||||||
|
{ |
||||||
|
public ushort Codepoint; |
||||||
|
public float AdvanceX; |
||||||
|
public float X0; |
||||||
|
public float Y0; |
||||||
|
public float X1; |
||||||
|
public float Y1; |
||||||
|
public float U0; |
||||||
|
public float V0; |
||||||
|
public float U1; |
||||||
|
public float V1; |
||||||
|
} |
||||||
|
public unsafe partial struct ImFontGlyphPtr |
||||||
|
{ |
||||||
|
public ImFontGlyph* NativePtr { get; } |
||||||
|
public ImFontGlyphPtr(ImFontGlyph* nativePtr) => NativePtr = nativePtr; |
||||||
|
public ImFontGlyphPtr(IntPtr nativePtr) => NativePtr = (ImFontGlyph*)nativePtr; |
||||||
|
public static implicit operator ImFontGlyphPtr(ImFontGlyph* nativePtr) => new ImFontGlyphPtr(nativePtr); |
||||||
|
public static implicit operator ImFontGlyph* (ImFontGlyphPtr wrappedPtr) => wrappedPtr.NativePtr; |
||||||
|
public static implicit operator ImFontGlyphPtr(IntPtr nativePtr) => new ImFontGlyphPtr(nativePtr); |
||||||
|
public ref ushort Codepoint => ref Unsafe.AsRef<ushort>(&NativePtr->Codepoint); |
||||||
|
public ref float AdvanceX => ref Unsafe.AsRef<float>(&NativePtr->AdvanceX); |
||||||
|
public ref float X0 => ref Unsafe.AsRef<float>(&NativePtr->X0); |
||||||
|
public ref float Y0 => ref Unsafe.AsRef<float>(&NativePtr->Y0); |
||||||
|
public ref float X1 => ref Unsafe.AsRef<float>(&NativePtr->X1); |
||||||
|
public ref float Y1 => ref Unsafe.AsRef<float>(&NativePtr->Y1); |
||||||
|
public ref float U0 => ref Unsafe.AsRef<float>(&NativePtr->U0); |
||||||
|
public ref float V0 => ref Unsafe.AsRef<float>(&NativePtr->V0); |
||||||
|
public ref float U1 => ref Unsafe.AsRef<float>(&NativePtr->U1); |
||||||
|
public ref float V1 => ref Unsafe.AsRef<float>(&NativePtr->V1); |
||||||
|
} |
||||||
|
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,10 @@ |
|||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
[System.Flags] |
||||||
|
public enum ImGuiBackendFlags |
||||||
|
{ |
||||||
|
HasGamepad = 1 << 0, |
||||||
|
HasMouseCursors = 1 << 1, |
||||||
|
HasSetMousePos = 1 << 2, |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,50 @@ |
|||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
public enum ImGuiCol |
||||||
|
{ |
||||||
|
Text = 0, |
||||||
|
TextDisabled = 1, |
||||||
|
WindowBg = 2, |
||||||
|
ChildBg = 3, |
||||||
|
PopupBg = 4, |
||||||
|
Border = 5, |
||||||
|
BorderShadow = 6, |
||||||
|
FrameBg = 7, |
||||||
|
FrameBgHovered = 8, |
||||||
|
FrameBgActive = 9, |
||||||
|
TitleBg = 10, |
||||||
|
TitleBgActive = 11, |
||||||
|
TitleBgCollapsed = 12, |
||||||
|
MenuBarBg = 13, |
||||||
|
ScrollbarBg = 14, |
||||||
|
ScrollbarGrab = 15, |
||||||
|
ScrollbarGrabHovered = 16, |
||||||
|
ScrollbarGrabActive = 17, |
||||||
|
CheckMark = 18, |
||||||
|
SliderGrab = 19, |
||||||
|
SliderGrabActive = 20, |
||||||
|
Button = 21, |
||||||
|
ButtonHovered = 22, |
||||||
|
ButtonActive = 23, |
||||||
|
Header = 24, |
||||||
|
HeaderHovered = 25, |
||||||
|
HeaderActive = 26, |
||||||
|
Separator = 27, |
||||||
|
SeparatorHovered = 28, |
||||||
|
SeparatorActive = 29, |
||||||
|
ResizeGrip = 30, |
||||||
|
ResizeGripHovered = 31, |
||||||
|
ResizeGripActive = 32, |
||||||
|
PlotLines = 33, |
||||||
|
PlotLinesHovered = 34, |
||||||
|
PlotHistogram = 35, |
||||||
|
PlotHistogramHovered = 36, |
||||||
|
TextSelectedBg = 37, |
||||||
|
DragDropTarget = 38, |
||||||
|
NavHighlight = 39, |
||||||
|
NavWindowingHighlight = 40, |
||||||
|
NavWindowingDimBg = 41, |
||||||
|
ModalWindowDimBg = 42, |
||||||
|
COUNT = 43, |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,32 @@ |
|||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
[System.Flags] |
||||||
|
public enum ImGuiColorEditFlags |
||||||
|
{ |
||||||
|
None = 0, |
||||||
|
NoAlpha = 1 << 1, |
||||||
|
NoPicker = 1 << 2, |
||||||
|
NoOptions = 1 << 3, |
||||||
|
NoSmallPreview = 1 << 4, |
||||||
|
NoInputs = 1 << 5, |
||||||
|
NoTooltip = 1 << 6, |
||||||
|
NoLabel = 1 << 7, |
||||||
|
NoSidePreview = 1 << 8, |
||||||
|
NoDragDrop = 1 << 9, |
||||||
|
AlphaBar = 1 << 16, |
||||||
|
AlphaPreview = 1 << 17, |
||||||
|
AlphaPreviewHalf = 1 << 18, |
||||||
|
HDR = 1 << 19, |
||||||
|
RGB = 1 << 20, |
||||||
|
HSV = 1 << 21, |
||||||
|
HEX = 1 << 22, |
||||||
|
Uint8 = 1 << 23, |
||||||
|
Float = 1 << 24, |
||||||
|
PickerHueBar = 1 << 25, |
||||||
|
PickerHueWheel = 1 << 26, |
||||||
|
_InputsMask = RGB|HSV|HEX, |
||||||
|
_DataTypeMask = Uint8|Float, |
||||||
|
_PickerMask = PickerHueWheel|PickerHueBar, |
||||||
|
_OptionsDefault = Uint8|RGB|PickerHueBar, |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,16 @@ |
|||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
[System.Flags] |
||||||
|
public enum ImGuiComboFlags |
||||||
|
{ |
||||||
|
None = 0, |
||||||
|
PopupAlignLeft = 1 << 0, |
||||||
|
HeightSmall = 1 << 1, |
||||||
|
HeightRegular = 1 << 2, |
||||||
|
HeightLarge = 1 << 3, |
||||||
|
HeightLargest = 1 << 4, |
||||||
|
NoArrowButton = 1 << 5, |
||||||
|
NoPreview = 1 << 6, |
||||||
|
HeightMask = HeightSmall | HeightRegular | HeightLarge | HeightLargest, |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,10 @@ |
|||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
public enum ImGuiCond |
||||||
|
{ |
||||||
|
Always = 1 << 0, |
||||||
|
Once = 1 << 1, |
||||||
|
FirstUseEver = 1 << 2, |
||||||
|
Appearing = 1 << 3, |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,15 @@ |
|||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
[System.Flags] |
||||||
|
public enum ImGuiConfigFlags |
||||||
|
{ |
||||||
|
NavEnableKeyboard = 1 << 0, |
||||||
|
NavEnableGamepad = 1 << 1, |
||||||
|
NavEnableSetMousePos = 1 << 2, |
||||||
|
NavNoCaptureKeyboard = 1 << 3, |
||||||
|
NoMouse = 1 << 4, |
||||||
|
NoMouseCursorChange = 1 << 5, |
||||||
|
IsSRGB = 1 << 20, |
||||||
|
IsTouchScreen = 1 << 21, |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,13 @@ |
|||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
public enum ImGuiDataType |
||||||
|
{ |
||||||
|
S32 = 0, |
||||||
|
U32 = 1, |
||||||
|
S64 = 2, |
||||||
|
U64 = 3, |
||||||
|
Float = 4, |
||||||
|
Double = 5, |
||||||
|
COUNT = 6, |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,12 @@ |
|||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
public enum ImGuiDir |
||||||
|
{ |
||||||
|
None = -1, |
||||||
|
Left = 0, |
||||||
|
Right = 1, |
||||||
|
Up = 2, |
||||||
|
Down = 3, |
||||||
|
COUNT = 4, |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,18 @@ |
|||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
[System.Flags] |
||||||
|
public enum ImGuiDragDropFlags |
||||||
|
{ |
||||||
|
None = 0, |
||||||
|
SourceNoPreviewTooltip = 1 << 0, |
||||||
|
SourceNoDisableHover = 1 << 1, |
||||||
|
SourceNoHoldToOpenOthers = 1 << 2, |
||||||
|
SourceAllowNullID = 1 << 3, |
||||||
|
SourceExtern = 1 << 4, |
||||||
|
SourceAutoExpirePayload = 1 << 5, |
||||||
|
AcceptBeforeDelivery = 1 << 10, |
||||||
|
AcceptNoDrawDefaultRect = 1 << 11, |
||||||
|
AcceptNoPreviewTooltip = 1 << 12, |
||||||
|
AcceptPeekOnly = AcceptBeforeDelivery | AcceptNoDrawDefaultRect, |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,12 @@ |
|||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
[System.Flags] |
||||||
|
public enum ImGuiFocusedFlags |
||||||
|
{ |
||||||
|
None = 0, |
||||||
|
ChildWindows = 1 << 0, |
||||||
|
RootWindow = 1 << 1, |
||||||
|
AnyWindow = 1 << 2, |
||||||
|
RootAndChildWindows = RootWindow | ChildWindows, |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,17 @@ |
|||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
[System.Flags] |
||||||
|
public enum ImGuiHoveredFlags |
||||||
|
{ |
||||||
|
None = 0, |
||||||
|
ChildWindows = 1 << 0, |
||||||
|
RootWindow = 1 << 1, |
||||||
|
AnyWindow = 1 << 2, |
||||||
|
AllowWhenBlockedByPopup = 1 << 3, |
||||||
|
AllowWhenBlockedByActiveItem = 1 << 5, |
||||||
|
AllowWhenOverlapped = 1 << 6, |
||||||
|
AllowWhenDisabled = 1 << 7, |
||||||
|
RectOnly = AllowWhenBlockedByPopup | AllowWhenBlockedByActiveItem | AllowWhenOverlapped, |
||||||
|
RootAndChildWindows = RootWindow | ChildWindows, |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,189 @@ |
|||||||
|
using System; |
||||||
|
using System.Numerics; |
||||||
|
using System.Runtime.CompilerServices; |
||||||
|
using System.Text; |
||||||
|
|
||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
public unsafe partial struct ImGuiIO |
||||||
|
{ |
||||||
|
public ImGuiConfigFlags ConfigFlags; |
||||||
|
public ImGuiBackendFlags BackendFlags; |
||||||
|
public Vector2 DisplaySize; |
||||||
|
public float DeltaTime; |
||||||
|
public float IniSavingRate; |
||||||
|
public byte* IniFilename; |
||||||
|
public byte* LogFilename; |
||||||
|
public float MouseDoubleClickTime; |
||||||
|
public float MouseDoubleClickMaxDist; |
||||||
|
public float MouseDragThreshold; |
||||||
|
public fixed int KeyMap[21]; |
||||||
|
public float KeyRepeatDelay; |
||||||
|
public float KeyRepeatRate; |
||||||
|
public void* UserData; |
||||||
|
public ImFontAtlas* Fonts; |
||||||
|
public float FontGlobalScale; |
||||||
|
public byte FontAllowUserScaling; |
||||||
|
public ImFont* FontDefault; |
||||||
|
public Vector2 DisplayFramebufferScale; |
||||||
|
public Vector2 DisplayVisibleMin; |
||||||
|
public Vector2 DisplayVisibleMax; |
||||||
|
public byte MouseDrawCursor; |
||||||
|
public byte ConfigMacOSXBehaviors; |
||||||
|
public byte ConfigInputTextCursorBlink; |
||||||
|
public byte ConfigResizeWindowsFromEdges; |
||||||
|
public IntPtr GetClipboardTextFn; |
||||||
|
public IntPtr SetClipboardTextFn; |
||||||
|
public void* ClipboardUserData; |
||||||
|
public IntPtr ImeSetInputScreenPosFn; |
||||||
|
public void* ImeWindowHandle; |
||||||
|
public void* RenderDrawListsFnUnused; |
||||||
|
public Vector2 MousePos; |
||||||
|
public fixed byte MouseDown[5]; |
||||||
|
public float MouseWheel; |
||||||
|
public float MouseWheelH; |
||||||
|
public byte KeyCtrl; |
||||||
|
public byte KeyShift; |
||||||
|
public byte KeyAlt; |
||||||
|
public byte KeySuper; |
||||||
|
public fixed byte KeysDown[512]; |
||||||
|
public fixed ushort InputCharacters[17]; |
||||||
|
public fixed float NavInputs[21]; |
||||||
|
public byte WantCaptureMouse; |
||||||
|
public byte WantCaptureKeyboard; |
||||||
|
public byte WantTextInput; |
||||||
|
public byte WantSetMousePos; |
||||||
|
public byte WantSaveIniSettings; |
||||||
|
public byte NavActive; |
||||||
|
public byte NavVisible; |
||||||
|
public float Framerate; |
||||||
|
public int MetricsRenderVertices; |
||||||
|
public int MetricsRenderIndices; |
||||||
|
public int MetricsRenderWindows; |
||||||
|
public int MetricsActiveWindows; |
||||||
|
public int MetricsActiveAllocations; |
||||||
|
public Vector2 MouseDelta; |
||||||
|
public Vector2 MousePosPrev; |
||||||
|
public Vector2 MouseClickedPos_0; |
||||||
|
public Vector2 MouseClickedPos_1; |
||||||
|
public Vector2 MouseClickedPos_2; |
||||||
|
public Vector2 MouseClickedPos_3; |
||||||
|
public Vector2 MouseClickedPos_4; |
||||||
|
public fixed double MouseClickedTime[5]; |
||||||
|
public fixed byte MouseClicked[5]; |
||||||
|
public fixed byte MouseDoubleClicked[5]; |
||||||
|
public fixed byte MouseReleased[5]; |
||||||
|
public fixed byte MouseDownOwned[5]; |
||||||
|
public fixed float MouseDownDuration[5]; |
||||||
|
public fixed float MouseDownDurationPrev[5]; |
||||||
|
public Vector2 MouseDragMaxDistanceAbs_0; |
||||||
|
public Vector2 MouseDragMaxDistanceAbs_1; |
||||||
|
public Vector2 MouseDragMaxDistanceAbs_2; |
||||||
|
public Vector2 MouseDragMaxDistanceAbs_3; |
||||||
|
public Vector2 MouseDragMaxDistanceAbs_4; |
||||||
|
public fixed float MouseDragMaxDistanceSqr[5]; |
||||||
|
public fixed float KeysDownDuration[512]; |
||||||
|
public fixed float KeysDownDurationPrev[512]; |
||||||
|
public fixed float NavInputsDownDuration[21]; |
||||||
|
public fixed float NavInputsDownDurationPrev[21]; |
||||||
|
} |
||||||
|
public unsafe partial struct ImGuiIOPtr |
||||||
|
{ |
||||||
|
public ImGuiIO* NativePtr { get; } |
||||||
|
public ImGuiIOPtr(ImGuiIO* nativePtr) => NativePtr = nativePtr; |
||||||
|
public ImGuiIOPtr(IntPtr nativePtr) => NativePtr = (ImGuiIO*)nativePtr; |
||||||
|
public static implicit operator ImGuiIOPtr(ImGuiIO* nativePtr) => new ImGuiIOPtr(nativePtr); |
||||||
|
public static implicit operator ImGuiIO* (ImGuiIOPtr wrappedPtr) => wrappedPtr.NativePtr; |
||||||
|
public static implicit operator ImGuiIOPtr(IntPtr nativePtr) => new ImGuiIOPtr(nativePtr); |
||||||
|
public ref ImGuiConfigFlags ConfigFlags => ref Unsafe.AsRef<ImGuiConfigFlags>(&NativePtr->ConfigFlags); |
||||||
|
public ref ImGuiBackendFlags BackendFlags => ref Unsafe.AsRef<ImGuiBackendFlags>(&NativePtr->BackendFlags); |
||||||
|
public ref Vector2 DisplaySize => ref Unsafe.AsRef<Vector2>(&NativePtr->DisplaySize); |
||||||
|
public ref float DeltaTime => ref Unsafe.AsRef<float>(&NativePtr->DeltaTime); |
||||||
|
public ref float IniSavingRate => ref Unsafe.AsRef<float>(&NativePtr->IniSavingRate); |
||||||
|
public NullTerminatedString IniFilename => new NullTerminatedString(NativePtr->IniFilename); |
||||||
|
public NullTerminatedString LogFilename => new NullTerminatedString(NativePtr->LogFilename); |
||||||
|
public ref float MouseDoubleClickTime => ref Unsafe.AsRef<float>(&NativePtr->MouseDoubleClickTime); |
||||||
|
public ref float MouseDoubleClickMaxDist => ref Unsafe.AsRef<float>(&NativePtr->MouseDoubleClickMaxDist); |
||||||
|
public ref float MouseDragThreshold => ref Unsafe.AsRef<float>(&NativePtr->MouseDragThreshold); |
||||||
|
public RangeAccessor<int> KeyMap => new RangeAccessor<int>(NativePtr->KeyMap, 21); |
||||||
|
public ref float KeyRepeatDelay => ref Unsafe.AsRef<float>(&NativePtr->KeyRepeatDelay); |
||||||
|
public ref float KeyRepeatRate => ref Unsafe.AsRef<float>(&NativePtr->KeyRepeatRate); |
||||||
|
public IntPtr UserData { get => (IntPtr)NativePtr->UserData; set => NativePtr->UserData = (void*)value; } |
||||||
|
public ImFontAtlasPtr Fonts => new ImFontAtlasPtr(NativePtr->Fonts); |
||||||
|
public ref float FontGlobalScale => ref Unsafe.AsRef<float>(&NativePtr->FontGlobalScale); |
||||||
|
public ref Bool8 FontAllowUserScaling => ref Unsafe.AsRef<Bool8>(&NativePtr->FontAllowUserScaling); |
||||||
|
public ImFontPtr FontDefault => new ImFontPtr(NativePtr->FontDefault); |
||||||
|
public ref Vector2 DisplayFramebufferScale => ref Unsafe.AsRef<Vector2>(&NativePtr->DisplayFramebufferScale); |
||||||
|
public ref Vector2 DisplayVisibleMin => ref Unsafe.AsRef<Vector2>(&NativePtr->DisplayVisibleMin); |
||||||
|
public ref Vector2 DisplayVisibleMax => ref Unsafe.AsRef<Vector2>(&NativePtr->DisplayVisibleMax); |
||||||
|
public ref Bool8 MouseDrawCursor => ref Unsafe.AsRef<Bool8>(&NativePtr->MouseDrawCursor); |
||||||
|
public ref Bool8 ConfigMacOSXBehaviors => ref Unsafe.AsRef<Bool8>(&NativePtr->ConfigMacOSXBehaviors); |
||||||
|
public ref Bool8 ConfigInputTextCursorBlink => ref Unsafe.AsRef<Bool8>(&NativePtr->ConfigInputTextCursorBlink); |
||||||
|
public ref Bool8 ConfigResizeWindowsFromEdges => ref Unsafe.AsRef<Bool8>(&NativePtr->ConfigResizeWindowsFromEdges); |
||||||
|
public ref IntPtr GetClipboardTextFn => ref Unsafe.AsRef<IntPtr>(&NativePtr->GetClipboardTextFn); |
||||||
|
public ref IntPtr SetClipboardTextFn => ref Unsafe.AsRef<IntPtr>(&NativePtr->SetClipboardTextFn); |
||||||
|
public IntPtr ClipboardUserData { get => (IntPtr)NativePtr->ClipboardUserData; set => NativePtr->ClipboardUserData = (void*)value; } |
||||||
|
public ref IntPtr ImeSetInputScreenPosFn => ref Unsafe.AsRef<IntPtr>(&NativePtr->ImeSetInputScreenPosFn); |
||||||
|
public IntPtr ImeWindowHandle { get => (IntPtr)NativePtr->ImeWindowHandle; set => NativePtr->ImeWindowHandle = (void*)value; } |
||||||
|
public IntPtr RenderDrawListsFnUnused { get => (IntPtr)NativePtr->RenderDrawListsFnUnused; set => NativePtr->RenderDrawListsFnUnused = (void*)value; } |
||||||
|
public ref Vector2 MousePos => ref Unsafe.AsRef<Vector2>(&NativePtr->MousePos); |
||||||
|
public RangeAccessor<Bool8> MouseDown => new RangeAccessor<Bool8>(NativePtr->MouseDown, 5); |
||||||
|
public ref float MouseWheel => ref Unsafe.AsRef<float>(&NativePtr->MouseWheel); |
||||||
|
public ref float MouseWheelH => ref Unsafe.AsRef<float>(&NativePtr->MouseWheelH); |
||||||
|
public ref Bool8 KeyCtrl => ref Unsafe.AsRef<Bool8>(&NativePtr->KeyCtrl); |
||||||
|
public ref Bool8 KeyShift => ref Unsafe.AsRef<Bool8>(&NativePtr->KeyShift); |
||||||
|
public ref Bool8 KeyAlt => ref Unsafe.AsRef<Bool8>(&NativePtr->KeyAlt); |
||||||
|
public ref Bool8 KeySuper => ref Unsafe.AsRef<Bool8>(&NativePtr->KeySuper); |
||||||
|
public RangeAccessor<Bool8> KeysDown => new RangeAccessor<Bool8>(NativePtr->KeysDown, 512); |
||||||
|
public RangeAccessor<ushort> InputCharacters => new RangeAccessor<ushort>(NativePtr->InputCharacters, 17); |
||||||
|
public RangeAccessor<float> NavInputs => new RangeAccessor<float>(NativePtr->NavInputs, 21); |
||||||
|
public ref Bool8 WantCaptureMouse => ref Unsafe.AsRef<Bool8>(&NativePtr->WantCaptureMouse); |
||||||
|
public ref Bool8 WantCaptureKeyboard => ref Unsafe.AsRef<Bool8>(&NativePtr->WantCaptureKeyboard); |
||||||
|
public ref Bool8 WantTextInput => ref Unsafe.AsRef<Bool8>(&NativePtr->WantTextInput); |
||||||
|
public ref Bool8 WantSetMousePos => ref Unsafe.AsRef<Bool8>(&NativePtr->WantSetMousePos); |
||||||
|
public ref Bool8 WantSaveIniSettings => ref Unsafe.AsRef<Bool8>(&NativePtr->WantSaveIniSettings); |
||||||
|
public ref Bool8 NavActive => ref Unsafe.AsRef<Bool8>(&NativePtr->NavActive); |
||||||
|
public ref Bool8 NavVisible => ref Unsafe.AsRef<Bool8>(&NativePtr->NavVisible); |
||||||
|
public ref float Framerate => ref Unsafe.AsRef<float>(&NativePtr->Framerate); |
||||||
|
public ref int MetricsRenderVertices => ref Unsafe.AsRef<int>(&NativePtr->MetricsRenderVertices); |
||||||
|
public ref int MetricsRenderIndices => ref Unsafe.AsRef<int>(&NativePtr->MetricsRenderIndices); |
||||||
|
public ref int MetricsRenderWindows => ref Unsafe.AsRef<int>(&NativePtr->MetricsRenderWindows); |
||||||
|
public ref int MetricsActiveWindows => ref Unsafe.AsRef<int>(&NativePtr->MetricsActiveWindows); |
||||||
|
public ref int MetricsActiveAllocations => ref Unsafe.AsRef<int>(&NativePtr->MetricsActiveAllocations); |
||||||
|
public ref Vector2 MouseDelta => ref Unsafe.AsRef<Vector2>(&NativePtr->MouseDelta); |
||||||
|
public ref Vector2 MousePosPrev => ref Unsafe.AsRef<Vector2>(&NativePtr->MousePosPrev); |
||||||
|
public RangeAccessor<Vector2> MouseClickedPos => new RangeAccessor<Vector2>(&NativePtr->MouseClickedPos_0, 5); |
||||||
|
public RangeAccessor<double> MouseClickedTime => new RangeAccessor<double>(NativePtr->MouseClickedTime, 5); |
||||||
|
public RangeAccessor<Bool8> MouseClicked => new RangeAccessor<Bool8>(NativePtr->MouseClicked, 5); |
||||||
|
public RangeAccessor<Bool8> MouseDoubleClicked => new RangeAccessor<Bool8>(NativePtr->MouseDoubleClicked, 5); |
||||||
|
public RangeAccessor<Bool8> MouseReleased => new RangeAccessor<Bool8>(NativePtr->MouseReleased, 5); |
||||||
|
public RangeAccessor<Bool8> MouseDownOwned => new RangeAccessor<Bool8>(NativePtr->MouseDownOwned, 5); |
||||||
|
public RangeAccessor<float> MouseDownDuration => new RangeAccessor<float>(NativePtr->MouseDownDuration, 5); |
||||||
|
public RangeAccessor<float> MouseDownDurationPrev => new RangeAccessor<float>(NativePtr->MouseDownDurationPrev, 5); |
||||||
|
public RangeAccessor<Vector2> MouseDragMaxDistanceAbs => new RangeAccessor<Vector2>(&NativePtr->MouseDragMaxDistanceAbs_0, 5); |
||||||
|
public RangeAccessor<float> MouseDragMaxDistanceSqr => new RangeAccessor<float>(NativePtr->MouseDragMaxDistanceSqr, 5); |
||||||
|
public RangeAccessor<float> KeysDownDuration => new RangeAccessor<float>(NativePtr->KeysDownDuration, 512); |
||||||
|
public RangeAccessor<float> KeysDownDurationPrev => new RangeAccessor<float>(NativePtr->KeysDownDurationPrev, 512); |
||||||
|
public RangeAccessor<float> NavInputsDownDuration => new RangeAccessor<float>(NativePtr->NavInputsDownDuration, 21); |
||||||
|
public RangeAccessor<float> NavInputsDownDurationPrev => new RangeAccessor<float>(NativePtr->NavInputsDownDurationPrev, 21); |
||||||
|
public void AddInputCharactersUTF8(string utf8_chars) |
||||||
|
{ |
||||||
|
int utf8_chars_byteCount = Encoding.UTF8.GetByteCount(utf8_chars); |
||||||
|
byte* native_utf8_chars = stackalloc byte[utf8_chars_byteCount + 1]; |
||||||
|
fixed (char* utf8_chars_ptr = utf8_chars) |
||||||
|
{ |
||||||
|
int native_utf8_chars_offset = Encoding.UTF8.GetBytes(utf8_chars_ptr, utf8_chars.Length, native_utf8_chars, utf8_chars_byteCount); |
||||||
|
native_utf8_chars[native_utf8_chars_offset] = 0; |
||||||
|
} |
||||||
|
ImGuiNative.ImGuiIO_AddInputCharactersUTF8(NativePtr, native_utf8_chars); |
||||||
|
} |
||||||
|
public void ClearInputCharacters() |
||||||
|
{ |
||||||
|
ImGuiNative.ImGuiIO_ClearInputCharacters(NativePtr); |
||||||
|
} |
||||||
|
public void AddInputCharacter(ushort c) |
||||||
|
{ |
||||||
|
ImGuiNative.ImGuiIO_AddInputCharacter(NativePtr, c); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,65 @@ |
|||||||
|
using System; |
||||||
|
using System.Numerics; |
||||||
|
using System.Runtime.CompilerServices; |
||||||
|
using System.Text; |
||||||
|
|
||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
public unsafe partial struct ImGuiInputTextCallbackData |
||||||
|
{ |
||||||
|
public ImGuiInputTextFlags EventFlag; |
||||||
|
public ImGuiInputTextFlags Flags; |
||||||
|
public void* UserData; |
||||||
|
public ushort EventChar; |
||||||
|
public ImGuiKey EventKey; |
||||||
|
public byte* Buf; |
||||||
|
public int BufTextLen; |
||||||
|
public int BufSize; |
||||||
|
public byte BufDirty; |
||||||
|
public int CursorPos; |
||||||
|
public int SelectionStart; |
||||||
|
public int SelectionEnd; |
||||||
|
} |
||||||
|
public unsafe partial struct ImGuiInputTextCallbackDataPtr |
||||||
|
{ |
||||||
|
public ImGuiInputTextCallbackData* NativePtr { get; } |
||||||
|
public ImGuiInputTextCallbackDataPtr(ImGuiInputTextCallbackData* nativePtr) => NativePtr = nativePtr; |
||||||
|
public ImGuiInputTextCallbackDataPtr(IntPtr nativePtr) => NativePtr = (ImGuiInputTextCallbackData*)nativePtr; |
||||||
|
public static implicit operator ImGuiInputTextCallbackDataPtr(ImGuiInputTextCallbackData* nativePtr) => new ImGuiInputTextCallbackDataPtr(nativePtr); |
||||||
|
public static implicit operator ImGuiInputTextCallbackData* (ImGuiInputTextCallbackDataPtr wrappedPtr) => wrappedPtr.NativePtr; |
||||||
|
public static implicit operator ImGuiInputTextCallbackDataPtr(IntPtr nativePtr) => new ImGuiInputTextCallbackDataPtr(nativePtr); |
||||||
|
public ref ImGuiInputTextFlags EventFlag => ref Unsafe.AsRef<ImGuiInputTextFlags>(&NativePtr->EventFlag); |
||||||
|
public ref ImGuiInputTextFlags Flags => ref Unsafe.AsRef<ImGuiInputTextFlags>(&NativePtr->Flags); |
||||||
|
public IntPtr UserData { get => (IntPtr)NativePtr->UserData; set => NativePtr->UserData = (void*)value; } |
||||||
|
public ref ushort EventChar => ref Unsafe.AsRef<ushort>(&NativePtr->EventChar); |
||||||
|
public ref ImGuiKey EventKey => ref Unsafe.AsRef<ImGuiKey>(&NativePtr->EventKey); |
||||||
|
public IntPtr Buf { get => (IntPtr)NativePtr->Buf; set => NativePtr->Buf = (byte*)value; } |
||||||
|
public ref int BufTextLen => ref Unsafe.AsRef<int>(&NativePtr->BufTextLen); |
||||||
|
public ref int BufSize => ref Unsafe.AsRef<int>(&NativePtr->BufSize); |
||||||
|
public ref Bool8 BufDirty => ref Unsafe.AsRef<Bool8>(&NativePtr->BufDirty); |
||||||
|
public ref int CursorPos => ref Unsafe.AsRef<int>(&NativePtr->CursorPos); |
||||||
|
public ref int SelectionStart => ref Unsafe.AsRef<int>(&NativePtr->SelectionStart); |
||||||
|
public ref int SelectionEnd => ref Unsafe.AsRef<int>(&NativePtr->SelectionEnd); |
||||||
|
public void DeleteChars(int pos, int bytes_count) |
||||||
|
{ |
||||||
|
ImGuiNative.ImGuiInputTextCallbackData_DeleteChars(NativePtr, pos, bytes_count); |
||||||
|
} |
||||||
|
public bool HasSelection() |
||||||
|
{ |
||||||
|
byte ret = ImGuiNative.ImGuiInputTextCallbackData_HasSelection(NativePtr); |
||||||
|
return ret != 0; |
||||||
|
} |
||||||
|
public void InsertChars(int pos, string text) |
||||||
|
{ |
||||||
|
int text_byteCount = Encoding.UTF8.GetByteCount(text); |
||||||
|
byte* native_text = stackalloc byte[text_byteCount + 1]; |
||||||
|
fixed (char* text_ptr = text) |
||||||
|
{ |
||||||
|
int native_text_offset = Encoding.UTF8.GetBytes(text_ptr, text.Length, native_text, text_byteCount); |
||||||
|
native_text[native_text_offset] = 0; |
||||||
|
} |
||||||
|
byte* native_text_end = null; |
||||||
|
ImGuiNative.ImGuiInputTextCallbackData_InsertChars(NativePtr, pos, native_text, native_text_end); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,28 @@ |
|||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
[System.Flags] |
||||||
|
public enum ImGuiInputTextFlags |
||||||
|
{ |
||||||
|
None = 0, |
||||||
|
CharsDecimal = 1 << 0, |
||||||
|
CharsHexadecimal = 1 << 1, |
||||||
|
CharsUppercase = 1 << 2, |
||||||
|
CharsNoBlank = 1 << 3, |
||||||
|
AutoSelectAll = 1 << 4, |
||||||
|
EnterReturnsTrue = 1 << 5, |
||||||
|
CallbackCompletion = 1 << 6, |
||||||
|
CallbackHistory = 1 << 7, |
||||||
|
CallbackAlways = 1 << 8, |
||||||
|
CallbackCharFilter = 1 << 9, |
||||||
|
AllowTabInput = 1 << 10, |
||||||
|
CtrlEnterForNewLine = 1 << 11, |
||||||
|
NoHorizontalScroll = 1 << 12, |
||||||
|
AlwaysInsertMode = 1 << 13, |
||||||
|
ReadOnly = 1 << 14, |
||||||
|
Password = 1 << 15, |
||||||
|
NoUndoRedo = 1 << 16, |
||||||
|
CharsScientific = 1 << 17, |
||||||
|
CallbackResize = 1 << 18, |
||||||
|
Multiline = 1 << 20, |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,28 @@ |
|||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
public enum ImGuiKey |
||||||
|
{ |
||||||
|
Tab = 0, |
||||||
|
LeftArrow = 1, |
||||||
|
RightArrow = 2, |
||||||
|
UpArrow = 3, |
||||||
|
DownArrow = 4, |
||||||
|
PageUp = 5, |
||||||
|
PageDown = 6, |
||||||
|
Home = 7, |
||||||
|
End = 8, |
||||||
|
Insert = 9, |
||||||
|
Delete = 10, |
||||||
|
Backspace = 11, |
||||||
|
Space = 12, |
||||||
|
Enter = 13, |
||||||
|
Escape = 14, |
||||||
|
A = 15, |
||||||
|
C = 16, |
||||||
|
V = 17, |
||||||
|
X = 18, |
||||||
|
Y = 19, |
||||||
|
Z = 20, |
||||||
|
COUNT = 21, |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,50 @@ |
|||||||
|
using System; |
||||||
|
using System.Numerics; |
||||||
|
using System.Runtime.CompilerServices; |
||||||
|
using System.Text; |
||||||
|
|
||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
public unsafe partial struct ImGuiListClipper |
||||||
|
{ |
||||||
|
public float StartPosY; |
||||||
|
public float ItemsHeight; |
||||||
|
public int ItemsCount; |
||||||
|
public int StepNo; |
||||||
|
public int DisplayStart; |
||||||
|
public int DisplayEnd; |
||||||
|
} |
||||||
|
public unsafe partial struct ImGuiListClipperPtr |
||||||
|
{ |
||||||
|
public ImGuiListClipper* NativePtr { get; } |
||||||
|
public ImGuiListClipperPtr(ImGuiListClipper* nativePtr) => NativePtr = nativePtr; |
||||||
|
public ImGuiListClipperPtr(IntPtr nativePtr) => NativePtr = (ImGuiListClipper*)nativePtr; |
||||||
|
public static implicit operator ImGuiListClipperPtr(ImGuiListClipper* nativePtr) => new ImGuiListClipperPtr(nativePtr); |
||||||
|
public static implicit operator ImGuiListClipper* (ImGuiListClipperPtr wrappedPtr) => wrappedPtr.NativePtr; |
||||||
|
public static implicit operator ImGuiListClipperPtr(IntPtr nativePtr) => new ImGuiListClipperPtr(nativePtr); |
||||||
|
public ref float StartPosY => ref Unsafe.AsRef<float>(&NativePtr->StartPosY); |
||||||
|
public ref float ItemsHeight => ref Unsafe.AsRef<float>(&NativePtr->ItemsHeight); |
||||||
|
public ref int ItemsCount => ref Unsafe.AsRef<int>(&NativePtr->ItemsCount); |
||||||
|
public ref int StepNo => ref Unsafe.AsRef<int>(&NativePtr->StepNo); |
||||||
|
public ref int DisplayStart => ref Unsafe.AsRef<int>(&NativePtr->DisplayStart); |
||||||
|
public ref int DisplayEnd => ref Unsafe.AsRef<int>(&NativePtr->DisplayEnd); |
||||||
|
public void End() |
||||||
|
{ |
||||||
|
ImGuiNative.ImGuiListClipper_End(NativePtr); |
||||||
|
} |
||||||
|
public void Begin(int items_count) |
||||||
|
{ |
||||||
|
float items_height = -1.0f; |
||||||
|
ImGuiNative.ImGuiListClipper_Begin(NativePtr, items_count, items_height); |
||||||
|
} |
||||||
|
public void Begin(int items_count, float items_height) |
||||||
|
{ |
||||||
|
ImGuiNative.ImGuiListClipper_Begin(NativePtr, items_count, items_height); |
||||||
|
} |
||||||
|
public bool Step() |
||||||
|
{ |
||||||
|
byte ret = ImGuiNative.ImGuiListClipper_Step(NativePtr); |
||||||
|
return ret != 0; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,16 @@ |
|||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
public enum ImGuiMouseCursor |
||||||
|
{ |
||||||
|
None = -1, |
||||||
|
Arrow = 0, |
||||||
|
TextInput = 1, |
||||||
|
ResizeAll = 2, |
||||||
|
ResizeNS = 3, |
||||||
|
ResizeEW = 4, |
||||||
|
ResizeNESW = 5, |
||||||
|
ResizeNWSE = 6, |
||||||
|
Hand = 7, |
||||||
|
COUNT = 8, |
||||||
|
} |
||||||
|
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,29 @@ |
|||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
public enum ImGuiNavInput |
||||||
|
{ |
||||||
|
Activate = 0, |
||||||
|
Cancel = 1, |
||||||
|
Input = 2, |
||||||
|
Menu = 3, |
||||||
|
DpadLeft = 4, |
||||||
|
DpadRight = 5, |
||||||
|
DpadUp = 6, |
||||||
|
DpadDown = 7, |
||||||
|
LStickLeft = 8, |
||||||
|
LStickRight = 9, |
||||||
|
LStickUp = 10, |
||||||
|
LStickDown = 11, |
||||||
|
FocusPrev = 12, |
||||||
|
FocusNext = 13, |
||||||
|
TweakSlow = 14, |
||||||
|
TweakFast = 15, |
||||||
|
KeyMenu = 16, |
||||||
|
KeyLeft = 17, |
||||||
|
KeyRight = 18, |
||||||
|
KeyUp = 19, |
||||||
|
KeyDown = 20, |
||||||
|
COUNT = 21, |
||||||
|
InternalStart = KeyMenu, |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,22 @@ |
|||||||
|
using System; |
||||||
|
using System.Numerics; |
||||||
|
using System.Runtime.CompilerServices; |
||||||
|
using System.Text; |
||||||
|
|
||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
public unsafe partial struct ImGuiOnceUponAFrame |
||||||
|
{ |
||||||
|
public int RefFrame; |
||||||
|
} |
||||||
|
public unsafe partial struct ImGuiOnceUponAFramePtr |
||||||
|
{ |
||||||
|
public ImGuiOnceUponAFrame* NativePtr { get; } |
||||||
|
public ImGuiOnceUponAFramePtr(ImGuiOnceUponAFrame* nativePtr) => NativePtr = nativePtr; |
||||||
|
public ImGuiOnceUponAFramePtr(IntPtr nativePtr) => NativePtr = (ImGuiOnceUponAFrame*)nativePtr; |
||||||
|
public static implicit operator ImGuiOnceUponAFramePtr(ImGuiOnceUponAFrame* nativePtr) => new ImGuiOnceUponAFramePtr(nativePtr); |
||||||
|
public static implicit operator ImGuiOnceUponAFrame* (ImGuiOnceUponAFramePtr wrappedPtr) => wrappedPtr.NativePtr; |
||||||
|
public static implicit operator ImGuiOnceUponAFramePtr(IntPtr nativePtr) => new ImGuiOnceUponAFramePtr(nativePtr); |
||||||
|
public ref int RefFrame => ref Unsafe.AsRef<int>(&NativePtr->RefFrame); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,62 @@ |
|||||||
|
using System; |
||||||
|
using System.Numerics; |
||||||
|
using System.Runtime.CompilerServices; |
||||||
|
using System.Text; |
||||||
|
|
||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
public unsafe partial struct ImGuiPayload |
||||||
|
{ |
||||||
|
public void* Data; |
||||||
|
public int DataSize; |
||||||
|
public uint SourceId; |
||||||
|
public uint SourceParentId; |
||||||
|
public int DataFrameCount; |
||||||
|
public fixed byte DataType[33]; |
||||||
|
public byte Preview; |
||||||
|
public byte Delivery; |
||||||
|
} |
||||||
|
public unsafe partial struct ImGuiPayloadPtr |
||||||
|
{ |
||||||
|
public ImGuiPayload* NativePtr { get; } |
||||||
|
public ImGuiPayloadPtr(ImGuiPayload* nativePtr) => NativePtr = nativePtr; |
||||||
|
public ImGuiPayloadPtr(IntPtr nativePtr) => NativePtr = (ImGuiPayload*)nativePtr; |
||||||
|
public static implicit operator ImGuiPayloadPtr(ImGuiPayload* nativePtr) => new ImGuiPayloadPtr(nativePtr); |
||||||
|
public static implicit operator ImGuiPayload* (ImGuiPayloadPtr wrappedPtr) => wrappedPtr.NativePtr; |
||||||
|
public static implicit operator ImGuiPayloadPtr(IntPtr nativePtr) => new ImGuiPayloadPtr(nativePtr); |
||||||
|
public IntPtr Data { get => (IntPtr)NativePtr->Data; set => NativePtr->Data = (void*)value; } |
||||||
|
public ref int DataSize => ref Unsafe.AsRef<int>(&NativePtr->DataSize); |
||||||
|
public ref uint SourceId => ref Unsafe.AsRef<uint>(&NativePtr->SourceId); |
||||||
|
public ref uint SourceParentId => ref Unsafe.AsRef<uint>(&NativePtr->SourceParentId); |
||||||
|
public ref int DataFrameCount => ref Unsafe.AsRef<int>(&NativePtr->DataFrameCount); |
||||||
|
public RangeAccessor<byte> DataType => new RangeAccessor<byte>(NativePtr->DataType, 33); |
||||||
|
public ref Bool8 Preview => ref Unsafe.AsRef<Bool8>(&NativePtr->Preview); |
||||||
|
public ref Bool8 Delivery => ref Unsafe.AsRef<Bool8>(&NativePtr->Delivery); |
||||||
|
public void Clear() |
||||||
|
{ |
||||||
|
ImGuiNative.ImGuiPayload_Clear(NativePtr); |
||||||
|
} |
||||||
|
public bool IsPreview() |
||||||
|
{ |
||||||
|
byte ret = ImGuiNative.ImGuiPayload_IsPreview(NativePtr); |
||||||
|
return ret != 0; |
||||||
|
} |
||||||
|
public bool IsDataType(string type) |
||||||
|
{ |
||||||
|
int type_byteCount = Encoding.UTF8.GetByteCount(type); |
||||||
|
byte* native_type = stackalloc byte[type_byteCount + 1]; |
||||||
|
fixed (char* type_ptr = type) |
||||||
|
{ |
||||||
|
int native_type_offset = Encoding.UTF8.GetBytes(type_ptr, type.Length, native_type, type_byteCount); |
||||||
|
native_type[native_type_offset] = 0; |
||||||
|
} |
||||||
|
byte ret = ImGuiNative.ImGuiPayload_IsDataType(NativePtr, native_type); |
||||||
|
return ret != 0; |
||||||
|
} |
||||||
|
public bool IsDelivery() |
||||||
|
{ |
||||||
|
byte ret = ImGuiNative.ImGuiPayload_IsDelivery(NativePtr); |
||||||
|
return ret != 0; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,12 @@ |
|||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
[System.Flags] |
||||||
|
public enum ImGuiSelectableFlags |
||||||
|
{ |
||||||
|
None = 0, |
||||||
|
DontClosePopups = 1 << 0, |
||||||
|
SpanAllColumns = 1 << 1, |
||||||
|
AllowDoubleClick = 1 << 2, |
||||||
|
Disabled = 1 << 3, |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,28 @@ |
|||||||
|
using System; |
||||||
|
using System.Numerics; |
||||||
|
using System.Runtime.CompilerServices; |
||||||
|
using System.Text; |
||||||
|
|
||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
public unsafe partial struct ImGuiSizeCallbackData |
||||||
|
{ |
||||||
|
public void* UserData; |
||||||
|
public Vector2 Pos; |
||||||
|
public Vector2 CurrentSize; |
||||||
|
public Vector2 DesiredSize; |
||||||
|
} |
||||||
|
public unsafe partial struct ImGuiSizeCallbackDataPtr |
||||||
|
{ |
||||||
|
public ImGuiSizeCallbackData* NativePtr { get; } |
||||||
|
public ImGuiSizeCallbackDataPtr(ImGuiSizeCallbackData* nativePtr) => NativePtr = nativePtr; |
||||||
|
public ImGuiSizeCallbackDataPtr(IntPtr nativePtr) => NativePtr = (ImGuiSizeCallbackData*)nativePtr; |
||||||
|
public static implicit operator ImGuiSizeCallbackDataPtr(ImGuiSizeCallbackData* nativePtr) => new ImGuiSizeCallbackDataPtr(nativePtr); |
||||||
|
public static implicit operator ImGuiSizeCallbackData* (ImGuiSizeCallbackDataPtr wrappedPtr) => wrappedPtr.NativePtr; |
||||||
|
public static implicit operator ImGuiSizeCallbackDataPtr(IntPtr nativePtr) => new ImGuiSizeCallbackDataPtr(nativePtr); |
||||||
|
public IntPtr UserData { get => (IntPtr)NativePtr->UserData; set => NativePtr->UserData = (void*)value; } |
||||||
|
public ref Vector2 Pos => ref Unsafe.AsRef<Vector2>(&NativePtr->Pos); |
||||||
|
public ref Vector2 CurrentSize => ref Unsafe.AsRef<Vector2>(&NativePtr->CurrentSize); |
||||||
|
public ref Vector2 DesiredSize => ref Unsafe.AsRef<Vector2>(&NativePtr->DesiredSize); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,137 @@ |
|||||||
|
using System; |
||||||
|
using System.Numerics; |
||||||
|
using System.Runtime.CompilerServices; |
||||||
|
using System.Text; |
||||||
|
|
||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
public unsafe partial struct ImGuiStorage |
||||||
|
{ |
||||||
|
public ImVector/*<Pair>*/ Data; |
||||||
|
} |
||||||
|
public unsafe partial struct ImGuiStoragePtr |
||||||
|
{ |
||||||
|
public ImGuiStorage* NativePtr { get; } |
||||||
|
public ImGuiStoragePtr(ImGuiStorage* nativePtr) => NativePtr = nativePtr; |
||||||
|
public ImGuiStoragePtr(IntPtr nativePtr) => NativePtr = (ImGuiStorage*)nativePtr; |
||||||
|
public static implicit operator ImGuiStoragePtr(ImGuiStorage* nativePtr) => new ImGuiStoragePtr(nativePtr); |
||||||
|
public static implicit operator ImGuiStorage* (ImGuiStoragePtr wrappedPtr) => wrappedPtr.NativePtr; |
||||||
|
public static implicit operator ImGuiStoragePtr(IntPtr nativePtr) => new ImGuiStoragePtr(nativePtr); |
||||||
|
public ImVector<Pair> Data => new ImVector<Pair>(NativePtr->Data); |
||||||
|
public void SetFloat(uint key, float val) |
||||||
|
{ |
||||||
|
ImGuiNative.ImGuiStorage_SetFloat(NativePtr, key, val); |
||||||
|
} |
||||||
|
public IntPtr GetVoidPtr(uint key) |
||||||
|
{ |
||||||
|
void* ret = ImGuiNative.ImGuiStorage_GetVoidPtr(NativePtr, key); |
||||||
|
return (IntPtr)ret; |
||||||
|
} |
||||||
|
public float* GetFloatRef(uint key) |
||||||
|
{ |
||||||
|
float default_val = 0.0f; |
||||||
|
float* ret = ImGuiNative.ImGuiStorage_GetFloatRef(NativePtr, key, default_val); |
||||||
|
return ret; |
||||||
|
} |
||||||
|
public float* GetFloatRef(uint key, float default_val) |
||||||
|
{ |
||||||
|
float* ret = ImGuiNative.ImGuiStorage_GetFloatRef(NativePtr, key, default_val); |
||||||
|
return ret; |
||||||
|
} |
||||||
|
public void SetAllInt(int val) |
||||||
|
{ |
||||||
|
ImGuiNative.ImGuiStorage_SetAllInt(NativePtr, val); |
||||||
|
} |
||||||
|
public void** GetVoidPtrRef(uint key) |
||||||
|
{ |
||||||
|
void* default_val = null; |
||||||
|
void** ret = ImGuiNative.ImGuiStorage_GetVoidPtrRef(NativePtr, key, default_val); |
||||||
|
return ret; |
||||||
|
} |
||||||
|
public void** GetVoidPtrRef(uint key, IntPtr default_val) |
||||||
|
{ |
||||||
|
void* native_default_val = default_val.ToPointer(); |
||||||
|
void** ret = ImGuiNative.ImGuiStorage_GetVoidPtrRef(NativePtr, key, native_default_val); |
||||||
|
return ret; |
||||||
|
} |
||||||
|
public byte* GetBoolRef(uint key) |
||||||
|
{ |
||||||
|
byte default_val = 0; |
||||||
|
byte* ret = ImGuiNative.ImGuiStorage_GetBoolRef(NativePtr, key, default_val); |
||||||
|
return ret; |
||||||
|
} |
||||||
|
public byte* GetBoolRef(uint key, bool default_val) |
||||||
|
{ |
||||||
|
byte native_default_val = default_val ? (byte)1 : (byte)0; |
||||||
|
byte* ret = ImGuiNative.ImGuiStorage_GetBoolRef(NativePtr, key, native_default_val); |
||||||
|
return ret; |
||||||
|
} |
||||||
|
public int* GetIntRef(uint key) |
||||||
|
{ |
||||||
|
int default_val = 0; |
||||||
|
int* ret = ImGuiNative.ImGuiStorage_GetIntRef(NativePtr, key, default_val); |
||||||
|
return ret; |
||||||
|
} |
||||||
|
public int* GetIntRef(uint key, int default_val) |
||||||
|
{ |
||||||
|
int* ret = ImGuiNative.ImGuiStorage_GetIntRef(NativePtr, key, default_val); |
||||||
|
return ret; |
||||||
|
} |
||||||
|
public void SetVoidPtr(uint key, IntPtr val) |
||||||
|
{ |
||||||
|
void* native_val = val.ToPointer(); |
||||||
|
ImGuiNative.ImGuiStorage_SetVoidPtr(NativePtr, key, native_val); |
||||||
|
} |
||||||
|
public void BuildSortByKey() |
||||||
|
{ |
||||||
|
ImGuiNative.ImGuiStorage_BuildSortByKey(NativePtr); |
||||||
|
} |
||||||
|
public float GetFloat(uint key) |
||||||
|
{ |
||||||
|
float default_val = 0.0f; |
||||||
|
float ret = ImGuiNative.ImGuiStorage_GetFloat(NativePtr, key, default_val); |
||||||
|
return ret; |
||||||
|
} |
||||||
|
public float GetFloat(uint key, float default_val) |
||||||
|
{ |
||||||
|
float ret = ImGuiNative.ImGuiStorage_GetFloat(NativePtr, key, default_val); |
||||||
|
return ret; |
||||||
|
} |
||||||
|
public void SetBool(uint key, bool val) |
||||||
|
{ |
||||||
|
byte native_val = val ? (byte)1 : (byte)0; |
||||||
|
ImGuiNative.ImGuiStorage_SetBool(NativePtr, key, native_val); |
||||||
|
} |
||||||
|
public bool GetBool(uint key) |
||||||
|
{ |
||||||
|
byte default_val = 0; |
||||||
|
byte ret = ImGuiNative.ImGuiStorage_GetBool(NativePtr, key, default_val); |
||||||
|
return ret != 0; |
||||||
|
} |
||||||
|
public bool GetBool(uint key, bool default_val) |
||||||
|
{ |
||||||
|
byte native_default_val = default_val ? (byte)1 : (byte)0; |
||||||
|
byte ret = ImGuiNative.ImGuiStorage_GetBool(NativePtr, key, native_default_val); |
||||||
|
return ret != 0; |
||||||
|
} |
||||||
|
public void SetInt(uint key, int val) |
||||||
|
{ |
||||||
|
ImGuiNative.ImGuiStorage_SetInt(NativePtr, key, val); |
||||||
|
} |
||||||
|
public void Clear() |
||||||
|
{ |
||||||
|
ImGuiNative.ImGuiStorage_Clear(NativePtr); |
||||||
|
} |
||||||
|
public int GetInt(uint key) |
||||||
|
{ |
||||||
|
int default_val = 0; |
||||||
|
int ret = ImGuiNative.ImGuiStorage_GetInt(NativePtr, key, default_val); |
||||||
|
return ret; |
||||||
|
} |
||||||
|
public int GetInt(uint key, int default_val) |
||||||
|
{ |
||||||
|
int ret = ImGuiNative.ImGuiStorage_GetInt(NativePtr, key, default_val); |
||||||
|
return ret; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,126 @@ |
|||||||
|
using System; |
||||||
|
using System.Numerics; |
||||||
|
using System.Runtime.CompilerServices; |
||||||
|
using System.Text; |
||||||
|
|
||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
public unsafe partial struct ImGuiStyle |
||||||
|
{ |
||||||
|
public float Alpha; |
||||||
|
public Vector2 WindowPadding; |
||||||
|
public float WindowRounding; |
||||||
|
public float WindowBorderSize; |
||||||
|
public Vector2 WindowMinSize; |
||||||
|
public Vector2 WindowTitleAlign; |
||||||
|
public float ChildRounding; |
||||||
|
public float ChildBorderSize; |
||||||
|
public float PopupRounding; |
||||||
|
public float PopupBorderSize; |
||||||
|
public Vector2 FramePadding; |
||||||
|
public float FrameRounding; |
||||||
|
public float FrameBorderSize; |
||||||
|
public Vector2 ItemSpacing; |
||||||
|
public Vector2 ItemInnerSpacing; |
||||||
|
public Vector2 TouchExtraPadding; |
||||||
|
public float IndentSpacing; |
||||||
|
public float ColumnsMinSpacing; |
||||||
|
public float ScrollbarSize; |
||||||
|
public float ScrollbarRounding; |
||||||
|
public float GrabMinSize; |
||||||
|
public float GrabRounding; |
||||||
|
public Vector2 ButtonTextAlign; |
||||||
|
public Vector2 DisplayWindowPadding; |
||||||
|
public Vector2 DisplaySafeAreaPadding; |
||||||
|
public float MouseCursorScale; |
||||||
|
public byte AntiAliasedLines; |
||||||
|
public byte AntiAliasedFill; |
||||||
|
public float CurveTessellationTol; |
||||||
|
public Vector4 Colors_0; |
||||||
|
public Vector4 Colors_1; |
||||||
|
public Vector4 Colors_2; |
||||||
|
public Vector4 Colors_3; |
||||||
|
public Vector4 Colors_4; |
||||||
|
public Vector4 Colors_5; |
||||||
|
public Vector4 Colors_6; |
||||||
|
public Vector4 Colors_7; |
||||||
|
public Vector4 Colors_8; |
||||||
|
public Vector4 Colors_9; |
||||||
|
public Vector4 Colors_10; |
||||||
|
public Vector4 Colors_11; |
||||||
|
public Vector4 Colors_12; |
||||||
|
public Vector4 Colors_13; |
||||||
|
public Vector4 Colors_14; |
||||||
|
public Vector4 Colors_15; |
||||||
|
public Vector4 Colors_16; |
||||||
|
public Vector4 Colors_17; |
||||||
|
public Vector4 Colors_18; |
||||||
|
public Vector4 Colors_19; |
||||||
|
public Vector4 Colors_20; |
||||||
|
public Vector4 Colors_21; |
||||||
|
public Vector4 Colors_22; |
||||||
|
public Vector4 Colors_23; |
||||||
|
public Vector4 Colors_24; |
||||||
|
public Vector4 Colors_25; |
||||||
|
public Vector4 Colors_26; |
||||||
|
public Vector4 Colors_27; |
||||||
|
public Vector4 Colors_28; |
||||||
|
public Vector4 Colors_29; |
||||||
|
public Vector4 Colors_30; |
||||||
|
public Vector4 Colors_31; |
||||||
|
public Vector4 Colors_32; |
||||||
|
public Vector4 Colors_33; |
||||||
|
public Vector4 Colors_34; |
||||||
|
public Vector4 Colors_35; |
||||||
|
public Vector4 Colors_36; |
||||||
|
public Vector4 Colors_37; |
||||||
|
public Vector4 Colors_38; |
||||||
|
public Vector4 Colors_39; |
||||||
|
public Vector4 Colors_40; |
||||||
|
public Vector4 Colors_41; |
||||||
|
public Vector4 Colors_42; |
||||||
|
} |
||||||
|
public unsafe partial struct ImGuiStylePtr |
||||||
|
{ |
||||||
|
public ImGuiStyle* NativePtr { get; } |
||||||
|
public ImGuiStylePtr(ImGuiStyle* nativePtr) => NativePtr = nativePtr; |
||||||
|
public ImGuiStylePtr(IntPtr nativePtr) => NativePtr = (ImGuiStyle*)nativePtr; |
||||||
|
public static implicit operator ImGuiStylePtr(ImGuiStyle* nativePtr) => new ImGuiStylePtr(nativePtr); |
||||||
|
public static implicit operator ImGuiStyle* (ImGuiStylePtr wrappedPtr) => wrappedPtr.NativePtr; |
||||||
|
public static implicit operator ImGuiStylePtr(IntPtr nativePtr) => new ImGuiStylePtr(nativePtr); |
||||||
|
public ref float Alpha => ref Unsafe.AsRef<float>(&NativePtr->Alpha); |
||||||
|
public ref Vector2 WindowPadding => ref Unsafe.AsRef<Vector2>(&NativePtr->WindowPadding); |
||||||
|
public ref float WindowRounding => ref Unsafe.AsRef<float>(&NativePtr->WindowRounding); |
||||||
|
public ref float WindowBorderSize => ref Unsafe.AsRef<float>(&NativePtr->WindowBorderSize); |
||||||
|
public ref Vector2 WindowMinSize => ref Unsafe.AsRef<Vector2>(&NativePtr->WindowMinSize); |
||||||
|
public ref Vector2 WindowTitleAlign => ref Unsafe.AsRef<Vector2>(&NativePtr->WindowTitleAlign); |
||||||
|
public ref float ChildRounding => ref Unsafe.AsRef<float>(&NativePtr->ChildRounding); |
||||||
|
public ref float ChildBorderSize => ref Unsafe.AsRef<float>(&NativePtr->ChildBorderSize); |
||||||
|
public ref float PopupRounding => ref Unsafe.AsRef<float>(&NativePtr->PopupRounding); |
||||||
|
public ref float PopupBorderSize => ref Unsafe.AsRef<float>(&NativePtr->PopupBorderSize); |
||||||
|
public ref Vector2 FramePadding => ref Unsafe.AsRef<Vector2>(&NativePtr->FramePadding); |
||||||
|
public ref float FrameRounding => ref Unsafe.AsRef<float>(&NativePtr->FrameRounding); |
||||||
|
public ref float FrameBorderSize => ref Unsafe.AsRef<float>(&NativePtr->FrameBorderSize); |
||||||
|
public ref Vector2 ItemSpacing => ref Unsafe.AsRef<Vector2>(&NativePtr->ItemSpacing); |
||||||
|
public ref Vector2 ItemInnerSpacing => ref Unsafe.AsRef<Vector2>(&NativePtr->ItemInnerSpacing); |
||||||
|
public ref Vector2 TouchExtraPadding => ref Unsafe.AsRef<Vector2>(&NativePtr->TouchExtraPadding); |
||||||
|
public ref float IndentSpacing => ref Unsafe.AsRef<float>(&NativePtr->IndentSpacing); |
||||||
|
public ref float ColumnsMinSpacing => ref Unsafe.AsRef<float>(&NativePtr->ColumnsMinSpacing); |
||||||
|
public ref float ScrollbarSize => ref Unsafe.AsRef<float>(&NativePtr->ScrollbarSize); |
||||||
|
public ref float ScrollbarRounding => ref Unsafe.AsRef<float>(&NativePtr->ScrollbarRounding); |
||||||
|
public ref float GrabMinSize => ref Unsafe.AsRef<float>(&NativePtr->GrabMinSize); |
||||||
|
public ref float GrabRounding => ref Unsafe.AsRef<float>(&NativePtr->GrabRounding); |
||||||
|
public ref Vector2 ButtonTextAlign => ref Unsafe.AsRef<Vector2>(&NativePtr->ButtonTextAlign); |
||||||
|
public ref Vector2 DisplayWindowPadding => ref Unsafe.AsRef<Vector2>(&NativePtr->DisplayWindowPadding); |
||||||
|
public ref Vector2 DisplaySafeAreaPadding => ref Unsafe.AsRef<Vector2>(&NativePtr->DisplaySafeAreaPadding); |
||||||
|
public ref float MouseCursorScale => ref Unsafe.AsRef<float>(&NativePtr->MouseCursorScale); |
||||||
|
public ref Bool8 AntiAliasedLines => ref Unsafe.AsRef<Bool8>(&NativePtr->AntiAliasedLines); |
||||||
|
public ref Bool8 AntiAliasedFill => ref Unsafe.AsRef<Bool8>(&NativePtr->AntiAliasedFill); |
||||||
|
public ref float CurveTessellationTol => ref Unsafe.AsRef<float>(&NativePtr->CurveTessellationTol); |
||||||
|
public RangeAccessor<Vector4> Colors => new RangeAccessor<Vector4>(&NativePtr->Colors_0, 43); |
||||||
|
public void ScaleAllSizes(float scale_factor) |
||||||
|
{ |
||||||
|
ImGuiNative.ImGuiStyle_ScaleAllSizes(NativePtr, scale_factor); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,28 @@ |
|||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
public enum ImGuiStyleVar |
||||||
|
{ |
||||||
|
Alpha = 0, |
||||||
|
WindowPadding = 1, |
||||||
|
WindowRounding = 2, |
||||||
|
WindowBorderSize = 3, |
||||||
|
WindowMinSize = 4, |
||||||
|
WindowTitleAlign = 5, |
||||||
|
ChildRounding = 6, |
||||||
|
ChildBorderSize = 7, |
||||||
|
PopupRounding = 8, |
||||||
|
PopupBorderSize = 9, |
||||||
|
FramePadding = 10, |
||||||
|
FrameRounding = 11, |
||||||
|
FrameBorderSize = 12, |
||||||
|
ItemSpacing = 13, |
||||||
|
ItemInnerSpacing = 14, |
||||||
|
IndentSpacing = 15, |
||||||
|
ScrollbarSize = 16, |
||||||
|
ScrollbarRounding = 17, |
||||||
|
GrabMinSize = 18, |
||||||
|
GrabRounding = 19, |
||||||
|
ButtonTextAlign = 20, |
||||||
|
COUNT = 21, |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,66 @@ |
|||||||
|
using System; |
||||||
|
using System.Numerics; |
||||||
|
using System.Runtime.CompilerServices; |
||||||
|
using System.Text; |
||||||
|
|
||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
public unsafe partial struct ImGuiTextBuffer |
||||||
|
{ |
||||||
|
public ImVector/*<char>*/ Buf; |
||||||
|
} |
||||||
|
public unsafe partial struct ImGuiTextBufferPtr |
||||||
|
{ |
||||||
|
public ImGuiTextBuffer* NativePtr { get; } |
||||||
|
public ImGuiTextBufferPtr(ImGuiTextBuffer* nativePtr) => NativePtr = nativePtr; |
||||||
|
public ImGuiTextBufferPtr(IntPtr nativePtr) => NativePtr = (ImGuiTextBuffer*)nativePtr; |
||||||
|
public static implicit operator ImGuiTextBufferPtr(ImGuiTextBuffer* nativePtr) => new ImGuiTextBufferPtr(nativePtr); |
||||||
|
public static implicit operator ImGuiTextBuffer* (ImGuiTextBufferPtr wrappedPtr) => wrappedPtr.NativePtr; |
||||||
|
public static implicit operator ImGuiTextBufferPtr(IntPtr nativePtr) => new ImGuiTextBufferPtr(nativePtr); |
||||||
|
public ImVector<byte> Buf => new ImVector<byte>(NativePtr->Buf); |
||||||
|
public void clear() |
||||||
|
{ |
||||||
|
ImGuiNative.ImGuiTextBuffer_clear(NativePtr); |
||||||
|
} |
||||||
|
public void appendf(string fmt) |
||||||
|
{ |
||||||
|
int fmt_byteCount = Encoding.UTF8.GetByteCount(fmt); |
||||||
|
byte* native_fmt = stackalloc byte[fmt_byteCount + 1]; |
||||||
|
fixed (char* fmt_ptr = fmt) |
||||||
|
{ |
||||||
|
int native_fmt_offset = Encoding.UTF8.GetBytes(fmt_ptr, fmt.Length, native_fmt, fmt_byteCount); |
||||||
|
native_fmt[native_fmt_offset] = 0; |
||||||
|
} |
||||||
|
ImGuiNative.ImGuiTextBuffer_appendf(NativePtr, native_fmt); |
||||||
|
} |
||||||
|
public string c_str() |
||||||
|
{ |
||||||
|
byte* ret = ImGuiNative.ImGuiTextBuffer_c_str(NativePtr); |
||||||
|
return Util.StringFromPtr(ret); |
||||||
|
} |
||||||
|
public void reserve(int capacity) |
||||||
|
{ |
||||||
|
ImGuiNative.ImGuiTextBuffer_reserve(NativePtr, capacity); |
||||||
|
} |
||||||
|
public bool empty() |
||||||
|
{ |
||||||
|
byte ret = ImGuiNative.ImGuiTextBuffer_empty(NativePtr); |
||||||
|
return ret != 0; |
||||||
|
} |
||||||
|
public int size() |
||||||
|
{ |
||||||
|
int ret = ImGuiNative.ImGuiTextBuffer_size(NativePtr); |
||||||
|
return ret; |
||||||
|
} |
||||||
|
public string begin() |
||||||
|
{ |
||||||
|
byte* ret = ImGuiNative.ImGuiTextBuffer_begin(NativePtr); |
||||||
|
return Util.StringFromPtr(ret); |
||||||
|
} |
||||||
|
public string end() |
||||||
|
{ |
||||||
|
byte* ret = ImGuiNative.ImGuiTextBuffer_end(NativePtr); |
||||||
|
return Util.StringFromPtr(ret); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,90 @@ |
|||||||
|
using System; |
||||||
|
using System.Numerics; |
||||||
|
using System.Runtime.CompilerServices; |
||||||
|
using System.Text; |
||||||
|
|
||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
public unsafe partial struct ImGuiTextFilter |
||||||
|
{ |
||||||
|
public fixed byte InputBuf[256]; |
||||||
|
public ImVector/*<TextRange>*/ Filters; |
||||||
|
public int CountGrep; |
||||||
|
} |
||||||
|
public unsafe partial struct ImGuiTextFilterPtr |
||||||
|
{ |
||||||
|
public ImGuiTextFilter* NativePtr { get; } |
||||||
|
public ImGuiTextFilterPtr(ImGuiTextFilter* nativePtr) => NativePtr = nativePtr; |
||||||
|
public ImGuiTextFilterPtr(IntPtr nativePtr) => NativePtr = (ImGuiTextFilter*)nativePtr; |
||||||
|
public static implicit operator ImGuiTextFilterPtr(ImGuiTextFilter* nativePtr) => new ImGuiTextFilterPtr(nativePtr); |
||||||
|
public static implicit operator ImGuiTextFilter* (ImGuiTextFilterPtr wrappedPtr) => wrappedPtr.NativePtr; |
||||||
|
public static implicit operator ImGuiTextFilterPtr(IntPtr nativePtr) => new ImGuiTextFilterPtr(nativePtr); |
||||||
|
public RangeAccessor<byte> InputBuf => new RangeAccessor<byte>(NativePtr->InputBuf, 256); |
||||||
|
public ImVector<TextRange> Filters => new ImVector<TextRange>(NativePtr->Filters); |
||||||
|
public ref int CountGrep => ref Unsafe.AsRef<int>(&NativePtr->CountGrep); |
||||||
|
public void Build() |
||||||
|
{ |
||||||
|
ImGuiNative.ImGuiTextFilter_Build(NativePtr); |
||||||
|
} |
||||||
|
public bool Draw() |
||||||
|
{ |
||||||
|
int label_byteCount = Encoding.UTF8.GetByteCount("Filter(inc,-exc)"); |
||||||
|
byte* native_label = stackalloc byte[label_byteCount + 1]; |
||||||
|
fixed (char* label_ptr = "Filter(inc,-exc)") |
||||||
|
{ |
||||||
|
int native_label_offset = Encoding.UTF8.GetBytes(label_ptr, "Filter(inc,-exc)".Length, native_label, label_byteCount); |
||||||
|
native_label[native_label_offset] = 0; |
||||||
|
} |
||||||
|
float width = 0.0f; |
||||||
|
byte ret = ImGuiNative.ImGuiTextFilter_Draw(NativePtr, native_label, width); |
||||||
|
return ret != 0; |
||||||
|
} |
||||||
|
public bool Draw(string label) |
||||||
|
{ |
||||||
|
int label_byteCount = Encoding.UTF8.GetByteCount(label); |
||||||
|
byte* native_label = stackalloc byte[label_byteCount + 1]; |
||||||
|
fixed (char* label_ptr = label) |
||||||
|
{ |
||||||
|
int native_label_offset = Encoding.UTF8.GetBytes(label_ptr, label.Length, native_label, label_byteCount); |
||||||
|
native_label[native_label_offset] = 0; |
||||||
|
} |
||||||
|
float width = 0.0f; |
||||||
|
byte ret = ImGuiNative.ImGuiTextFilter_Draw(NativePtr, native_label, width); |
||||||
|
return ret != 0; |
||||||
|
} |
||||||
|
public bool Draw(string label, float width) |
||||||
|
{ |
||||||
|
int label_byteCount = Encoding.UTF8.GetByteCount(label); |
||||||
|
byte* native_label = stackalloc byte[label_byteCount + 1]; |
||||||
|
fixed (char* label_ptr = label) |
||||||
|
{ |
||||||
|
int native_label_offset = Encoding.UTF8.GetBytes(label_ptr, label.Length, native_label, label_byteCount); |
||||||
|
native_label[native_label_offset] = 0; |
||||||
|
} |
||||||
|
byte ret = ImGuiNative.ImGuiTextFilter_Draw(NativePtr, native_label, width); |
||||||
|
return ret != 0; |
||||||
|
} |
||||||
|
public bool IsActive() |
||||||
|
{ |
||||||
|
byte ret = ImGuiNative.ImGuiTextFilter_IsActive(NativePtr); |
||||||
|
return ret != 0; |
||||||
|
} |
||||||
|
public void Clear() |
||||||
|
{ |
||||||
|
ImGuiNative.ImGuiTextFilter_Clear(NativePtr); |
||||||
|
} |
||||||
|
public bool PassFilter(string text) |
||||||
|
{ |
||||||
|
int text_byteCount = Encoding.UTF8.GetByteCount(text); |
||||||
|
byte* native_text = stackalloc byte[text_byteCount + 1]; |
||||||
|
fixed (char* text_ptr = text) |
||||||
|
{ |
||||||
|
int native_text_offset = Encoding.UTF8.GetBytes(text_ptr, text.Length, native_text, text_byteCount); |
||||||
|
native_text[native_text_offset] = 0; |
||||||
|
} |
||||||
|
byte* native_text_end = null; |
||||||
|
byte ret = ImGuiNative.ImGuiTextFilter_PassFilter(NativePtr, native_text, native_text_end); |
||||||
|
return ret != 0; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,21 @@ |
|||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
[System.Flags] |
||||||
|
public enum ImGuiTreeNodeFlags |
||||||
|
{ |
||||||
|
None = 0, |
||||||
|
Selected = 1 << 0, |
||||||
|
Framed = 1 << 1, |
||||||
|
AllowItemOverlap = 1 << 2, |
||||||
|
NoTreePushOnOpen = 1 << 3, |
||||||
|
NoAutoOpenOnLog = 1 << 4, |
||||||
|
DefaultOpen = 1 << 5, |
||||||
|
OpenOnDoubleClick = 1 << 6, |
||||||
|
OpenOnArrow = 1 << 7, |
||||||
|
Leaf = 1 << 8, |
||||||
|
Bullet = 1 << 9, |
||||||
|
FramePadding = 1 << 10, |
||||||
|
NavLeftJumpsBackHere = 1 << 13, |
||||||
|
CollapsingHeader = Framed | NoTreePushOnOpen | NoAutoOpenOnLog, |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,33 @@ |
|||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
[System.Flags] |
||||||
|
public enum ImGuiWindowFlags |
||||||
|
{ |
||||||
|
None = 0, |
||||||
|
NoTitleBar = 1 << 0, |
||||||
|
NoResize = 1 << 1, |
||||||
|
NoMove = 1 << 2, |
||||||
|
NoScrollbar = 1 << 3, |
||||||
|
NoScrollWithMouse = 1 << 4, |
||||||
|
NoCollapse = 1 << 5, |
||||||
|
AlwaysAutoResize = 1 << 6, |
||||||
|
NoSavedSettings = 1 << 8, |
||||||
|
NoInputs = 1 << 9, |
||||||
|
MenuBar = 1 << 10, |
||||||
|
HorizontalScrollbar = 1 << 11, |
||||||
|
NoFocusOnAppearing = 1 << 12, |
||||||
|
NoBringToFrontOnFocus = 1 << 13, |
||||||
|
AlwaysVerticalScrollbar = 1 << 14, |
||||||
|
AlwaysHorizontalScrollbar = 1<< 15, |
||||||
|
AlwaysUseWindowPadding = 1 << 16, |
||||||
|
NoNavInputs = 1 << 18, |
||||||
|
NoNavFocus = 1 << 19, |
||||||
|
NoNav = NoNavInputs | NoNavFocus, |
||||||
|
NavFlattened = 1 << 23, |
||||||
|
ChildWindow = 1 << 24, |
||||||
|
Tooltip = 1 << 25, |
||||||
|
Popup = 1 << 26, |
||||||
|
Modal = 1 << 27, |
||||||
|
ChildMenu = 1 << 28, |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,46 @@ |
|||||||
|
using System; |
||||||
|
using System.Numerics; |
||||||
|
using System.Runtime.CompilerServices; |
||||||
|
using System.Text; |
||||||
|
|
||||||
|
namespace ImGuiNET |
||||||
|
{ |
||||||
|
public unsafe partial struct TextRange |
||||||
|
{ |
||||||
|
public byte* b; |
||||||
|
public byte* e; |
||||||
|
} |
||||||
|
public unsafe partial struct TextRangePtr |
||||||
|
{ |
||||||
|
public TextRange* NativePtr { get; } |
||||||
|
public TextRangePtr(TextRange* nativePtr) => NativePtr = nativePtr; |
||||||
|
public TextRangePtr(IntPtr nativePtr) => NativePtr = (TextRange*)nativePtr; |
||||||
|
public static implicit operator TextRangePtr(TextRange* nativePtr) => new TextRangePtr(nativePtr); |
||||||
|
public static implicit operator TextRange* (TextRangePtr wrappedPtr) => wrappedPtr.NativePtr; |
||||||
|
public static implicit operator TextRangePtr(IntPtr nativePtr) => new TextRangePtr(nativePtr); |
||||||
|
public IntPtr b { get => (IntPtr)NativePtr->b; set => NativePtr->b = (byte*)value; } |
||||||
|
public IntPtr e { get => (IntPtr)NativePtr->e; set => NativePtr->e = (byte*)value; } |
||||||
|
public void split(byte separator, ref ImVector @out) |
||||||
|
{ |
||||||
|
fixed (ImVector* native_out = &@out) |
||||||
|
{ |
||||||
|
ImGuiNative.TextRange_split(NativePtr, separator, native_out); |
||||||
|
} |
||||||
|
} |
||||||
|
public string end() |
||||||
|
{ |
||||||
|
byte* ret = ImGuiNative.TextRange_end(NativePtr); |
||||||
|
return Util.StringFromPtr(ret); |
||||||
|
} |
||||||
|
public string begin() |
||||||
|
{ |
||||||
|
byte* ret = ImGuiNative.TextRange_begin(NativePtr); |
||||||
|
return Util.StringFromPtr(ret); |
||||||
|
} |
||||||
|
public bool empty() |
||||||
|
{ |
||||||
|
byte ret = ImGuiNative.TextRange_empty(NativePtr); |
||||||
|
return ret != 0; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue