commit d6c32ef3403e89a5dc3f3fead42eb2cf9d6ee55d Author: cosmonaut Date: Thu Dec 21 15:03:12 2023 -0800 initial commit diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..c5993e5 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +*.dll filter=lfs diff=lfs merge=lfs -text +*.dylib filter=lfs diff=lfs merge=lfs -text +*.so filter=lfs diff=lfs merge=lfs -text +*.so.* filter=lfs diff=lfs merge=lfs -text +*.refresh filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..894124f --- /dev/null +++ b/.gitignore @@ -0,0 +1,347 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +imgui.ini + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*[.json, .xml, .info] + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..d51e2a4 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "lib/MoonWorks"] + path = lib/MoonWorks + url = https://gitea.moonside.games/MoonsideGames/MoonWorks.git diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..092dd74 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,16 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Attach to .NET 8 Debugger", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "Build: .NET 8 Debug", + "program": "${workspaceFolder}/bin/Debug/net8.0/MoonWorksDearImGuiScaffold.dll", + "args": [], + "cwd": "${workspaceFolder}/bin/Debug/net8.0", + "console": "integratedTerminal", + "internalConsoleOptions": "neverOpen" + } + ] +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..13adf83 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,129 @@ +{ + "version": "2.0.0", + "options": { + "cwd": "${workspaceRoot}" + }, + "windows": { + "options": { + "shell": { + "executable": "cmd.exe", + "args": [ + "/d", + "/c" + ] + } + } + }, + "presentation": { + "reveal": "always", + "focus": true, + "panel": "shared" + }, + "tasks": [ + { + "label": "Build & Run with Hot Reload: .NET 8 Debug", + "command": "dotnet", + "args": [ + "watch" + ], + "type": "shell", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [] + }, + { + "label": "Build & Run: .NET 8 Debug", + "type": "shell", + "dependsOrder": "sequence", + "dependsOn": [ + "Build: .NET 8 Debug", + "Run: .NET 8 Debug" + ], + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [] + }, + { + "label": "Build: .NET 8 Debug", + "command": "dotnet", + "args": [ + "build", + "./MoonWorksDearImGuiScaffold.csproj", + "-p:SolutionDir=${workspaceFolder}/" + ], + "type": "shell", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [] + }, + { + "label": "Run: .NET 8 Debug", + "command": "MoonWorksDearImGuiScaffold", + "windows": { + "command": "MoonWorksDearImGuiScaffold.exe" + }, + "options": { + "cwd": "${workspaceFolder}/bin/Debug/net8.0" + }, + "type": "process", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [] + }, + { + "label": "Build: .NET 8 Release", + "command": "dotnet", + "args": [ + "build", + "./MoonWorksDearImGuiScaffold.csproj", + "--configuration", + "Release", + "-p:SolutionDir=${workspaceFolder}/" + ], + "type": "shell", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [] + }, + { + "label": "Run: .NET 8 Release", + "command": "MoonWorksDearImGuiScaffold", + "windows": { + "command": "MoonWorksDearImGuiScaffold.exe" + }, + "options": { + "cwd": "${workspaceFolder}/bin/Debug/net8.0" + }, + "type": "process", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [] + }, + { + "label": "Build & Run: .NET 8 Release", + "dependsOrder": "sequence", + "dependsOn": [ + "Build: .NET 8 Release", + "Run: .NET 8 Release" + ], + "type": "shell", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [] + } + ] +} diff --git a/Content/Shaders/ImGui.frag.refresh b/Content/Shaders/ImGui.frag.refresh new file mode 100644 index 0000000..2a77dac --- /dev/null +++ b/Content/Shaders/ImGui.frag.refresh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d119f9d64fa6ed20ad6f8aa2065b0d5bbcb5d989f55ae0b23b3e4371daf1d774 +size 741 diff --git a/Content/Shaders/ImGui.vert.refresh b/Content/Shaders/ImGui.vert.refresh new file mode 100644 index 0000000..fa7eff8 --- /dev/null +++ b/Content/Shaders/ImGui.vert.refresh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ec6523170c4add2325152f2cae4a71d6d6402b663582221e17bdf34a8fbf128d +size 1521 diff --git a/CopyMoonlibs.targets b/CopyMoonlibs.targets new file mode 100644 index 0000000..8998eba --- /dev/null +++ b/CopyMoonlibs.targets @@ -0,0 +1,27 @@ + + + + + + + + + + %(RecursiveDir)%(Filename)%(Extension) + PreserveNewest + + + + + %(RecursiveDir)%(Filename)%(Extension) + PreserveNewest + + + + + %(RecursiveDir)%(Filename)%(Extension) + PreserveNewest + + + + diff --git a/MoonWorksDearImGuiScaffold.csproj b/MoonWorksDearImGuiScaffold.csproj new file mode 100644 index 0000000..70d9ee2 --- /dev/null +++ b/MoonWorksDearImGuiScaffold.csproj @@ -0,0 +1,32 @@ + + + Exe + net8.0 + MoonWorksDearImGuiScaffold + false + false + MoonWorksDearImGuiScaffold.Program + MoonWorksDearImGuiScaffold + MoonWorksDearImGuiScaffold + true + true + + + + + + Always + + + + + $(DefaultItemExcludes);lib\**\* + + + + + + + + + diff --git a/MoonWorksDearImGuiScaffold.sln b/MoonWorksDearImGuiScaffold.sln new file mode 100644 index 0000000..c5c5252 --- /dev/null +++ b/MoonWorksDearImGuiScaffold.sln @@ -0,0 +1,64 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MoonWorksDearImGuiScaffold", "MoonWorksDearImGuiScaffold.csproj", "{6CCE887D-748D-4806-8900-E79945B03F06}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MoonWorks", "lib\MoonWorks\MoonWorks.csproj", "{181A0E72-417D-49B2-89F6-1D042CE8AF7D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dav1dfile-CS", "lib\MoonWorks\lib\dav1dfile\csharp\dav1dfile-CS.csproj", "{2F4FA1A6-02D5-480A-9C83-E9B40C6D29AC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FAudio-CS.Core", "lib\MoonWorks\lib\FAudio\csharp\FAudio-CS.Core.csproj", "{5B6ACF3C-BB48-432F-98D2-35BE84A00539}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RefreshCS", "lib\MoonWorks\lib\RefreshCS\RefreshCS.csproj", "{CCFCA552-3DEA-4F4E-938D-F5ED022063D2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SDL2-CS.Core", "lib\MoonWorks\lib\SDL2-CS\SDL2-CS.Core.csproj", "{1243BB8E-F065-446A-9B1C-629D731F3B63}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WellspringCS", "lib\MoonWorks\lib\WellspringCS\WellspringCS.csproj", "{00D0DD4D-959F-4B95-85D9-B3CC9AD2AA66}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImGui.NET", "lib\ImGui.NET\ImGui.NET.csproj", "{3ABD7C60-D069-484F-A0B2-2F0C2C1BD5A5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6CCE887D-748D-4806-8900-E79945B03F06}.Debug|x64.ActiveCfg = Debug|Any CPU + {6CCE887D-748D-4806-8900-E79945B03F06}.Debug|x64.Build.0 = Debug|Any CPU + {6CCE887D-748D-4806-8900-E79945B03F06}.Release|x64.ActiveCfg = Release|Any CPU + {6CCE887D-748D-4806-8900-E79945B03F06}.Release|x64.Build.0 = Release|Any CPU + {181A0E72-417D-49B2-89F6-1D042CE8AF7D}.Debug|x64.ActiveCfg = Debug|Any CPU + {181A0E72-417D-49B2-89F6-1D042CE8AF7D}.Debug|x64.Build.0 = Debug|Any CPU + {181A0E72-417D-49B2-89F6-1D042CE8AF7D}.Release|x64.ActiveCfg = Release|Any CPU + {181A0E72-417D-49B2-89F6-1D042CE8AF7D}.Release|x64.Build.0 = Release|Any CPU + {2F4FA1A6-02D5-480A-9C83-E9B40C6D29AC}.Debug|x64.ActiveCfg = Debug|x64 + {2F4FA1A6-02D5-480A-9C83-E9B40C6D29AC}.Debug|x64.Build.0 = Debug|x64 + {2F4FA1A6-02D5-480A-9C83-E9B40C6D29AC}.Release|x64.ActiveCfg = Release|x64 + {2F4FA1A6-02D5-480A-9C83-E9B40C6D29AC}.Release|x64.Build.0 = Release|x64 + {5B6ACF3C-BB48-432F-98D2-35BE84A00539}.Debug|x64.ActiveCfg = Debug|x64 + {5B6ACF3C-BB48-432F-98D2-35BE84A00539}.Debug|x64.Build.0 = Debug|x64 + {5B6ACF3C-BB48-432F-98D2-35BE84A00539}.Release|x64.ActiveCfg = Release|x64 + {5B6ACF3C-BB48-432F-98D2-35BE84A00539}.Release|x64.Build.0 = Release|x64 + {CCFCA552-3DEA-4F4E-938D-F5ED022063D2}.Debug|x64.ActiveCfg = Debug|x64 + {CCFCA552-3DEA-4F4E-938D-F5ED022063D2}.Debug|x64.Build.0 = Debug|x64 + {CCFCA552-3DEA-4F4E-938D-F5ED022063D2}.Release|x64.ActiveCfg = Release|x64 + {CCFCA552-3DEA-4F4E-938D-F5ED022063D2}.Release|x64.Build.0 = Release|x64 + {1243BB8E-F065-446A-9B1C-629D731F3B63}.Debug|x64.ActiveCfg = Debug|x64 + {1243BB8E-F065-446A-9B1C-629D731F3B63}.Debug|x64.Build.0 = Debug|x64 + {1243BB8E-F065-446A-9B1C-629D731F3B63}.Release|x64.ActiveCfg = Release|x64 + {1243BB8E-F065-446A-9B1C-629D731F3B63}.Release|x64.Build.0 = Release|x64 + {00D0DD4D-959F-4B95-85D9-B3CC9AD2AA66}.Debug|x64.ActiveCfg = Debug|x64 + {00D0DD4D-959F-4B95-85D9-B3CC9AD2AA66}.Debug|x64.Build.0 = Debug|x64 + {00D0DD4D-959F-4B95-85D9-B3CC9AD2AA66}.Release|x64.ActiveCfg = Release|x64 + {00D0DD4D-959F-4B95-85D9-B3CC9AD2AA66}.Release|x64.Build.0 = Release|x64 + {3ABD7C60-D069-484F-A0B2-2F0C2C1BD5A5}.Debug|x64.ActiveCfg = Debug|Any CPU + {3ABD7C60-D069-484F-A0B2-2F0C2C1BD5A5}.Debug|x64.Build.0 = Debug|Any CPU + {3ABD7C60-D069-484F-A0B2-2F0C2C1BD5A5}.Release|x64.ActiveCfg = Release|Any CPU + {3ABD7C60-D069-484F-A0B2-2F0C2C1BD5A5}.Release|x64.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/README.md b/README.md new file mode 100644 index 0000000..4a7d0df --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# MoonWorksDearImGuiScaffold + +This is a project that you can use to get a MoonWorks + Dear ImGui application up and running. diff --git a/lib/ImGui.NET/Delegates.cs b/lib/ImGui.NET/Delegates.cs new file mode 100644 index 0000000..4075f15 --- /dev/null +++ b/lib/ImGui.NET/Delegates.cs @@ -0,0 +1,17 @@ +using System; +using System.Numerics; + +namespace ImGuiNET +{ + public delegate void Platform_CreateWindow(ImGuiViewportPtr vp); // Create a new platform window for the given viewport + public delegate void Platform_DestroyWindow(ImGuiViewportPtr vp); + public delegate void Platform_ShowWindow(ImGuiViewportPtr vp); // Newly created windows are initially hidden so SetWindowPos/Size/Title can be called on them first + public delegate void Platform_SetWindowPos(ImGuiViewportPtr vp, Vector2 pos); + public unsafe delegate void Platform_GetWindowPos(ImGuiViewportPtr vp, Vector2* outPos); + public delegate void Platform_SetWindowSize(ImGuiViewportPtr vp, Vector2 size); + public unsafe delegate void Platform_GetWindowSize(ImGuiViewportPtr vp, Vector2* outSize); + public delegate void Platform_SetWindowFocus(ImGuiViewportPtr vp); // Move window to front and set input focus + public delegate byte Platform_GetWindowFocus(ImGuiViewportPtr vp); + public delegate byte Platform_GetWindowMinimized(ImGuiViewportPtr vp); + public delegate void Platform_SetWindowTitle(ImGuiViewportPtr vp, IntPtr title); +} diff --git a/lib/ImGui.NET/Generated/ImColor.gen.cs b/lib/ImGui.NET/Generated/ImColor.gen.cs new file mode 100644 index 0000000..009ed06 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImColor.gen.cs @@ -0,0 +1,48 @@ +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(&NativePtr->Value); + public void Destroy() + { + ImGuiNative.ImColor_destroy((ImColor*)(NativePtr)); + } + public ImColor HSV(float h, float s, float v) + { + ImColor __retval; + float a = 1.0f; + ImGuiNative.ImColor_HSV(&__retval, h, s, v, a); + return __retval; + } + public ImColor HSV(float h, float s, float v, float a) + { + ImColor __retval; + ImGuiNative.ImColor_HSV(&__retval, h, s, v, a); + return __retval; + } + public void SetHSV(float h, float s, float v) + { + float a = 1.0f; + ImGuiNative.ImColor_SetHSV((ImColor*)(NativePtr), h, s, v, a); + } + public void SetHSV(float h, float s, float v, float a) + { + ImGuiNative.ImColor_SetHSV((ImColor*)(NativePtr), h, s, v, a); + } + } +} diff --git a/lib/ImGui.NET/Generated/ImDrawChannel.gen.cs b/lib/ImGui.NET/Generated/ImDrawChannel.gen.cs new file mode 100644 index 0000000..850df76 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImDrawChannel.gen.cs @@ -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 _CmdBuffer; + public ImVector _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 _CmdBuffer => new ImPtrVector(NativePtr->_CmdBuffer, Unsafe.SizeOf()); + public ImVector _IdxBuffer => new ImVector(NativePtr->_IdxBuffer); + } +} diff --git a/lib/ImGui.NET/Generated/ImDrawCmd.gen.cs b/lib/ImGui.NET/Generated/ImDrawCmd.gen.cs new file mode 100644 index 0000000..344d905 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImDrawCmd.gen.cs @@ -0,0 +1,43 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ImGuiNET +{ + public unsafe partial struct ImDrawCmd + { + public Vector4 ClipRect; + public IntPtr TextureId; + public uint VtxOffset; + public uint IdxOffset; + public uint ElemCount; + 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 Vector4 ClipRect => ref Unsafe.AsRef(&NativePtr->ClipRect); + public ref IntPtr TextureId => ref Unsafe.AsRef(&NativePtr->TextureId); + public ref uint VtxOffset => ref Unsafe.AsRef(&NativePtr->VtxOffset); + public ref uint IdxOffset => ref Unsafe.AsRef(&NativePtr->IdxOffset); + public ref uint ElemCount => ref Unsafe.AsRef(&NativePtr->ElemCount); + public ref IntPtr UserCallback => ref Unsafe.AsRef(&NativePtr->UserCallback); + public IntPtr UserCallbackData { get => (IntPtr)NativePtr->UserCallbackData; set => NativePtr->UserCallbackData = (void*)value; } + public void Destroy() + { + ImGuiNative.ImDrawCmd_destroy((ImDrawCmd*)(NativePtr)); + } + public IntPtr GetTexID() + { + IntPtr ret = ImGuiNative.ImDrawCmd_GetTexID((ImDrawCmd*)(NativePtr)); + return ret; + } + } +} diff --git a/lib/ImGui.NET/Generated/ImDrawCmdHeader.gen.cs b/lib/ImGui.NET/Generated/ImDrawCmdHeader.gen.cs new file mode 100644 index 0000000..2d1c053 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImDrawCmdHeader.gen.cs @@ -0,0 +1,26 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ImGuiNET +{ + public unsafe partial struct ImDrawCmdHeader + { + public Vector4 ClipRect; + public IntPtr TextureId; + public uint VtxOffset; + } + public unsafe partial struct ImDrawCmdHeaderPtr + { + public ImDrawCmdHeader* NativePtr { get; } + public ImDrawCmdHeaderPtr(ImDrawCmdHeader* nativePtr) => NativePtr = nativePtr; + public ImDrawCmdHeaderPtr(IntPtr nativePtr) => NativePtr = (ImDrawCmdHeader*)nativePtr; + public static implicit operator ImDrawCmdHeaderPtr(ImDrawCmdHeader* nativePtr) => new ImDrawCmdHeaderPtr(nativePtr); + public static implicit operator ImDrawCmdHeader* (ImDrawCmdHeaderPtr wrappedPtr) => wrappedPtr.NativePtr; + public static implicit operator ImDrawCmdHeaderPtr(IntPtr nativePtr) => new ImDrawCmdHeaderPtr(nativePtr); + public ref Vector4 ClipRect => ref Unsafe.AsRef(&NativePtr->ClipRect); + public ref IntPtr TextureId => ref Unsafe.AsRef(&NativePtr->TextureId); + public ref uint VtxOffset => ref Unsafe.AsRef(&NativePtr->VtxOffset); + } +} diff --git a/lib/ImGui.NET/Generated/ImDrawData.gen.cs b/lib/ImGui.NET/Generated/ImDrawData.gen.cs new file mode 100644 index 0000000..4ea932e --- /dev/null +++ b/lib/ImGui.NET/Generated/ImDrawData.gen.cs @@ -0,0 +1,59 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ImGuiNET +{ + public unsafe partial struct ImDrawData + { + public byte Valid; + public int CmdListsCount; + public int TotalIdxCount; + public int TotalVtxCount; + public ImVector CmdLists; + public Vector2 DisplayPos; + public Vector2 DisplaySize; + public Vector2 FramebufferScale; + public ImGuiViewport* OwnerViewport; + } + 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 bool Valid => ref Unsafe.AsRef(&NativePtr->Valid); + public ref int CmdListsCount => ref Unsafe.AsRef(&NativePtr->CmdListsCount); + public ref int TotalIdxCount => ref Unsafe.AsRef(&NativePtr->TotalIdxCount); + public ref int TotalVtxCount => ref Unsafe.AsRef(&NativePtr->TotalVtxCount); + public ImVector CmdLists => new ImVector(NativePtr->CmdLists); + public ref Vector2 DisplayPos => ref Unsafe.AsRef(&NativePtr->DisplayPos); + public ref Vector2 DisplaySize => ref Unsafe.AsRef(&NativePtr->DisplaySize); + public ref Vector2 FramebufferScale => ref Unsafe.AsRef(&NativePtr->FramebufferScale); + public ImGuiViewportPtr OwnerViewport => new ImGuiViewportPtr(NativePtr->OwnerViewport); + public void AddDrawList(ImDrawListPtr draw_list) + { + ImDrawList* native_draw_list = draw_list.NativePtr; + ImGuiNative.ImDrawData_AddDrawList((ImDrawData*)(NativePtr), native_draw_list); + } + public void Clear() + { + ImGuiNative.ImDrawData_Clear((ImDrawData*)(NativePtr)); + } + public void DeIndexAllBuffers() + { + ImGuiNative.ImDrawData_DeIndexAllBuffers((ImDrawData*)(NativePtr)); + } + public void Destroy() + { + ImGuiNative.ImDrawData_destroy((ImDrawData*)(NativePtr)); + } + public void ScaleClipRects(Vector2 fb_scale) + { + ImGuiNative.ImDrawData_ScaleClipRects((ImDrawData*)(NativePtr), fb_scale); + } + } +} diff --git a/lib/ImGui.NET/Generated/ImDrawFlags.gen.cs b/lib/ImGui.NET/Generated/ImDrawFlags.gen.cs new file mode 100644 index 0000000..60ae459 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImDrawFlags.gen.cs @@ -0,0 +1,21 @@ +namespace ImGuiNET +{ + [System.Flags] + public enum ImDrawFlags + { + None = 0, + Closed = 1, + RoundCornersTopLeft = 16, + RoundCornersTopRight = 32, + RoundCornersBottomLeft = 64, + RoundCornersBottomRight = 128, + RoundCornersNone = 256, + RoundCornersTop = 48, + RoundCornersBottom = 192, + RoundCornersLeft = 80, + RoundCornersRight = 160, + RoundCornersAll = 240, + RoundCornersDefault = 240, + RoundCornersMask = 496, + } +} diff --git a/lib/ImGui.NET/Generated/ImDrawList.gen.cs b/lib/ImGui.NET/Generated/ImDrawList.gen.cs new file mode 100644 index 0000000..07835f3 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImDrawList.gen.cs @@ -0,0 +1,731 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ImGuiNET +{ + public unsafe partial struct ImDrawList + { + public ImVector CmdBuffer; + public ImVector IdxBuffer; + public ImVector VtxBuffer; + public ImDrawListFlags Flags; + public uint _VtxCurrentIdx; + public IntPtr _Data; + public byte* _OwnerName; + public ImDrawVert* _VtxWritePtr; + public ushort* _IdxWritePtr; + public ImVector _ClipRectStack; + public ImVector _TextureIdStack; + public ImVector _Path; + public ImDrawCmdHeader _CmdHeader; + public ImDrawListSplitter _Splitter; + public float _FringeScale; + } + 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 CmdBuffer => new ImPtrVector(NativePtr->CmdBuffer, Unsafe.SizeOf()); + public ImVector IdxBuffer => new ImVector(NativePtr->IdxBuffer); + public ImPtrVector VtxBuffer => new ImPtrVector(NativePtr->VtxBuffer, Unsafe.SizeOf()); + public ref ImDrawListFlags Flags => ref Unsafe.AsRef(&NativePtr->Flags); + public ref uint _VtxCurrentIdx => ref Unsafe.AsRef(&NativePtr->_VtxCurrentIdx); + public ref IntPtr _Data => ref Unsafe.AsRef(&NativePtr->_Data); + public NullTerminatedString _OwnerName => new NullTerminatedString(NativePtr->_OwnerName); + public ImDrawVertPtr _VtxWritePtr => new ImDrawVertPtr(NativePtr->_VtxWritePtr); + public IntPtr _IdxWritePtr { get => (IntPtr)NativePtr->_IdxWritePtr; set => NativePtr->_IdxWritePtr = (ushort*)value; } + public ImVector _ClipRectStack => new ImVector(NativePtr->_ClipRectStack); + public ImVector _TextureIdStack => new ImVector(NativePtr->_TextureIdStack); + public ImVector _Path => new ImVector(NativePtr->_Path); + public ref ImDrawCmdHeader _CmdHeader => ref Unsafe.AsRef(&NativePtr->_CmdHeader); + public ref ImDrawListSplitter _Splitter => ref Unsafe.AsRef(&NativePtr->_Splitter); + public ref float _FringeScale => ref Unsafe.AsRef(&NativePtr->_FringeScale); + public int _CalcCircleAutoSegmentCount(float radius) + { + int ret = ImGuiNative.ImDrawList__CalcCircleAutoSegmentCount((ImDrawList*)(NativePtr), radius); + return ret; + } + public void _ClearFreeMemory() + { + ImGuiNative.ImDrawList__ClearFreeMemory((ImDrawList*)(NativePtr)); + } + public void _OnChangedClipRect() + { + ImGuiNative.ImDrawList__OnChangedClipRect((ImDrawList*)(NativePtr)); + } + public void _OnChangedTextureID() + { + ImGuiNative.ImDrawList__OnChangedTextureID((ImDrawList*)(NativePtr)); + } + public void _OnChangedVtxOffset() + { + ImGuiNative.ImDrawList__OnChangedVtxOffset((ImDrawList*)(NativePtr)); + } + public void _PathArcToFastEx(Vector2 center, float radius, int a_min_sample, int a_max_sample, int a_step) + { + ImGuiNative.ImDrawList__PathArcToFastEx((ImDrawList*)(NativePtr), center, radius, a_min_sample, a_max_sample, a_step); + } + public void _PathArcToN(Vector2 center, float radius, float a_min, float a_max, int num_segments) + { + ImGuiNative.ImDrawList__PathArcToN((ImDrawList*)(NativePtr), center, radius, a_min, a_max, num_segments); + } + public void _PopUnusedDrawCmd() + { + ImGuiNative.ImDrawList__PopUnusedDrawCmd((ImDrawList*)(NativePtr)); + } + public void _ResetForNewFrame() + { + ImGuiNative.ImDrawList__ResetForNewFrame((ImDrawList*)(NativePtr)); + } + public void _TryMergeDrawCmds() + { + ImGuiNative.ImDrawList__TryMergeDrawCmds((ImDrawList*)(NativePtr)); + } + public void AddBezierCubic(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, uint col, float thickness) + { + int num_segments = 0; + ImGuiNative.ImDrawList_AddBezierCubic((ImDrawList*)(NativePtr), p1, p2, p3, p4, col, thickness, num_segments); + } + public void AddBezierCubic(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, uint col, float thickness, int num_segments) + { + ImGuiNative.ImDrawList_AddBezierCubic((ImDrawList*)(NativePtr), p1, p2, p3, p4, col, thickness, num_segments); + } + public void AddBezierQuadratic(Vector2 p1, Vector2 p2, Vector2 p3, uint col, float thickness) + { + int num_segments = 0; + ImGuiNative.ImDrawList_AddBezierQuadratic((ImDrawList*)(NativePtr), p1, p2, p3, col, thickness, num_segments); + } + public void AddBezierQuadratic(Vector2 p1, Vector2 p2, Vector2 p3, uint col, float thickness, int num_segments) + { + ImGuiNative.ImDrawList_AddBezierQuadratic((ImDrawList*)(NativePtr), p1, p2, p3, col, thickness, num_segments); + } + public void AddCallback(IntPtr callback, IntPtr callback_data) + { + void* native_callback_data = (void*)callback_data.ToPointer(); + ImGuiNative.ImDrawList_AddCallback((ImDrawList*)(NativePtr), callback, native_callback_data); + } + public void AddCircle(Vector2 center, float radius, uint col) + { + int num_segments = 0; + float thickness = 1.0f; + ImGuiNative.ImDrawList_AddCircle((ImDrawList*)(NativePtr), center, radius, col, num_segments, thickness); + } + public void AddCircle(Vector2 center, float radius, uint col, int num_segments) + { + float thickness = 1.0f; + ImGuiNative.ImDrawList_AddCircle((ImDrawList*)(NativePtr), center, radius, col, num_segments, thickness); + } + public void AddCircle(Vector2 center, float radius, uint col, int num_segments, float thickness) + { + ImGuiNative.ImDrawList_AddCircle((ImDrawList*)(NativePtr), center, radius, col, num_segments, thickness); + } + public void AddCircleFilled(Vector2 center, float radius, uint col) + { + int num_segments = 0; + ImGuiNative.ImDrawList_AddCircleFilled((ImDrawList*)(NativePtr), center, radius, col, num_segments); + } + public void AddCircleFilled(Vector2 center, float radius, uint col, int num_segments) + { + ImGuiNative.ImDrawList_AddCircleFilled((ImDrawList*)(NativePtr), center, radius, col, num_segments); + } + public void AddConvexPolyFilled(ref Vector2 points, int num_points, uint col) + { + fixed (Vector2* native_points = &points) + { + ImGuiNative.ImDrawList_AddConvexPolyFilled((ImDrawList*)(NativePtr), native_points, num_points, col); + } + } + public void AddDrawCmd() + { + ImGuiNative.ImDrawList_AddDrawCmd((ImDrawList*)(NativePtr)); + } + public void AddEllipse(Vector2 center, float radius_x, float radius_y, uint col) + { + float rot = 0.0f; + int num_segments = 0; + float thickness = 1.0f; + ImGuiNative.ImDrawList_AddEllipse((ImDrawList*)(NativePtr), center, radius_x, radius_y, col, rot, num_segments, thickness); + } + public void AddEllipse(Vector2 center, float radius_x, float radius_y, uint col, float rot) + { + int num_segments = 0; + float thickness = 1.0f; + ImGuiNative.ImDrawList_AddEllipse((ImDrawList*)(NativePtr), center, radius_x, radius_y, col, rot, num_segments, thickness); + } + public void AddEllipse(Vector2 center, float radius_x, float radius_y, uint col, float rot, int num_segments) + { + float thickness = 1.0f; + ImGuiNative.ImDrawList_AddEllipse((ImDrawList*)(NativePtr), center, radius_x, radius_y, col, rot, num_segments, thickness); + } + public void AddEllipse(Vector2 center, float radius_x, float radius_y, uint col, float rot, int num_segments, float thickness) + { + ImGuiNative.ImDrawList_AddEllipse((ImDrawList*)(NativePtr), center, radius_x, radius_y, col, rot, num_segments, thickness); + } + public void AddEllipseFilled(Vector2 center, float radius_x, float radius_y, uint col) + { + float rot = 0.0f; + int num_segments = 0; + ImGuiNative.ImDrawList_AddEllipseFilled((ImDrawList*)(NativePtr), center, radius_x, radius_y, col, rot, num_segments); + } + public void AddEllipseFilled(Vector2 center, float radius_x, float radius_y, uint col, float rot) + { + int num_segments = 0; + ImGuiNative.ImDrawList_AddEllipseFilled((ImDrawList*)(NativePtr), center, radius_x, radius_y, col, rot, num_segments); + } + public void AddEllipseFilled(Vector2 center, float radius_x, float radius_y, uint col, float rot, int num_segments) + { + ImGuiNative.ImDrawList_AddEllipseFilled((ImDrawList*)(NativePtr), center, radius_x, radius_y, col, rot, num_segments); + } + public void AddImage(IntPtr user_texture_id, Vector2 p_min, Vector2 p_max) + { + Vector2 uv_min = new Vector2(); + Vector2 uv_max = new Vector2(1, 1); + uint col = 4294967295; + ImGuiNative.ImDrawList_AddImage((ImDrawList*)(NativePtr), user_texture_id, p_min, p_max, uv_min, uv_max, col); + } + public void AddImage(IntPtr user_texture_id, Vector2 p_min, Vector2 p_max, Vector2 uv_min) + { + Vector2 uv_max = new Vector2(1, 1); + uint col = 4294967295; + ImGuiNative.ImDrawList_AddImage((ImDrawList*)(NativePtr), user_texture_id, p_min, p_max, uv_min, uv_max, col); + } + public void AddImage(IntPtr user_texture_id, Vector2 p_min, Vector2 p_max, Vector2 uv_min, Vector2 uv_max) + { + uint col = 4294967295; + ImGuiNative.ImDrawList_AddImage((ImDrawList*)(NativePtr), user_texture_id, p_min, p_max, uv_min, uv_max, col); + } + public void AddImage(IntPtr user_texture_id, Vector2 p_min, Vector2 p_max, Vector2 uv_min, Vector2 uv_max, uint col) + { + ImGuiNative.ImDrawList_AddImage((ImDrawList*)(NativePtr), user_texture_id, p_min, p_max, uv_min, uv_max, col); + } + public void AddImageQuad(IntPtr user_texture_id, Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4) + { + Vector2 uv1 = new Vector2(); + Vector2 uv2 = new Vector2(1, 0); + Vector2 uv3 = new Vector2(1, 1); + Vector2 uv4 = new Vector2(0, 1); + uint col = 4294967295; + ImGuiNative.ImDrawList_AddImageQuad((ImDrawList*)(NativePtr), user_texture_id, p1, p2, p3, p4, uv1, uv2, uv3, uv4, col); + } + public void AddImageQuad(IntPtr user_texture_id, Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, Vector2 uv1) + { + Vector2 uv2 = new Vector2(1, 0); + Vector2 uv3 = new Vector2(1, 1); + Vector2 uv4 = new Vector2(0, 1); + uint col = 4294967295; + ImGuiNative.ImDrawList_AddImageQuad((ImDrawList*)(NativePtr), user_texture_id, p1, p2, p3, p4, uv1, uv2, uv3, uv4, col); + } + public void AddImageQuad(IntPtr user_texture_id, Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, Vector2 uv1, Vector2 uv2) + { + Vector2 uv3 = new Vector2(1, 1); + Vector2 uv4 = new Vector2(0, 1); + uint col = 4294967295; + ImGuiNative.ImDrawList_AddImageQuad((ImDrawList*)(NativePtr), user_texture_id, p1, p2, p3, p4, uv1, uv2, uv3, uv4, col); + } + public void AddImageQuad(IntPtr user_texture_id, Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, Vector2 uv1, Vector2 uv2, Vector2 uv3) + { + Vector2 uv4 = new Vector2(0, 1); + uint col = 4294967295; + ImGuiNative.ImDrawList_AddImageQuad((ImDrawList*)(NativePtr), user_texture_id, p1, p2, p3, p4, uv1, uv2, uv3, uv4, col); + } + public void AddImageQuad(IntPtr user_texture_id, Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, Vector2 uv1, Vector2 uv2, Vector2 uv3, Vector2 uv4) + { + uint col = 4294967295; + ImGuiNative.ImDrawList_AddImageQuad((ImDrawList*)(NativePtr), user_texture_id, p1, p2, p3, p4, uv1, uv2, uv3, uv4, col); + } + public void AddImageQuad(IntPtr user_texture_id, Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, Vector2 uv1, Vector2 uv2, Vector2 uv3, Vector2 uv4, uint col) + { + ImGuiNative.ImDrawList_AddImageQuad((ImDrawList*)(NativePtr), user_texture_id, p1, p2, p3, p4, uv1, uv2, uv3, uv4, col); + } + public void AddImageRounded(IntPtr user_texture_id, Vector2 p_min, Vector2 p_max, Vector2 uv_min, Vector2 uv_max, uint col, float rounding) + { + ImDrawFlags flags = (ImDrawFlags)0; + ImGuiNative.ImDrawList_AddImageRounded((ImDrawList*)(NativePtr), user_texture_id, p_min, p_max, uv_min, uv_max, col, rounding, flags); + } + public void AddImageRounded(IntPtr user_texture_id, Vector2 p_min, Vector2 p_max, Vector2 uv_min, Vector2 uv_max, uint col, float rounding, ImDrawFlags flags) + { + ImGuiNative.ImDrawList_AddImageRounded((ImDrawList*)(NativePtr), user_texture_id, p_min, p_max, uv_min, uv_max, col, rounding, flags); + } + public void AddLine(Vector2 p1, Vector2 p2, uint col) + { + float thickness = 1.0f; + ImGuiNative.ImDrawList_AddLine((ImDrawList*)(NativePtr), p1, p2, col, thickness); + } + public void AddLine(Vector2 p1, Vector2 p2, uint col, float thickness) + { + ImGuiNative.ImDrawList_AddLine((ImDrawList*)(NativePtr), p1, p2, col, thickness); + } + public void AddNgon(Vector2 center, float radius, uint col, int num_segments) + { + float thickness = 1.0f; + ImGuiNative.ImDrawList_AddNgon((ImDrawList*)(NativePtr), center, radius, col, num_segments, thickness); + } + public void AddNgon(Vector2 center, float radius, uint col, int num_segments, float thickness) + { + ImGuiNative.ImDrawList_AddNgon((ImDrawList*)(NativePtr), center, radius, col, num_segments, thickness); + } + public void AddNgonFilled(Vector2 center, float radius, uint col, int num_segments) + { + ImGuiNative.ImDrawList_AddNgonFilled((ImDrawList*)(NativePtr), center, radius, col, num_segments); + } + public void AddPolyline(ref Vector2 points, int num_points, uint col, ImDrawFlags flags, float thickness) + { + fixed (Vector2* native_points = &points) + { + ImGuiNative.ImDrawList_AddPolyline((ImDrawList*)(NativePtr), native_points, num_points, col, flags, thickness); + } + } + public void AddQuad(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, uint col) + { + float thickness = 1.0f; + ImGuiNative.ImDrawList_AddQuad((ImDrawList*)(NativePtr), p1, p2, p3, p4, col, thickness); + } + public void AddQuad(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, uint col, float thickness) + { + ImGuiNative.ImDrawList_AddQuad((ImDrawList*)(NativePtr), p1, p2, p3, p4, col, thickness); + } + public void AddQuadFilled(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, uint col) + { + ImGuiNative.ImDrawList_AddQuadFilled((ImDrawList*)(NativePtr), p1, p2, p3, p4, col); + } + public void AddRect(Vector2 p_min, Vector2 p_max, uint col) + { + float rounding = 0.0f; + ImDrawFlags flags = (ImDrawFlags)0; + float thickness = 1.0f; + ImGuiNative.ImDrawList_AddRect((ImDrawList*)(NativePtr), p_min, p_max, col, rounding, flags, thickness); + } + public void AddRect(Vector2 p_min, Vector2 p_max, uint col, float rounding) + { + ImDrawFlags flags = (ImDrawFlags)0; + float thickness = 1.0f; + ImGuiNative.ImDrawList_AddRect((ImDrawList*)(NativePtr), p_min, p_max, col, rounding, flags, thickness); + } + public void AddRect(Vector2 p_min, Vector2 p_max, uint col, float rounding, ImDrawFlags flags) + { + float thickness = 1.0f; + ImGuiNative.ImDrawList_AddRect((ImDrawList*)(NativePtr), p_min, p_max, col, rounding, flags, thickness); + } + public void AddRect(Vector2 p_min, Vector2 p_max, uint col, float rounding, ImDrawFlags flags, float thickness) + { + ImGuiNative.ImDrawList_AddRect((ImDrawList*)(NativePtr), p_min, p_max, col, rounding, flags, thickness); + } + public void AddRectFilled(Vector2 p_min, Vector2 p_max, uint col) + { + float rounding = 0.0f; + ImDrawFlags flags = (ImDrawFlags)0; + ImGuiNative.ImDrawList_AddRectFilled((ImDrawList*)(NativePtr), p_min, p_max, col, rounding, flags); + } + public void AddRectFilled(Vector2 p_min, Vector2 p_max, uint col, float rounding) + { + ImDrawFlags flags = (ImDrawFlags)0; + ImGuiNative.ImDrawList_AddRectFilled((ImDrawList*)(NativePtr), p_min, p_max, col, rounding, flags); + } + public void AddRectFilled(Vector2 p_min, Vector2 p_max, uint col, float rounding, ImDrawFlags flags) + { + ImGuiNative.ImDrawList_AddRectFilled((ImDrawList*)(NativePtr), p_min, p_max, col, rounding, flags); + } + public void AddRectFilledMultiColor(Vector2 p_min, Vector2 p_max, uint col_upr_left, uint col_upr_right, uint col_bot_right, uint col_bot_left) + { + ImGuiNative.ImDrawList_AddRectFilledMultiColor((ImDrawList*)(NativePtr), p_min, p_max, col_upr_left, col_upr_right, col_bot_right, col_bot_left); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public void AddText(Vector2 pos, uint col, ReadOnlySpan text_begin) + { + byte* native_text_begin; + int text_begin_byteCount = 0; + text_begin_byteCount = Encoding.UTF8.GetByteCount(text_begin); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + native_text_begin = Util.Allocate(text_begin_byteCount + 1); + } + else + { + byte* native_text_begin_stackBytes = stackalloc byte[text_begin_byteCount + 1]; + native_text_begin = native_text_begin_stackBytes; + } + int native_text_begin_offset = Util.GetUtf8(text_begin, native_text_begin, text_begin_byteCount); + native_text_begin[native_text_begin_offset] = 0; + ImGuiNative.ImDrawList_AddText_Vec2((ImDrawList*)(NativePtr), pos, col, native_text_begin, native_text_begin+text_begin_byteCount); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text_begin); + } + } +#endif + public void AddText(Vector2 pos, uint col, string text_begin) + { + byte* native_text_begin; + int text_begin_byteCount = 0; + text_begin_byteCount = Encoding.UTF8.GetByteCount(text_begin); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + native_text_begin = Util.Allocate(text_begin_byteCount + 1); + } + else + { + byte* native_text_begin_stackBytes = stackalloc byte[text_begin_byteCount + 1]; + native_text_begin = native_text_begin_stackBytes; + } + int native_text_begin_offset = Util.GetUtf8(text_begin, native_text_begin, text_begin_byteCount); + native_text_begin[native_text_begin_offset] = 0; + ImGuiNative.ImDrawList_AddText_Vec2((ImDrawList*)(NativePtr), pos, col, native_text_begin, native_text_begin+text_begin_byteCount); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text_begin); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public void AddText(ImFontPtr font, float font_size, Vector2 pos, uint col, ReadOnlySpan text_begin) + { + ImFont* native_font = font.NativePtr; + byte* native_text_begin; + int text_begin_byteCount = 0; + text_begin_byteCount = Encoding.UTF8.GetByteCount(text_begin); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + native_text_begin = Util.Allocate(text_begin_byteCount + 1); + } + else + { + byte* native_text_begin_stackBytes = stackalloc byte[text_begin_byteCount + 1]; + native_text_begin = native_text_begin_stackBytes; + } + int native_text_begin_offset = Util.GetUtf8(text_begin, native_text_begin, text_begin_byteCount); + native_text_begin[native_text_begin_offset] = 0; + float wrap_width = 0.0f; + Vector4* cpu_fine_clip_rect = null; + ImGuiNative.ImDrawList_AddText_FontPtr((ImDrawList*)(NativePtr), native_font, font_size, pos, col, native_text_begin, native_text_begin+text_begin_byteCount, wrap_width, cpu_fine_clip_rect); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text_begin); + } + } +#endif + public void AddText(ImFontPtr font, float font_size, Vector2 pos, uint col, string text_begin) + { + ImFont* native_font = font.NativePtr; + byte* native_text_begin; + int text_begin_byteCount = 0; + text_begin_byteCount = Encoding.UTF8.GetByteCount(text_begin); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + native_text_begin = Util.Allocate(text_begin_byteCount + 1); + } + else + { + byte* native_text_begin_stackBytes = stackalloc byte[text_begin_byteCount + 1]; + native_text_begin = native_text_begin_stackBytes; + } + int native_text_begin_offset = Util.GetUtf8(text_begin, native_text_begin, text_begin_byteCount); + native_text_begin[native_text_begin_offset] = 0; + float wrap_width = 0.0f; + Vector4* cpu_fine_clip_rect = null; + ImGuiNative.ImDrawList_AddText_FontPtr((ImDrawList*)(NativePtr), native_font, font_size, pos, col, native_text_begin, native_text_begin+text_begin_byteCount, wrap_width, cpu_fine_clip_rect); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text_begin); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public void AddText(ImFontPtr font, float font_size, Vector2 pos, uint col, ReadOnlySpan text_begin, float wrap_width) + { + ImFont* native_font = font.NativePtr; + byte* native_text_begin; + int text_begin_byteCount = 0; + text_begin_byteCount = Encoding.UTF8.GetByteCount(text_begin); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + native_text_begin = Util.Allocate(text_begin_byteCount + 1); + } + else + { + byte* native_text_begin_stackBytes = stackalloc byte[text_begin_byteCount + 1]; + native_text_begin = native_text_begin_stackBytes; + } + int native_text_begin_offset = Util.GetUtf8(text_begin, native_text_begin, text_begin_byteCount); + native_text_begin[native_text_begin_offset] = 0; + Vector4* cpu_fine_clip_rect = null; + ImGuiNative.ImDrawList_AddText_FontPtr((ImDrawList*)(NativePtr), native_font, font_size, pos, col, native_text_begin, native_text_begin+text_begin_byteCount, wrap_width, cpu_fine_clip_rect); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text_begin); + } + } +#endif + public void AddText(ImFontPtr font, float font_size, Vector2 pos, uint col, string text_begin, float wrap_width) + { + ImFont* native_font = font.NativePtr; + byte* native_text_begin; + int text_begin_byteCount = 0; + text_begin_byteCount = Encoding.UTF8.GetByteCount(text_begin); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + native_text_begin = Util.Allocate(text_begin_byteCount + 1); + } + else + { + byte* native_text_begin_stackBytes = stackalloc byte[text_begin_byteCount + 1]; + native_text_begin = native_text_begin_stackBytes; + } + int native_text_begin_offset = Util.GetUtf8(text_begin, native_text_begin, text_begin_byteCount); + native_text_begin[native_text_begin_offset] = 0; + Vector4* cpu_fine_clip_rect = null; + ImGuiNative.ImDrawList_AddText_FontPtr((ImDrawList*)(NativePtr), native_font, font_size, pos, col, native_text_begin, native_text_begin+text_begin_byteCount, wrap_width, cpu_fine_clip_rect); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text_begin); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public void AddText(ImFontPtr font, float font_size, Vector2 pos, uint col, ReadOnlySpan text_begin, float wrap_width, ref Vector4 cpu_fine_clip_rect) + { + ImFont* native_font = font.NativePtr; + byte* native_text_begin; + int text_begin_byteCount = 0; + text_begin_byteCount = Encoding.UTF8.GetByteCount(text_begin); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + native_text_begin = Util.Allocate(text_begin_byteCount + 1); + } + else + { + byte* native_text_begin_stackBytes = stackalloc byte[text_begin_byteCount + 1]; + native_text_begin = native_text_begin_stackBytes; + } + int native_text_begin_offset = Util.GetUtf8(text_begin, native_text_begin, text_begin_byteCount); + native_text_begin[native_text_begin_offset] = 0; + fixed (Vector4* native_cpu_fine_clip_rect = &cpu_fine_clip_rect) + { + ImGuiNative.ImDrawList_AddText_FontPtr((ImDrawList*)(NativePtr), native_font, font_size, pos, col, native_text_begin, native_text_begin+text_begin_byteCount, wrap_width, native_cpu_fine_clip_rect); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text_begin); + } + } + } +#endif + public void AddText(ImFontPtr font, float font_size, Vector2 pos, uint col, string text_begin, float wrap_width, ref Vector4 cpu_fine_clip_rect) + { + ImFont* native_font = font.NativePtr; + byte* native_text_begin; + int text_begin_byteCount = 0; + text_begin_byteCount = Encoding.UTF8.GetByteCount(text_begin); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + native_text_begin = Util.Allocate(text_begin_byteCount + 1); + } + else + { + byte* native_text_begin_stackBytes = stackalloc byte[text_begin_byteCount + 1]; + native_text_begin = native_text_begin_stackBytes; + } + int native_text_begin_offset = Util.GetUtf8(text_begin, native_text_begin, text_begin_byteCount); + native_text_begin[native_text_begin_offset] = 0; + fixed (Vector4* native_cpu_fine_clip_rect = &cpu_fine_clip_rect) + { + ImGuiNative.ImDrawList_AddText_FontPtr((ImDrawList*)(NativePtr), native_font, font_size, pos, col, native_text_begin, native_text_begin+text_begin_byteCount, wrap_width, native_cpu_fine_clip_rect); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text_begin); + } + } + } + public void AddTriangle(Vector2 p1, Vector2 p2, Vector2 p3, uint col) + { + float thickness = 1.0f; + ImGuiNative.ImDrawList_AddTriangle((ImDrawList*)(NativePtr), p1, p2, p3, col, thickness); + } + public void AddTriangle(Vector2 p1, Vector2 p2, Vector2 p3, uint col, float thickness) + { + ImGuiNative.ImDrawList_AddTriangle((ImDrawList*)(NativePtr), p1, p2, p3, col, thickness); + } + public void AddTriangleFilled(Vector2 p1, Vector2 p2, Vector2 p3, uint col) + { + ImGuiNative.ImDrawList_AddTriangleFilled((ImDrawList*)(NativePtr), p1, p2, p3, col); + } + public void ChannelsMerge() + { + ImGuiNative.ImDrawList_ChannelsMerge((ImDrawList*)(NativePtr)); + } + public void ChannelsSetCurrent(int n) + { + ImGuiNative.ImDrawList_ChannelsSetCurrent((ImDrawList*)(NativePtr), n); + } + public void ChannelsSplit(int count) + { + ImGuiNative.ImDrawList_ChannelsSplit((ImDrawList*)(NativePtr), count); + } + public ImDrawListPtr CloneOutput() + { + ImDrawList* ret = ImGuiNative.ImDrawList_CloneOutput((ImDrawList*)(NativePtr)); + return new ImDrawListPtr(ret); + } + public void Destroy() + { + ImGuiNative.ImDrawList_destroy((ImDrawList*)(NativePtr)); + } + public Vector2 GetClipRectMax() + { + Vector2 __retval; + ImGuiNative.ImDrawList_GetClipRectMax(&__retval, (ImDrawList*)(NativePtr)); + return __retval; + } + public Vector2 GetClipRectMin() + { + Vector2 __retval; + ImGuiNative.ImDrawList_GetClipRectMin(&__retval, (ImDrawList*)(NativePtr)); + return __retval; + } + public void PathArcTo(Vector2 center, float radius, float a_min, float a_max) + { + int num_segments = 0; + ImGuiNative.ImDrawList_PathArcTo((ImDrawList*)(NativePtr), center, radius, a_min, a_max, num_segments); + } + public void PathArcTo(Vector2 center, float radius, float a_min, float a_max, int num_segments) + { + ImGuiNative.ImDrawList_PathArcTo((ImDrawList*)(NativePtr), center, radius, a_min, a_max, num_segments); + } + public void PathArcToFast(Vector2 center, float radius, int a_min_of_12, int a_max_of_12) + { + ImGuiNative.ImDrawList_PathArcToFast((ImDrawList*)(NativePtr), center, radius, a_min_of_12, a_max_of_12); + } + public void PathBezierCubicCurveTo(Vector2 p2, Vector2 p3, Vector2 p4) + { + int num_segments = 0; + ImGuiNative.ImDrawList_PathBezierCubicCurveTo((ImDrawList*)(NativePtr), p2, p3, p4, num_segments); + } + public void PathBezierCubicCurveTo(Vector2 p2, Vector2 p3, Vector2 p4, int num_segments) + { + ImGuiNative.ImDrawList_PathBezierCubicCurveTo((ImDrawList*)(NativePtr), p2, p3, p4, num_segments); + } + public void PathBezierQuadraticCurveTo(Vector2 p2, Vector2 p3) + { + int num_segments = 0; + ImGuiNative.ImDrawList_PathBezierQuadraticCurveTo((ImDrawList*)(NativePtr), p2, p3, num_segments); + } + public void PathBezierQuadraticCurveTo(Vector2 p2, Vector2 p3, int num_segments) + { + ImGuiNative.ImDrawList_PathBezierQuadraticCurveTo((ImDrawList*)(NativePtr), p2, p3, num_segments); + } + public void PathClear() + { + ImGuiNative.ImDrawList_PathClear((ImDrawList*)(NativePtr)); + } + public void PathEllipticalArcTo(Vector2 center, float radius_x, float radius_y, float rot, float a_min, float a_max) + { + int num_segments = 0; + ImGuiNative.ImDrawList_PathEllipticalArcTo((ImDrawList*)(NativePtr), center, radius_x, radius_y, rot, a_min, a_max, num_segments); + } + public void PathEllipticalArcTo(Vector2 center, float radius_x, float radius_y, float rot, float a_min, float a_max, int num_segments) + { + ImGuiNative.ImDrawList_PathEllipticalArcTo((ImDrawList*)(NativePtr), center, radius_x, radius_y, rot, a_min, a_max, num_segments); + } + public void PathFillConvex(uint col) + { + ImGuiNative.ImDrawList_PathFillConvex((ImDrawList*)(NativePtr), col); + } + public void PathLineTo(Vector2 pos) + { + ImGuiNative.ImDrawList_PathLineTo((ImDrawList*)(NativePtr), pos); + } + public void PathLineToMergeDuplicate(Vector2 pos) + { + ImGuiNative.ImDrawList_PathLineToMergeDuplicate((ImDrawList*)(NativePtr), pos); + } + public void PathRect(Vector2 rect_min, Vector2 rect_max) + { + float rounding = 0.0f; + ImDrawFlags flags = (ImDrawFlags)0; + ImGuiNative.ImDrawList_PathRect((ImDrawList*)(NativePtr), rect_min, rect_max, rounding, flags); + } + public void PathRect(Vector2 rect_min, Vector2 rect_max, float rounding) + { + ImDrawFlags flags = (ImDrawFlags)0; + ImGuiNative.ImDrawList_PathRect((ImDrawList*)(NativePtr), rect_min, rect_max, rounding, flags); + } + public void PathRect(Vector2 rect_min, Vector2 rect_max, float rounding, ImDrawFlags flags) + { + ImGuiNative.ImDrawList_PathRect((ImDrawList*)(NativePtr), rect_min, rect_max, rounding, flags); + } + public void PathStroke(uint col) + { + ImDrawFlags flags = (ImDrawFlags)0; + float thickness = 1.0f; + ImGuiNative.ImDrawList_PathStroke((ImDrawList*)(NativePtr), col, flags, thickness); + } + public void PathStroke(uint col, ImDrawFlags flags) + { + float thickness = 1.0f; + ImGuiNative.ImDrawList_PathStroke((ImDrawList*)(NativePtr), col, flags, thickness); + } + public void PathStroke(uint col, ImDrawFlags flags, float thickness) + { + ImGuiNative.ImDrawList_PathStroke((ImDrawList*)(NativePtr), col, flags, thickness); + } + public void PopClipRect() + { + ImGuiNative.ImDrawList_PopClipRect((ImDrawList*)(NativePtr)); + } + public void PopTextureID() + { + ImGuiNative.ImDrawList_PopTextureID((ImDrawList*)(NativePtr)); + } + 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((ImDrawList*)(NativePtr), a, b, c, d, uv_a, uv_b, uv_c, uv_d, col); + } + public void PrimRect(Vector2 a, Vector2 b, uint col) + { + ImGuiNative.ImDrawList_PrimRect((ImDrawList*)(NativePtr), a, b, col); + } + public void PrimRectUV(Vector2 a, Vector2 b, Vector2 uv_a, Vector2 uv_b, uint col) + { + ImGuiNative.ImDrawList_PrimRectUV((ImDrawList*)(NativePtr), a, b, uv_a, uv_b, col); + } + public void PrimReserve(int idx_count, int vtx_count) + { + ImGuiNative.ImDrawList_PrimReserve((ImDrawList*)(NativePtr), idx_count, vtx_count); + } + public void PrimUnreserve(int idx_count, int vtx_count) + { + ImGuiNative.ImDrawList_PrimUnreserve((ImDrawList*)(NativePtr), idx_count, vtx_count); + } + public void PrimVtx(Vector2 pos, Vector2 uv, uint col) + { + ImGuiNative.ImDrawList_PrimVtx((ImDrawList*)(NativePtr), pos, uv, col); + } + public void PrimWriteIdx(ushort idx) + { + ImGuiNative.ImDrawList_PrimWriteIdx((ImDrawList*)(NativePtr), idx); + } + public void PrimWriteVtx(Vector2 pos, Vector2 uv, uint col) + { + ImGuiNative.ImDrawList_PrimWriteVtx((ImDrawList*)(NativePtr), pos, uv, col); + } + public void PushClipRect(Vector2 clip_rect_min, Vector2 clip_rect_max) + { + byte intersect_with_current_clip_rect = 0; + ImGuiNative.ImDrawList_PushClipRect((ImDrawList*)(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((ImDrawList*)(NativePtr), clip_rect_min, clip_rect_max, native_intersect_with_current_clip_rect); + } + public void PushClipRectFullScreen() + { + ImGuiNative.ImDrawList_PushClipRectFullScreen((ImDrawList*)(NativePtr)); + } + public void PushTextureID(IntPtr texture_id) + { + ImGuiNative.ImDrawList_PushTextureID((ImDrawList*)(NativePtr), texture_id); + } + } +} diff --git a/lib/ImGui.NET/Generated/ImDrawListFlags.gen.cs b/lib/ImGui.NET/Generated/ImDrawListFlags.gen.cs new file mode 100644 index 0000000..e55321f --- /dev/null +++ b/lib/ImGui.NET/Generated/ImDrawListFlags.gen.cs @@ -0,0 +1,12 @@ +namespace ImGuiNET +{ + [System.Flags] + public enum ImDrawListFlags + { + None = 0, + AntiAliasedLines = 1, + AntiAliasedLinesUseTex = 2, + AntiAliasedFill = 4, + AllowVtxOffset = 8, + } +} diff --git a/lib/ImGui.NET/Generated/ImDrawListSplitter.gen.cs b/lib/ImGui.NET/Generated/ImDrawListSplitter.gen.cs new file mode 100644 index 0000000..9c180e7 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImDrawListSplitter.gen.cs @@ -0,0 +1,53 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ImGuiNET +{ + public unsafe partial struct ImDrawListSplitter + { + public int _Current; + public int _Count; + public ImVector _Channels; + } + public unsafe partial struct ImDrawListSplitterPtr + { + public ImDrawListSplitter* NativePtr { get; } + public ImDrawListSplitterPtr(ImDrawListSplitter* nativePtr) => NativePtr = nativePtr; + public ImDrawListSplitterPtr(IntPtr nativePtr) => NativePtr = (ImDrawListSplitter*)nativePtr; + public static implicit operator ImDrawListSplitterPtr(ImDrawListSplitter* nativePtr) => new ImDrawListSplitterPtr(nativePtr); + public static implicit operator ImDrawListSplitter* (ImDrawListSplitterPtr wrappedPtr) => wrappedPtr.NativePtr; + public static implicit operator ImDrawListSplitterPtr(IntPtr nativePtr) => new ImDrawListSplitterPtr(nativePtr); + public ref int _Current => ref Unsafe.AsRef(&NativePtr->_Current); + public ref int _Count => ref Unsafe.AsRef(&NativePtr->_Count); + public ImPtrVector _Channels => new ImPtrVector(NativePtr->_Channels, Unsafe.SizeOf()); + public void Clear() + { + ImGuiNative.ImDrawListSplitter_Clear((ImDrawListSplitter*)(NativePtr)); + } + public void ClearFreeMemory() + { + ImGuiNative.ImDrawListSplitter_ClearFreeMemory((ImDrawListSplitter*)(NativePtr)); + } + public void Destroy() + { + ImGuiNative.ImDrawListSplitter_destroy((ImDrawListSplitter*)(NativePtr)); + } + public void Merge(ImDrawListPtr draw_list) + { + ImDrawList* native_draw_list = draw_list.NativePtr; + ImGuiNative.ImDrawListSplitter_Merge((ImDrawListSplitter*)(NativePtr), native_draw_list); + } + public void SetCurrentChannel(ImDrawListPtr draw_list, int channel_idx) + { + ImDrawList* native_draw_list = draw_list.NativePtr; + ImGuiNative.ImDrawListSplitter_SetCurrentChannel((ImDrawListSplitter*)(NativePtr), native_draw_list, channel_idx); + } + public void Split(ImDrawListPtr draw_list, int count) + { + ImDrawList* native_draw_list = draw_list.NativePtr; + ImGuiNative.ImDrawListSplitter_Split((ImDrawListSplitter*)(NativePtr), native_draw_list, count); + } + } +} diff --git a/lib/ImGui.NET/Generated/ImDrawVert.gen.cs b/lib/ImGui.NET/Generated/ImDrawVert.gen.cs new file mode 100644 index 0000000..6382adf --- /dev/null +++ b/lib/ImGui.NET/Generated/ImDrawVert.gen.cs @@ -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(&NativePtr->pos); + public ref Vector2 uv => ref Unsafe.AsRef(&NativePtr->uv); + public ref uint col => ref Unsafe.AsRef(&NativePtr->col); + } +} diff --git a/lib/ImGui.NET/Generated/ImFont.gen.cs b/lib/ImGui.NET/Generated/ImFont.gen.cs new file mode 100644 index 0000000..07d0f69 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImFont.gen.cs @@ -0,0 +1,442 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ImGuiNET +{ + public unsafe partial struct ImFont + { + public ImVector IndexAdvanceX; + public float FallbackAdvanceX; + public float FontSize; + public ImVector IndexLookup; + public ImVector Glyphs; + public ImFontGlyph* FallbackGlyph; + public ImFontAtlas* ContainerAtlas; + public ImFontConfig* ConfigData; + public short ConfigDataCount; + public ushort FallbackChar; + public ushort EllipsisChar; + public short EllipsisCharCount; + public float EllipsisWidth; + public float EllipsisCharStep; + public byte DirtyLookupTables; + public float Scale; + public float Ascent; + public float Descent; + public int MetricsTotalSurface; + public fixed byte Used4kPagesMap[2]; + } + 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 ImVector IndexAdvanceX => new ImVector(NativePtr->IndexAdvanceX); + public ref float FallbackAdvanceX => ref Unsafe.AsRef(&NativePtr->FallbackAdvanceX); + public ref float FontSize => ref Unsafe.AsRef(&NativePtr->FontSize); + public ImVector IndexLookup => new ImVector(NativePtr->IndexLookup); + public ImPtrVector Glyphs => new ImPtrVector(NativePtr->Glyphs, Unsafe.SizeOf()); + public ImFontGlyphPtr FallbackGlyph => new ImFontGlyphPtr(NativePtr->FallbackGlyph); + public ImFontAtlasPtr ContainerAtlas => new ImFontAtlasPtr(NativePtr->ContainerAtlas); + public ImFontConfigPtr ConfigData => new ImFontConfigPtr(NativePtr->ConfigData); + public ref short ConfigDataCount => ref Unsafe.AsRef(&NativePtr->ConfigDataCount); + public ref ushort FallbackChar => ref Unsafe.AsRef(&NativePtr->FallbackChar); + public ref ushort EllipsisChar => ref Unsafe.AsRef(&NativePtr->EllipsisChar); + public ref short EllipsisCharCount => ref Unsafe.AsRef(&NativePtr->EllipsisCharCount); + public ref float EllipsisWidth => ref Unsafe.AsRef(&NativePtr->EllipsisWidth); + public ref float EllipsisCharStep => ref Unsafe.AsRef(&NativePtr->EllipsisCharStep); + public ref bool DirtyLookupTables => ref Unsafe.AsRef(&NativePtr->DirtyLookupTables); + public ref float Scale => ref Unsafe.AsRef(&NativePtr->Scale); + public ref float Ascent => ref Unsafe.AsRef(&NativePtr->Ascent); + public ref float Descent => ref Unsafe.AsRef(&NativePtr->Descent); + public ref int MetricsTotalSurface => ref Unsafe.AsRef(&NativePtr->MetricsTotalSurface); + public RangeAccessor Used4kPagesMap => new RangeAccessor(NativePtr->Used4kPagesMap, 2); + public void AddGlyph(ImFontConfigPtr src_cfg, ushort c, float x0, float y0, float x1, float y1, float u0, float v0, float u1, float v1, float advance_x) + { + ImFontConfig* native_src_cfg = src_cfg.NativePtr; + ImGuiNative.ImFont_AddGlyph((ImFont*)(NativePtr), native_src_cfg, c, x0, y0, x1, y1, u0, v0, u1, v1, advance_x); + } + public void AddRemapChar(ushort dst, ushort src) + { + byte overwrite_dst = 1; + ImGuiNative.ImFont_AddRemapChar((ImFont*)(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((ImFont*)(NativePtr), dst, src, native_overwrite_dst); + } + public void BuildLookupTable() + { + ImGuiNative.ImFont_BuildLookupTable((ImFont*)(NativePtr)); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public Vector2 CalcTextSizeA(float size, float max_width, float wrap_width, ReadOnlySpan text_begin) + { + Vector2 __retval; + byte* native_text_begin; + int text_begin_byteCount = 0; + text_begin_byteCount = Encoding.UTF8.GetByteCount(text_begin); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + native_text_begin = Util.Allocate(text_begin_byteCount + 1); + } + else + { + byte* native_text_begin_stackBytes = stackalloc byte[text_begin_byteCount + 1]; + native_text_begin = native_text_begin_stackBytes; + } + int native_text_begin_offset = Util.GetUtf8(text_begin, native_text_begin, text_begin_byteCount); + native_text_begin[native_text_begin_offset] = 0; + byte** remaining = null; + ImGuiNative.ImFont_CalcTextSizeA(&__retval, (ImFont*)(NativePtr), size, max_width, wrap_width, native_text_begin, native_text_begin+text_begin_byteCount, remaining); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text_begin); + } + return __retval; + } +#endif + public Vector2 CalcTextSizeA(float size, float max_width, float wrap_width, string text_begin) + { + Vector2 __retval; + byte* native_text_begin; + int text_begin_byteCount = 0; + text_begin_byteCount = Encoding.UTF8.GetByteCount(text_begin); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + native_text_begin = Util.Allocate(text_begin_byteCount + 1); + } + else + { + byte* native_text_begin_stackBytes = stackalloc byte[text_begin_byteCount + 1]; + native_text_begin = native_text_begin_stackBytes; + } + int native_text_begin_offset = Util.GetUtf8(text_begin, native_text_begin, text_begin_byteCount); + native_text_begin[native_text_begin_offset] = 0; + byte** remaining = null; + ImGuiNative.ImFont_CalcTextSizeA(&__retval, (ImFont*)(NativePtr), size, max_width, wrap_width, native_text_begin, native_text_begin+text_begin_byteCount, remaining); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text_begin); + } + return __retval; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public Vector2 CalcTextSizeA(float size, float max_width, float wrap_width, ReadOnlySpan text_begin, ref byte* remaining) + { + Vector2 __retval; + byte* native_text_begin; + int text_begin_byteCount = 0; + text_begin_byteCount = Encoding.UTF8.GetByteCount(text_begin); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + native_text_begin = Util.Allocate(text_begin_byteCount + 1); + } + else + { + byte* native_text_begin_stackBytes = stackalloc byte[text_begin_byteCount + 1]; + native_text_begin = native_text_begin_stackBytes; + } + int native_text_begin_offset = Util.GetUtf8(text_begin, native_text_begin, text_begin_byteCount); + native_text_begin[native_text_begin_offset] = 0; + fixed (byte** native_remaining = &remaining) + { + ImGuiNative.ImFont_CalcTextSizeA(&__retval, (ImFont*)(NativePtr), size, max_width, wrap_width, native_text_begin, native_text_begin+text_begin_byteCount, native_remaining); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text_begin); + } + return __retval; + } + } +#endif + public Vector2 CalcTextSizeA(float size, float max_width, float wrap_width, string text_begin, ref byte* remaining) + { + Vector2 __retval; + byte* native_text_begin; + int text_begin_byteCount = 0; + text_begin_byteCount = Encoding.UTF8.GetByteCount(text_begin); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + native_text_begin = Util.Allocate(text_begin_byteCount + 1); + } + else + { + byte* native_text_begin_stackBytes = stackalloc byte[text_begin_byteCount + 1]; + native_text_begin = native_text_begin_stackBytes; + } + int native_text_begin_offset = Util.GetUtf8(text_begin, native_text_begin, text_begin_byteCount); + native_text_begin[native_text_begin_offset] = 0; + fixed (byte** native_remaining = &remaining) + { + ImGuiNative.ImFont_CalcTextSizeA(&__retval, (ImFont*)(NativePtr), size, max_width, wrap_width, native_text_begin, native_text_begin+text_begin_byteCount, native_remaining); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text_begin); + } + return __retval; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public string CalcWordWrapPositionA(float scale, ReadOnlySpan text, float wrap_width) + { + byte* native_text; + int text_byteCount = 0; + if (text != null) + { + text_byteCount = Encoding.UTF8.GetByteCount(text); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + native_text = Util.Allocate(text_byteCount + 1); + } + else + { + byte* native_text_stackBytes = stackalloc byte[text_byteCount + 1]; + native_text = native_text_stackBytes; + } + int native_text_offset = Util.GetUtf8(text, native_text, text_byteCount); + native_text[native_text_offset] = 0; + } + else { native_text = null; } + byte* ret = ImGuiNative.ImFont_CalcWordWrapPositionA((ImFont*)(NativePtr), scale, native_text, native_text+text_byteCount, wrap_width); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text); + } + return Util.StringFromPtr(ret); + } +#endif + public string CalcWordWrapPositionA(float scale, string text, float wrap_width) + { + byte* native_text; + int text_byteCount = 0; + if (text != null) + { + text_byteCount = Encoding.UTF8.GetByteCount(text); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + native_text = Util.Allocate(text_byteCount + 1); + } + else + { + byte* native_text_stackBytes = stackalloc byte[text_byteCount + 1]; + native_text = native_text_stackBytes; + } + int native_text_offset = Util.GetUtf8(text, native_text, text_byteCount); + native_text[native_text_offset] = 0; + } + else { native_text = null; } + byte* ret = ImGuiNative.ImFont_CalcWordWrapPositionA((ImFont*)(NativePtr), scale, native_text, native_text+text_byteCount, wrap_width); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text); + } + return Util.StringFromPtr(ret); + } + public void ClearOutputData() + { + ImGuiNative.ImFont_ClearOutputData((ImFont*)(NativePtr)); + } + public void Destroy() + { + ImGuiNative.ImFont_destroy((ImFont*)(NativePtr)); + } + public ImFontGlyphPtr FindGlyph(ushort c) + { + ImFontGlyph* ret = ImGuiNative.ImFont_FindGlyph((ImFont*)(NativePtr), c); + return new ImFontGlyphPtr(ret); + } + public ImFontGlyphPtr FindGlyphNoFallback(ushort c) + { + ImFontGlyph* ret = ImGuiNative.ImFont_FindGlyphNoFallback((ImFont*)(NativePtr), c); + return new ImFontGlyphPtr(ret); + } + public float GetCharAdvance(ushort c) + { + float ret = ImGuiNative.ImFont_GetCharAdvance((ImFont*)(NativePtr), c); + return ret; + } + public string GetDebugName() + { + byte* ret = ImGuiNative.ImFont_GetDebugName((ImFont*)(NativePtr)); + return Util.StringFromPtr(ret); + } + public void GrowIndex(int new_size) + { + ImGuiNative.ImFont_GrowIndex((ImFont*)(NativePtr), new_size); + } + public bool IsLoaded() + { + byte ret = ImGuiNative.ImFont_IsLoaded((ImFont*)(NativePtr)); + return ret != 0; + } + public void RenderChar(ImDrawListPtr draw_list, float size, Vector2 pos, uint col, ushort c) + { + ImDrawList* native_draw_list = draw_list.NativePtr; + ImGuiNative.ImFont_RenderChar((ImFont*)(NativePtr), native_draw_list, size, pos, col, c); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public void RenderText(ImDrawListPtr draw_list, float size, Vector2 pos, uint col, Vector4 clip_rect, ReadOnlySpan text_begin) + { + ImDrawList* native_draw_list = draw_list.NativePtr; + byte* native_text_begin; + int text_begin_byteCount = 0; + text_begin_byteCount = Encoding.UTF8.GetByteCount(text_begin); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + native_text_begin = Util.Allocate(text_begin_byteCount + 1); + } + else + { + byte* native_text_begin_stackBytes = stackalloc byte[text_begin_byteCount + 1]; + native_text_begin = native_text_begin_stackBytes; + } + int native_text_begin_offset = Util.GetUtf8(text_begin, native_text_begin, text_begin_byteCount); + native_text_begin[native_text_begin_offset] = 0; + float wrap_width = 0.0f; + byte cpu_fine_clip = 0; + ImGuiNative.ImFont_RenderText((ImFont*)(NativePtr), native_draw_list, size, pos, col, clip_rect, native_text_begin, native_text_begin+text_begin_byteCount, wrap_width, cpu_fine_clip); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text_begin); + } + } +#endif + public void RenderText(ImDrawListPtr draw_list, float size, Vector2 pos, uint col, Vector4 clip_rect, string text_begin) + { + ImDrawList* native_draw_list = draw_list.NativePtr; + byte* native_text_begin; + int text_begin_byteCount = 0; + text_begin_byteCount = Encoding.UTF8.GetByteCount(text_begin); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + native_text_begin = Util.Allocate(text_begin_byteCount + 1); + } + else + { + byte* native_text_begin_stackBytes = stackalloc byte[text_begin_byteCount + 1]; + native_text_begin = native_text_begin_stackBytes; + } + int native_text_begin_offset = Util.GetUtf8(text_begin, native_text_begin, text_begin_byteCount); + native_text_begin[native_text_begin_offset] = 0; + float wrap_width = 0.0f; + byte cpu_fine_clip = 0; + ImGuiNative.ImFont_RenderText((ImFont*)(NativePtr), native_draw_list, size, pos, col, clip_rect, native_text_begin, native_text_begin+text_begin_byteCount, wrap_width, cpu_fine_clip); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text_begin); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public void RenderText(ImDrawListPtr draw_list, float size, Vector2 pos, uint col, Vector4 clip_rect, ReadOnlySpan text_begin, float wrap_width) + { + ImDrawList* native_draw_list = draw_list.NativePtr; + byte* native_text_begin; + int text_begin_byteCount = 0; + text_begin_byteCount = Encoding.UTF8.GetByteCount(text_begin); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + native_text_begin = Util.Allocate(text_begin_byteCount + 1); + } + else + { + byte* native_text_begin_stackBytes = stackalloc byte[text_begin_byteCount + 1]; + native_text_begin = native_text_begin_stackBytes; + } + int native_text_begin_offset = Util.GetUtf8(text_begin, native_text_begin, text_begin_byteCount); + native_text_begin[native_text_begin_offset] = 0; + byte cpu_fine_clip = 0; + ImGuiNative.ImFont_RenderText((ImFont*)(NativePtr), native_draw_list, size, pos, col, clip_rect, native_text_begin, native_text_begin+text_begin_byteCount, wrap_width, cpu_fine_clip); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text_begin); + } + } +#endif + public void RenderText(ImDrawListPtr draw_list, float size, Vector2 pos, uint col, Vector4 clip_rect, string text_begin, float wrap_width) + { + ImDrawList* native_draw_list = draw_list.NativePtr; + byte* native_text_begin; + int text_begin_byteCount = 0; + text_begin_byteCount = Encoding.UTF8.GetByteCount(text_begin); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + native_text_begin = Util.Allocate(text_begin_byteCount + 1); + } + else + { + byte* native_text_begin_stackBytes = stackalloc byte[text_begin_byteCount + 1]; + native_text_begin = native_text_begin_stackBytes; + } + int native_text_begin_offset = Util.GetUtf8(text_begin, native_text_begin, text_begin_byteCount); + native_text_begin[native_text_begin_offset] = 0; + byte cpu_fine_clip = 0; + ImGuiNative.ImFont_RenderText((ImFont*)(NativePtr), native_draw_list, size, pos, col, clip_rect, native_text_begin, native_text_begin+text_begin_byteCount, wrap_width, cpu_fine_clip); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text_begin); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public void RenderText(ImDrawListPtr draw_list, float size, Vector2 pos, uint col, Vector4 clip_rect, ReadOnlySpan text_begin, float wrap_width, bool cpu_fine_clip) + { + ImDrawList* native_draw_list = draw_list.NativePtr; + byte* native_text_begin; + int text_begin_byteCount = 0; + text_begin_byteCount = Encoding.UTF8.GetByteCount(text_begin); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + native_text_begin = Util.Allocate(text_begin_byteCount + 1); + } + else + { + byte* native_text_begin_stackBytes = stackalloc byte[text_begin_byteCount + 1]; + native_text_begin = native_text_begin_stackBytes; + } + int native_text_begin_offset = Util.GetUtf8(text_begin, native_text_begin, text_begin_byteCount); + native_text_begin[native_text_begin_offset] = 0; + byte native_cpu_fine_clip = cpu_fine_clip ? (byte)1 : (byte)0; + ImGuiNative.ImFont_RenderText((ImFont*)(NativePtr), native_draw_list, size, pos, col, clip_rect, native_text_begin, native_text_begin+text_begin_byteCount, wrap_width, native_cpu_fine_clip); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text_begin); + } + } +#endif + public void RenderText(ImDrawListPtr draw_list, float size, Vector2 pos, uint col, Vector4 clip_rect, string text_begin, float wrap_width, bool cpu_fine_clip) + { + ImDrawList* native_draw_list = draw_list.NativePtr; + byte* native_text_begin; + int text_begin_byteCount = 0; + text_begin_byteCount = Encoding.UTF8.GetByteCount(text_begin); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + native_text_begin = Util.Allocate(text_begin_byteCount + 1); + } + else + { + byte* native_text_begin_stackBytes = stackalloc byte[text_begin_byteCount + 1]; + native_text_begin = native_text_begin_stackBytes; + } + int native_text_begin_offset = Util.GetUtf8(text_begin, native_text_begin, text_begin_byteCount); + native_text_begin[native_text_begin_offset] = 0; + byte native_cpu_fine_clip = cpu_fine_clip ? (byte)1 : (byte)0; + ImGuiNative.ImFont_RenderText((ImFont*)(NativePtr), native_draw_list, size, pos, col, clip_rect, native_text_begin, native_text_begin+text_begin_byteCount, wrap_width, native_cpu_fine_clip); + if (text_begin_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text_begin); + } + } + public void SetGlyphVisible(ushort c, bool visible) + { + byte native_visible = visible ? (byte)1 : (byte)0; + ImGuiNative.ImFont_SetGlyphVisible((ImFont*)(NativePtr), c, native_visible); + } + } +} diff --git a/lib/ImGui.NET/Generated/ImFontAtlas.gen.cs b/lib/ImGui.NET/Generated/ImFontAtlas.gen.cs new file mode 100644 index 0000000..b498622 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImFontAtlas.gen.cs @@ -0,0 +1,803 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ImGuiNET +{ + public unsafe partial struct ImFontAtlas + { + public ImFontAtlasFlags Flags; + public IntPtr TexID; + public int TexDesiredWidth; + public int TexGlyphPadding; + public byte Locked; + public void* UserData; + public byte TexReady; + public byte TexPixelsUseColors; + public byte* TexPixelsAlpha8; + public uint* TexPixelsRGBA32; + public int TexWidth; + public int TexHeight; + public Vector2 TexUvScale; + public Vector2 TexUvWhitePixel; + public ImVector Fonts; + public ImVector CustomRects; + public ImVector ConfigData; + public Vector4 TexUvLines_0; + public Vector4 TexUvLines_1; + public Vector4 TexUvLines_2; + public Vector4 TexUvLines_3; + public Vector4 TexUvLines_4; + public Vector4 TexUvLines_5; + public Vector4 TexUvLines_6; + public Vector4 TexUvLines_7; + public Vector4 TexUvLines_8; + public Vector4 TexUvLines_9; + public Vector4 TexUvLines_10; + public Vector4 TexUvLines_11; + public Vector4 TexUvLines_12; + public Vector4 TexUvLines_13; + public Vector4 TexUvLines_14; + public Vector4 TexUvLines_15; + public Vector4 TexUvLines_16; + public Vector4 TexUvLines_17; + public Vector4 TexUvLines_18; + public Vector4 TexUvLines_19; + public Vector4 TexUvLines_20; + public Vector4 TexUvLines_21; + public Vector4 TexUvLines_22; + public Vector4 TexUvLines_23; + public Vector4 TexUvLines_24; + public Vector4 TexUvLines_25; + public Vector4 TexUvLines_26; + public Vector4 TexUvLines_27; + public Vector4 TexUvLines_28; + public Vector4 TexUvLines_29; + public Vector4 TexUvLines_30; + public Vector4 TexUvLines_31; + public Vector4 TexUvLines_32; + public Vector4 TexUvLines_33; + public Vector4 TexUvLines_34; + public Vector4 TexUvLines_35; + public Vector4 TexUvLines_36; + public Vector4 TexUvLines_37; + public Vector4 TexUvLines_38; + public Vector4 TexUvLines_39; + public Vector4 TexUvLines_40; + public Vector4 TexUvLines_41; + public Vector4 TexUvLines_42; + public Vector4 TexUvLines_43; + public Vector4 TexUvLines_44; + public Vector4 TexUvLines_45; + public Vector4 TexUvLines_46; + public Vector4 TexUvLines_47; + public Vector4 TexUvLines_48; + public Vector4 TexUvLines_49; + public Vector4 TexUvLines_50; + public Vector4 TexUvLines_51; + public Vector4 TexUvLines_52; + public Vector4 TexUvLines_53; + public Vector4 TexUvLines_54; + public Vector4 TexUvLines_55; + public Vector4 TexUvLines_56; + public Vector4 TexUvLines_57; + public Vector4 TexUvLines_58; + public Vector4 TexUvLines_59; + public Vector4 TexUvLines_60; + public Vector4 TexUvLines_61; + public Vector4 TexUvLines_62; + public Vector4 TexUvLines_63; + public IntPtr* FontBuilderIO; + public uint FontBuilderFlags; + public int PackIdMouseCursors; + public int PackIdLines; + } + 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 ImFontAtlasFlags Flags => ref Unsafe.AsRef(&NativePtr->Flags); + public ref IntPtr TexID => ref Unsafe.AsRef(&NativePtr->TexID); + public ref int TexDesiredWidth => ref Unsafe.AsRef(&NativePtr->TexDesiredWidth); + public ref int TexGlyphPadding => ref Unsafe.AsRef(&NativePtr->TexGlyphPadding); + public ref bool Locked => ref Unsafe.AsRef(&NativePtr->Locked); + public IntPtr UserData { get => (IntPtr)NativePtr->UserData; set => NativePtr->UserData = (void*)value; } + public ref bool TexReady => ref Unsafe.AsRef(&NativePtr->TexReady); + public ref bool TexPixelsUseColors => ref Unsafe.AsRef(&NativePtr->TexPixelsUseColors); + 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(&NativePtr->TexWidth); + public ref int TexHeight => ref Unsafe.AsRef(&NativePtr->TexHeight); + public ref Vector2 TexUvScale => ref Unsafe.AsRef(&NativePtr->TexUvScale); + public ref Vector2 TexUvWhitePixel => ref Unsafe.AsRef(&NativePtr->TexUvWhitePixel); + public ImVector Fonts => new ImVector(NativePtr->Fonts); + public ImPtrVector CustomRects => new ImPtrVector(NativePtr->CustomRects, Unsafe.SizeOf()); + public ImPtrVector ConfigData => new ImPtrVector(NativePtr->ConfigData, Unsafe.SizeOf()); + public RangeAccessor TexUvLines => new RangeAccessor(&NativePtr->TexUvLines_0, 64); + public IntPtr FontBuilderIO { get => (IntPtr)NativePtr->FontBuilderIO; set => NativePtr->FontBuilderIO = (IntPtr*)value; } + public ref uint FontBuilderFlags => ref Unsafe.AsRef(&NativePtr->FontBuilderFlags); + public ref int PackIdMouseCursors => ref Unsafe.AsRef(&NativePtr->PackIdMouseCursors); + public ref int PackIdLines => ref Unsafe.AsRef(&NativePtr->PackIdLines); + 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((ImFontAtlas*)(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((ImFontAtlas*)(NativePtr), native_font, id, width, height, advance_x, offset); + return ret; + } + public int AddCustomRectRegular(int width, int height) + { + int ret = ImGuiNative.ImFontAtlas_AddCustomRectRegular((ImFontAtlas*)(NativePtr), width, height); + return ret; + } + public ImFontPtr AddFont(ImFontConfigPtr font_cfg) + { + ImFontConfig* native_font_cfg = font_cfg.NativePtr; + ImFont* ret = ImGuiNative.ImFontAtlas_AddFont((ImFontAtlas*)(NativePtr), native_font_cfg); + return new ImFontPtr(ret); + } + public ImFontPtr AddFontDefault() + { + ImFontConfig* font_cfg = null; + ImFont* ret = ImGuiNative.ImFontAtlas_AddFontDefault((ImFontAtlas*)(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((ImFontAtlas*)(NativePtr), native_font_cfg); + return new ImFontPtr(ret); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public ImFontPtr AddFontFromFileTTF(ReadOnlySpan filename, float size_pixels) + { + byte* native_filename; + int filename_byteCount = 0; + if (filename != null) + { + filename_byteCount = Encoding.UTF8.GetByteCount(filename); + if (filename_byteCount > Util.StackAllocationSizeLimit) + { + native_filename = Util.Allocate(filename_byteCount + 1); + } + else + { + byte* native_filename_stackBytes = stackalloc byte[filename_byteCount + 1]; + native_filename = native_filename_stackBytes; + } + int native_filename_offset = Util.GetUtf8(filename, native_filename, filename_byteCount); + native_filename[native_filename_offset] = 0; + } + else { native_filename = null; } + ImFontConfig* font_cfg = null; + ushort* glyph_ranges = null; + ImFont* ret = ImGuiNative.ImFontAtlas_AddFontFromFileTTF((ImFontAtlas*)(NativePtr), native_filename, size_pixels, font_cfg, glyph_ranges); + if (filename_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_filename); + } + return new ImFontPtr(ret); + } +#endif + public ImFontPtr AddFontFromFileTTF(string filename, float size_pixels) + { + byte* native_filename; + int filename_byteCount = 0; + if (filename != null) + { + filename_byteCount = Encoding.UTF8.GetByteCount(filename); + if (filename_byteCount > Util.StackAllocationSizeLimit) + { + native_filename = Util.Allocate(filename_byteCount + 1); + } + else + { + byte* native_filename_stackBytes = stackalloc byte[filename_byteCount + 1]; + native_filename = native_filename_stackBytes; + } + int native_filename_offset = Util.GetUtf8(filename, native_filename, filename_byteCount); + native_filename[native_filename_offset] = 0; + } + else { native_filename = null; } + ImFontConfig* font_cfg = null; + ushort* glyph_ranges = null; + ImFont* ret = ImGuiNative.ImFontAtlas_AddFontFromFileTTF((ImFontAtlas*)(NativePtr), native_filename, size_pixels, font_cfg, glyph_ranges); + if (filename_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_filename); + } + return new ImFontPtr(ret); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public ImFontPtr AddFontFromFileTTF(ReadOnlySpan filename, float size_pixels, ImFontConfigPtr font_cfg) + { + byte* native_filename; + int filename_byteCount = 0; + if (filename != null) + { + filename_byteCount = Encoding.UTF8.GetByteCount(filename); + if (filename_byteCount > Util.StackAllocationSizeLimit) + { + native_filename = Util.Allocate(filename_byteCount + 1); + } + else + { + byte* native_filename_stackBytes = stackalloc byte[filename_byteCount + 1]; + native_filename = native_filename_stackBytes; + } + int native_filename_offset = Util.GetUtf8(filename, native_filename, filename_byteCount); + native_filename[native_filename_offset] = 0; + } + else { native_filename = null; } + ImFontConfig* native_font_cfg = font_cfg.NativePtr; + ushort* glyph_ranges = null; + ImFont* ret = ImGuiNative.ImFontAtlas_AddFontFromFileTTF((ImFontAtlas*)(NativePtr), native_filename, size_pixels, native_font_cfg, glyph_ranges); + if (filename_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_filename); + } + return new ImFontPtr(ret); + } +#endif + public ImFontPtr AddFontFromFileTTF(string filename, float size_pixels, ImFontConfigPtr font_cfg) + { + byte* native_filename; + int filename_byteCount = 0; + if (filename != null) + { + filename_byteCount = Encoding.UTF8.GetByteCount(filename); + if (filename_byteCount > Util.StackAllocationSizeLimit) + { + native_filename = Util.Allocate(filename_byteCount + 1); + } + else + { + byte* native_filename_stackBytes = stackalloc byte[filename_byteCount + 1]; + native_filename = native_filename_stackBytes; + } + int native_filename_offset = Util.GetUtf8(filename, native_filename, filename_byteCount); + native_filename[native_filename_offset] = 0; + } + else { native_filename = null; } + ImFontConfig* native_font_cfg = font_cfg.NativePtr; + ushort* glyph_ranges = null; + ImFont* ret = ImGuiNative.ImFontAtlas_AddFontFromFileTTF((ImFontAtlas*)(NativePtr), native_filename, size_pixels, native_font_cfg, glyph_ranges); + if (filename_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_filename); + } + return new ImFontPtr(ret); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public ImFontPtr AddFontFromFileTTF(ReadOnlySpan filename, float size_pixels, ImFontConfigPtr font_cfg, IntPtr glyph_ranges) + { + byte* native_filename; + int filename_byteCount = 0; + if (filename != null) + { + filename_byteCount = Encoding.UTF8.GetByteCount(filename); + if (filename_byteCount > Util.StackAllocationSizeLimit) + { + native_filename = Util.Allocate(filename_byteCount + 1); + } + else + { + byte* native_filename_stackBytes = stackalloc byte[filename_byteCount + 1]; + native_filename = native_filename_stackBytes; + } + int native_filename_offset = Util.GetUtf8(filename, native_filename, filename_byteCount); + native_filename[native_filename_offset] = 0; + } + else { native_filename = null; } + ImFontConfig* native_font_cfg = font_cfg.NativePtr; + ushort* native_glyph_ranges = (ushort*)glyph_ranges.ToPointer(); + ImFont* ret = ImGuiNative.ImFontAtlas_AddFontFromFileTTF((ImFontAtlas*)(NativePtr), native_filename, size_pixels, native_font_cfg, native_glyph_ranges); + if (filename_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_filename); + } + return new ImFontPtr(ret); + } +#endif + public ImFontPtr AddFontFromFileTTF(string filename, float size_pixels, ImFontConfigPtr font_cfg, IntPtr glyph_ranges) + { + byte* native_filename; + int filename_byteCount = 0; + if (filename != null) + { + filename_byteCount = Encoding.UTF8.GetByteCount(filename); + if (filename_byteCount > Util.StackAllocationSizeLimit) + { + native_filename = Util.Allocate(filename_byteCount + 1); + } + else + { + byte* native_filename_stackBytes = stackalloc byte[filename_byteCount + 1]; + native_filename = native_filename_stackBytes; + } + int native_filename_offset = Util.GetUtf8(filename, native_filename, filename_byteCount); + native_filename[native_filename_offset] = 0; + } + else { native_filename = null; } + ImFontConfig* native_font_cfg = font_cfg.NativePtr; + ushort* native_glyph_ranges = (ushort*)glyph_ranges.ToPointer(); + ImFont* ret = ImGuiNative.ImFontAtlas_AddFontFromFileTTF((ImFontAtlas*)(NativePtr), native_filename, size_pixels, native_font_cfg, native_glyph_ranges); + if (filename_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_filename); + } + return new ImFontPtr(ret); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public ImFontPtr AddFontFromMemoryCompressedBase85TTF(ReadOnlySpan compressed_font_data_base85, float size_pixels) + { + byte* native_compressed_font_data_base85; + int compressed_font_data_base85_byteCount = 0; + if (compressed_font_data_base85 != null) + { + compressed_font_data_base85_byteCount = Encoding.UTF8.GetByteCount(compressed_font_data_base85); + if (compressed_font_data_base85_byteCount > Util.StackAllocationSizeLimit) + { + native_compressed_font_data_base85 = Util.Allocate(compressed_font_data_base85_byteCount + 1); + } + else + { + byte* native_compressed_font_data_base85_stackBytes = stackalloc byte[compressed_font_data_base85_byteCount + 1]; + native_compressed_font_data_base85 = native_compressed_font_data_base85_stackBytes; + } + int native_compressed_font_data_base85_offset = Util.GetUtf8(compressed_font_data_base85, native_compressed_font_data_base85, compressed_font_data_base85_byteCount); + native_compressed_font_data_base85[native_compressed_font_data_base85_offset] = 0; + } + else { native_compressed_font_data_base85 = null; } + ImFontConfig* font_cfg = null; + ushort* glyph_ranges = null; + ImFont* ret = ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedBase85TTF((ImFontAtlas*)(NativePtr), native_compressed_font_data_base85, size_pixels, font_cfg, glyph_ranges); + if (compressed_font_data_base85_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_compressed_font_data_base85); + } + return new ImFontPtr(ret); + } +#endif + public ImFontPtr AddFontFromMemoryCompressedBase85TTF(string compressed_font_data_base85, float size_pixels) + { + byte* native_compressed_font_data_base85; + int compressed_font_data_base85_byteCount = 0; + if (compressed_font_data_base85 != null) + { + compressed_font_data_base85_byteCount = Encoding.UTF8.GetByteCount(compressed_font_data_base85); + if (compressed_font_data_base85_byteCount > Util.StackAllocationSizeLimit) + { + native_compressed_font_data_base85 = Util.Allocate(compressed_font_data_base85_byteCount + 1); + } + else + { + byte* native_compressed_font_data_base85_stackBytes = stackalloc byte[compressed_font_data_base85_byteCount + 1]; + native_compressed_font_data_base85 = native_compressed_font_data_base85_stackBytes; + } + int native_compressed_font_data_base85_offset = Util.GetUtf8(compressed_font_data_base85, native_compressed_font_data_base85, compressed_font_data_base85_byteCount); + native_compressed_font_data_base85[native_compressed_font_data_base85_offset] = 0; + } + else { native_compressed_font_data_base85 = null; } + ImFontConfig* font_cfg = null; + ushort* glyph_ranges = null; + ImFont* ret = ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedBase85TTF((ImFontAtlas*)(NativePtr), native_compressed_font_data_base85, size_pixels, font_cfg, glyph_ranges); + if (compressed_font_data_base85_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_compressed_font_data_base85); + } + return new ImFontPtr(ret); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public ImFontPtr AddFontFromMemoryCompressedBase85TTF(ReadOnlySpan compressed_font_data_base85, float size_pixels, ImFontConfigPtr font_cfg) + { + byte* native_compressed_font_data_base85; + int compressed_font_data_base85_byteCount = 0; + if (compressed_font_data_base85 != null) + { + compressed_font_data_base85_byteCount = Encoding.UTF8.GetByteCount(compressed_font_data_base85); + if (compressed_font_data_base85_byteCount > Util.StackAllocationSizeLimit) + { + native_compressed_font_data_base85 = Util.Allocate(compressed_font_data_base85_byteCount + 1); + } + else + { + byte* native_compressed_font_data_base85_stackBytes = stackalloc byte[compressed_font_data_base85_byteCount + 1]; + native_compressed_font_data_base85 = native_compressed_font_data_base85_stackBytes; + } + int native_compressed_font_data_base85_offset = Util.GetUtf8(compressed_font_data_base85, native_compressed_font_data_base85, compressed_font_data_base85_byteCount); + native_compressed_font_data_base85[native_compressed_font_data_base85_offset] = 0; + } + else { native_compressed_font_data_base85 = null; } + ImFontConfig* native_font_cfg = font_cfg.NativePtr; + ushort* glyph_ranges = null; + ImFont* ret = ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedBase85TTF((ImFontAtlas*)(NativePtr), native_compressed_font_data_base85, size_pixels, native_font_cfg, glyph_ranges); + if (compressed_font_data_base85_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_compressed_font_data_base85); + } + return new ImFontPtr(ret); + } +#endif + public ImFontPtr AddFontFromMemoryCompressedBase85TTF(string compressed_font_data_base85, float size_pixels, ImFontConfigPtr font_cfg) + { + byte* native_compressed_font_data_base85; + int compressed_font_data_base85_byteCount = 0; + if (compressed_font_data_base85 != null) + { + compressed_font_data_base85_byteCount = Encoding.UTF8.GetByteCount(compressed_font_data_base85); + if (compressed_font_data_base85_byteCount > Util.StackAllocationSizeLimit) + { + native_compressed_font_data_base85 = Util.Allocate(compressed_font_data_base85_byteCount + 1); + } + else + { + byte* native_compressed_font_data_base85_stackBytes = stackalloc byte[compressed_font_data_base85_byteCount + 1]; + native_compressed_font_data_base85 = native_compressed_font_data_base85_stackBytes; + } + int native_compressed_font_data_base85_offset = Util.GetUtf8(compressed_font_data_base85, native_compressed_font_data_base85, compressed_font_data_base85_byteCount); + native_compressed_font_data_base85[native_compressed_font_data_base85_offset] = 0; + } + else { native_compressed_font_data_base85 = null; } + ImFontConfig* native_font_cfg = font_cfg.NativePtr; + ushort* glyph_ranges = null; + ImFont* ret = ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedBase85TTF((ImFontAtlas*)(NativePtr), native_compressed_font_data_base85, size_pixels, native_font_cfg, glyph_ranges); + if (compressed_font_data_base85_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_compressed_font_data_base85); + } + return new ImFontPtr(ret); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public ImFontPtr AddFontFromMemoryCompressedBase85TTF(ReadOnlySpan compressed_font_data_base85, float size_pixels, ImFontConfigPtr font_cfg, IntPtr glyph_ranges) + { + byte* native_compressed_font_data_base85; + int compressed_font_data_base85_byteCount = 0; + if (compressed_font_data_base85 != null) + { + compressed_font_data_base85_byteCount = Encoding.UTF8.GetByteCount(compressed_font_data_base85); + if (compressed_font_data_base85_byteCount > Util.StackAllocationSizeLimit) + { + native_compressed_font_data_base85 = Util.Allocate(compressed_font_data_base85_byteCount + 1); + } + else + { + byte* native_compressed_font_data_base85_stackBytes = stackalloc byte[compressed_font_data_base85_byteCount + 1]; + native_compressed_font_data_base85 = native_compressed_font_data_base85_stackBytes; + } + int native_compressed_font_data_base85_offset = Util.GetUtf8(compressed_font_data_base85, native_compressed_font_data_base85, compressed_font_data_base85_byteCount); + native_compressed_font_data_base85[native_compressed_font_data_base85_offset] = 0; + } + else { native_compressed_font_data_base85 = null; } + ImFontConfig* native_font_cfg = font_cfg.NativePtr; + ushort* native_glyph_ranges = (ushort*)glyph_ranges.ToPointer(); + ImFont* ret = ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedBase85TTF((ImFontAtlas*)(NativePtr), native_compressed_font_data_base85, size_pixels, native_font_cfg, native_glyph_ranges); + if (compressed_font_data_base85_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_compressed_font_data_base85); + } + return new ImFontPtr(ret); + } +#endif + public ImFontPtr AddFontFromMemoryCompressedBase85TTF(string compressed_font_data_base85, float size_pixels, ImFontConfigPtr font_cfg, IntPtr glyph_ranges) + { + byte* native_compressed_font_data_base85; + int compressed_font_data_base85_byteCount = 0; + if (compressed_font_data_base85 != null) + { + compressed_font_data_base85_byteCount = Encoding.UTF8.GetByteCount(compressed_font_data_base85); + if (compressed_font_data_base85_byteCount > Util.StackAllocationSizeLimit) + { + native_compressed_font_data_base85 = Util.Allocate(compressed_font_data_base85_byteCount + 1); + } + else + { + byte* native_compressed_font_data_base85_stackBytes = stackalloc byte[compressed_font_data_base85_byteCount + 1]; + native_compressed_font_data_base85 = native_compressed_font_data_base85_stackBytes; + } + int native_compressed_font_data_base85_offset = Util.GetUtf8(compressed_font_data_base85, native_compressed_font_data_base85, compressed_font_data_base85_byteCount); + native_compressed_font_data_base85[native_compressed_font_data_base85_offset] = 0; + } + else { native_compressed_font_data_base85 = null; } + ImFontConfig* native_font_cfg = font_cfg.NativePtr; + ushort* native_glyph_ranges = (ushort*)glyph_ranges.ToPointer(); + ImFont* ret = ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedBase85TTF((ImFontAtlas*)(NativePtr), native_compressed_font_data_base85, size_pixels, native_font_cfg, native_glyph_ranges); + if (compressed_font_data_base85_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_compressed_font_data_base85); + } + return new ImFontPtr(ret); + } + public ImFontPtr AddFontFromMemoryCompressedTTF(IntPtr compressed_font_data, int compressed_font_data_size, float size_pixels) + { + void* native_compressed_font_data = (void*)compressed_font_data.ToPointer(); + ImFontConfig* font_cfg = null; + ushort* glyph_ranges = null; + ImFont* ret = ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedTTF((ImFontAtlas*)(NativePtr), native_compressed_font_data, compressed_font_data_size, size_pixels, font_cfg, glyph_ranges); + return new ImFontPtr(ret); + } + public ImFontPtr AddFontFromMemoryCompressedTTF(IntPtr compressed_font_data, int compressed_font_data_size, float size_pixels, ImFontConfigPtr font_cfg) + { + void* native_compressed_font_data = (void*)compressed_font_data.ToPointer(); + ImFontConfig* native_font_cfg = font_cfg.NativePtr; + ushort* glyph_ranges = null; + ImFont* ret = ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedTTF((ImFontAtlas*)(NativePtr), native_compressed_font_data, compressed_font_data_size, size_pixels, native_font_cfg, glyph_ranges); + return new ImFontPtr(ret); + } + public ImFontPtr AddFontFromMemoryCompressedTTF(IntPtr compressed_font_data, int compressed_font_data_size, float size_pixels, ImFontConfigPtr font_cfg, IntPtr glyph_ranges) + { + void* native_compressed_font_data = (void*)compressed_font_data.ToPointer(); + ImFontConfig* native_font_cfg = font_cfg.NativePtr; + ushort* native_glyph_ranges = (ushort*)glyph_ranges.ToPointer(); + ImFont* ret = ImGuiNative.ImFontAtlas_AddFontFromMemoryCompressedTTF((ImFontAtlas*)(NativePtr), native_compressed_font_data, compressed_font_data_size, size_pixels, native_font_cfg, native_glyph_ranges); + return new ImFontPtr(ret); + } + public ImFontPtr AddFontFromMemoryTTF(IntPtr font_data, int font_data_size, float size_pixels) + { + void* native_font_data = (void*)font_data.ToPointer(); + ImFontConfig* font_cfg = null; + ushort* glyph_ranges = null; + ImFont* ret = ImGuiNative.ImFontAtlas_AddFontFromMemoryTTF((ImFontAtlas*)(NativePtr), native_font_data, font_data_size, size_pixels, font_cfg, glyph_ranges); + return new ImFontPtr(ret); + } + public ImFontPtr AddFontFromMemoryTTF(IntPtr font_data, int font_data_size, float size_pixels, ImFontConfigPtr font_cfg) + { + void* native_font_data = (void*)font_data.ToPointer(); + ImFontConfig* native_font_cfg = font_cfg.NativePtr; + ushort* glyph_ranges = null; + ImFont* ret = ImGuiNative.ImFontAtlas_AddFontFromMemoryTTF((ImFontAtlas*)(NativePtr), native_font_data, font_data_size, size_pixels, native_font_cfg, glyph_ranges); + return new ImFontPtr(ret); + } + public ImFontPtr AddFontFromMemoryTTF(IntPtr font_data, int font_data_size, float size_pixels, ImFontConfigPtr font_cfg, IntPtr glyph_ranges) + { + void* native_font_data = (void*)font_data.ToPointer(); + ImFontConfig* native_font_cfg = font_cfg.NativePtr; + ushort* native_glyph_ranges = (ushort*)glyph_ranges.ToPointer(); + ImFont* ret = ImGuiNative.ImFontAtlas_AddFontFromMemoryTTF((ImFontAtlas*)(NativePtr), native_font_data, font_data_size, size_pixels, native_font_cfg, native_glyph_ranges); + return new ImFontPtr(ret); + } + public bool Build() + { + byte ret = ImGuiNative.ImFontAtlas_Build((ImFontAtlas*)(NativePtr)); + return ret != 0; + } + public void CalcCustomRectUV(ImFontAtlasCustomRectPtr rect, out Vector2 out_uv_min, out Vector2 out_uv_max) + { + ImFontAtlasCustomRect* native_rect = rect.NativePtr; + fixed (Vector2* native_out_uv_min = &out_uv_min) + { + fixed (Vector2* native_out_uv_max = &out_uv_max) + { + ImGuiNative.ImFontAtlas_CalcCustomRectUV((ImFontAtlas*)(NativePtr), native_rect, native_out_uv_min, native_out_uv_max); + } + } + } + public void Clear() + { + ImGuiNative.ImFontAtlas_Clear((ImFontAtlas*)(NativePtr)); + } + public void ClearFonts() + { + ImGuiNative.ImFontAtlas_ClearFonts((ImFontAtlas*)(NativePtr)); + } + public void ClearInputData() + { + ImGuiNative.ImFontAtlas_ClearInputData((ImFontAtlas*)(NativePtr)); + } + public void ClearTexData() + { + ImGuiNative.ImFontAtlas_ClearTexData((ImFontAtlas*)(NativePtr)); + } + public void Destroy() + { + ImGuiNative.ImFontAtlas_destroy((ImFontAtlas*)(NativePtr)); + } + public ImFontAtlasCustomRectPtr GetCustomRectByIndex(int index) + { + ImFontAtlasCustomRect* ret = ImGuiNative.ImFontAtlas_GetCustomRectByIndex((ImFontAtlas*)(NativePtr), index); + return new ImFontAtlasCustomRectPtr(ret); + } + public IntPtr GetGlyphRangesChineseFull() + { + ushort* ret = ImGuiNative.ImFontAtlas_GetGlyphRangesChineseFull((ImFontAtlas*)(NativePtr)); + return (IntPtr)ret; + } + public IntPtr GetGlyphRangesChineseSimplifiedCommon() + { + ushort* ret = ImGuiNative.ImFontAtlas_GetGlyphRangesChineseSimplifiedCommon((ImFontAtlas*)(NativePtr)); + return (IntPtr)ret; + } + public IntPtr GetGlyphRangesCyrillic() + { + ushort* ret = ImGuiNative.ImFontAtlas_GetGlyphRangesCyrillic((ImFontAtlas*)(NativePtr)); + return (IntPtr)ret; + } + public IntPtr GetGlyphRangesDefault() + { + ushort* ret = ImGuiNative.ImFontAtlas_GetGlyphRangesDefault((ImFontAtlas*)(NativePtr)); + return (IntPtr)ret; + } + public IntPtr GetGlyphRangesGreek() + { + ushort* ret = ImGuiNative.ImFontAtlas_GetGlyphRangesGreek((ImFontAtlas*)(NativePtr)); + return (IntPtr)ret; + } + public IntPtr GetGlyphRangesJapanese() + { + ushort* ret = ImGuiNative.ImFontAtlas_GetGlyphRangesJapanese((ImFontAtlas*)(NativePtr)); + return (IntPtr)ret; + } + public IntPtr GetGlyphRangesKorean() + { + ushort* ret = ImGuiNative.ImFontAtlas_GetGlyphRangesKorean((ImFontAtlas*)(NativePtr)); + return (IntPtr)ret; + } + public IntPtr GetGlyphRangesThai() + { + ushort* ret = ImGuiNative.ImFontAtlas_GetGlyphRangesThai((ImFontAtlas*)(NativePtr)); + return (IntPtr)ret; + } + public IntPtr GetGlyphRangesVietnamese() + { + ushort* ret = ImGuiNative.ImFontAtlas_GetGlyphRangesVietnamese((ImFontAtlas*)(NativePtr)); + return (IntPtr)ret; + } + 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((ImFontAtlas*)(NativePtr), cursor, native_out_offset, native_out_size, native_out_uv_border, native_out_uv_fill); + return ret != 0; + } + } + } + } + } + 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((ImFontAtlas*)(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((ImFontAtlas*)(NativePtr), native_out_pixels, native_out_width, native_out_height, native_out_bytes_per_pixel); + } + } + } + } + } + public void GetTexDataAsAlpha8(out IntPtr out_pixels, out int out_width, out int out_height) + { + int* out_bytes_per_pixel = null; + fixed (IntPtr* native_out_pixels = &out_pixels) + { + fixed (int* native_out_width = &out_width) + { + fixed (int* native_out_height = &out_height) + { + ImGuiNative.ImFontAtlas_GetTexDataAsAlpha8((ImFontAtlas*)(NativePtr), native_out_pixels, native_out_width, native_out_height, out_bytes_per_pixel); + } + } + } + } + public void GetTexDataAsAlpha8(out IntPtr out_pixels, out int out_width, out int out_height, out int out_bytes_per_pixel) + { + fixed (IntPtr* 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((ImFontAtlas*)(NativePtr), native_out_pixels, native_out_width, native_out_height, native_out_bytes_per_pixel); + } + } + } + } + } + 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((ImFontAtlas*)(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((ImFontAtlas*)(NativePtr), native_out_pixels, native_out_width, native_out_height, native_out_bytes_per_pixel); + } + } + } + } + } + public void GetTexDataAsRGBA32(out IntPtr out_pixels, out int out_width, out int out_height) + { + int* out_bytes_per_pixel = null; + fixed (IntPtr* native_out_pixels = &out_pixels) + { + fixed (int* native_out_width = &out_width) + { + fixed (int* native_out_height = &out_height) + { + ImGuiNative.ImFontAtlas_GetTexDataAsRGBA32((ImFontAtlas*)(NativePtr), native_out_pixels, native_out_width, native_out_height, out_bytes_per_pixel); + } + } + } + } + public void GetTexDataAsRGBA32(out IntPtr out_pixels, out int out_width, out int out_height, out int out_bytes_per_pixel) + { + fixed (IntPtr* 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((ImFontAtlas*)(NativePtr), native_out_pixels, native_out_width, native_out_height, native_out_bytes_per_pixel); + } + } + } + } + } + public bool IsBuilt() + { + byte ret = ImGuiNative.ImFontAtlas_IsBuilt((ImFontAtlas*)(NativePtr)); + return ret != 0; + } + public void SetTexID(IntPtr id) + { + ImGuiNative.ImFontAtlas_SetTexID((ImFontAtlas*)(NativePtr), id); + } + } +} diff --git a/lib/ImGui.NET/Generated/ImFontAtlasCustomRect.gen.cs b/lib/ImGui.NET/Generated/ImFontAtlasCustomRect.gen.cs new file mode 100644 index 0000000..10ce3ef --- /dev/null +++ b/lib/ImGui.NET/Generated/ImFontAtlasCustomRect.gen.cs @@ -0,0 +1,45 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ImGuiNET +{ + public unsafe partial struct ImFontAtlasCustomRect + { + public ushort Width; + public ushort Height; + public ushort X; + public ushort Y; + public uint GlyphID; + public float GlyphAdvanceX; + public Vector2 GlyphOffset; + public ImFont* Font; + } + public unsafe partial struct ImFontAtlasCustomRectPtr + { + public ImFontAtlasCustomRect* NativePtr { get; } + public ImFontAtlasCustomRectPtr(ImFontAtlasCustomRect* nativePtr) => NativePtr = nativePtr; + public ImFontAtlasCustomRectPtr(IntPtr nativePtr) => NativePtr = (ImFontAtlasCustomRect*)nativePtr; + public static implicit operator ImFontAtlasCustomRectPtr(ImFontAtlasCustomRect* nativePtr) => new ImFontAtlasCustomRectPtr(nativePtr); + public static implicit operator ImFontAtlasCustomRect* (ImFontAtlasCustomRectPtr wrappedPtr) => wrappedPtr.NativePtr; + public static implicit operator ImFontAtlasCustomRectPtr(IntPtr nativePtr) => new ImFontAtlasCustomRectPtr(nativePtr); + public ref ushort Width => ref Unsafe.AsRef(&NativePtr->Width); + public ref ushort Height => ref Unsafe.AsRef(&NativePtr->Height); + public ref ushort X => ref Unsafe.AsRef(&NativePtr->X); + public ref ushort Y => ref Unsafe.AsRef(&NativePtr->Y); + public ref uint GlyphID => ref Unsafe.AsRef(&NativePtr->GlyphID); + public ref float GlyphAdvanceX => ref Unsafe.AsRef(&NativePtr->GlyphAdvanceX); + public ref Vector2 GlyphOffset => ref Unsafe.AsRef(&NativePtr->GlyphOffset); + public ImFontPtr Font => new ImFontPtr(NativePtr->Font); + public void Destroy() + { + ImGuiNative.ImFontAtlasCustomRect_destroy((ImFontAtlasCustomRect*)(NativePtr)); + } + public bool IsPacked() + { + byte ret = ImGuiNative.ImFontAtlasCustomRect_IsPacked((ImFontAtlasCustomRect*)(NativePtr)); + return ret != 0; + } + } +} diff --git a/lib/ImGui.NET/Generated/ImFontAtlasFlags.gen.cs b/lib/ImGui.NET/Generated/ImFontAtlasFlags.gen.cs new file mode 100644 index 0000000..336f53e --- /dev/null +++ b/lib/ImGui.NET/Generated/ImFontAtlasFlags.gen.cs @@ -0,0 +1,11 @@ +namespace ImGuiNET +{ + [System.Flags] + public enum ImFontAtlasFlags + { + None = 0, + NoPowerOfTwoHeight = 1, + NoMouseCursors = 2, + NoBakedLines = 4, + } +} diff --git a/lib/ImGui.NET/Generated/ImFontConfig.gen.cs b/lib/ImGui.NET/Generated/ImFontConfig.gen.cs new file mode 100644 index 0000000..46e785b --- /dev/null +++ b/lib/ImGui.NET/Generated/ImFontConfig.gen.cs @@ -0,0 +1,64 @@ +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 FontBuilderFlags; + public float RasterizerMultiply; + public float RasterizerDensity; + public ushort EllipsisChar; + 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(&NativePtr->FontDataSize); + public ref bool FontDataOwnedByAtlas => ref Unsafe.AsRef(&NativePtr->FontDataOwnedByAtlas); + public ref int FontNo => ref Unsafe.AsRef(&NativePtr->FontNo); + public ref float SizePixels => ref Unsafe.AsRef(&NativePtr->SizePixels); + public ref int OversampleH => ref Unsafe.AsRef(&NativePtr->OversampleH); + public ref int OversampleV => ref Unsafe.AsRef(&NativePtr->OversampleV); + public ref bool PixelSnapH => ref Unsafe.AsRef(&NativePtr->PixelSnapH); + public ref Vector2 GlyphExtraSpacing => ref Unsafe.AsRef(&NativePtr->GlyphExtraSpacing); + public ref Vector2 GlyphOffset => ref Unsafe.AsRef(&NativePtr->GlyphOffset); + public IntPtr GlyphRanges { get => (IntPtr)NativePtr->GlyphRanges; set => NativePtr->GlyphRanges = (ushort*)value; } + public ref float GlyphMinAdvanceX => ref Unsafe.AsRef(&NativePtr->GlyphMinAdvanceX); + public ref float GlyphMaxAdvanceX => ref Unsafe.AsRef(&NativePtr->GlyphMaxAdvanceX); + public ref bool MergeMode => ref Unsafe.AsRef(&NativePtr->MergeMode); + public ref uint FontBuilderFlags => ref Unsafe.AsRef(&NativePtr->FontBuilderFlags); + public ref float RasterizerMultiply => ref Unsafe.AsRef(&NativePtr->RasterizerMultiply); + public ref float RasterizerDensity => ref Unsafe.AsRef(&NativePtr->RasterizerDensity); + public ref ushort EllipsisChar => ref Unsafe.AsRef(&NativePtr->EllipsisChar); + public RangeAccessor Name => new RangeAccessor(NativePtr->Name, 40); + public ImFontPtr DstFont => new ImFontPtr(NativePtr->DstFont); + public void Destroy() + { + ImGuiNative.ImFontConfig_destroy((ImFontConfig*)(NativePtr)); + } + } +} diff --git a/lib/ImGui.NET/Generated/ImFontGlyph.gen.cs b/lib/ImGui.NET/Generated/ImFontGlyph.gen.cs new file mode 100644 index 0000000..8a78d6f --- /dev/null +++ b/lib/ImGui.NET/Generated/ImFontGlyph.gen.cs @@ -0,0 +1,44 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ImGuiNET +{ + public unsafe partial struct ImFontGlyph + { + public uint Colored; + public uint Visible; + public uint 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 uint Colored => ref Unsafe.AsRef(&NativePtr->Colored); + public ref uint Visible => ref Unsafe.AsRef(&NativePtr->Visible); + public ref uint Codepoint => ref Unsafe.AsRef(&NativePtr->Codepoint); + public ref float AdvanceX => ref Unsafe.AsRef(&NativePtr->AdvanceX); + public ref float X0 => ref Unsafe.AsRef(&NativePtr->X0); + public ref float Y0 => ref Unsafe.AsRef(&NativePtr->Y0); + public ref float X1 => ref Unsafe.AsRef(&NativePtr->X1); + public ref float Y1 => ref Unsafe.AsRef(&NativePtr->Y1); + public ref float U0 => ref Unsafe.AsRef(&NativePtr->U0); + public ref float V0 => ref Unsafe.AsRef(&NativePtr->V0); + public ref float U1 => ref Unsafe.AsRef(&NativePtr->U1); + public ref float V1 => ref Unsafe.AsRef(&NativePtr->V1); + } +} diff --git a/lib/ImGui.NET/Generated/ImFontGlyphRangesBuilder.gen.cs b/lib/ImGui.NET/Generated/ImFontGlyphRangesBuilder.gen.cs new file mode 100644 index 0000000..4a0cb22 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImFontGlyphRangesBuilder.gen.cs @@ -0,0 +1,109 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ImGuiNET +{ + public unsafe partial struct ImFontGlyphRangesBuilder + { + public ImVector UsedChars; + } + public unsafe partial struct ImFontGlyphRangesBuilderPtr + { + public ImFontGlyphRangesBuilder* NativePtr { get; } + public ImFontGlyphRangesBuilderPtr(ImFontGlyphRangesBuilder* nativePtr) => NativePtr = nativePtr; + public ImFontGlyphRangesBuilderPtr(IntPtr nativePtr) => NativePtr = (ImFontGlyphRangesBuilder*)nativePtr; + public static implicit operator ImFontGlyphRangesBuilderPtr(ImFontGlyphRangesBuilder* nativePtr) => new ImFontGlyphRangesBuilderPtr(nativePtr); + public static implicit operator ImFontGlyphRangesBuilder* (ImFontGlyphRangesBuilderPtr wrappedPtr) => wrappedPtr.NativePtr; + public static implicit operator ImFontGlyphRangesBuilderPtr(IntPtr nativePtr) => new ImFontGlyphRangesBuilderPtr(nativePtr); + public ImVector UsedChars => new ImVector(NativePtr->UsedChars); + public void AddChar(ushort c) + { + ImGuiNative.ImFontGlyphRangesBuilder_AddChar((ImFontGlyphRangesBuilder*)(NativePtr), c); + } + public void AddRanges(IntPtr ranges) + { + ushort* native_ranges = (ushort*)ranges.ToPointer(); + ImGuiNative.ImFontGlyphRangesBuilder_AddRanges((ImFontGlyphRangesBuilder*)(NativePtr), native_ranges); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public void AddText(ReadOnlySpan text) + { + byte* native_text; + int text_byteCount = 0; + if (text != null) + { + text_byteCount = Encoding.UTF8.GetByteCount(text); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + native_text = Util.Allocate(text_byteCount + 1); + } + else + { + byte* native_text_stackBytes = stackalloc byte[text_byteCount + 1]; + native_text = native_text_stackBytes; + } + int native_text_offset = Util.GetUtf8(text, native_text, text_byteCount); + native_text[native_text_offset] = 0; + } + else { native_text = null; } + ImGuiNative.ImFontGlyphRangesBuilder_AddText((ImFontGlyphRangesBuilder*)(NativePtr), native_text, native_text+text_byteCount); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text); + } + } +#endif + public void AddText(string text) + { + byte* native_text; + int text_byteCount = 0; + if (text != null) + { + text_byteCount = Encoding.UTF8.GetByteCount(text); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + native_text = Util.Allocate(text_byteCount + 1); + } + else + { + byte* native_text_stackBytes = stackalloc byte[text_byteCount + 1]; + native_text = native_text_stackBytes; + } + int native_text_offset = Util.GetUtf8(text, native_text, text_byteCount); + native_text[native_text_offset] = 0; + } + else { native_text = null; } + ImGuiNative.ImFontGlyphRangesBuilder_AddText((ImFontGlyphRangesBuilder*)(NativePtr), native_text, native_text+text_byteCount); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text); + } + } + public void BuildRanges(out ImVector out_ranges) + { + fixed (ImVector* native_out_ranges = &out_ranges) + { + ImGuiNative.ImFontGlyphRangesBuilder_BuildRanges((ImFontGlyphRangesBuilder*)(NativePtr), native_out_ranges); + } + } + public void Clear() + { + ImGuiNative.ImFontGlyphRangesBuilder_Clear((ImFontGlyphRangesBuilder*)(NativePtr)); + } + public void Destroy() + { + ImGuiNative.ImFontGlyphRangesBuilder_destroy((ImFontGlyphRangesBuilder*)(NativePtr)); + } + public bool GetBit(uint n) + { + byte ret = ImGuiNative.ImFontGlyphRangesBuilder_GetBit((ImFontGlyphRangesBuilder*)(NativePtr), n); + return ret != 0; + } + public void SetBit(uint n) + { + ImGuiNative.ImFontGlyphRangesBuilder_SetBit((ImFontGlyphRangesBuilder*)(NativePtr), n); + } + } +} diff --git a/lib/ImGui.NET/Generated/ImGui.gen.cs b/lib/ImGui.NET/Generated/ImGui.gen.cs new file mode 100644 index 0000000..7126597 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGui.gen.cs @@ -0,0 +1,28311 @@ +using System; +using System.Numerics; +using System.Runtime.InteropServices; +using System.Text; + +namespace ImGuiNET +{ + public static unsafe partial class ImGui + { +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static ImGuiPayloadPtr AcceptDragDropPayload(ReadOnlySpan type) + { + byte* native_type; + int type_byteCount = 0; + if (type != null) + { + type_byteCount = Encoding.UTF8.GetByteCount(type); + if (type_byteCount > Util.StackAllocationSizeLimit) + { + native_type = Util.Allocate(type_byteCount + 1); + } + else + { + byte* native_type_stackBytes = stackalloc byte[type_byteCount + 1]; + native_type = native_type_stackBytes; + } + int native_type_offset = Util.GetUtf8(type, native_type, type_byteCount); + native_type[native_type_offset] = 0; + } + else { native_type = null; } + ImGuiDragDropFlags flags = (ImGuiDragDropFlags)0; + ImGuiPayload* ret = ImGuiNative.igAcceptDragDropPayload(native_type, flags); + if (type_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_type); + } + return new ImGuiPayloadPtr(ret); + } +#endif + public static ImGuiPayloadPtr AcceptDragDropPayload(string type) + { + byte* native_type; + int type_byteCount = 0; + if (type != null) + { + type_byteCount = Encoding.UTF8.GetByteCount(type); + if (type_byteCount > Util.StackAllocationSizeLimit) + { + native_type = Util.Allocate(type_byteCount + 1); + } + else + { + byte* native_type_stackBytes = stackalloc byte[type_byteCount + 1]; + native_type = native_type_stackBytes; + } + int native_type_offset = Util.GetUtf8(type, native_type, type_byteCount); + native_type[native_type_offset] = 0; + } + else { native_type = null; } + ImGuiDragDropFlags flags = (ImGuiDragDropFlags)0; + ImGuiPayload* ret = ImGuiNative.igAcceptDragDropPayload(native_type, flags); + if (type_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_type); + } + return new ImGuiPayloadPtr(ret); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static ImGuiPayloadPtr AcceptDragDropPayload(ReadOnlySpan type, ImGuiDragDropFlags flags) + { + byte* native_type; + int type_byteCount = 0; + if (type != null) + { + type_byteCount = Encoding.UTF8.GetByteCount(type); + if (type_byteCount > Util.StackAllocationSizeLimit) + { + native_type = Util.Allocate(type_byteCount + 1); + } + else + { + byte* native_type_stackBytes = stackalloc byte[type_byteCount + 1]; + native_type = native_type_stackBytes; + } + int native_type_offset = Util.GetUtf8(type, native_type, type_byteCount); + native_type[native_type_offset] = 0; + } + else { native_type = null; } + ImGuiPayload* ret = ImGuiNative.igAcceptDragDropPayload(native_type, flags); + if (type_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_type); + } + return new ImGuiPayloadPtr(ret); + } +#endif + public static ImGuiPayloadPtr AcceptDragDropPayload(string type, ImGuiDragDropFlags flags) + { + byte* native_type; + int type_byteCount = 0; + if (type != null) + { + type_byteCount = Encoding.UTF8.GetByteCount(type); + if (type_byteCount > Util.StackAllocationSizeLimit) + { + native_type = Util.Allocate(type_byteCount + 1); + } + else + { + byte* native_type_stackBytes = stackalloc byte[type_byteCount + 1]; + native_type = native_type_stackBytes; + } + int native_type_offset = Util.GetUtf8(type, native_type, type_byteCount); + native_type[native_type_offset] = 0; + } + else { native_type = null; } + ImGuiPayload* ret = ImGuiNative.igAcceptDragDropPayload(native_type, flags); + if (type_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_type); + } + return new ImGuiPayloadPtr(ret); + } + public static void AlignTextToFramePadding() + { + ImGuiNative.igAlignTextToFramePadding(); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool ArrowButton(ReadOnlySpan str_id, ImGuiDir dir) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + byte ret = ImGuiNative.igArrowButton(native_str_id, dir); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#endif + public static bool ArrowButton(string str_id, ImGuiDir dir) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + byte ret = ImGuiNative.igArrowButton(native_str_id, dir); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool Begin(ReadOnlySpan name) + { + byte* native_name; + int name_byteCount = 0; + if (name != null) + { + name_byteCount = Encoding.UTF8.GetByteCount(name); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + native_name = Util.Allocate(name_byteCount + 1); + } + else + { + byte* native_name_stackBytes = stackalloc byte[name_byteCount + 1]; + native_name = native_name_stackBytes; + } + int native_name_offset = Util.GetUtf8(name, native_name, name_byteCount); + native_name[native_name_offset] = 0; + } + else { native_name = null; } + byte* p_open = null; + ImGuiWindowFlags flags = (ImGuiWindowFlags)0; + byte ret = ImGuiNative.igBegin(native_name, p_open, flags); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_name); + } + return ret != 0; + } +#endif + public static bool Begin(string name) + { + byte* native_name; + int name_byteCount = 0; + if (name != null) + { + name_byteCount = Encoding.UTF8.GetByteCount(name); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + native_name = Util.Allocate(name_byteCount + 1); + } + else + { + byte* native_name_stackBytes = stackalloc byte[name_byteCount + 1]; + native_name = native_name_stackBytes; + } + int native_name_offset = Util.GetUtf8(name, native_name, name_byteCount); + native_name[native_name_offset] = 0; + } + else { native_name = null; } + byte* p_open = null; + ImGuiWindowFlags flags = (ImGuiWindowFlags)0; + byte ret = ImGuiNative.igBegin(native_name, p_open, flags); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_name); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool Begin(ReadOnlySpan name, ref bool p_open) + { + byte* native_name; + int name_byteCount = 0; + if (name != null) + { + name_byteCount = Encoding.UTF8.GetByteCount(name); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + native_name = Util.Allocate(name_byteCount + 1); + } + else + { + byte* native_name_stackBytes = stackalloc byte[name_byteCount + 1]; + native_name = native_name_stackBytes; + } + int native_name_offset = Util.GetUtf8(name, native_name, name_byteCount); + native_name[native_name_offset] = 0; + } + else { native_name = null; } + byte native_p_open_val = p_open ? (byte)1 : (byte)0; + byte* native_p_open = &native_p_open_val; + ImGuiWindowFlags flags = (ImGuiWindowFlags)0; + byte ret = ImGuiNative.igBegin(native_name, native_p_open, flags); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_name); + } + p_open = native_p_open_val != 0; + return ret != 0; + } +#endif + public static bool Begin(string name, ref bool p_open) + { + byte* native_name; + int name_byteCount = 0; + if (name != null) + { + name_byteCount = Encoding.UTF8.GetByteCount(name); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + native_name = Util.Allocate(name_byteCount + 1); + } + else + { + byte* native_name_stackBytes = stackalloc byte[name_byteCount + 1]; + native_name = native_name_stackBytes; + } + int native_name_offset = Util.GetUtf8(name, native_name, name_byteCount); + native_name[native_name_offset] = 0; + } + else { native_name = null; } + byte native_p_open_val = p_open ? (byte)1 : (byte)0; + byte* native_p_open = &native_p_open_val; + ImGuiWindowFlags flags = (ImGuiWindowFlags)0; + byte ret = ImGuiNative.igBegin(native_name, native_p_open, flags); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_name); + } + p_open = native_p_open_val != 0; + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool Begin(ReadOnlySpan name, ref bool p_open, ImGuiWindowFlags flags) + { + byte* native_name; + int name_byteCount = 0; + if (name != null) + { + name_byteCount = Encoding.UTF8.GetByteCount(name); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + native_name = Util.Allocate(name_byteCount + 1); + } + else + { + byte* native_name_stackBytes = stackalloc byte[name_byteCount + 1]; + native_name = native_name_stackBytes; + } + int native_name_offset = Util.GetUtf8(name, native_name, name_byteCount); + native_name[native_name_offset] = 0; + } + else { native_name = null; } + byte native_p_open_val = p_open ? (byte)1 : (byte)0; + byte* native_p_open = &native_p_open_val; + byte ret = ImGuiNative.igBegin(native_name, native_p_open, flags); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_name); + } + p_open = native_p_open_val != 0; + return ret != 0; + } +#endif + public static bool Begin(string name, ref bool p_open, ImGuiWindowFlags flags) + { + byte* native_name; + int name_byteCount = 0; + if (name != null) + { + name_byteCount = Encoding.UTF8.GetByteCount(name); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + native_name = Util.Allocate(name_byteCount + 1); + } + else + { + byte* native_name_stackBytes = stackalloc byte[name_byteCount + 1]; + native_name = native_name_stackBytes; + } + int native_name_offset = Util.GetUtf8(name, native_name, name_byteCount); + native_name[native_name_offset] = 0; + } + else { native_name = null; } + byte native_p_open_val = p_open ? (byte)1 : (byte)0; + byte* native_p_open = &native_p_open_val; + byte ret = ImGuiNative.igBegin(native_name, native_p_open, flags); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_name); + } + p_open = native_p_open_val != 0; + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool BeginChild(ReadOnlySpan str_id) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + Vector2 size = new Vector2(); + ImGuiChildFlags child_flags = (ImGuiChildFlags)0; + ImGuiWindowFlags window_flags = (ImGuiWindowFlags)0; + byte ret = ImGuiNative.igBeginChild_Str(native_str_id, size, child_flags, window_flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#endif + public static bool BeginChild(string str_id) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + Vector2 size = new Vector2(); + ImGuiChildFlags child_flags = (ImGuiChildFlags)0; + ImGuiWindowFlags window_flags = (ImGuiWindowFlags)0; + byte ret = ImGuiNative.igBeginChild_Str(native_str_id, size, child_flags, window_flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool BeginChild(ReadOnlySpan str_id, Vector2 size) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + ImGuiChildFlags child_flags = (ImGuiChildFlags)0; + ImGuiWindowFlags window_flags = (ImGuiWindowFlags)0; + byte ret = ImGuiNative.igBeginChild_Str(native_str_id, size, child_flags, window_flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#endif + public static bool BeginChild(string str_id, Vector2 size) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + ImGuiChildFlags child_flags = (ImGuiChildFlags)0; + ImGuiWindowFlags window_flags = (ImGuiWindowFlags)0; + byte ret = ImGuiNative.igBeginChild_Str(native_str_id, size, child_flags, window_flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool BeginChild(ReadOnlySpan str_id, Vector2 size, ImGuiChildFlags child_flags) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + ImGuiWindowFlags window_flags = (ImGuiWindowFlags)0; + byte ret = ImGuiNative.igBeginChild_Str(native_str_id, size, child_flags, window_flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#endif + public static bool BeginChild(string str_id, Vector2 size, ImGuiChildFlags child_flags) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + ImGuiWindowFlags window_flags = (ImGuiWindowFlags)0; + byte ret = ImGuiNative.igBeginChild_Str(native_str_id, size, child_flags, window_flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool BeginChild(ReadOnlySpan str_id, Vector2 size, ImGuiChildFlags child_flags, ImGuiWindowFlags window_flags) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + byte ret = ImGuiNative.igBeginChild_Str(native_str_id, size, child_flags, window_flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#endif + public static bool BeginChild(string str_id, Vector2 size, ImGuiChildFlags child_flags, ImGuiWindowFlags window_flags) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + byte ret = ImGuiNative.igBeginChild_Str(native_str_id, size, child_flags, window_flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } + public static bool BeginChild(uint id) + { + Vector2 size = new Vector2(); + ImGuiChildFlags child_flags = (ImGuiChildFlags)0; + ImGuiWindowFlags window_flags = (ImGuiWindowFlags)0; + byte ret = ImGuiNative.igBeginChild_ID(id, size, child_flags, window_flags); + return ret != 0; + } + public static bool BeginChild(uint id, Vector2 size) + { + ImGuiChildFlags child_flags = (ImGuiChildFlags)0; + ImGuiWindowFlags window_flags = (ImGuiWindowFlags)0; + byte ret = ImGuiNative.igBeginChild_ID(id, size, child_flags, window_flags); + return ret != 0; + } + public static bool BeginChild(uint id, Vector2 size, ImGuiChildFlags child_flags) + { + ImGuiWindowFlags window_flags = (ImGuiWindowFlags)0; + byte ret = ImGuiNative.igBeginChild_ID(id, size, child_flags, window_flags); + return ret != 0; + } + public static bool BeginChild(uint id, Vector2 size, ImGuiChildFlags child_flags, ImGuiWindowFlags window_flags) + { + byte ret = ImGuiNative.igBeginChild_ID(id, size, child_flags, window_flags); + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool BeginCombo(ReadOnlySpan label, ReadOnlySpan preview_value) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_preview_value; + int preview_value_byteCount = 0; + if (preview_value != null) + { + preview_value_byteCount = Encoding.UTF8.GetByteCount(preview_value); + if (preview_value_byteCount > Util.StackAllocationSizeLimit) + { + native_preview_value = Util.Allocate(preview_value_byteCount + 1); + } + else + { + byte* native_preview_value_stackBytes = stackalloc byte[preview_value_byteCount + 1]; + native_preview_value = native_preview_value_stackBytes; + } + int native_preview_value_offset = Util.GetUtf8(preview_value, native_preview_value, preview_value_byteCount); + native_preview_value[native_preview_value_offset] = 0; + } + else { native_preview_value = null; } + ImGuiComboFlags flags = (ImGuiComboFlags)0; + byte ret = ImGuiNative.igBeginCombo(native_label, native_preview_value, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (preview_value_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_preview_value); + } + return ret != 0; + } +#endif + public static bool BeginCombo(string label, string preview_value) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_preview_value; + int preview_value_byteCount = 0; + if (preview_value != null) + { + preview_value_byteCount = Encoding.UTF8.GetByteCount(preview_value); + if (preview_value_byteCount > Util.StackAllocationSizeLimit) + { + native_preview_value = Util.Allocate(preview_value_byteCount + 1); + } + else + { + byte* native_preview_value_stackBytes = stackalloc byte[preview_value_byteCount + 1]; + native_preview_value = native_preview_value_stackBytes; + } + int native_preview_value_offset = Util.GetUtf8(preview_value, native_preview_value, preview_value_byteCount); + native_preview_value[native_preview_value_offset] = 0; + } + else { native_preview_value = null; } + ImGuiComboFlags flags = (ImGuiComboFlags)0; + byte ret = ImGuiNative.igBeginCombo(native_label, native_preview_value, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (preview_value_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_preview_value); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool BeginCombo(ReadOnlySpan label, ReadOnlySpan preview_value, ImGuiComboFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_preview_value; + int preview_value_byteCount = 0; + if (preview_value != null) + { + preview_value_byteCount = Encoding.UTF8.GetByteCount(preview_value); + if (preview_value_byteCount > Util.StackAllocationSizeLimit) + { + native_preview_value = Util.Allocate(preview_value_byteCount + 1); + } + else + { + byte* native_preview_value_stackBytes = stackalloc byte[preview_value_byteCount + 1]; + native_preview_value = native_preview_value_stackBytes; + } + int native_preview_value_offset = Util.GetUtf8(preview_value, native_preview_value, preview_value_byteCount); + native_preview_value[native_preview_value_offset] = 0; + } + else { native_preview_value = null; } + byte ret = ImGuiNative.igBeginCombo(native_label, native_preview_value, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (preview_value_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_preview_value); + } + return ret != 0; + } +#endif + public static bool BeginCombo(string label, string preview_value, ImGuiComboFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_preview_value; + int preview_value_byteCount = 0; + if (preview_value != null) + { + preview_value_byteCount = Encoding.UTF8.GetByteCount(preview_value); + if (preview_value_byteCount > Util.StackAllocationSizeLimit) + { + native_preview_value = Util.Allocate(preview_value_byteCount + 1); + } + else + { + byte* native_preview_value_stackBytes = stackalloc byte[preview_value_byteCount + 1]; + native_preview_value = native_preview_value_stackBytes; + } + int native_preview_value_offset = Util.GetUtf8(preview_value, native_preview_value, preview_value_byteCount); + native_preview_value[native_preview_value_offset] = 0; + } + else { native_preview_value = null; } + byte ret = ImGuiNative.igBeginCombo(native_label, native_preview_value, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (preview_value_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_preview_value); + } + return ret != 0; + } + public static void BeginDisabled() + { + byte disabled = 1; + ImGuiNative.igBeginDisabled(disabled); + } + public static void BeginDisabled(bool disabled) + { + byte native_disabled = disabled ? (byte)1 : (byte)0; + ImGuiNative.igBeginDisabled(native_disabled); + } + public static bool BeginDragDropSource() + { + ImGuiDragDropFlags flags = (ImGuiDragDropFlags)0; + byte ret = ImGuiNative.igBeginDragDropSource(flags); + return ret != 0; + } + public static bool BeginDragDropSource(ImGuiDragDropFlags flags) + { + byte ret = ImGuiNative.igBeginDragDropSource(flags); + return ret != 0; + } + public static bool BeginDragDropTarget() + { + byte ret = ImGuiNative.igBeginDragDropTarget(); + return ret != 0; + } + public static void BeginGroup() + { + ImGuiNative.igBeginGroup(); + } + public static bool BeginItemTooltip() + { + byte ret = ImGuiNative.igBeginItemTooltip(); + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool BeginListBox(ReadOnlySpan label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + Vector2 size = new Vector2(); + byte ret = ImGuiNative.igBeginListBox(native_label, size); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool BeginListBox(string label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + Vector2 size = new Vector2(); + byte ret = ImGuiNative.igBeginListBox(native_label, size); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool BeginListBox(ReadOnlySpan label, Vector2 size) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte ret = ImGuiNative.igBeginListBox(native_label, size); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool BeginListBox(string label, Vector2 size) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte ret = ImGuiNative.igBeginListBox(native_label, size); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + public static bool BeginMainMenuBar() + { + byte ret = ImGuiNative.igBeginMainMenuBar(); + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool BeginMenu(ReadOnlySpan label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte enabled = 1; + byte ret = ImGuiNative.igBeginMenu(native_label, enabled); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool BeginMenu(string label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte enabled = 1; + byte ret = ImGuiNative.igBeginMenu(native_label, enabled); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool BeginMenu(ReadOnlySpan label, bool enabled) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte native_enabled = enabled ? (byte)1 : (byte)0; + byte ret = ImGuiNative.igBeginMenu(native_label, native_enabled); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool BeginMenu(string label, bool enabled) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte native_enabled = enabled ? (byte)1 : (byte)0; + byte ret = ImGuiNative.igBeginMenu(native_label, native_enabled); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + public static bool BeginMenuBar() + { + byte ret = ImGuiNative.igBeginMenuBar(); + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool BeginPopup(ReadOnlySpan str_id) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + ImGuiWindowFlags flags = (ImGuiWindowFlags)0; + byte ret = ImGuiNative.igBeginPopup(native_str_id, flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#endif + public static bool BeginPopup(string str_id) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + ImGuiWindowFlags flags = (ImGuiWindowFlags)0; + byte ret = ImGuiNative.igBeginPopup(native_str_id, flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool BeginPopup(ReadOnlySpan str_id, ImGuiWindowFlags flags) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + byte ret = ImGuiNative.igBeginPopup(native_str_id, flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#endif + public static bool BeginPopup(string str_id, ImGuiWindowFlags flags) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + byte ret = ImGuiNative.igBeginPopup(native_str_id, flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } + public static bool BeginPopupContextItem() + { + byte* native_str_id = null; + ImGuiPopupFlags popup_flags = (ImGuiPopupFlags)1; + byte ret = ImGuiNative.igBeginPopupContextItem(native_str_id, popup_flags); + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool BeginPopupContextItem(ReadOnlySpan str_id) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + ImGuiPopupFlags popup_flags = (ImGuiPopupFlags)1; + byte ret = ImGuiNative.igBeginPopupContextItem(native_str_id, popup_flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#endif + public static bool BeginPopupContextItem(string str_id) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + ImGuiPopupFlags popup_flags = (ImGuiPopupFlags)1; + byte ret = ImGuiNative.igBeginPopupContextItem(native_str_id, popup_flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool BeginPopupContextItem(ReadOnlySpan str_id, ImGuiPopupFlags popup_flags) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + byte ret = ImGuiNative.igBeginPopupContextItem(native_str_id, popup_flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#endif + public static bool BeginPopupContextItem(string str_id, ImGuiPopupFlags popup_flags) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + byte ret = ImGuiNative.igBeginPopupContextItem(native_str_id, popup_flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } + public static bool BeginPopupContextVoid() + { + byte* native_str_id = null; + ImGuiPopupFlags popup_flags = (ImGuiPopupFlags)1; + byte ret = ImGuiNative.igBeginPopupContextVoid(native_str_id, popup_flags); + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool BeginPopupContextVoid(ReadOnlySpan str_id) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + ImGuiPopupFlags popup_flags = (ImGuiPopupFlags)1; + byte ret = ImGuiNative.igBeginPopupContextVoid(native_str_id, popup_flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#endif + public static bool BeginPopupContextVoid(string str_id) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + ImGuiPopupFlags popup_flags = (ImGuiPopupFlags)1; + byte ret = ImGuiNative.igBeginPopupContextVoid(native_str_id, popup_flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool BeginPopupContextVoid(ReadOnlySpan str_id, ImGuiPopupFlags popup_flags) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + byte ret = ImGuiNative.igBeginPopupContextVoid(native_str_id, popup_flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#endif + public static bool BeginPopupContextVoid(string str_id, ImGuiPopupFlags popup_flags) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + byte ret = ImGuiNative.igBeginPopupContextVoid(native_str_id, popup_flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } + public static bool BeginPopupContextWindow() + { + byte* native_str_id = null; + ImGuiPopupFlags popup_flags = (ImGuiPopupFlags)1; + byte ret = ImGuiNative.igBeginPopupContextWindow(native_str_id, popup_flags); + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool BeginPopupContextWindow(ReadOnlySpan str_id) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + ImGuiPopupFlags popup_flags = (ImGuiPopupFlags)1; + byte ret = ImGuiNative.igBeginPopupContextWindow(native_str_id, popup_flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#endif + public static bool BeginPopupContextWindow(string str_id) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + ImGuiPopupFlags popup_flags = (ImGuiPopupFlags)1; + byte ret = ImGuiNative.igBeginPopupContextWindow(native_str_id, popup_flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool BeginPopupContextWindow(ReadOnlySpan str_id, ImGuiPopupFlags popup_flags) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + byte ret = ImGuiNative.igBeginPopupContextWindow(native_str_id, popup_flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#endif + public static bool BeginPopupContextWindow(string str_id, ImGuiPopupFlags popup_flags) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + byte ret = ImGuiNative.igBeginPopupContextWindow(native_str_id, popup_flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool BeginPopupModal(ReadOnlySpan name) + { + byte* native_name; + int name_byteCount = 0; + if (name != null) + { + name_byteCount = Encoding.UTF8.GetByteCount(name); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + native_name = Util.Allocate(name_byteCount + 1); + } + else + { + byte* native_name_stackBytes = stackalloc byte[name_byteCount + 1]; + native_name = native_name_stackBytes; + } + int native_name_offset = Util.GetUtf8(name, native_name, name_byteCount); + native_name[native_name_offset] = 0; + } + else { native_name = null; } + byte* p_open = null; + ImGuiWindowFlags flags = (ImGuiWindowFlags)0; + byte ret = ImGuiNative.igBeginPopupModal(native_name, p_open, flags); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_name); + } + return ret != 0; + } +#endif + public static bool BeginPopupModal(string name) + { + byte* native_name; + int name_byteCount = 0; + if (name != null) + { + name_byteCount = Encoding.UTF8.GetByteCount(name); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + native_name = Util.Allocate(name_byteCount + 1); + } + else + { + byte* native_name_stackBytes = stackalloc byte[name_byteCount + 1]; + native_name = native_name_stackBytes; + } + int native_name_offset = Util.GetUtf8(name, native_name, name_byteCount); + native_name[native_name_offset] = 0; + } + else { native_name = null; } + byte* p_open = null; + ImGuiWindowFlags flags = (ImGuiWindowFlags)0; + byte ret = ImGuiNative.igBeginPopupModal(native_name, p_open, flags); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_name); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool BeginPopupModal(ReadOnlySpan name, ref bool p_open) + { + byte* native_name; + int name_byteCount = 0; + if (name != null) + { + name_byteCount = Encoding.UTF8.GetByteCount(name); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + native_name = Util.Allocate(name_byteCount + 1); + } + else + { + byte* native_name_stackBytes = stackalloc byte[name_byteCount + 1]; + native_name = native_name_stackBytes; + } + int native_name_offset = Util.GetUtf8(name, native_name, name_byteCount); + native_name[native_name_offset] = 0; + } + else { native_name = null; } + byte native_p_open_val = p_open ? (byte)1 : (byte)0; + byte* native_p_open = &native_p_open_val; + ImGuiWindowFlags flags = (ImGuiWindowFlags)0; + byte ret = ImGuiNative.igBeginPopupModal(native_name, native_p_open, flags); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_name); + } + p_open = native_p_open_val != 0; + return ret != 0; + } +#endif + public static bool BeginPopupModal(string name, ref bool p_open) + { + byte* native_name; + int name_byteCount = 0; + if (name != null) + { + name_byteCount = Encoding.UTF8.GetByteCount(name); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + native_name = Util.Allocate(name_byteCount + 1); + } + else + { + byte* native_name_stackBytes = stackalloc byte[name_byteCount + 1]; + native_name = native_name_stackBytes; + } + int native_name_offset = Util.GetUtf8(name, native_name, name_byteCount); + native_name[native_name_offset] = 0; + } + else { native_name = null; } + byte native_p_open_val = p_open ? (byte)1 : (byte)0; + byte* native_p_open = &native_p_open_val; + ImGuiWindowFlags flags = (ImGuiWindowFlags)0; + byte ret = ImGuiNative.igBeginPopupModal(native_name, native_p_open, flags); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_name); + } + p_open = native_p_open_val != 0; + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool BeginPopupModal(ReadOnlySpan name, ref bool p_open, ImGuiWindowFlags flags) + { + byte* native_name; + int name_byteCount = 0; + if (name != null) + { + name_byteCount = Encoding.UTF8.GetByteCount(name); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + native_name = Util.Allocate(name_byteCount + 1); + } + else + { + byte* native_name_stackBytes = stackalloc byte[name_byteCount + 1]; + native_name = native_name_stackBytes; + } + int native_name_offset = Util.GetUtf8(name, native_name, name_byteCount); + native_name[native_name_offset] = 0; + } + else { native_name = null; } + byte native_p_open_val = p_open ? (byte)1 : (byte)0; + byte* native_p_open = &native_p_open_val; + byte ret = ImGuiNative.igBeginPopupModal(native_name, native_p_open, flags); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_name); + } + p_open = native_p_open_val != 0; + return ret != 0; + } +#endif + public static bool BeginPopupModal(string name, ref bool p_open, ImGuiWindowFlags flags) + { + byte* native_name; + int name_byteCount = 0; + if (name != null) + { + name_byteCount = Encoding.UTF8.GetByteCount(name); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + native_name = Util.Allocate(name_byteCount + 1); + } + else + { + byte* native_name_stackBytes = stackalloc byte[name_byteCount + 1]; + native_name = native_name_stackBytes; + } + int native_name_offset = Util.GetUtf8(name, native_name, name_byteCount); + native_name[native_name_offset] = 0; + } + else { native_name = null; } + byte native_p_open_val = p_open ? (byte)1 : (byte)0; + byte* native_p_open = &native_p_open_val; + byte ret = ImGuiNative.igBeginPopupModal(native_name, native_p_open, flags); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_name); + } + p_open = native_p_open_val != 0; + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool BeginTabBar(ReadOnlySpan str_id) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + ImGuiTabBarFlags flags = (ImGuiTabBarFlags)0; + byte ret = ImGuiNative.igBeginTabBar(native_str_id, flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#endif + public static bool BeginTabBar(string str_id) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + ImGuiTabBarFlags flags = (ImGuiTabBarFlags)0; + byte ret = ImGuiNative.igBeginTabBar(native_str_id, flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool BeginTabBar(ReadOnlySpan str_id, ImGuiTabBarFlags flags) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + byte ret = ImGuiNative.igBeginTabBar(native_str_id, flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#endif + public static bool BeginTabBar(string str_id, ImGuiTabBarFlags flags) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + byte ret = ImGuiNative.igBeginTabBar(native_str_id, flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool BeginTabItem(ReadOnlySpan label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* p_open = null; + ImGuiTabItemFlags flags = (ImGuiTabItemFlags)0; + byte ret = ImGuiNative.igBeginTabItem(native_label, p_open, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool BeginTabItem(string label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* p_open = null; + ImGuiTabItemFlags flags = (ImGuiTabItemFlags)0; + byte ret = ImGuiNative.igBeginTabItem(native_label, p_open, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool BeginTabItem(ReadOnlySpan label, ref bool p_open) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte native_p_open_val = p_open ? (byte)1 : (byte)0; + byte* native_p_open = &native_p_open_val; + ImGuiTabItemFlags flags = (ImGuiTabItemFlags)0; + byte ret = ImGuiNative.igBeginTabItem(native_label, native_p_open, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + p_open = native_p_open_val != 0; + return ret != 0; + } +#endif + public static bool BeginTabItem(string label, ref bool p_open) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte native_p_open_val = p_open ? (byte)1 : (byte)0; + byte* native_p_open = &native_p_open_val; + ImGuiTabItemFlags flags = (ImGuiTabItemFlags)0; + byte ret = ImGuiNative.igBeginTabItem(native_label, native_p_open, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + p_open = native_p_open_val != 0; + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool BeginTabItem(ReadOnlySpan label, ref bool p_open, ImGuiTabItemFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte native_p_open_val = p_open ? (byte)1 : (byte)0; + byte* native_p_open = &native_p_open_val; + byte ret = ImGuiNative.igBeginTabItem(native_label, native_p_open, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + p_open = native_p_open_val != 0; + return ret != 0; + } +#endif + public static bool BeginTabItem(string label, ref bool p_open, ImGuiTabItemFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte native_p_open_val = p_open ? (byte)1 : (byte)0; + byte* native_p_open = &native_p_open_val; + byte ret = ImGuiNative.igBeginTabItem(native_label, native_p_open, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + p_open = native_p_open_val != 0; + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool BeginTable(ReadOnlySpan str_id, int column) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + ImGuiTableFlags flags = (ImGuiTableFlags)0; + Vector2 outer_size = new Vector2(); + float inner_width = 0.0f; + byte ret = ImGuiNative.igBeginTable(native_str_id, column, flags, outer_size, inner_width); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#endif + public static bool BeginTable(string str_id, int column) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + ImGuiTableFlags flags = (ImGuiTableFlags)0; + Vector2 outer_size = new Vector2(); + float inner_width = 0.0f; + byte ret = ImGuiNative.igBeginTable(native_str_id, column, flags, outer_size, inner_width); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool BeginTable(ReadOnlySpan str_id, int column, ImGuiTableFlags flags) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + Vector2 outer_size = new Vector2(); + float inner_width = 0.0f; + byte ret = ImGuiNative.igBeginTable(native_str_id, column, flags, outer_size, inner_width); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#endif + public static bool BeginTable(string str_id, int column, ImGuiTableFlags flags) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + Vector2 outer_size = new Vector2(); + float inner_width = 0.0f; + byte ret = ImGuiNative.igBeginTable(native_str_id, column, flags, outer_size, inner_width); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool BeginTable(ReadOnlySpan str_id, int column, ImGuiTableFlags flags, Vector2 outer_size) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + float inner_width = 0.0f; + byte ret = ImGuiNative.igBeginTable(native_str_id, column, flags, outer_size, inner_width); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#endif + public static bool BeginTable(string str_id, int column, ImGuiTableFlags flags, Vector2 outer_size) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + float inner_width = 0.0f; + byte ret = ImGuiNative.igBeginTable(native_str_id, column, flags, outer_size, inner_width); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool BeginTable(ReadOnlySpan str_id, int column, ImGuiTableFlags flags, Vector2 outer_size, float inner_width) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + byte ret = ImGuiNative.igBeginTable(native_str_id, column, flags, outer_size, inner_width); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#endif + public static bool BeginTable(string str_id, int column, ImGuiTableFlags flags, Vector2 outer_size, float inner_width) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + byte ret = ImGuiNative.igBeginTable(native_str_id, column, flags, outer_size, inner_width); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } + public static bool BeginTooltip() + { + byte ret = ImGuiNative.igBeginTooltip(); + return ret != 0; + } + public static void Bullet() + { + ImGuiNative.igBullet(); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void BulletText(ReadOnlySpan fmt) + { + byte* native_fmt; + int fmt_byteCount = 0; + if (fmt != null) + { + fmt_byteCount = Encoding.UTF8.GetByteCount(fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + native_fmt = Util.Allocate(fmt_byteCount + 1); + } + else + { + byte* native_fmt_stackBytes = stackalloc byte[fmt_byteCount + 1]; + native_fmt = native_fmt_stackBytes; + } + int native_fmt_offset = Util.GetUtf8(fmt, native_fmt, fmt_byteCount); + native_fmt[native_fmt_offset] = 0; + } + else { native_fmt = null; } + ImGuiNative.igBulletText(native_fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_fmt); + } + } +#endif + public static void BulletText(string fmt) + { + byte* native_fmt; + int fmt_byteCount = 0; + if (fmt != null) + { + fmt_byteCount = Encoding.UTF8.GetByteCount(fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + native_fmt = Util.Allocate(fmt_byteCount + 1); + } + else + { + byte* native_fmt_stackBytes = stackalloc byte[fmt_byteCount + 1]; + native_fmt = native_fmt_stackBytes; + } + int native_fmt_offset = Util.GetUtf8(fmt, native_fmt, fmt_byteCount); + native_fmt[native_fmt_offset] = 0; + } + else { native_fmt = null; } + ImGuiNative.igBulletText(native_fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_fmt); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool Button(ReadOnlySpan label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + Vector2 size = new Vector2(); + byte ret = ImGuiNative.igButton(native_label, size); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool Button(string label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + Vector2 size = new Vector2(); + byte ret = ImGuiNative.igButton(native_label, size); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool Button(ReadOnlySpan label, Vector2 size) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte ret = ImGuiNative.igButton(native_label, size); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool Button(string label, Vector2 size) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte ret = ImGuiNative.igButton(native_label, size); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + public static float CalcItemWidth() + { + float ret = ImGuiNative.igCalcItemWidth(); + return ret; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static Vector2 CalcTextSize(ReadOnlySpan text) + { + Vector2 __retval; + byte* native_text; + int text_byteCount = 0; + if (text != null) + { + text_byteCount = Encoding.UTF8.GetByteCount(text); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + native_text = Util.Allocate(text_byteCount + 1); + } + else + { + byte* native_text_stackBytes = stackalloc byte[text_byteCount + 1]; + native_text = native_text_stackBytes; + } + int native_text_offset = Util.GetUtf8(text, native_text, text_byteCount); + native_text[native_text_offset] = 0; + } + else { native_text = null; } + byte hide_text_after_double_hash = 0; + float wrap_width = -1.0f; + ImGuiNative.igCalcTextSize(&__retval, native_text, native_text+text_byteCount, hide_text_after_double_hash, wrap_width); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text); + } + return __retval; + } +#endif + public static Vector2 CalcTextSize(string text) + { + Vector2 __retval; + byte* native_text; + int text_byteCount = 0; + if (text != null) + { + text_byteCount = Encoding.UTF8.GetByteCount(text); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + native_text = Util.Allocate(text_byteCount + 1); + } + else + { + byte* native_text_stackBytes = stackalloc byte[text_byteCount + 1]; + native_text = native_text_stackBytes; + } + int native_text_offset = Util.GetUtf8(text, native_text, text_byteCount); + native_text[native_text_offset] = 0; + } + else { native_text = null; } + byte hide_text_after_double_hash = 0; + float wrap_width = -1.0f; + ImGuiNative.igCalcTextSize(&__retval, native_text, native_text+text_byteCount, hide_text_after_double_hash, wrap_width); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text); + } + return __retval; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static Vector2 CalcTextSize(ReadOnlySpan text, bool hide_text_after_double_hash) + { + Vector2 __retval; + byte* native_text; + int text_byteCount = 0; + if (text != null) + { + text_byteCount = Encoding.UTF8.GetByteCount(text); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + native_text = Util.Allocate(text_byteCount + 1); + } + else + { + byte* native_text_stackBytes = stackalloc byte[text_byteCount + 1]; + native_text = native_text_stackBytes; + } + int native_text_offset = Util.GetUtf8(text, native_text, text_byteCount); + native_text[native_text_offset] = 0; + } + else { native_text = null; } + byte native_hide_text_after_double_hash = hide_text_after_double_hash ? (byte)1 : (byte)0; + float wrap_width = -1.0f; + ImGuiNative.igCalcTextSize(&__retval, native_text, native_text+text_byteCount, native_hide_text_after_double_hash, wrap_width); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text); + } + return __retval; + } +#endif + public static Vector2 CalcTextSize(string text, bool hide_text_after_double_hash) + { + Vector2 __retval; + byte* native_text; + int text_byteCount = 0; + if (text != null) + { + text_byteCount = Encoding.UTF8.GetByteCount(text); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + native_text = Util.Allocate(text_byteCount + 1); + } + else + { + byte* native_text_stackBytes = stackalloc byte[text_byteCount + 1]; + native_text = native_text_stackBytes; + } + int native_text_offset = Util.GetUtf8(text, native_text, text_byteCount); + native_text[native_text_offset] = 0; + } + else { native_text = null; } + byte native_hide_text_after_double_hash = hide_text_after_double_hash ? (byte)1 : (byte)0; + float wrap_width = -1.0f; + ImGuiNative.igCalcTextSize(&__retval, native_text, native_text+text_byteCount, native_hide_text_after_double_hash, wrap_width); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text); + } + return __retval; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static Vector2 CalcTextSize(ReadOnlySpan text, bool hide_text_after_double_hash, float wrap_width) + { + Vector2 __retval; + byte* native_text; + int text_byteCount = 0; + if (text != null) + { + text_byteCount = Encoding.UTF8.GetByteCount(text); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + native_text = Util.Allocate(text_byteCount + 1); + } + else + { + byte* native_text_stackBytes = stackalloc byte[text_byteCount + 1]; + native_text = native_text_stackBytes; + } + int native_text_offset = Util.GetUtf8(text, native_text, text_byteCount); + native_text[native_text_offset] = 0; + } + else { native_text = null; } + byte native_hide_text_after_double_hash = hide_text_after_double_hash ? (byte)1 : (byte)0; + ImGuiNative.igCalcTextSize(&__retval, native_text, native_text+text_byteCount, native_hide_text_after_double_hash, wrap_width); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text); + } + return __retval; + } +#endif + public static Vector2 CalcTextSize(string text, bool hide_text_after_double_hash, float wrap_width) + { + Vector2 __retval; + byte* native_text; + int text_byteCount = 0; + if (text != null) + { + text_byteCount = Encoding.UTF8.GetByteCount(text); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + native_text = Util.Allocate(text_byteCount + 1); + } + else + { + byte* native_text_stackBytes = stackalloc byte[text_byteCount + 1]; + native_text = native_text_stackBytes; + } + int native_text_offset = Util.GetUtf8(text, native_text, text_byteCount); + native_text[native_text_offset] = 0; + } + else { native_text = null; } + byte native_hide_text_after_double_hash = hide_text_after_double_hash ? (byte)1 : (byte)0; + ImGuiNative.igCalcTextSize(&__retval, native_text, native_text+text_byteCount, native_hide_text_after_double_hash, wrap_width); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text); + } + return __retval; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool Checkbox(ReadOnlySpan label, ref bool v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte native_v_val = v ? (byte)1 : (byte)0; + byte* native_v = &native_v_val; + byte ret = ImGuiNative.igCheckbox(native_label, native_v); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + v = native_v_val != 0; + return ret != 0; + } +#endif + public static bool Checkbox(string label, ref bool v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte native_v_val = v ? (byte)1 : (byte)0; + byte* native_v = &native_v_val; + byte ret = ImGuiNative.igCheckbox(native_label, native_v); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + v = native_v_val != 0; + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool CheckboxFlags(ReadOnlySpan label, ref int flags, int flags_value) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + fixed (int* native_flags = &flags) + { + byte ret = ImGuiNative.igCheckboxFlags_IntPtr(native_label, native_flags, flags_value); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#endif + public static bool CheckboxFlags(string label, ref int flags, int flags_value) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + fixed (int* native_flags = &flags) + { + byte ret = ImGuiNative.igCheckboxFlags_IntPtr(native_label, native_flags, flags_value); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool CheckboxFlags(ReadOnlySpan label, ref uint flags, uint flags_value) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + fixed (uint* native_flags = &flags) + { + byte ret = ImGuiNative.igCheckboxFlags_UintPtr(native_label, native_flags, flags_value); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#endif + public static bool CheckboxFlags(string label, ref uint flags, uint flags_value) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + fixed (uint* native_flags = &flags) + { + byte ret = ImGuiNative.igCheckboxFlags_UintPtr(native_label, native_flags, flags_value); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } + public static void CloseCurrentPopup() + { + ImGuiNative.igCloseCurrentPopup(); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool CollapsingHeader(ReadOnlySpan label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + ImGuiTreeNodeFlags flags = (ImGuiTreeNodeFlags)0; + byte ret = ImGuiNative.igCollapsingHeader_TreeNodeFlags(native_label, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool CollapsingHeader(string label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + ImGuiTreeNodeFlags flags = (ImGuiTreeNodeFlags)0; + byte ret = ImGuiNative.igCollapsingHeader_TreeNodeFlags(native_label, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool CollapsingHeader(ReadOnlySpan label, ImGuiTreeNodeFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte ret = ImGuiNative.igCollapsingHeader_TreeNodeFlags(native_label, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool CollapsingHeader(string label, ImGuiTreeNodeFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte ret = ImGuiNative.igCollapsingHeader_TreeNodeFlags(native_label, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool CollapsingHeader(ReadOnlySpan label, ref bool p_visible) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte native_p_visible_val = p_visible ? (byte)1 : (byte)0; + byte* native_p_visible = &native_p_visible_val; + ImGuiTreeNodeFlags flags = (ImGuiTreeNodeFlags)0; + byte ret = ImGuiNative.igCollapsingHeader_BoolPtr(native_label, native_p_visible, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + p_visible = native_p_visible_val != 0; + return ret != 0; + } +#endif + public static bool CollapsingHeader(string label, ref bool p_visible) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte native_p_visible_val = p_visible ? (byte)1 : (byte)0; + byte* native_p_visible = &native_p_visible_val; + ImGuiTreeNodeFlags flags = (ImGuiTreeNodeFlags)0; + byte ret = ImGuiNative.igCollapsingHeader_BoolPtr(native_label, native_p_visible, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + p_visible = native_p_visible_val != 0; + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool CollapsingHeader(ReadOnlySpan label, ref bool p_visible, ImGuiTreeNodeFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte native_p_visible_val = p_visible ? (byte)1 : (byte)0; + byte* native_p_visible = &native_p_visible_val; + byte ret = ImGuiNative.igCollapsingHeader_BoolPtr(native_label, native_p_visible, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + p_visible = native_p_visible_val != 0; + return ret != 0; + } +#endif + public static bool CollapsingHeader(string label, ref bool p_visible, ImGuiTreeNodeFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte native_p_visible_val = p_visible ? (byte)1 : (byte)0; + byte* native_p_visible = &native_p_visible_val; + byte ret = ImGuiNative.igCollapsingHeader_BoolPtr(native_label, native_p_visible, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + p_visible = native_p_visible_val != 0; + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool ColorButton(ReadOnlySpan desc_id, Vector4 col) + { + byte* native_desc_id; + int desc_id_byteCount = 0; + if (desc_id != null) + { + desc_id_byteCount = Encoding.UTF8.GetByteCount(desc_id); + if (desc_id_byteCount > Util.StackAllocationSizeLimit) + { + native_desc_id = Util.Allocate(desc_id_byteCount + 1); + } + else + { + byte* native_desc_id_stackBytes = stackalloc byte[desc_id_byteCount + 1]; + native_desc_id = native_desc_id_stackBytes; + } + int native_desc_id_offset = Util.GetUtf8(desc_id, native_desc_id, desc_id_byteCount); + native_desc_id[native_desc_id_offset] = 0; + } + else { native_desc_id = null; } + ImGuiColorEditFlags flags = (ImGuiColorEditFlags)0; + Vector2 size = new Vector2(); + byte ret = ImGuiNative.igColorButton(native_desc_id, col, flags, size); + if (desc_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_desc_id); + } + return ret != 0; + } +#endif + public static bool ColorButton(string desc_id, Vector4 col) + { + byte* native_desc_id; + int desc_id_byteCount = 0; + if (desc_id != null) + { + desc_id_byteCount = Encoding.UTF8.GetByteCount(desc_id); + if (desc_id_byteCount > Util.StackAllocationSizeLimit) + { + native_desc_id = Util.Allocate(desc_id_byteCount + 1); + } + else + { + byte* native_desc_id_stackBytes = stackalloc byte[desc_id_byteCount + 1]; + native_desc_id = native_desc_id_stackBytes; + } + int native_desc_id_offset = Util.GetUtf8(desc_id, native_desc_id, desc_id_byteCount); + native_desc_id[native_desc_id_offset] = 0; + } + else { native_desc_id = null; } + ImGuiColorEditFlags flags = (ImGuiColorEditFlags)0; + Vector2 size = new Vector2(); + byte ret = ImGuiNative.igColorButton(native_desc_id, col, flags, size); + if (desc_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_desc_id); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool ColorButton(ReadOnlySpan desc_id, Vector4 col, ImGuiColorEditFlags flags) + { + byte* native_desc_id; + int desc_id_byteCount = 0; + if (desc_id != null) + { + desc_id_byteCount = Encoding.UTF8.GetByteCount(desc_id); + if (desc_id_byteCount > Util.StackAllocationSizeLimit) + { + native_desc_id = Util.Allocate(desc_id_byteCount + 1); + } + else + { + byte* native_desc_id_stackBytes = stackalloc byte[desc_id_byteCount + 1]; + native_desc_id = native_desc_id_stackBytes; + } + int native_desc_id_offset = Util.GetUtf8(desc_id, native_desc_id, desc_id_byteCount); + native_desc_id[native_desc_id_offset] = 0; + } + else { native_desc_id = null; } + Vector2 size = new Vector2(); + byte ret = ImGuiNative.igColorButton(native_desc_id, col, flags, size); + if (desc_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_desc_id); + } + return ret != 0; + } +#endif + public static bool ColorButton(string desc_id, Vector4 col, ImGuiColorEditFlags flags) + { + byte* native_desc_id; + int desc_id_byteCount = 0; + if (desc_id != null) + { + desc_id_byteCount = Encoding.UTF8.GetByteCount(desc_id); + if (desc_id_byteCount > Util.StackAllocationSizeLimit) + { + native_desc_id = Util.Allocate(desc_id_byteCount + 1); + } + else + { + byte* native_desc_id_stackBytes = stackalloc byte[desc_id_byteCount + 1]; + native_desc_id = native_desc_id_stackBytes; + } + int native_desc_id_offset = Util.GetUtf8(desc_id, native_desc_id, desc_id_byteCount); + native_desc_id[native_desc_id_offset] = 0; + } + else { native_desc_id = null; } + Vector2 size = new Vector2(); + byte ret = ImGuiNative.igColorButton(native_desc_id, col, flags, size); + if (desc_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_desc_id); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool ColorButton(ReadOnlySpan desc_id, Vector4 col, ImGuiColorEditFlags flags, Vector2 size) + { + byte* native_desc_id; + int desc_id_byteCount = 0; + if (desc_id != null) + { + desc_id_byteCount = Encoding.UTF8.GetByteCount(desc_id); + if (desc_id_byteCount > Util.StackAllocationSizeLimit) + { + native_desc_id = Util.Allocate(desc_id_byteCount + 1); + } + else + { + byte* native_desc_id_stackBytes = stackalloc byte[desc_id_byteCount + 1]; + native_desc_id = native_desc_id_stackBytes; + } + int native_desc_id_offset = Util.GetUtf8(desc_id, native_desc_id, desc_id_byteCount); + native_desc_id[native_desc_id_offset] = 0; + } + else { native_desc_id = null; } + byte ret = ImGuiNative.igColorButton(native_desc_id, col, flags, size); + if (desc_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_desc_id); + } + return ret != 0; + } +#endif + public static bool ColorButton(string desc_id, Vector4 col, ImGuiColorEditFlags flags, Vector2 size) + { + byte* native_desc_id; + int desc_id_byteCount = 0; + if (desc_id != null) + { + desc_id_byteCount = Encoding.UTF8.GetByteCount(desc_id); + if (desc_id_byteCount > Util.StackAllocationSizeLimit) + { + native_desc_id = Util.Allocate(desc_id_byteCount + 1); + } + else + { + byte* native_desc_id_stackBytes = stackalloc byte[desc_id_byteCount + 1]; + native_desc_id = native_desc_id_stackBytes; + } + int native_desc_id_offset = Util.GetUtf8(desc_id, native_desc_id, desc_id_byteCount); + native_desc_id[native_desc_id_offset] = 0; + } + else { native_desc_id = null; } + byte ret = ImGuiNative.igColorButton(native_desc_id, col, flags, size); + if (desc_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_desc_id); + } + return ret != 0; + } + public static uint ColorConvertFloat4ToU32(Vector4 @in) + { + uint ret = ImGuiNative.igColorConvertFloat4ToU32(@in); + return ret; + } + public static void ColorConvertHSVtoRGB(float h, float s, float v, out float out_r, out float out_g, out float out_b) + { + fixed (float* native_out_r = &out_r) + { + fixed (float* native_out_g = &out_g) + { + fixed (float* native_out_b = &out_b) + { + ImGuiNative.igColorConvertHSVtoRGB(h, s, v, native_out_r, native_out_g, native_out_b); + } + } + } + } + public static void ColorConvertRGBtoHSV(float r, float g, float b, out float out_h, out float out_s, out float out_v) + { + fixed (float* native_out_h = &out_h) + { + fixed (float* native_out_s = &out_s) + { + fixed (float* native_out_v = &out_v) + { + ImGuiNative.igColorConvertRGBtoHSV(r, g, b, native_out_h, native_out_s, native_out_v); + } + } + } + } + public static Vector4 ColorConvertU32ToFloat4(uint @in) + { + Vector4 __retval; + ImGuiNative.igColorConvertU32ToFloat4(&__retval, @in); + return __retval; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool ColorEdit3(ReadOnlySpan label, ref Vector3 col) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + ImGuiColorEditFlags flags = (ImGuiColorEditFlags)0; + fixed (Vector3* native_col = &col) + { + byte ret = ImGuiNative.igColorEdit3(native_label, native_col, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#endif + public static bool ColorEdit3(string label, ref Vector3 col) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + ImGuiColorEditFlags flags = (ImGuiColorEditFlags)0; + fixed (Vector3* native_col = &col) + { + byte ret = ImGuiNative.igColorEdit3(native_label, native_col, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool ColorEdit3(ReadOnlySpan label, ref Vector3 col, ImGuiColorEditFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + fixed (Vector3* native_col = &col) + { + byte ret = ImGuiNative.igColorEdit3(native_label, native_col, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#endif + public static bool ColorEdit3(string label, ref Vector3 col, ImGuiColorEditFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + fixed (Vector3* native_col = &col) + { + byte ret = ImGuiNative.igColorEdit3(native_label, native_col, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool ColorEdit4(ReadOnlySpan label, ref Vector4 col) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + ImGuiColorEditFlags flags = (ImGuiColorEditFlags)0; + fixed (Vector4* native_col = &col) + { + byte ret = ImGuiNative.igColorEdit4(native_label, native_col, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#endif + public static bool ColorEdit4(string label, ref Vector4 col) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + ImGuiColorEditFlags flags = (ImGuiColorEditFlags)0; + fixed (Vector4* native_col = &col) + { + byte ret = ImGuiNative.igColorEdit4(native_label, native_col, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool ColorEdit4(ReadOnlySpan label, ref Vector4 col, ImGuiColorEditFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + fixed (Vector4* native_col = &col) + { + byte ret = ImGuiNative.igColorEdit4(native_label, native_col, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#endif + public static bool ColorEdit4(string label, ref Vector4 col, ImGuiColorEditFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + fixed (Vector4* native_col = &col) + { + byte ret = ImGuiNative.igColorEdit4(native_label, native_col, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool ColorPicker3(ReadOnlySpan label, ref Vector3 col) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + ImGuiColorEditFlags flags = (ImGuiColorEditFlags)0; + fixed (Vector3* native_col = &col) + { + byte ret = ImGuiNative.igColorPicker3(native_label, native_col, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#endif + public static bool ColorPicker3(string label, ref Vector3 col) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + ImGuiColorEditFlags flags = (ImGuiColorEditFlags)0; + fixed (Vector3* native_col = &col) + { + byte ret = ImGuiNative.igColorPicker3(native_label, native_col, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool ColorPicker3(ReadOnlySpan label, ref Vector3 col, ImGuiColorEditFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + fixed (Vector3* native_col = &col) + { + byte ret = ImGuiNative.igColorPicker3(native_label, native_col, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#endif + public static bool ColorPicker3(string label, ref Vector3 col, ImGuiColorEditFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + fixed (Vector3* native_col = &col) + { + byte ret = ImGuiNative.igColorPicker3(native_label, native_col, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool ColorPicker4(ReadOnlySpan label, ref Vector4 col) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + ImGuiColorEditFlags flags = (ImGuiColorEditFlags)0; + float* ref_col = null; + fixed (Vector4* native_col = &col) + { + byte ret = ImGuiNative.igColorPicker4(native_label, native_col, flags, ref_col); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#endif + public static bool ColorPicker4(string label, ref Vector4 col) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + ImGuiColorEditFlags flags = (ImGuiColorEditFlags)0; + float* ref_col = null; + fixed (Vector4* native_col = &col) + { + byte ret = ImGuiNative.igColorPicker4(native_label, native_col, flags, ref_col); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool ColorPicker4(ReadOnlySpan label, ref Vector4 col, ImGuiColorEditFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float* ref_col = null; + fixed (Vector4* native_col = &col) + { + byte ret = ImGuiNative.igColorPicker4(native_label, native_col, flags, ref_col); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#endif + public static bool ColorPicker4(string label, ref Vector4 col, ImGuiColorEditFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float* ref_col = null; + fixed (Vector4* native_col = &col) + { + byte ret = ImGuiNative.igColorPicker4(native_label, native_col, flags, ref_col); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool ColorPicker4(ReadOnlySpan label, ref Vector4 col, ImGuiColorEditFlags flags, ref float ref_col) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + fixed (Vector4* native_col = &col) + { + fixed (float* native_ref_col = &ref_col) + { + byte ret = ImGuiNative.igColorPicker4(native_label, native_col, flags, native_ref_col); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } + } +#endif + public static bool ColorPicker4(string label, ref Vector4 col, ImGuiColorEditFlags flags, ref float ref_col) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + fixed (Vector4* native_col = &col) + { + fixed (float* native_ref_col = &ref_col) + { + byte ret = ImGuiNative.igColorPicker4(native_label, native_col, flags, native_ref_col); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } + } + public static void Columns() + { + int count = 1; + byte* native_id = null; + byte border = 1; + ImGuiNative.igColumns(count, native_id, border); + } + public static void Columns(int count) + { + byte* native_id = null; + byte border = 1; + ImGuiNative.igColumns(count, native_id, border); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void Columns(int count, ReadOnlySpan id) + { + byte* native_id; + int id_byteCount = 0; + if (id != null) + { + id_byteCount = Encoding.UTF8.GetByteCount(id); + if (id_byteCount > Util.StackAllocationSizeLimit) + { + native_id = Util.Allocate(id_byteCount + 1); + } + else + { + byte* native_id_stackBytes = stackalloc byte[id_byteCount + 1]; + native_id = native_id_stackBytes; + } + int native_id_offset = Util.GetUtf8(id, native_id, id_byteCount); + native_id[native_id_offset] = 0; + } + else { native_id = null; } + byte border = 1; + ImGuiNative.igColumns(count, native_id, border); + if (id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_id); + } + } +#endif + public static void Columns(int count, string id) + { + byte* native_id; + int id_byteCount = 0; + if (id != null) + { + id_byteCount = Encoding.UTF8.GetByteCount(id); + if (id_byteCount > Util.StackAllocationSizeLimit) + { + native_id = Util.Allocate(id_byteCount + 1); + } + else + { + byte* native_id_stackBytes = stackalloc byte[id_byteCount + 1]; + native_id = native_id_stackBytes; + } + int native_id_offset = Util.GetUtf8(id, native_id, id_byteCount); + native_id[native_id_offset] = 0; + } + else { native_id = null; } + byte border = 1; + ImGuiNative.igColumns(count, native_id, border); + if (id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_id); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void Columns(int count, ReadOnlySpan id, bool border) + { + byte* native_id; + int id_byteCount = 0; + if (id != null) + { + id_byteCount = Encoding.UTF8.GetByteCount(id); + if (id_byteCount > Util.StackAllocationSizeLimit) + { + native_id = Util.Allocate(id_byteCount + 1); + } + else + { + byte* native_id_stackBytes = stackalloc byte[id_byteCount + 1]; + native_id = native_id_stackBytes; + } + int native_id_offset = Util.GetUtf8(id, native_id, id_byteCount); + native_id[native_id_offset] = 0; + } + else { native_id = null; } + byte native_border = border ? (byte)1 : (byte)0; + ImGuiNative.igColumns(count, native_id, native_border); + if (id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_id); + } + } +#endif + public static void Columns(int count, string id, bool border) + { + byte* native_id; + int id_byteCount = 0; + if (id != null) + { + id_byteCount = Encoding.UTF8.GetByteCount(id); + if (id_byteCount > Util.StackAllocationSizeLimit) + { + native_id = Util.Allocate(id_byteCount + 1); + } + else + { + byte* native_id_stackBytes = stackalloc byte[id_byteCount + 1]; + native_id = native_id_stackBytes; + } + int native_id_offset = Util.GetUtf8(id, native_id, id_byteCount); + native_id[native_id_offset] = 0; + } + else { native_id = null; } + byte native_border = border ? (byte)1 : (byte)0; + ImGuiNative.igColumns(count, native_id, native_border); + if (id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_id); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool Combo(ReadOnlySpan label, ref int current_item, string[] items, int items_count) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int* items_byteCounts = stackalloc int[items.Length]; + int items_byteCount = 0; + for (int i = 0; i < items.Length; i++) + { + string s = items[i]; + items_byteCounts[i] = Encoding.UTF8.GetByteCount(s); + items_byteCount += items_byteCounts[i] + 1; + } + byte* native_items_data = stackalloc byte[items_byteCount]; + int offset = 0; + for (int i = 0; i < items.Length; i++) + { + string s = items[i]; + offset += Util.GetUtf8(s, native_items_data + offset, items_byteCounts[i]); + native_items_data[offset++] = 0; + } + byte** native_items = stackalloc byte*[items.Length]; + offset = 0; + for (int i = 0; i < items.Length; i++) + { + native_items[i] = &native_items_data[offset]; + offset += items_byteCounts[i] + 1; + } + int popup_max_height_in_items = -1; + fixed (int* native_current_item = ¤t_item) + { + byte ret = ImGuiNative.igCombo_Str_arr(native_label, native_current_item, native_items, items_count, popup_max_height_in_items); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#endif + public static bool Combo(string label, ref int current_item, string[] items, int items_count) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int* items_byteCounts = stackalloc int[items.Length]; + int items_byteCount = 0; + for (int i = 0; i < items.Length; i++) + { + string s = items[i]; + items_byteCounts[i] = Encoding.UTF8.GetByteCount(s); + items_byteCount += items_byteCounts[i] + 1; + } + byte* native_items_data = stackalloc byte[items_byteCount]; + int offset = 0; + for (int i = 0; i < items.Length; i++) + { + string s = items[i]; + offset += Util.GetUtf8(s, native_items_data + offset, items_byteCounts[i]); + native_items_data[offset++] = 0; + } + byte** native_items = stackalloc byte*[items.Length]; + offset = 0; + for (int i = 0; i < items.Length; i++) + { + native_items[i] = &native_items_data[offset]; + offset += items_byteCounts[i] + 1; + } + int popup_max_height_in_items = -1; + fixed (int* native_current_item = ¤t_item) + { + byte ret = ImGuiNative.igCombo_Str_arr(native_label, native_current_item, native_items, items_count, popup_max_height_in_items); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool Combo(ReadOnlySpan label, ref int current_item, string[] items, int items_count, int popup_max_height_in_items) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int* items_byteCounts = stackalloc int[items.Length]; + int items_byteCount = 0; + for (int i = 0; i < items.Length; i++) + { + string s = items[i]; + items_byteCounts[i] = Encoding.UTF8.GetByteCount(s); + items_byteCount += items_byteCounts[i] + 1; + } + byte* native_items_data = stackalloc byte[items_byteCount]; + int offset = 0; + for (int i = 0; i < items.Length; i++) + { + string s = items[i]; + offset += Util.GetUtf8(s, native_items_data + offset, items_byteCounts[i]); + native_items_data[offset++] = 0; + } + byte** native_items = stackalloc byte*[items.Length]; + offset = 0; + for (int i = 0; i < items.Length; i++) + { + native_items[i] = &native_items_data[offset]; + offset += items_byteCounts[i] + 1; + } + fixed (int* native_current_item = ¤t_item) + { + byte ret = ImGuiNative.igCombo_Str_arr(native_label, native_current_item, native_items, items_count, popup_max_height_in_items); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#endif + public static bool Combo(string label, ref int current_item, string[] items, int items_count, int popup_max_height_in_items) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int* items_byteCounts = stackalloc int[items.Length]; + int items_byteCount = 0; + for (int i = 0; i < items.Length; i++) + { + string s = items[i]; + items_byteCounts[i] = Encoding.UTF8.GetByteCount(s); + items_byteCount += items_byteCounts[i] + 1; + } + byte* native_items_data = stackalloc byte[items_byteCount]; + int offset = 0; + for (int i = 0; i < items.Length; i++) + { + string s = items[i]; + offset += Util.GetUtf8(s, native_items_data + offset, items_byteCounts[i]); + native_items_data[offset++] = 0; + } + byte** native_items = stackalloc byte*[items.Length]; + offset = 0; + for (int i = 0; i < items.Length; i++) + { + native_items[i] = &native_items_data[offset]; + offset += items_byteCounts[i] + 1; + } + fixed (int* native_current_item = ¤t_item) + { + byte ret = ImGuiNative.igCombo_Str_arr(native_label, native_current_item, native_items, items_count, popup_max_height_in_items); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool Combo(ReadOnlySpan label, ref int current_item, ReadOnlySpan items_separated_by_zeros) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_items_separated_by_zeros; + int items_separated_by_zeros_byteCount = 0; + if (items_separated_by_zeros != null) + { + items_separated_by_zeros_byteCount = Encoding.UTF8.GetByteCount(items_separated_by_zeros); + if (items_separated_by_zeros_byteCount > Util.StackAllocationSizeLimit) + { + native_items_separated_by_zeros = Util.Allocate(items_separated_by_zeros_byteCount + 1); + } + else + { + byte* native_items_separated_by_zeros_stackBytes = stackalloc byte[items_separated_by_zeros_byteCount + 1]; + native_items_separated_by_zeros = native_items_separated_by_zeros_stackBytes; + } + int native_items_separated_by_zeros_offset = Util.GetUtf8(items_separated_by_zeros, native_items_separated_by_zeros, items_separated_by_zeros_byteCount); + native_items_separated_by_zeros[native_items_separated_by_zeros_offset] = 0; + } + else { native_items_separated_by_zeros = null; } + int popup_max_height_in_items = -1; + fixed (int* native_current_item = ¤t_item) + { + byte ret = ImGuiNative.igCombo_Str(native_label, native_current_item, native_items_separated_by_zeros, popup_max_height_in_items); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (items_separated_by_zeros_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_items_separated_by_zeros); + } + return ret != 0; + } + } +#endif + public static bool Combo(string label, ref int current_item, string items_separated_by_zeros) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_items_separated_by_zeros; + int items_separated_by_zeros_byteCount = 0; + if (items_separated_by_zeros != null) + { + items_separated_by_zeros_byteCount = Encoding.UTF8.GetByteCount(items_separated_by_zeros); + if (items_separated_by_zeros_byteCount > Util.StackAllocationSizeLimit) + { + native_items_separated_by_zeros = Util.Allocate(items_separated_by_zeros_byteCount + 1); + } + else + { + byte* native_items_separated_by_zeros_stackBytes = stackalloc byte[items_separated_by_zeros_byteCount + 1]; + native_items_separated_by_zeros = native_items_separated_by_zeros_stackBytes; + } + int native_items_separated_by_zeros_offset = Util.GetUtf8(items_separated_by_zeros, native_items_separated_by_zeros, items_separated_by_zeros_byteCount); + native_items_separated_by_zeros[native_items_separated_by_zeros_offset] = 0; + } + else { native_items_separated_by_zeros = null; } + int popup_max_height_in_items = -1; + fixed (int* native_current_item = ¤t_item) + { + byte ret = ImGuiNative.igCombo_Str(native_label, native_current_item, native_items_separated_by_zeros, popup_max_height_in_items); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (items_separated_by_zeros_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_items_separated_by_zeros); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool Combo(ReadOnlySpan label, ref int current_item, ReadOnlySpan items_separated_by_zeros, int popup_max_height_in_items) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_items_separated_by_zeros; + int items_separated_by_zeros_byteCount = 0; + if (items_separated_by_zeros != null) + { + items_separated_by_zeros_byteCount = Encoding.UTF8.GetByteCount(items_separated_by_zeros); + if (items_separated_by_zeros_byteCount > Util.StackAllocationSizeLimit) + { + native_items_separated_by_zeros = Util.Allocate(items_separated_by_zeros_byteCount + 1); + } + else + { + byte* native_items_separated_by_zeros_stackBytes = stackalloc byte[items_separated_by_zeros_byteCount + 1]; + native_items_separated_by_zeros = native_items_separated_by_zeros_stackBytes; + } + int native_items_separated_by_zeros_offset = Util.GetUtf8(items_separated_by_zeros, native_items_separated_by_zeros, items_separated_by_zeros_byteCount); + native_items_separated_by_zeros[native_items_separated_by_zeros_offset] = 0; + } + else { native_items_separated_by_zeros = null; } + fixed (int* native_current_item = ¤t_item) + { + byte ret = ImGuiNative.igCombo_Str(native_label, native_current_item, native_items_separated_by_zeros, popup_max_height_in_items); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (items_separated_by_zeros_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_items_separated_by_zeros); + } + return ret != 0; + } + } +#endif + public static bool Combo(string label, ref int current_item, string items_separated_by_zeros, int popup_max_height_in_items) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_items_separated_by_zeros; + int items_separated_by_zeros_byteCount = 0; + if (items_separated_by_zeros != null) + { + items_separated_by_zeros_byteCount = Encoding.UTF8.GetByteCount(items_separated_by_zeros); + if (items_separated_by_zeros_byteCount > Util.StackAllocationSizeLimit) + { + native_items_separated_by_zeros = Util.Allocate(items_separated_by_zeros_byteCount + 1); + } + else + { + byte* native_items_separated_by_zeros_stackBytes = stackalloc byte[items_separated_by_zeros_byteCount + 1]; + native_items_separated_by_zeros = native_items_separated_by_zeros_stackBytes; + } + int native_items_separated_by_zeros_offset = Util.GetUtf8(items_separated_by_zeros, native_items_separated_by_zeros, items_separated_by_zeros_byteCount); + native_items_separated_by_zeros[native_items_separated_by_zeros_offset] = 0; + } + else { native_items_separated_by_zeros = null; } + fixed (int* native_current_item = ¤t_item) + { + byte ret = ImGuiNative.igCombo_Str(native_label, native_current_item, native_items_separated_by_zeros, popup_max_height_in_items); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (items_separated_by_zeros_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_items_separated_by_zeros); + } + return ret != 0; + } + } + public static IntPtr CreateContext() + { + ImFontAtlas* shared_font_atlas = null; + IntPtr ret = ImGuiNative.igCreateContext(shared_font_atlas); + return ret; + } + public static IntPtr CreateContext(ImFontAtlasPtr shared_font_atlas) + { + ImFontAtlas* native_shared_font_atlas = shared_font_atlas.NativePtr; + IntPtr ret = ImGuiNative.igCreateContext(native_shared_font_atlas); + return ret; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DebugCheckVersionAndDataLayout(ReadOnlySpan version_str, uint sz_io, uint sz_style, uint sz_vec2, uint sz_vec4, uint sz_drawvert, uint sz_drawidx) + { + byte* native_version_str; + int version_str_byteCount = 0; + if (version_str != null) + { + version_str_byteCount = Encoding.UTF8.GetByteCount(version_str); + if (version_str_byteCount > Util.StackAllocationSizeLimit) + { + native_version_str = Util.Allocate(version_str_byteCount + 1); + } + else + { + byte* native_version_str_stackBytes = stackalloc byte[version_str_byteCount + 1]; + native_version_str = native_version_str_stackBytes; + } + int native_version_str_offset = Util.GetUtf8(version_str, native_version_str, version_str_byteCount); + native_version_str[native_version_str_offset] = 0; + } + else { native_version_str = null; } + byte ret = ImGuiNative.igDebugCheckVersionAndDataLayout(native_version_str, sz_io, sz_style, sz_vec2, sz_vec4, sz_drawvert, sz_drawidx); + if (version_str_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_version_str); + } + return ret != 0; + } +#endif + public static bool DebugCheckVersionAndDataLayout(string version_str, uint sz_io, uint sz_style, uint sz_vec2, uint sz_vec4, uint sz_drawvert, uint sz_drawidx) + { + byte* native_version_str; + int version_str_byteCount = 0; + if (version_str != null) + { + version_str_byteCount = Encoding.UTF8.GetByteCount(version_str); + if (version_str_byteCount > Util.StackAllocationSizeLimit) + { + native_version_str = Util.Allocate(version_str_byteCount + 1); + } + else + { + byte* native_version_str_stackBytes = stackalloc byte[version_str_byteCount + 1]; + native_version_str = native_version_str_stackBytes; + } + int native_version_str_offset = Util.GetUtf8(version_str, native_version_str, version_str_byteCount); + native_version_str[native_version_str_offset] = 0; + } + else { native_version_str = null; } + byte ret = ImGuiNative.igDebugCheckVersionAndDataLayout(native_version_str, sz_io, sz_style, sz_vec2, sz_vec4, sz_drawvert, sz_drawidx); + if (version_str_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_version_str); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void DebugTextEncoding(ReadOnlySpan text) + { + byte* native_text; + int text_byteCount = 0; + if (text != null) + { + text_byteCount = Encoding.UTF8.GetByteCount(text); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + native_text = Util.Allocate(text_byteCount + 1); + } + else + { + byte* native_text_stackBytes = stackalloc byte[text_byteCount + 1]; + native_text = native_text_stackBytes; + } + int native_text_offset = Util.GetUtf8(text, native_text, text_byteCount); + native_text[native_text_offset] = 0; + } + else { native_text = null; } + ImGuiNative.igDebugTextEncoding(native_text); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text); + } + } +#endif + public static void DebugTextEncoding(string text) + { + byte* native_text; + int text_byteCount = 0; + if (text != null) + { + text_byteCount = Encoding.UTF8.GetByteCount(text); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + native_text = Util.Allocate(text_byteCount + 1); + } + else + { + byte* native_text_stackBytes = stackalloc byte[text_byteCount + 1]; + native_text = native_text_stackBytes; + } + int native_text_offset = Util.GetUtf8(text, native_text, text_byteCount); + native_text[native_text_offset] = 0; + } + else { native_text = null; } + ImGuiNative.igDebugTextEncoding(native_text); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text); + } + } + public static void DestroyContext() + { + IntPtr ctx = IntPtr.Zero; + ImGuiNative.igDestroyContext(ctx); + } + public static void DestroyContext(IntPtr ctx) + { + ImGuiNative.igDestroyContext(ctx); + } + public static void DestroyPlatformWindows() + { + ImGuiNative.igDestroyPlatformWindows(); + } + public static uint DockSpace(uint id) + { + Vector2 size = new Vector2(); + ImGuiDockNodeFlags flags = (ImGuiDockNodeFlags)0; + ImGuiWindowClass* window_class = null; + uint ret = ImGuiNative.igDockSpace(id, size, flags, window_class); + return ret; + } + public static uint DockSpace(uint id, Vector2 size) + { + ImGuiDockNodeFlags flags = (ImGuiDockNodeFlags)0; + ImGuiWindowClass* window_class = null; + uint ret = ImGuiNative.igDockSpace(id, size, flags, window_class); + return ret; + } + public static uint DockSpace(uint id, Vector2 size, ImGuiDockNodeFlags flags) + { + ImGuiWindowClass* window_class = null; + uint ret = ImGuiNative.igDockSpace(id, size, flags, window_class); + return ret; + } + public static uint DockSpace(uint id, Vector2 size, ImGuiDockNodeFlags flags, ImGuiWindowClassPtr window_class) + { + ImGuiWindowClass* native_window_class = window_class.NativePtr; + uint ret = ImGuiNative.igDockSpace(id, size, flags, native_window_class); + return ret; + } + public static uint DockSpaceOverViewport() + { + ImGuiViewport* viewport = null; + ImGuiDockNodeFlags flags = (ImGuiDockNodeFlags)0; + ImGuiWindowClass* window_class = null; + uint ret = ImGuiNative.igDockSpaceOverViewport(viewport, flags, window_class); + return ret; + } + public static uint DockSpaceOverViewport(ImGuiViewportPtr viewport) + { + ImGuiViewport* native_viewport = viewport.NativePtr; + ImGuiDockNodeFlags flags = (ImGuiDockNodeFlags)0; + ImGuiWindowClass* window_class = null; + uint ret = ImGuiNative.igDockSpaceOverViewport(native_viewport, flags, window_class); + return ret; + } + public static uint DockSpaceOverViewport(ImGuiViewportPtr viewport, ImGuiDockNodeFlags flags) + { + ImGuiViewport* native_viewport = viewport.NativePtr; + ImGuiWindowClass* window_class = null; + uint ret = ImGuiNative.igDockSpaceOverViewport(native_viewport, flags, window_class); + return ret; + } + public static uint DockSpaceOverViewport(ImGuiViewportPtr viewport, ImGuiDockNodeFlags flags, ImGuiWindowClassPtr window_class) + { + ImGuiViewport* native_viewport = viewport.NativePtr; + ImGuiWindowClass* native_window_class = window_class.NativePtr; + uint ret = ImGuiNative.igDockSpaceOverViewport(native_viewport, flags, native_window_class); + return ret; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragFloat(ReadOnlySpan label, ref float v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_speed = 1.0f; + float v_min = 0.0f; + float v_max = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragFloat(string label, ref float v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_speed = 1.0f; + float v_min = 0.0f; + float v_max = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragFloat(ReadOnlySpan label, ref float v, float v_speed) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_min = 0.0f; + float v_max = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragFloat(string label, ref float v, float v_speed) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_min = 0.0f; + float v_max = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragFloat(ReadOnlySpan label, ref float v, float v_speed, float v_min) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_max = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragFloat(string label, ref float v, float v_speed, float v_min) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_max = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragFloat(ReadOnlySpan label, ref float v, float v_speed, float v_min, float v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragFloat(string label, ref float v, float v_speed, float v_min, float v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragFloat(ReadOnlySpan label, ref float v, float v_speed, float v_min, float v_max, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragFloat(string label, ref float v, float v_speed, float v_min, float v_max, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragFloat(ReadOnlySpan label, ref float v, float v_speed, float v_min, float v_max, ReadOnlySpan format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragFloat(string label, ref float v, float v_speed, float v_min, float v_max, string format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragFloat2(ReadOnlySpan label, ref Vector2 v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_speed = 1.0f; + float v_min = 0.0f; + float v_max = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector2* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat2(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragFloat2(string label, ref Vector2 v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_speed = 1.0f; + float v_min = 0.0f; + float v_max = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector2* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat2(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragFloat2(ReadOnlySpan label, ref Vector2 v, float v_speed) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_min = 0.0f; + float v_max = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector2* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat2(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragFloat2(string label, ref Vector2 v, float v_speed) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_min = 0.0f; + float v_max = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector2* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat2(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragFloat2(ReadOnlySpan label, ref Vector2 v, float v_speed, float v_min) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_max = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector2* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat2(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragFloat2(string label, ref Vector2 v, float v_speed, float v_min) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_max = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector2* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat2(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragFloat2(ReadOnlySpan label, ref Vector2 v, float v_speed, float v_min, float v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector2* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat2(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragFloat2(string label, ref Vector2 v, float v_speed, float v_min, float v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector2* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat2(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragFloat2(ReadOnlySpan label, ref Vector2 v, float v_speed, float v_min, float v_max, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector2* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat2(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragFloat2(string label, ref Vector2 v, float v_speed, float v_min, float v_max, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector2* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat2(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragFloat2(ReadOnlySpan label, ref Vector2 v, float v_speed, float v_min, float v_max, ReadOnlySpan format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (Vector2* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat2(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragFloat2(string label, ref Vector2 v, float v_speed, float v_min, float v_max, string format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (Vector2* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat2(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragFloat3(ReadOnlySpan label, ref Vector3 v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_speed = 1.0f; + float v_min = 0.0f; + float v_max = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector3* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat3(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragFloat3(string label, ref Vector3 v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_speed = 1.0f; + float v_min = 0.0f; + float v_max = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector3* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat3(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragFloat3(ReadOnlySpan label, ref Vector3 v, float v_speed) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_min = 0.0f; + float v_max = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector3* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat3(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragFloat3(string label, ref Vector3 v, float v_speed) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_min = 0.0f; + float v_max = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector3* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat3(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragFloat3(ReadOnlySpan label, ref Vector3 v, float v_speed, float v_min) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_max = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector3* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat3(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragFloat3(string label, ref Vector3 v, float v_speed, float v_min) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_max = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector3* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat3(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragFloat3(ReadOnlySpan label, ref Vector3 v, float v_speed, float v_min, float v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector3* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat3(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragFloat3(string label, ref Vector3 v, float v_speed, float v_min, float v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector3* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat3(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragFloat3(ReadOnlySpan label, ref Vector3 v, float v_speed, float v_min, float v_max, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector3* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat3(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragFloat3(string label, ref Vector3 v, float v_speed, float v_min, float v_max, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector3* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat3(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragFloat3(ReadOnlySpan label, ref Vector3 v, float v_speed, float v_min, float v_max, ReadOnlySpan format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (Vector3* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat3(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragFloat3(string label, ref Vector3 v, float v_speed, float v_min, float v_max, string format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (Vector3* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat3(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragFloat4(ReadOnlySpan label, ref Vector4 v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_speed = 1.0f; + float v_min = 0.0f; + float v_max = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector4* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat4(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragFloat4(string label, ref Vector4 v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_speed = 1.0f; + float v_min = 0.0f; + float v_max = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector4* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat4(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragFloat4(ReadOnlySpan label, ref Vector4 v, float v_speed) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_min = 0.0f; + float v_max = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector4* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat4(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragFloat4(string label, ref Vector4 v, float v_speed) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_min = 0.0f; + float v_max = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector4* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat4(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragFloat4(ReadOnlySpan label, ref Vector4 v, float v_speed, float v_min) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_max = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector4* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat4(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragFloat4(string label, ref Vector4 v, float v_speed, float v_min) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_max = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector4* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat4(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragFloat4(ReadOnlySpan label, ref Vector4 v, float v_speed, float v_min, float v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector4* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat4(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragFloat4(string label, ref Vector4 v, float v_speed, float v_min, float v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector4* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat4(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragFloat4(ReadOnlySpan label, ref Vector4 v, float v_speed, float v_min, float v_max, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector4* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat4(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragFloat4(string label, ref Vector4 v, float v_speed, float v_min, float v_max, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector4* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat4(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragFloat4(ReadOnlySpan label, ref Vector4 v, float v_speed, float v_min, float v_max, ReadOnlySpan format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (Vector4* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat4(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragFloat4(string label, ref Vector4 v, float v_speed, float v_min, float v_max, string format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (Vector4* native_v = &v) + { + byte ret = ImGuiNative.igDragFloat4(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragFloatRange2(ReadOnlySpan label, ref float v_current_min, ref float v_current_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_speed = 1.0f; + float v_min = 0.0f; + float v_max = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + byte* native_format_max = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v_current_min = &v_current_min) + { + fixed (float* native_v_current_max = &v_current_max) + { + byte ret = ImGuiNative.igDragFloatRange2(native_label, native_v_current_min, native_v_current_max, v_speed, v_min, v_max, native_format, native_format_max, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } + } +#endif + public static bool DragFloatRange2(string label, ref float v_current_min, ref float v_current_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_speed = 1.0f; + float v_min = 0.0f; + float v_max = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + byte* native_format_max = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v_current_min = &v_current_min) + { + fixed (float* native_v_current_max = &v_current_max) + { + byte ret = ImGuiNative.igDragFloatRange2(native_label, native_v_current_min, native_v_current_max, v_speed, v_min, v_max, native_format, native_format_max, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragFloatRange2(ReadOnlySpan label, ref float v_current_min, ref float v_current_max, float v_speed) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_min = 0.0f; + float v_max = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + byte* native_format_max = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v_current_min = &v_current_min) + { + fixed (float* native_v_current_max = &v_current_max) + { + byte ret = ImGuiNative.igDragFloatRange2(native_label, native_v_current_min, native_v_current_max, v_speed, v_min, v_max, native_format, native_format_max, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } + } +#endif + public static bool DragFloatRange2(string label, ref float v_current_min, ref float v_current_max, float v_speed) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_min = 0.0f; + float v_max = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + byte* native_format_max = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v_current_min = &v_current_min) + { + fixed (float* native_v_current_max = &v_current_max) + { + byte ret = ImGuiNative.igDragFloatRange2(native_label, native_v_current_min, native_v_current_max, v_speed, v_min, v_max, native_format, native_format_max, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragFloatRange2(ReadOnlySpan label, ref float v_current_min, ref float v_current_max, float v_speed, float v_min) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_max = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + byte* native_format_max = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v_current_min = &v_current_min) + { + fixed (float* native_v_current_max = &v_current_max) + { + byte ret = ImGuiNative.igDragFloatRange2(native_label, native_v_current_min, native_v_current_max, v_speed, v_min, v_max, native_format, native_format_max, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } + } +#endif + public static bool DragFloatRange2(string label, ref float v_current_min, ref float v_current_max, float v_speed, float v_min) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_max = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + byte* native_format_max = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v_current_min = &v_current_min) + { + fixed (float* native_v_current_max = &v_current_max) + { + byte ret = ImGuiNative.igDragFloatRange2(native_label, native_v_current_min, native_v_current_max, v_speed, v_min, v_max, native_format, native_format_max, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragFloatRange2(ReadOnlySpan label, ref float v_current_min, ref float v_current_max, float v_speed, float v_min, float v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + byte* native_format_max = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v_current_min = &v_current_min) + { + fixed (float* native_v_current_max = &v_current_max) + { + byte ret = ImGuiNative.igDragFloatRange2(native_label, native_v_current_min, native_v_current_max, v_speed, v_min, v_max, native_format, native_format_max, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } + } +#endif + public static bool DragFloatRange2(string label, ref float v_current_min, ref float v_current_max, float v_speed, float v_min, float v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + byte* native_format_max = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v_current_min = &v_current_min) + { + fixed (float* native_v_current_max = &v_current_max) + { + byte ret = ImGuiNative.igDragFloatRange2(native_label, native_v_current_min, native_v_current_max, v_speed, v_min, v_max, native_format, native_format_max, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragFloatRange2(ReadOnlySpan label, ref float v_current_min, ref float v_current_max, float v_speed, float v_min, float v_max, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + byte* native_format_max = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v_current_min = &v_current_min) + { + fixed (float* native_v_current_max = &v_current_max) + { + byte ret = ImGuiNative.igDragFloatRange2(native_label, native_v_current_min, native_v_current_max, v_speed, v_min, v_max, native_format, native_format_max, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } + } +#endif + public static bool DragFloatRange2(string label, ref float v_current_min, ref float v_current_max, float v_speed, float v_min, float v_max, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + byte* native_format_max = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v_current_min = &v_current_min) + { + fixed (float* native_v_current_max = &v_current_max) + { + byte ret = ImGuiNative.igDragFloatRange2(native_label, native_v_current_min, native_v_current_max, v_speed, v_min, v_max, native_format, native_format_max, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragFloatRange2(ReadOnlySpan label, ref float v_current_min, ref float v_current_max, float v_speed, float v_min, float v_max, ReadOnlySpan format, ReadOnlySpan format_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + byte* native_format_max; + int format_max_byteCount = 0; + if (format_max != null) + { + format_max_byteCount = Encoding.UTF8.GetByteCount(format_max); + if (format_max_byteCount > Util.StackAllocationSizeLimit) + { + native_format_max = Util.Allocate(format_max_byteCount + 1); + } + else + { + byte* native_format_max_stackBytes = stackalloc byte[format_max_byteCount + 1]; + native_format_max = native_format_max_stackBytes; + } + int native_format_max_offset = Util.GetUtf8(format_max, native_format_max, format_max_byteCount); + native_format_max[native_format_max_offset] = 0; + } + else { native_format_max = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v_current_min = &v_current_min) + { + fixed (float* native_v_current_max = &v_current_max) + { + byte ret = ImGuiNative.igDragFloatRange2(native_label, native_v_current_min, native_v_current_max, v_speed, v_min, v_max, native_format, native_format_max, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + if (format_max_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format_max); + } + return ret != 0; + } + } + } +#endif + public static bool DragFloatRange2(string label, ref float v_current_min, ref float v_current_max, float v_speed, float v_min, float v_max, string format, string format_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + byte* native_format_max; + int format_max_byteCount = 0; + if (format_max != null) + { + format_max_byteCount = Encoding.UTF8.GetByteCount(format_max); + if (format_max_byteCount > Util.StackAllocationSizeLimit) + { + native_format_max = Util.Allocate(format_max_byteCount + 1); + } + else + { + byte* native_format_max_stackBytes = stackalloc byte[format_max_byteCount + 1]; + native_format_max = native_format_max_stackBytes; + } + int native_format_max_offset = Util.GetUtf8(format_max, native_format_max, format_max_byteCount); + native_format_max[native_format_max_offset] = 0; + } + else { native_format_max = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v_current_min = &v_current_min) + { + fixed (float* native_v_current_max = &v_current_max) + { + byte ret = ImGuiNative.igDragFloatRange2(native_label, native_v_current_min, native_v_current_max, v_speed, v_min, v_max, native_format, native_format_max, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + if (format_max_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format_max); + } + return ret != 0; + } + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragFloatRange2(ReadOnlySpan label, ref float v_current_min, ref float v_current_max, float v_speed, float v_min, float v_max, ReadOnlySpan format, ReadOnlySpan format_max, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + byte* native_format_max; + int format_max_byteCount = 0; + if (format_max != null) + { + format_max_byteCount = Encoding.UTF8.GetByteCount(format_max); + if (format_max_byteCount > Util.StackAllocationSizeLimit) + { + native_format_max = Util.Allocate(format_max_byteCount + 1); + } + else + { + byte* native_format_max_stackBytes = stackalloc byte[format_max_byteCount + 1]; + native_format_max = native_format_max_stackBytes; + } + int native_format_max_offset = Util.GetUtf8(format_max, native_format_max, format_max_byteCount); + native_format_max[native_format_max_offset] = 0; + } + else { native_format_max = null; } + fixed (float* native_v_current_min = &v_current_min) + { + fixed (float* native_v_current_max = &v_current_max) + { + byte ret = ImGuiNative.igDragFloatRange2(native_label, native_v_current_min, native_v_current_max, v_speed, v_min, v_max, native_format, native_format_max, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + if (format_max_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format_max); + } + return ret != 0; + } + } + } +#endif + public static bool DragFloatRange2(string label, ref float v_current_min, ref float v_current_max, float v_speed, float v_min, float v_max, string format, string format_max, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + byte* native_format_max; + int format_max_byteCount = 0; + if (format_max != null) + { + format_max_byteCount = Encoding.UTF8.GetByteCount(format_max); + if (format_max_byteCount > Util.StackAllocationSizeLimit) + { + native_format_max = Util.Allocate(format_max_byteCount + 1); + } + else + { + byte* native_format_max_stackBytes = stackalloc byte[format_max_byteCount + 1]; + native_format_max = native_format_max_stackBytes; + } + int native_format_max_offset = Util.GetUtf8(format_max, native_format_max, format_max_byteCount); + native_format_max[native_format_max_offset] = 0; + } + else { native_format_max = null; } + fixed (float* native_v_current_min = &v_current_min) + { + fixed (float* native_v_current_max = &v_current_max) + { + byte ret = ImGuiNative.igDragFloatRange2(native_label, native_v_current_min, native_v_current_max, v_speed, v_min, v_max, native_format, native_format_max, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + if (format_max_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format_max); + } + return ret != 0; + } + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragInt(ReadOnlySpan label, ref int v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_speed = 1.0f; + int v_min = 0; + int v_max = 0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragInt(string label, ref int v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_speed = 1.0f; + int v_min = 0; + int v_max = 0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragInt(ReadOnlySpan label, ref int v, float v_speed) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int v_min = 0; + int v_max = 0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragInt(string label, ref int v, float v_speed) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int v_min = 0; + int v_max = 0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragInt(ReadOnlySpan label, ref int v, float v_speed, int v_min) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int v_max = 0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragInt(string label, ref int v, float v_speed, int v_min) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int v_max = 0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragInt(ReadOnlySpan label, ref int v, float v_speed, int v_min, int v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragInt(string label, ref int v, float v_speed, int v_min, int v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragInt(ReadOnlySpan label, ref int v, float v_speed, int v_min, int v_max, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragInt(string label, ref int v, float v_speed, int v_min, int v_max, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragInt(ReadOnlySpan label, ref int v, float v_speed, int v_min, int v_max, ReadOnlySpan format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragInt(string label, ref int v, float v_speed, int v_min, int v_max, string format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragInt2(ReadOnlySpan label, ref int v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_speed = 1.0f; + int v_min = 0; + int v_max = 0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt2(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragInt2(string label, ref int v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_speed = 1.0f; + int v_min = 0; + int v_max = 0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt2(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragInt2(ReadOnlySpan label, ref int v, float v_speed) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int v_min = 0; + int v_max = 0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt2(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragInt2(string label, ref int v, float v_speed) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int v_min = 0; + int v_max = 0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt2(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragInt2(ReadOnlySpan label, ref int v, float v_speed, int v_min) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int v_max = 0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt2(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragInt2(string label, ref int v, float v_speed, int v_min) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int v_max = 0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt2(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragInt2(ReadOnlySpan label, ref int v, float v_speed, int v_min, int v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt2(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragInt2(string label, ref int v, float v_speed, int v_min, int v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt2(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragInt2(ReadOnlySpan label, ref int v, float v_speed, int v_min, int v_max, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt2(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragInt2(string label, ref int v, float v_speed, int v_min, int v_max, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt2(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragInt2(ReadOnlySpan label, ref int v, float v_speed, int v_min, int v_max, ReadOnlySpan format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt2(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragInt2(string label, ref int v, float v_speed, int v_min, int v_max, string format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt2(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragInt3(ReadOnlySpan label, ref int v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_speed = 1.0f; + int v_min = 0; + int v_max = 0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt3(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragInt3(string label, ref int v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_speed = 1.0f; + int v_min = 0; + int v_max = 0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt3(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragInt3(ReadOnlySpan label, ref int v, float v_speed) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int v_min = 0; + int v_max = 0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt3(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragInt3(string label, ref int v, float v_speed) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int v_min = 0; + int v_max = 0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt3(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragInt3(ReadOnlySpan label, ref int v, float v_speed, int v_min) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int v_max = 0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt3(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragInt3(string label, ref int v, float v_speed, int v_min) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int v_max = 0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt3(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragInt3(ReadOnlySpan label, ref int v, float v_speed, int v_min, int v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt3(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragInt3(string label, ref int v, float v_speed, int v_min, int v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt3(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragInt3(ReadOnlySpan label, ref int v, float v_speed, int v_min, int v_max, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt3(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragInt3(string label, ref int v, float v_speed, int v_min, int v_max, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt3(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragInt3(ReadOnlySpan label, ref int v, float v_speed, int v_min, int v_max, ReadOnlySpan format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt3(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragInt3(string label, ref int v, float v_speed, int v_min, int v_max, string format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt3(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragInt4(ReadOnlySpan label, ref int v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_speed = 1.0f; + int v_min = 0; + int v_max = 0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt4(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragInt4(string label, ref int v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_speed = 1.0f; + int v_min = 0; + int v_max = 0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt4(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragInt4(ReadOnlySpan label, ref int v, float v_speed) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int v_min = 0; + int v_max = 0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt4(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragInt4(string label, ref int v, float v_speed) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int v_min = 0; + int v_max = 0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt4(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragInt4(ReadOnlySpan label, ref int v, float v_speed, int v_min) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int v_max = 0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt4(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragInt4(string label, ref int v, float v_speed, int v_min) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int v_max = 0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt4(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragInt4(ReadOnlySpan label, ref int v, float v_speed, int v_min, int v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt4(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragInt4(string label, ref int v, float v_speed, int v_min, int v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt4(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragInt4(ReadOnlySpan label, ref int v, float v_speed, int v_min, int v_max, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt4(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragInt4(string label, ref int v, float v_speed, int v_min, int v_max, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt4(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragInt4(ReadOnlySpan label, ref int v, float v_speed, int v_min, int v_max, ReadOnlySpan format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt4(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool DragInt4(string label, ref int v, float v_speed, int v_min, int v_max, string format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igDragInt4(native_label, native_v, v_speed, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragIntRange2(ReadOnlySpan label, ref int v_current_min, ref int v_current_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_speed = 1.0f; + int v_min = 0; + int v_max = 0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + byte* native_format_max = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v_current_min = &v_current_min) + { + fixed (int* native_v_current_max = &v_current_max) + { + byte ret = ImGuiNative.igDragIntRange2(native_label, native_v_current_min, native_v_current_max, v_speed, v_min, v_max, native_format, native_format_max, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } + } +#endif + public static bool DragIntRange2(string label, ref int v_current_min, ref int v_current_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_speed = 1.0f; + int v_min = 0; + int v_max = 0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + byte* native_format_max = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v_current_min = &v_current_min) + { + fixed (int* native_v_current_max = &v_current_max) + { + byte ret = ImGuiNative.igDragIntRange2(native_label, native_v_current_min, native_v_current_max, v_speed, v_min, v_max, native_format, native_format_max, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragIntRange2(ReadOnlySpan label, ref int v_current_min, ref int v_current_max, float v_speed) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int v_min = 0; + int v_max = 0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + byte* native_format_max = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v_current_min = &v_current_min) + { + fixed (int* native_v_current_max = &v_current_max) + { + byte ret = ImGuiNative.igDragIntRange2(native_label, native_v_current_min, native_v_current_max, v_speed, v_min, v_max, native_format, native_format_max, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } + } +#endif + public static bool DragIntRange2(string label, ref int v_current_min, ref int v_current_max, float v_speed) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int v_min = 0; + int v_max = 0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + byte* native_format_max = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v_current_min = &v_current_min) + { + fixed (int* native_v_current_max = &v_current_max) + { + byte ret = ImGuiNative.igDragIntRange2(native_label, native_v_current_min, native_v_current_max, v_speed, v_min, v_max, native_format, native_format_max, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragIntRange2(ReadOnlySpan label, ref int v_current_min, ref int v_current_max, float v_speed, int v_min) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int v_max = 0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + byte* native_format_max = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v_current_min = &v_current_min) + { + fixed (int* native_v_current_max = &v_current_max) + { + byte ret = ImGuiNative.igDragIntRange2(native_label, native_v_current_min, native_v_current_max, v_speed, v_min, v_max, native_format, native_format_max, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } + } +#endif + public static bool DragIntRange2(string label, ref int v_current_min, ref int v_current_max, float v_speed, int v_min) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int v_max = 0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + byte* native_format_max = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v_current_min = &v_current_min) + { + fixed (int* native_v_current_max = &v_current_max) + { + byte ret = ImGuiNative.igDragIntRange2(native_label, native_v_current_min, native_v_current_max, v_speed, v_min, v_max, native_format, native_format_max, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragIntRange2(ReadOnlySpan label, ref int v_current_min, ref int v_current_max, float v_speed, int v_min, int v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + byte* native_format_max = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v_current_min = &v_current_min) + { + fixed (int* native_v_current_max = &v_current_max) + { + byte ret = ImGuiNative.igDragIntRange2(native_label, native_v_current_min, native_v_current_max, v_speed, v_min, v_max, native_format, native_format_max, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } + } +#endif + public static bool DragIntRange2(string label, ref int v_current_min, ref int v_current_max, float v_speed, int v_min, int v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + byte* native_format_max = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v_current_min = &v_current_min) + { + fixed (int* native_v_current_max = &v_current_max) + { + byte ret = ImGuiNative.igDragIntRange2(native_label, native_v_current_min, native_v_current_max, v_speed, v_min, v_max, native_format, native_format_max, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragIntRange2(ReadOnlySpan label, ref int v_current_min, ref int v_current_max, float v_speed, int v_min, int v_max, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + byte* native_format_max = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v_current_min = &v_current_min) + { + fixed (int* native_v_current_max = &v_current_max) + { + byte ret = ImGuiNative.igDragIntRange2(native_label, native_v_current_min, native_v_current_max, v_speed, v_min, v_max, native_format, native_format_max, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } + } +#endif + public static bool DragIntRange2(string label, ref int v_current_min, ref int v_current_max, float v_speed, int v_min, int v_max, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + byte* native_format_max = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v_current_min = &v_current_min) + { + fixed (int* native_v_current_max = &v_current_max) + { + byte ret = ImGuiNative.igDragIntRange2(native_label, native_v_current_min, native_v_current_max, v_speed, v_min, v_max, native_format, native_format_max, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragIntRange2(ReadOnlySpan label, ref int v_current_min, ref int v_current_max, float v_speed, int v_min, int v_max, ReadOnlySpan format, ReadOnlySpan format_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + byte* native_format_max; + int format_max_byteCount = 0; + if (format_max != null) + { + format_max_byteCount = Encoding.UTF8.GetByteCount(format_max); + if (format_max_byteCount > Util.StackAllocationSizeLimit) + { + native_format_max = Util.Allocate(format_max_byteCount + 1); + } + else + { + byte* native_format_max_stackBytes = stackalloc byte[format_max_byteCount + 1]; + native_format_max = native_format_max_stackBytes; + } + int native_format_max_offset = Util.GetUtf8(format_max, native_format_max, format_max_byteCount); + native_format_max[native_format_max_offset] = 0; + } + else { native_format_max = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v_current_min = &v_current_min) + { + fixed (int* native_v_current_max = &v_current_max) + { + byte ret = ImGuiNative.igDragIntRange2(native_label, native_v_current_min, native_v_current_max, v_speed, v_min, v_max, native_format, native_format_max, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + if (format_max_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format_max); + } + return ret != 0; + } + } + } +#endif + public static bool DragIntRange2(string label, ref int v_current_min, ref int v_current_max, float v_speed, int v_min, int v_max, string format, string format_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + byte* native_format_max; + int format_max_byteCount = 0; + if (format_max != null) + { + format_max_byteCount = Encoding.UTF8.GetByteCount(format_max); + if (format_max_byteCount > Util.StackAllocationSizeLimit) + { + native_format_max = Util.Allocate(format_max_byteCount + 1); + } + else + { + byte* native_format_max_stackBytes = stackalloc byte[format_max_byteCount + 1]; + native_format_max = native_format_max_stackBytes; + } + int native_format_max_offset = Util.GetUtf8(format_max, native_format_max, format_max_byteCount); + native_format_max[native_format_max_offset] = 0; + } + else { native_format_max = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v_current_min = &v_current_min) + { + fixed (int* native_v_current_max = &v_current_max) + { + byte ret = ImGuiNative.igDragIntRange2(native_label, native_v_current_min, native_v_current_max, v_speed, v_min, v_max, native_format, native_format_max, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + if (format_max_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format_max); + } + return ret != 0; + } + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragIntRange2(ReadOnlySpan label, ref int v_current_min, ref int v_current_max, float v_speed, int v_min, int v_max, ReadOnlySpan format, ReadOnlySpan format_max, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + byte* native_format_max; + int format_max_byteCount = 0; + if (format_max != null) + { + format_max_byteCount = Encoding.UTF8.GetByteCount(format_max); + if (format_max_byteCount > Util.StackAllocationSizeLimit) + { + native_format_max = Util.Allocate(format_max_byteCount + 1); + } + else + { + byte* native_format_max_stackBytes = stackalloc byte[format_max_byteCount + 1]; + native_format_max = native_format_max_stackBytes; + } + int native_format_max_offset = Util.GetUtf8(format_max, native_format_max, format_max_byteCount); + native_format_max[native_format_max_offset] = 0; + } + else { native_format_max = null; } + fixed (int* native_v_current_min = &v_current_min) + { + fixed (int* native_v_current_max = &v_current_max) + { + byte ret = ImGuiNative.igDragIntRange2(native_label, native_v_current_min, native_v_current_max, v_speed, v_min, v_max, native_format, native_format_max, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + if (format_max_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format_max); + } + return ret != 0; + } + } + } +#endif + public static bool DragIntRange2(string label, ref int v_current_min, ref int v_current_max, float v_speed, int v_min, int v_max, string format, string format_max, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + byte* native_format_max; + int format_max_byteCount = 0; + if (format_max != null) + { + format_max_byteCount = Encoding.UTF8.GetByteCount(format_max); + if (format_max_byteCount > Util.StackAllocationSizeLimit) + { + native_format_max = Util.Allocate(format_max_byteCount + 1); + } + else + { + byte* native_format_max_stackBytes = stackalloc byte[format_max_byteCount + 1]; + native_format_max = native_format_max_stackBytes; + } + int native_format_max_offset = Util.GetUtf8(format_max, native_format_max, format_max_byteCount); + native_format_max[native_format_max_offset] = 0; + } + else { native_format_max = null; } + fixed (int* native_v_current_min = &v_current_min) + { + fixed (int* native_v_current_max = &v_current_max) + { + byte ret = ImGuiNative.igDragIntRange2(native_label, native_v_current_min, native_v_current_max, v_speed, v_min, v_max, native_format, native_format_max, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + if (format_max_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format_max); + } + return ret != 0; + } + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragScalar(ReadOnlySpan label, ImGuiDataType data_type, IntPtr p_data) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + float v_speed = 1.0f; + void* p_min = null; + void* p_max = null; + byte* native_format = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + byte ret = ImGuiNative.igDragScalar(native_label, data_type, native_p_data, v_speed, p_min, p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool DragScalar(string label, ImGuiDataType data_type, IntPtr p_data) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + float v_speed = 1.0f; + void* p_min = null; + void* p_max = null; + byte* native_format = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + byte ret = ImGuiNative.igDragScalar(native_label, data_type, native_p_data, v_speed, p_min, p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragScalar(ReadOnlySpan label, ImGuiDataType data_type, IntPtr p_data, float v_speed) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* p_min = null; + void* p_max = null; + byte* native_format = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + byte ret = ImGuiNative.igDragScalar(native_label, data_type, native_p_data, v_speed, p_min, p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool DragScalar(string label, ImGuiDataType data_type, IntPtr p_data, float v_speed) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* p_min = null; + void* p_max = null; + byte* native_format = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + byte ret = ImGuiNative.igDragScalar(native_label, data_type, native_p_data, v_speed, p_min, p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragScalar(ReadOnlySpan label, ImGuiDataType data_type, IntPtr p_data, float v_speed, IntPtr p_min) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* p_max = null; + byte* native_format = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + byte ret = ImGuiNative.igDragScalar(native_label, data_type, native_p_data, v_speed, native_p_min, p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool DragScalar(string label, ImGuiDataType data_type, IntPtr p_data, float v_speed, IntPtr p_min) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* p_max = null; + byte* native_format = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + byte ret = ImGuiNative.igDragScalar(native_label, data_type, native_p_data, v_speed, native_p_min, p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragScalar(ReadOnlySpan label, ImGuiDataType data_type, IntPtr p_data, float v_speed, IntPtr p_min, IntPtr p_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* native_p_max = (void*)p_max.ToPointer(); + byte* native_format = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + byte ret = ImGuiNative.igDragScalar(native_label, data_type, native_p_data, v_speed, native_p_min, native_p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool DragScalar(string label, ImGuiDataType data_type, IntPtr p_data, float v_speed, IntPtr p_min, IntPtr p_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* native_p_max = (void*)p_max.ToPointer(); + byte* native_format = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + byte ret = ImGuiNative.igDragScalar(native_label, data_type, native_p_data, v_speed, native_p_min, native_p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragScalar(ReadOnlySpan label, ImGuiDataType data_type, IntPtr p_data, float v_speed, IntPtr p_min, IntPtr p_max, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* native_p_max = (void*)p_max.ToPointer(); + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + byte ret = ImGuiNative.igDragScalar(native_label, data_type, native_p_data, v_speed, native_p_min, native_p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } +#endif + public static bool DragScalar(string label, ImGuiDataType data_type, IntPtr p_data, float v_speed, IntPtr p_min, IntPtr p_max, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* native_p_max = (void*)p_max.ToPointer(); + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + byte ret = ImGuiNative.igDragScalar(native_label, data_type, native_p_data, v_speed, native_p_min, native_p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragScalar(ReadOnlySpan label, ImGuiDataType data_type, IntPtr p_data, float v_speed, IntPtr p_min, IntPtr p_max, ReadOnlySpan format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* native_p_max = (void*)p_max.ToPointer(); + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + byte ret = ImGuiNative.igDragScalar(native_label, data_type, native_p_data, v_speed, native_p_min, native_p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } +#endif + public static bool DragScalar(string label, ImGuiDataType data_type, IntPtr p_data, float v_speed, IntPtr p_min, IntPtr p_max, string format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* native_p_max = (void*)p_max.ToPointer(); + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + byte ret = ImGuiNative.igDragScalar(native_label, data_type, native_p_data, v_speed, native_p_min, native_p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragScalarN(ReadOnlySpan label, ImGuiDataType data_type, IntPtr p_data, int components) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + float v_speed = 1.0f; + void* p_min = null; + void* p_max = null; + byte* native_format = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + byte ret = ImGuiNative.igDragScalarN(native_label, data_type, native_p_data, components, v_speed, p_min, p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool DragScalarN(string label, ImGuiDataType data_type, IntPtr p_data, int components) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + float v_speed = 1.0f; + void* p_min = null; + void* p_max = null; + byte* native_format = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + byte ret = ImGuiNative.igDragScalarN(native_label, data_type, native_p_data, components, v_speed, p_min, p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragScalarN(ReadOnlySpan label, ImGuiDataType data_type, IntPtr p_data, int components, float v_speed) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* p_min = null; + void* p_max = null; + byte* native_format = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + byte ret = ImGuiNative.igDragScalarN(native_label, data_type, native_p_data, components, v_speed, p_min, p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool DragScalarN(string label, ImGuiDataType data_type, IntPtr p_data, int components, float v_speed) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* p_min = null; + void* p_max = null; + byte* native_format = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + byte ret = ImGuiNative.igDragScalarN(native_label, data_type, native_p_data, components, v_speed, p_min, p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragScalarN(ReadOnlySpan label, ImGuiDataType data_type, IntPtr p_data, int components, float v_speed, IntPtr p_min) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* p_max = null; + byte* native_format = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + byte ret = ImGuiNative.igDragScalarN(native_label, data_type, native_p_data, components, v_speed, native_p_min, p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool DragScalarN(string label, ImGuiDataType data_type, IntPtr p_data, int components, float v_speed, IntPtr p_min) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* p_max = null; + byte* native_format = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + byte ret = ImGuiNative.igDragScalarN(native_label, data_type, native_p_data, components, v_speed, native_p_min, p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragScalarN(ReadOnlySpan label, ImGuiDataType data_type, IntPtr p_data, int components, float v_speed, IntPtr p_min, IntPtr p_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* native_p_max = (void*)p_max.ToPointer(); + byte* native_format = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + byte ret = ImGuiNative.igDragScalarN(native_label, data_type, native_p_data, components, v_speed, native_p_min, native_p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool DragScalarN(string label, ImGuiDataType data_type, IntPtr p_data, int components, float v_speed, IntPtr p_min, IntPtr p_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* native_p_max = (void*)p_max.ToPointer(); + byte* native_format = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + byte ret = ImGuiNative.igDragScalarN(native_label, data_type, native_p_data, components, v_speed, native_p_min, native_p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragScalarN(ReadOnlySpan label, ImGuiDataType data_type, IntPtr p_data, int components, float v_speed, IntPtr p_min, IntPtr p_max, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* native_p_max = (void*)p_max.ToPointer(); + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + byte ret = ImGuiNative.igDragScalarN(native_label, data_type, native_p_data, components, v_speed, native_p_min, native_p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } +#endif + public static bool DragScalarN(string label, ImGuiDataType data_type, IntPtr p_data, int components, float v_speed, IntPtr p_min, IntPtr p_max, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* native_p_max = (void*)p_max.ToPointer(); + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + byte ret = ImGuiNative.igDragScalarN(native_label, data_type, native_p_data, components, v_speed, native_p_min, native_p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool DragScalarN(ReadOnlySpan label, ImGuiDataType data_type, IntPtr p_data, int components, float v_speed, IntPtr p_min, IntPtr p_max, ReadOnlySpan format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* native_p_max = (void*)p_max.ToPointer(); + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + byte ret = ImGuiNative.igDragScalarN(native_label, data_type, native_p_data, components, v_speed, native_p_min, native_p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } +#endif + public static bool DragScalarN(string label, ImGuiDataType data_type, IntPtr p_data, int components, float v_speed, IntPtr p_min, IntPtr p_max, string format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* native_p_max = (void*)p_max.ToPointer(); + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + byte ret = ImGuiNative.igDragScalarN(native_label, data_type, native_p_data, components, v_speed, native_p_min, native_p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + public static void Dummy(Vector2 size) + { + ImGuiNative.igDummy(size); + } + public static void End() + { + ImGuiNative.igEnd(); + } + public static void EndChild() + { + ImGuiNative.igEndChild(); + } + public static void EndCombo() + { + ImGuiNative.igEndCombo(); + } + public static void EndDisabled() + { + ImGuiNative.igEndDisabled(); + } + public static void EndDragDropSource() + { + ImGuiNative.igEndDragDropSource(); + } + public static void EndDragDropTarget() + { + ImGuiNative.igEndDragDropTarget(); + } + public static void EndFrame() + { + ImGuiNative.igEndFrame(); + } + public static void EndGroup() + { + ImGuiNative.igEndGroup(); + } + public static void EndListBox() + { + ImGuiNative.igEndListBox(); + } + public static void EndMainMenuBar() + { + ImGuiNative.igEndMainMenuBar(); + } + public static void EndMenu() + { + ImGuiNative.igEndMenu(); + } + public static void EndMenuBar() + { + ImGuiNative.igEndMenuBar(); + } + public static void EndPopup() + { + ImGuiNative.igEndPopup(); + } + public static void EndTabBar() + { + ImGuiNative.igEndTabBar(); + } + public static void EndTabItem() + { + ImGuiNative.igEndTabItem(); + } + public static void EndTable() + { + ImGuiNative.igEndTable(); + } + public static void EndTooltip() + { + ImGuiNative.igEndTooltip(); + } + public static ImGuiViewportPtr FindViewportByID(uint id) + { + ImGuiViewport* ret = ImGuiNative.igFindViewportByID(id); + return new ImGuiViewportPtr(ret); + } + public static ImGuiViewportPtr FindViewportByPlatformHandle(IntPtr platform_handle) + { + void* native_platform_handle = (void*)platform_handle.ToPointer(); + ImGuiViewport* ret = ImGuiNative.igFindViewportByPlatformHandle(native_platform_handle); + return new ImGuiViewportPtr(ret); + } + public static void GetAllocatorFunctions(ref IntPtr p_alloc_func, ref IntPtr p_free_func, ref void* p_user_data) + { + fixed (IntPtr* native_p_alloc_func = &p_alloc_func) + { + fixed (IntPtr* native_p_free_func = &p_free_func) + { + fixed (void** native_p_user_data = &p_user_data) + { + ImGuiNative.igGetAllocatorFunctions(native_p_alloc_func, native_p_free_func, native_p_user_data); + } + } + } + } + public static ImDrawListPtr GetBackgroundDrawList() + { + ImDrawList* ret = ImGuiNative.igGetBackgroundDrawList_Nil(); + return new ImDrawListPtr(ret); + } + public static ImDrawListPtr GetBackgroundDrawList(ImGuiViewportPtr viewport) + { + ImGuiViewport* native_viewport = viewport.NativePtr; + ImDrawList* ret = ImGuiNative.igGetBackgroundDrawList_ViewportPtr(native_viewport); + return new ImDrawListPtr(ret); + } + public static string GetClipboardText() + { + byte* ret = ImGuiNative.igGetClipboardText(); + return Util.StringFromPtr(ret); + } + public static uint GetColorU32(ImGuiCol idx) + { + float alpha_mul = 1.0f; + uint ret = ImGuiNative.igGetColorU32_Col(idx, alpha_mul); + return ret; + } + public static uint GetColorU32(ImGuiCol idx, float alpha_mul) + { + uint ret = ImGuiNative.igGetColorU32_Col(idx, alpha_mul); + return ret; + } + public static uint GetColorU32(Vector4 col) + { + uint ret = ImGuiNative.igGetColorU32_Vec4(col); + return ret; + } + public static uint GetColorU32(uint col) + { + uint ret = ImGuiNative.igGetColorU32_U32(col); + return ret; + } + public static int GetColumnIndex() + { + int ret = ImGuiNative.igGetColumnIndex(); + return ret; + } + public static float GetColumnOffset() + { + int column_index = -1; + float ret = ImGuiNative.igGetColumnOffset(column_index); + return ret; + } + public static float GetColumnOffset(int column_index) + { + float ret = ImGuiNative.igGetColumnOffset(column_index); + return ret; + } + public static int GetColumnsCount() + { + int ret = ImGuiNative.igGetColumnsCount(); + return ret; + } + public static float GetColumnWidth() + { + int column_index = -1; + float ret = ImGuiNative.igGetColumnWidth(column_index); + return ret; + } + public static float GetColumnWidth(int column_index) + { + float ret = ImGuiNative.igGetColumnWidth(column_index); + return ret; + } + public static Vector2 GetContentRegionAvail() + { + Vector2 __retval; + ImGuiNative.igGetContentRegionAvail(&__retval); + return __retval; + } + public static Vector2 GetContentRegionMax() + { + Vector2 __retval; + ImGuiNative.igGetContentRegionMax(&__retval); + return __retval; + } + public static IntPtr GetCurrentContext() + { + IntPtr ret = ImGuiNative.igGetCurrentContext(); + return ret; + } + public static Vector2 GetCursorPos() + { + Vector2 __retval; + ImGuiNative.igGetCursorPos(&__retval); + return __retval; + } + public static float GetCursorPosX() + { + float ret = ImGuiNative.igGetCursorPosX(); + return ret; + } + public static float GetCursorPosY() + { + float ret = ImGuiNative.igGetCursorPosY(); + return ret; + } + public static Vector2 GetCursorScreenPos() + { + Vector2 __retval; + ImGuiNative.igGetCursorScreenPos(&__retval); + return __retval; + } + public static Vector2 GetCursorStartPos() + { + Vector2 __retval; + ImGuiNative.igGetCursorStartPos(&__retval); + return __retval; + } + public static ImGuiPayloadPtr GetDragDropPayload() + { + ImGuiPayload* ret = ImGuiNative.igGetDragDropPayload(); + return new ImGuiPayloadPtr(ret); + } + public static ImDrawDataPtr GetDrawData() + { + ImDrawData* ret = ImGuiNative.igGetDrawData(); + return new ImDrawDataPtr(ret); + } + public static IntPtr GetDrawListSharedData() + { + IntPtr ret = ImGuiNative.igGetDrawListSharedData(); + return ret; + } + public static ImFontPtr GetFont() + { + ImFont* ret = ImGuiNative.igGetFont(); + return new ImFontPtr(ret); + } + public static float GetFontSize() + { + float ret = ImGuiNative.igGetFontSize(); + return ret; + } + public static Vector2 GetFontTexUvWhitePixel() + { + Vector2 __retval; + ImGuiNative.igGetFontTexUvWhitePixel(&__retval); + return __retval; + } + public static ImDrawListPtr GetForegroundDrawList() + { + ImDrawList* ret = ImGuiNative.igGetForegroundDrawList_Nil(); + return new ImDrawListPtr(ret); + } + public static ImDrawListPtr GetForegroundDrawList(ImGuiViewportPtr viewport) + { + ImGuiViewport* native_viewport = viewport.NativePtr; + ImDrawList* ret = ImGuiNative.igGetForegroundDrawList_ViewportPtr(native_viewport); + return new ImDrawListPtr(ret); + } + public static int GetFrameCount() + { + int ret = ImGuiNative.igGetFrameCount(); + return ret; + } + public static float GetFrameHeight() + { + float ret = ImGuiNative.igGetFrameHeight(); + return ret; + } + public static float GetFrameHeightWithSpacing() + { + float ret = ImGuiNative.igGetFrameHeightWithSpacing(); + return ret; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static uint GetID(ReadOnlySpan str_id) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + uint ret = ImGuiNative.igGetID_Str(native_str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret; + } +#endif + public static uint GetID(string str_id) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + uint ret = ImGuiNative.igGetID_Str(native_str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret; + } + public static uint GetID(IntPtr ptr_id) + { + void* native_ptr_id = (void*)ptr_id.ToPointer(); + uint ret = ImGuiNative.igGetID_Ptr(native_ptr_id); + return ret; + } + public static ImGuiIOPtr GetIO() + { + ImGuiIO* ret = ImGuiNative.igGetIO(); + return new ImGuiIOPtr(ret); + } + public static uint GetItemID() + { + uint ret = ImGuiNative.igGetItemID(); + return ret; + } + public static Vector2 GetItemRectMax() + { + Vector2 __retval; + ImGuiNative.igGetItemRectMax(&__retval); + return __retval; + } + public static Vector2 GetItemRectMin() + { + Vector2 __retval; + ImGuiNative.igGetItemRectMin(&__retval); + return __retval; + } + public static Vector2 GetItemRectSize() + { + Vector2 __retval; + ImGuiNative.igGetItemRectSize(&__retval); + return __retval; + } + public static ImGuiKey GetKeyIndex(ImGuiKey key) + { + ImGuiKey ret = ImGuiNative.igGetKeyIndex(key); + return ret; + } + public static string GetKeyName(ImGuiKey key) + { + byte* ret = ImGuiNative.igGetKeyName(key); + return Util.StringFromPtr(ret); + } + public static int GetKeyPressedAmount(ImGuiKey key, float repeat_delay, float rate) + { + int ret = ImGuiNative.igGetKeyPressedAmount(key, repeat_delay, rate); + return ret; + } + public static ImGuiViewportPtr GetMainViewport() + { + ImGuiViewport* ret = ImGuiNative.igGetMainViewport(); + return new ImGuiViewportPtr(ret); + } + public static int GetMouseClickedCount(ImGuiMouseButton button) + { + int ret = ImGuiNative.igGetMouseClickedCount(button); + return ret; + } + public static ImGuiMouseCursor GetMouseCursor() + { + ImGuiMouseCursor ret = ImGuiNative.igGetMouseCursor(); + return ret; + } + public static Vector2 GetMouseDragDelta() + { + Vector2 __retval; + ImGuiMouseButton button = (ImGuiMouseButton)0; + float lock_threshold = -1.0f; + ImGuiNative.igGetMouseDragDelta(&__retval, button, lock_threshold); + return __retval; + } + public static Vector2 GetMouseDragDelta(ImGuiMouseButton button) + { + Vector2 __retval; + float lock_threshold = -1.0f; + ImGuiNative.igGetMouseDragDelta(&__retval, button, lock_threshold); + return __retval; + } + public static Vector2 GetMouseDragDelta(ImGuiMouseButton button, float lock_threshold) + { + Vector2 __retval; + ImGuiNative.igGetMouseDragDelta(&__retval, button, lock_threshold); + return __retval; + } + public static Vector2 GetMousePos() + { + Vector2 __retval; + ImGuiNative.igGetMousePos(&__retval); + return __retval; + } + public static Vector2 GetMousePosOnOpeningCurrentPopup() + { + Vector2 __retval; + ImGuiNative.igGetMousePosOnOpeningCurrentPopup(&__retval); + return __retval; + } + public static ImGuiPlatformIOPtr GetPlatformIO() + { + ImGuiPlatformIO* ret = ImGuiNative.igGetPlatformIO(); + return new ImGuiPlatformIOPtr(ret); + } + public static float GetScrollMaxX() + { + float ret = ImGuiNative.igGetScrollMaxX(); + return ret; + } + public static float GetScrollMaxY() + { + float ret = ImGuiNative.igGetScrollMaxY(); + return ret; + } + public static float GetScrollX() + { + float ret = ImGuiNative.igGetScrollX(); + return ret; + } + public static float GetScrollY() + { + float ret = ImGuiNative.igGetScrollY(); + return ret; + } + public static ImGuiStoragePtr GetStateStorage() + { + ImGuiStorage* ret = ImGuiNative.igGetStateStorage(); + return new ImGuiStoragePtr(ret); + } + public static ImGuiStylePtr GetStyle() + { + ImGuiStyle* ret = ImGuiNative.igGetStyle(); + return new ImGuiStylePtr(ret); + } + public static string GetStyleColorName(ImGuiCol idx) + { + byte* ret = ImGuiNative.igGetStyleColorName(idx); + return Util.StringFromPtr(ret); + } + public static Vector4* GetStyleColorVec4(ImGuiCol idx) + { + Vector4* ret = ImGuiNative.igGetStyleColorVec4(idx); + return ret; + } + public static float GetTextLineHeight() + { + float ret = ImGuiNative.igGetTextLineHeight(); + return ret; + } + public static float GetTextLineHeightWithSpacing() + { + float ret = ImGuiNative.igGetTextLineHeightWithSpacing(); + return ret; + } + public static double GetTime() + { + double ret = ImGuiNative.igGetTime(); + return ret; + } + public static float GetTreeNodeToLabelSpacing() + { + float ret = ImGuiNative.igGetTreeNodeToLabelSpacing(); + return ret; + } + public static string GetVersion() + { + byte* ret = ImGuiNative.igGetVersion(); + return Util.StringFromPtr(ret); + } + public static Vector2 GetWindowContentRegionMax() + { + Vector2 __retval; + ImGuiNative.igGetWindowContentRegionMax(&__retval); + return __retval; + } + public static Vector2 GetWindowContentRegionMin() + { + Vector2 __retval; + ImGuiNative.igGetWindowContentRegionMin(&__retval); + return __retval; + } + public static uint GetWindowDockID() + { + uint ret = ImGuiNative.igGetWindowDockID(); + return ret; + } + public static float GetWindowDpiScale() + { + float ret = ImGuiNative.igGetWindowDpiScale(); + return ret; + } + public static ImDrawListPtr GetWindowDrawList() + { + ImDrawList* ret = ImGuiNative.igGetWindowDrawList(); + return new ImDrawListPtr(ret); + } + public static float GetWindowHeight() + { + float ret = ImGuiNative.igGetWindowHeight(); + return ret; + } + public static Vector2 GetWindowPos() + { + Vector2 __retval; + ImGuiNative.igGetWindowPos(&__retval); + return __retval; + } + public static Vector2 GetWindowSize() + { + Vector2 __retval; + ImGuiNative.igGetWindowSize(&__retval); + return __retval; + } + public static ImGuiViewportPtr GetWindowViewport() + { + ImGuiViewport* ret = ImGuiNative.igGetWindowViewport(); + return new ImGuiViewportPtr(ret); + } + public static float GetWindowWidth() + { + float ret = ImGuiNative.igGetWindowWidth(); + return ret; + } + public static void Image(IntPtr user_texture_id, Vector2 size) + { + Vector2 uv0 = new Vector2(); + Vector2 uv1 = new Vector2(1, 1); + Vector4 tint_col = new Vector4(1, 1, 1, 1); + Vector4 border_col = new Vector4(); + ImGuiNative.igImage(user_texture_id, size, uv0, uv1, tint_col, border_col); + } + public static void Image(IntPtr user_texture_id, Vector2 size, Vector2 uv0) + { + Vector2 uv1 = new Vector2(1, 1); + Vector4 tint_col = new Vector4(1, 1, 1, 1); + Vector4 border_col = new Vector4(); + ImGuiNative.igImage(user_texture_id, size, uv0, uv1, tint_col, border_col); + } + public static void Image(IntPtr user_texture_id, Vector2 size, Vector2 uv0, Vector2 uv1) + { + Vector4 tint_col = new Vector4(1, 1, 1, 1); + Vector4 border_col = new Vector4(); + ImGuiNative.igImage(user_texture_id, size, uv0, uv1, tint_col, border_col); + } + public static void Image(IntPtr user_texture_id, Vector2 size, Vector2 uv0, Vector2 uv1, Vector4 tint_col) + { + Vector4 border_col = new Vector4(); + ImGuiNative.igImage(user_texture_id, size, uv0, uv1, tint_col, border_col); + } + public static void Image(IntPtr user_texture_id, Vector2 size, Vector2 uv0, Vector2 uv1, Vector4 tint_col, Vector4 border_col) + { + ImGuiNative.igImage(user_texture_id, size, uv0, uv1, tint_col, border_col); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool ImageButton(ReadOnlySpan str_id, IntPtr user_texture_id, Vector2 image_size) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + Vector2 uv0 = new Vector2(); + Vector2 uv1 = new Vector2(1, 1); + Vector4 bg_col = new Vector4(); + Vector4 tint_col = new Vector4(1, 1, 1, 1); + byte ret = ImGuiNative.igImageButton(native_str_id, user_texture_id, image_size, uv0, uv1, bg_col, tint_col); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#endif + public static bool ImageButton(string str_id, IntPtr user_texture_id, Vector2 image_size) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + Vector2 uv0 = new Vector2(); + Vector2 uv1 = new Vector2(1, 1); + Vector4 bg_col = new Vector4(); + Vector4 tint_col = new Vector4(1, 1, 1, 1); + byte ret = ImGuiNative.igImageButton(native_str_id, user_texture_id, image_size, uv0, uv1, bg_col, tint_col); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool ImageButton(ReadOnlySpan str_id, IntPtr user_texture_id, Vector2 image_size, Vector2 uv0) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + Vector2 uv1 = new Vector2(1, 1); + Vector4 bg_col = new Vector4(); + Vector4 tint_col = new Vector4(1, 1, 1, 1); + byte ret = ImGuiNative.igImageButton(native_str_id, user_texture_id, image_size, uv0, uv1, bg_col, tint_col); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#endif + public static bool ImageButton(string str_id, IntPtr user_texture_id, Vector2 image_size, Vector2 uv0) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + Vector2 uv1 = new Vector2(1, 1); + Vector4 bg_col = new Vector4(); + Vector4 tint_col = new Vector4(1, 1, 1, 1); + byte ret = ImGuiNative.igImageButton(native_str_id, user_texture_id, image_size, uv0, uv1, bg_col, tint_col); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool ImageButton(ReadOnlySpan str_id, IntPtr user_texture_id, Vector2 image_size, Vector2 uv0, Vector2 uv1) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + Vector4 bg_col = new Vector4(); + Vector4 tint_col = new Vector4(1, 1, 1, 1); + byte ret = ImGuiNative.igImageButton(native_str_id, user_texture_id, image_size, uv0, uv1, bg_col, tint_col); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#endif + public static bool ImageButton(string str_id, IntPtr user_texture_id, Vector2 image_size, Vector2 uv0, Vector2 uv1) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + Vector4 bg_col = new Vector4(); + Vector4 tint_col = new Vector4(1, 1, 1, 1); + byte ret = ImGuiNative.igImageButton(native_str_id, user_texture_id, image_size, uv0, uv1, bg_col, tint_col); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool ImageButton(ReadOnlySpan str_id, IntPtr user_texture_id, Vector2 image_size, Vector2 uv0, Vector2 uv1, Vector4 bg_col) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + Vector4 tint_col = new Vector4(1, 1, 1, 1); + byte ret = ImGuiNative.igImageButton(native_str_id, user_texture_id, image_size, uv0, uv1, bg_col, tint_col); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#endif + public static bool ImageButton(string str_id, IntPtr user_texture_id, Vector2 image_size, Vector2 uv0, Vector2 uv1, Vector4 bg_col) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + Vector4 tint_col = new Vector4(1, 1, 1, 1); + byte ret = ImGuiNative.igImageButton(native_str_id, user_texture_id, image_size, uv0, uv1, bg_col, tint_col); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool ImageButton(ReadOnlySpan str_id, IntPtr user_texture_id, Vector2 image_size, Vector2 uv0, Vector2 uv1, Vector4 bg_col, Vector4 tint_col) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + byte ret = ImGuiNative.igImageButton(native_str_id, user_texture_id, image_size, uv0, uv1, bg_col, tint_col); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#endif + public static bool ImageButton(string str_id, IntPtr user_texture_id, Vector2 image_size, Vector2 uv0, Vector2 uv1, Vector4 bg_col, Vector4 tint_col) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + byte ret = ImGuiNative.igImageButton(native_str_id, user_texture_id, image_size, uv0, uv1, bg_col, tint_col); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } + public static void Indent() + { + float indent_w = 0.0f; + ImGuiNative.igIndent(indent_w); + } + public static void Indent(float indent_w) + { + ImGuiNative.igIndent(indent_w); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputDouble(ReadOnlySpan label, ref double v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + double step = 0.0; + double step_fast = 0.0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.6f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.6f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (double* native_v = &v) + { + byte ret = ImGuiNative.igInputDouble(native_label, native_v, step, step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool InputDouble(string label, ref double v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + double step = 0.0; + double step_fast = 0.0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.6f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.6f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (double* native_v = &v) + { + byte ret = ImGuiNative.igInputDouble(native_label, native_v, step, step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputDouble(ReadOnlySpan label, ref double v, double step) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + double step_fast = 0.0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.6f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.6f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (double* native_v = &v) + { + byte ret = ImGuiNative.igInputDouble(native_label, native_v, step, step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool InputDouble(string label, ref double v, double step) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + double step_fast = 0.0; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.6f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.6f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (double* native_v = &v) + { + byte ret = ImGuiNative.igInputDouble(native_label, native_v, step, step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputDouble(ReadOnlySpan label, ref double v, double step, double step_fast) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.6f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.6f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (double* native_v = &v) + { + byte ret = ImGuiNative.igInputDouble(native_label, native_v, step, step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool InputDouble(string label, ref double v, double step, double step_fast) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.6f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.6f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (double* native_v = &v) + { + byte ret = ImGuiNative.igInputDouble(native_label, native_v, step, step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputDouble(ReadOnlySpan label, ref double v, double step, double step_fast, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (double* native_v = &v) + { + byte ret = ImGuiNative.igInputDouble(native_label, native_v, step, step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool InputDouble(string label, ref double v, double step, double step_fast, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (double* native_v = &v) + { + byte ret = ImGuiNative.igInputDouble(native_label, native_v, step, step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputDouble(ReadOnlySpan label, ref double v, double step, double step_fast, ReadOnlySpan format, ImGuiInputTextFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (double* native_v = &v) + { + byte ret = ImGuiNative.igInputDouble(native_label, native_v, step, step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool InputDouble(string label, ref double v, double step, double step_fast, string format, ImGuiInputTextFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (double* native_v = &v) + { + byte ret = ImGuiNative.igInputDouble(native_label, native_v, step, step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputFloat(ReadOnlySpan label, ref float v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float step = 0.0f; + float step_fast = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igInputFloat(native_label, native_v, step, step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool InputFloat(string label, ref float v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float step = 0.0f; + float step_fast = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igInputFloat(native_label, native_v, step, step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputFloat(ReadOnlySpan label, ref float v, float step) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float step_fast = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igInputFloat(native_label, native_v, step, step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool InputFloat(string label, ref float v, float step) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float step_fast = 0.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igInputFloat(native_label, native_v, step, step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputFloat(ReadOnlySpan label, ref float v, float step, float step_fast) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igInputFloat(native_label, native_v, step, step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool InputFloat(string label, ref float v, float step, float step_fast) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igInputFloat(native_label, native_v, step, step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputFloat(ReadOnlySpan label, ref float v, float step, float step_fast, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igInputFloat(native_label, native_v, step, step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool InputFloat(string label, ref float v, float step, float step_fast, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igInputFloat(native_label, native_v, step, step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputFloat(ReadOnlySpan label, ref float v, float step, float step_fast, ReadOnlySpan format, ImGuiInputTextFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igInputFloat(native_label, native_v, step, step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool InputFloat(string label, ref float v, float step, float step_fast, string format, ImGuiInputTextFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igInputFloat(native_label, native_v, step, step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputFloat2(ReadOnlySpan label, ref Vector2 v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (Vector2* native_v = &v) + { + byte ret = ImGuiNative.igInputFloat2(native_label, native_v, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool InputFloat2(string label, ref Vector2 v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (Vector2* native_v = &v) + { + byte ret = ImGuiNative.igInputFloat2(native_label, native_v, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputFloat2(ReadOnlySpan label, ref Vector2 v, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (Vector2* native_v = &v) + { + byte ret = ImGuiNative.igInputFloat2(native_label, native_v, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool InputFloat2(string label, ref Vector2 v, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (Vector2* native_v = &v) + { + byte ret = ImGuiNative.igInputFloat2(native_label, native_v, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputFloat2(ReadOnlySpan label, ref Vector2 v, ReadOnlySpan format, ImGuiInputTextFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (Vector2* native_v = &v) + { + byte ret = ImGuiNative.igInputFloat2(native_label, native_v, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool InputFloat2(string label, ref Vector2 v, string format, ImGuiInputTextFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (Vector2* native_v = &v) + { + byte ret = ImGuiNative.igInputFloat2(native_label, native_v, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputFloat3(ReadOnlySpan label, ref Vector3 v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (Vector3* native_v = &v) + { + byte ret = ImGuiNative.igInputFloat3(native_label, native_v, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool InputFloat3(string label, ref Vector3 v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (Vector3* native_v = &v) + { + byte ret = ImGuiNative.igInputFloat3(native_label, native_v, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputFloat3(ReadOnlySpan label, ref Vector3 v, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (Vector3* native_v = &v) + { + byte ret = ImGuiNative.igInputFloat3(native_label, native_v, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool InputFloat3(string label, ref Vector3 v, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (Vector3* native_v = &v) + { + byte ret = ImGuiNative.igInputFloat3(native_label, native_v, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputFloat3(ReadOnlySpan label, ref Vector3 v, ReadOnlySpan format, ImGuiInputTextFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (Vector3* native_v = &v) + { + byte ret = ImGuiNative.igInputFloat3(native_label, native_v, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool InputFloat3(string label, ref Vector3 v, string format, ImGuiInputTextFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (Vector3* native_v = &v) + { + byte ret = ImGuiNative.igInputFloat3(native_label, native_v, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputFloat4(ReadOnlySpan label, ref Vector4 v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (Vector4* native_v = &v) + { + byte ret = ImGuiNative.igInputFloat4(native_label, native_v, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool InputFloat4(string label, ref Vector4 v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (Vector4* native_v = &v) + { + byte ret = ImGuiNative.igInputFloat4(native_label, native_v, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputFloat4(ReadOnlySpan label, ref Vector4 v, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (Vector4* native_v = &v) + { + byte ret = ImGuiNative.igInputFloat4(native_label, native_v, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool InputFloat4(string label, ref Vector4 v, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (Vector4* native_v = &v) + { + byte ret = ImGuiNative.igInputFloat4(native_label, native_v, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputFloat4(ReadOnlySpan label, ref Vector4 v, ReadOnlySpan format, ImGuiInputTextFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (Vector4* native_v = &v) + { + byte ret = ImGuiNative.igInputFloat4(native_label, native_v, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool InputFloat4(string label, ref Vector4 v, string format, ImGuiInputTextFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (Vector4* native_v = &v) + { + byte ret = ImGuiNative.igInputFloat4(native_label, native_v, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputInt(ReadOnlySpan label, ref int v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int step = 1; + int step_fast = 100; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igInputInt(native_label, native_v, step, step_fast, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#endif + public static bool InputInt(string label, ref int v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int step = 1; + int step_fast = 100; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igInputInt(native_label, native_v, step, step_fast, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputInt(ReadOnlySpan label, ref int v, int step) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int step_fast = 100; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igInputInt(native_label, native_v, step, step_fast, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#endif + public static bool InputInt(string label, ref int v, int step) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int step_fast = 100; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igInputInt(native_label, native_v, step, step_fast, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputInt(ReadOnlySpan label, ref int v, int step, int step_fast) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igInputInt(native_label, native_v, step, step_fast, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#endif + public static bool InputInt(string label, ref int v, int step, int step_fast) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igInputInt(native_label, native_v, step, step_fast, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputInt(ReadOnlySpan label, ref int v, int step, int step_fast, ImGuiInputTextFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igInputInt(native_label, native_v, step, step_fast, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#endif + public static bool InputInt(string label, ref int v, int step, int step_fast, ImGuiInputTextFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igInputInt(native_label, native_v, step, step_fast, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputInt2(ReadOnlySpan label, ref int v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igInputInt2(native_label, native_v, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#endif + public static bool InputInt2(string label, ref int v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igInputInt2(native_label, native_v, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputInt2(ReadOnlySpan label, ref int v, ImGuiInputTextFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igInputInt2(native_label, native_v, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#endif + public static bool InputInt2(string label, ref int v, ImGuiInputTextFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igInputInt2(native_label, native_v, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputInt3(ReadOnlySpan label, ref int v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igInputInt3(native_label, native_v, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#endif + public static bool InputInt3(string label, ref int v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igInputInt3(native_label, native_v, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputInt3(ReadOnlySpan label, ref int v, ImGuiInputTextFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igInputInt3(native_label, native_v, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#endif + public static bool InputInt3(string label, ref int v, ImGuiInputTextFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igInputInt3(native_label, native_v, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputInt4(ReadOnlySpan label, ref int v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igInputInt4(native_label, native_v, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#endif + public static bool InputInt4(string label, ref int v) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igInputInt4(native_label, native_v, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputInt4(ReadOnlySpan label, ref int v, ImGuiInputTextFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igInputInt4(native_label, native_v, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#endif + public static bool InputInt4(string label, ref int v, ImGuiInputTextFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igInputInt4(native_label, native_v, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputScalar(ReadOnlySpan label, ImGuiDataType data_type, IntPtr p_data) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* p_step = null; + void* p_step_fast = null; + byte* native_format = null; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + byte ret = ImGuiNative.igInputScalar(native_label, data_type, native_p_data, p_step, p_step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool InputScalar(string label, ImGuiDataType data_type, IntPtr p_data) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* p_step = null; + void* p_step_fast = null; + byte* native_format = null; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + byte ret = ImGuiNative.igInputScalar(native_label, data_type, native_p_data, p_step, p_step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputScalar(ReadOnlySpan label, ImGuiDataType data_type, IntPtr p_data, IntPtr p_step) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_step = (void*)p_step.ToPointer(); + void* p_step_fast = null; + byte* native_format = null; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + byte ret = ImGuiNative.igInputScalar(native_label, data_type, native_p_data, native_p_step, p_step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool InputScalar(string label, ImGuiDataType data_type, IntPtr p_data, IntPtr p_step) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_step = (void*)p_step.ToPointer(); + void* p_step_fast = null; + byte* native_format = null; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + byte ret = ImGuiNative.igInputScalar(native_label, data_type, native_p_data, native_p_step, p_step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputScalar(ReadOnlySpan label, ImGuiDataType data_type, IntPtr p_data, IntPtr p_step, IntPtr p_step_fast) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_step = (void*)p_step.ToPointer(); + void* native_p_step_fast = (void*)p_step_fast.ToPointer(); + byte* native_format = null; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + byte ret = ImGuiNative.igInputScalar(native_label, data_type, native_p_data, native_p_step, native_p_step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool InputScalar(string label, ImGuiDataType data_type, IntPtr p_data, IntPtr p_step, IntPtr p_step_fast) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_step = (void*)p_step.ToPointer(); + void* native_p_step_fast = (void*)p_step_fast.ToPointer(); + byte* native_format = null; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + byte ret = ImGuiNative.igInputScalar(native_label, data_type, native_p_data, native_p_step, native_p_step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputScalar(ReadOnlySpan label, ImGuiDataType data_type, IntPtr p_data, IntPtr p_step, IntPtr p_step_fast, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_step = (void*)p_step.ToPointer(); + void* native_p_step_fast = (void*)p_step_fast.ToPointer(); + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + byte ret = ImGuiNative.igInputScalar(native_label, data_type, native_p_data, native_p_step, native_p_step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } +#endif + public static bool InputScalar(string label, ImGuiDataType data_type, IntPtr p_data, IntPtr p_step, IntPtr p_step_fast, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_step = (void*)p_step.ToPointer(); + void* native_p_step_fast = (void*)p_step_fast.ToPointer(); + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + byte ret = ImGuiNative.igInputScalar(native_label, data_type, native_p_data, native_p_step, native_p_step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputScalar(ReadOnlySpan label, ImGuiDataType data_type, IntPtr p_data, IntPtr p_step, IntPtr p_step_fast, ReadOnlySpan format, ImGuiInputTextFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_step = (void*)p_step.ToPointer(); + void* native_p_step_fast = (void*)p_step_fast.ToPointer(); + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + byte ret = ImGuiNative.igInputScalar(native_label, data_type, native_p_data, native_p_step, native_p_step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } +#endif + public static bool InputScalar(string label, ImGuiDataType data_type, IntPtr p_data, IntPtr p_step, IntPtr p_step_fast, string format, ImGuiInputTextFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_step = (void*)p_step.ToPointer(); + void* native_p_step_fast = (void*)p_step_fast.ToPointer(); + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + byte ret = ImGuiNative.igInputScalar(native_label, data_type, native_p_data, native_p_step, native_p_step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputScalarN(ReadOnlySpan label, ImGuiDataType data_type, IntPtr p_data, int components) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* p_step = null; + void* p_step_fast = null; + byte* native_format = null; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + byte ret = ImGuiNative.igInputScalarN(native_label, data_type, native_p_data, components, p_step, p_step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool InputScalarN(string label, ImGuiDataType data_type, IntPtr p_data, int components) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* p_step = null; + void* p_step_fast = null; + byte* native_format = null; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + byte ret = ImGuiNative.igInputScalarN(native_label, data_type, native_p_data, components, p_step, p_step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputScalarN(ReadOnlySpan label, ImGuiDataType data_type, IntPtr p_data, int components, IntPtr p_step) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_step = (void*)p_step.ToPointer(); + void* p_step_fast = null; + byte* native_format = null; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + byte ret = ImGuiNative.igInputScalarN(native_label, data_type, native_p_data, components, native_p_step, p_step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool InputScalarN(string label, ImGuiDataType data_type, IntPtr p_data, int components, IntPtr p_step) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_step = (void*)p_step.ToPointer(); + void* p_step_fast = null; + byte* native_format = null; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + byte ret = ImGuiNative.igInputScalarN(native_label, data_type, native_p_data, components, native_p_step, p_step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputScalarN(ReadOnlySpan label, ImGuiDataType data_type, IntPtr p_data, int components, IntPtr p_step, IntPtr p_step_fast) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_step = (void*)p_step.ToPointer(); + void* native_p_step_fast = (void*)p_step_fast.ToPointer(); + byte* native_format = null; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + byte ret = ImGuiNative.igInputScalarN(native_label, data_type, native_p_data, components, native_p_step, native_p_step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool InputScalarN(string label, ImGuiDataType data_type, IntPtr p_data, int components, IntPtr p_step, IntPtr p_step_fast) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_step = (void*)p_step.ToPointer(); + void* native_p_step_fast = (void*)p_step_fast.ToPointer(); + byte* native_format = null; + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + byte ret = ImGuiNative.igInputScalarN(native_label, data_type, native_p_data, components, native_p_step, native_p_step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputScalarN(ReadOnlySpan label, ImGuiDataType data_type, IntPtr p_data, int components, IntPtr p_step, IntPtr p_step_fast, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_step = (void*)p_step.ToPointer(); + void* native_p_step_fast = (void*)p_step_fast.ToPointer(); + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + byte ret = ImGuiNative.igInputScalarN(native_label, data_type, native_p_data, components, native_p_step, native_p_step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } +#endif + public static bool InputScalarN(string label, ImGuiDataType data_type, IntPtr p_data, int components, IntPtr p_step, IntPtr p_step_fast, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_step = (void*)p_step.ToPointer(); + void* native_p_step_fast = (void*)p_step_fast.ToPointer(); + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiInputTextFlags flags = (ImGuiInputTextFlags)0; + byte ret = ImGuiNative.igInputScalarN(native_label, data_type, native_p_data, components, native_p_step, native_p_step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InputScalarN(ReadOnlySpan label, ImGuiDataType data_type, IntPtr p_data, int components, IntPtr p_step, IntPtr p_step_fast, ReadOnlySpan format, ImGuiInputTextFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_step = (void*)p_step.ToPointer(); + void* native_p_step_fast = (void*)p_step_fast.ToPointer(); + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + byte ret = ImGuiNative.igInputScalarN(native_label, data_type, native_p_data, components, native_p_step, native_p_step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } +#endif + public static bool InputScalarN(string label, ImGuiDataType data_type, IntPtr p_data, int components, IntPtr p_step, IntPtr p_step_fast, string format, ImGuiInputTextFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_step = (void*)p_step.ToPointer(); + void* native_p_step_fast = (void*)p_step_fast.ToPointer(); + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + byte ret = ImGuiNative.igInputScalarN(native_label, data_type, native_p_data, components, native_p_step, native_p_step_fast, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InvisibleButton(ReadOnlySpan str_id, Vector2 size) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + ImGuiButtonFlags flags = (ImGuiButtonFlags)0; + byte ret = ImGuiNative.igInvisibleButton(native_str_id, size, flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#endif + public static bool InvisibleButton(string str_id, Vector2 size) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + ImGuiButtonFlags flags = (ImGuiButtonFlags)0; + byte ret = ImGuiNative.igInvisibleButton(native_str_id, size, flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool InvisibleButton(ReadOnlySpan str_id, Vector2 size, ImGuiButtonFlags flags) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + byte ret = ImGuiNative.igInvisibleButton(native_str_id, size, flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#endif + public static bool InvisibleButton(string str_id, Vector2 size, ImGuiButtonFlags flags) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + byte ret = ImGuiNative.igInvisibleButton(native_str_id, size, flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } + public static bool IsAnyItemActive() + { + byte ret = ImGuiNative.igIsAnyItemActive(); + return ret != 0; + } + public static bool IsAnyItemFocused() + { + byte ret = ImGuiNative.igIsAnyItemFocused(); + return ret != 0; + } + public static bool IsAnyItemHovered() + { + byte ret = ImGuiNative.igIsAnyItemHovered(); + return ret != 0; + } + public static bool IsAnyMouseDown() + { + byte ret = ImGuiNative.igIsAnyMouseDown(); + return ret != 0; + } + public static bool IsItemActivated() + { + byte ret = ImGuiNative.igIsItemActivated(); + return ret != 0; + } + public static bool IsItemActive() + { + byte ret = ImGuiNative.igIsItemActive(); + return ret != 0; + } + public static bool IsItemClicked() + { + ImGuiMouseButton mouse_button = (ImGuiMouseButton)0; + byte ret = ImGuiNative.igIsItemClicked(mouse_button); + return ret != 0; + } + public static bool IsItemClicked(ImGuiMouseButton mouse_button) + { + byte ret = ImGuiNative.igIsItemClicked(mouse_button); + return ret != 0; + } + public static bool IsItemDeactivated() + { + byte ret = ImGuiNative.igIsItemDeactivated(); + return ret != 0; + } + public static bool IsItemDeactivatedAfterEdit() + { + byte ret = ImGuiNative.igIsItemDeactivatedAfterEdit(); + return ret != 0; + } + public static bool IsItemEdited() + { + byte ret = ImGuiNative.igIsItemEdited(); + return ret != 0; + } + public static bool IsItemFocused() + { + byte ret = ImGuiNative.igIsItemFocused(); + return ret != 0; + } + public static bool IsItemHovered() + { + ImGuiHoveredFlags flags = (ImGuiHoveredFlags)0; + byte ret = ImGuiNative.igIsItemHovered(flags); + return ret != 0; + } + public static bool IsItemHovered(ImGuiHoveredFlags flags) + { + byte ret = ImGuiNative.igIsItemHovered(flags); + return ret != 0; + } + public static bool IsItemToggledOpen() + { + byte ret = ImGuiNative.igIsItemToggledOpen(); + return ret != 0; + } + public static bool IsItemVisible() + { + byte ret = ImGuiNative.igIsItemVisible(); + return ret != 0; + } + public static bool IsKeyChordPressed(ImGuiKey key_chord) + { + byte ret = ImGuiNative.igIsKeyChordPressed_Nil(key_chord); + return ret != 0; + } + public static bool IsKeyDown(ImGuiKey key) + { + byte ret = ImGuiNative.igIsKeyDown_Nil(key); + return ret != 0; + } + public static bool IsKeyPressed(ImGuiKey key) + { + byte repeat = 1; + byte ret = ImGuiNative.igIsKeyPressed_Bool(key, repeat); + return ret != 0; + } + public static bool IsKeyPressed(ImGuiKey key, bool repeat) + { + byte native_repeat = repeat ? (byte)1 : (byte)0; + byte ret = ImGuiNative.igIsKeyPressed_Bool(key, native_repeat); + return ret != 0; + } + public static bool IsKeyReleased(ImGuiKey key) + { + byte ret = ImGuiNative.igIsKeyReleased_Nil(key); + return ret != 0; + } + public static bool IsMouseClicked(ImGuiMouseButton button) + { + byte repeat = 0; + byte ret = ImGuiNative.igIsMouseClicked_Bool(button, repeat); + return ret != 0; + } + public static bool IsMouseClicked(ImGuiMouseButton button, bool repeat) + { + byte native_repeat = repeat ? (byte)1 : (byte)0; + byte ret = ImGuiNative.igIsMouseClicked_Bool(button, native_repeat); + return ret != 0; + } + public static bool IsMouseDoubleClicked(ImGuiMouseButton button) + { + byte ret = ImGuiNative.igIsMouseDoubleClicked_Nil(button); + return ret != 0; + } + public static bool IsMouseDown(ImGuiMouseButton button) + { + byte ret = ImGuiNative.igIsMouseDown_Nil(button); + return ret != 0; + } + public static bool IsMouseDragging(ImGuiMouseButton button) + { + float lock_threshold = -1.0f; + byte ret = ImGuiNative.igIsMouseDragging(button, lock_threshold); + return ret != 0; + } + public static bool IsMouseDragging(ImGuiMouseButton button, float lock_threshold) + { + byte ret = ImGuiNative.igIsMouseDragging(button, lock_threshold); + return ret != 0; + } + public static bool IsMouseHoveringRect(Vector2 r_min, Vector2 r_max) + { + byte clip = 1; + byte ret = ImGuiNative.igIsMouseHoveringRect(r_min, r_max, clip); + return ret != 0; + } + public static bool IsMouseHoveringRect(Vector2 r_min, Vector2 r_max, bool clip) + { + byte native_clip = clip ? (byte)1 : (byte)0; + byte ret = ImGuiNative.igIsMouseHoveringRect(r_min, r_max, native_clip); + return ret != 0; + } + public static bool IsMousePosValid() + { + Vector2* mouse_pos = null; + byte ret = ImGuiNative.igIsMousePosValid(mouse_pos); + return ret != 0; + } + public static bool IsMousePosValid(ref Vector2 mouse_pos) + { + fixed (Vector2* native_mouse_pos = &mouse_pos) + { + byte ret = ImGuiNative.igIsMousePosValid(native_mouse_pos); + return ret != 0; + } + } + public static bool IsMouseReleased(ImGuiMouseButton button) + { + byte ret = ImGuiNative.igIsMouseReleased_Nil(button); + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool IsPopupOpen(ReadOnlySpan str_id) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + ImGuiPopupFlags flags = (ImGuiPopupFlags)0; + byte ret = ImGuiNative.igIsPopupOpen_Str(native_str_id, flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#endif + public static bool IsPopupOpen(string str_id) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + ImGuiPopupFlags flags = (ImGuiPopupFlags)0; + byte ret = ImGuiNative.igIsPopupOpen_Str(native_str_id, flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool IsPopupOpen(ReadOnlySpan str_id, ImGuiPopupFlags flags) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + byte ret = ImGuiNative.igIsPopupOpen_Str(native_str_id, flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } +#endif + public static bool IsPopupOpen(string str_id, ImGuiPopupFlags flags) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + byte ret = ImGuiNative.igIsPopupOpen_Str(native_str_id, flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + return ret != 0; + } + public static bool IsRectVisible(Vector2 size) + { + byte ret = ImGuiNative.igIsRectVisible_Nil(size); + return ret != 0; + } + public static bool IsRectVisible(Vector2 rect_min, Vector2 rect_max) + { + byte ret = ImGuiNative.igIsRectVisible_Vec2(rect_min, rect_max); + return ret != 0; + } + public static bool IsWindowAppearing() + { + byte ret = ImGuiNative.igIsWindowAppearing(); + return ret != 0; + } + public static bool IsWindowCollapsed() + { + byte ret = ImGuiNative.igIsWindowCollapsed(); + return ret != 0; + } + public static bool IsWindowDocked() + { + byte ret = ImGuiNative.igIsWindowDocked(); + return ret != 0; + } + public static bool IsWindowFocused() + { + ImGuiFocusedFlags flags = (ImGuiFocusedFlags)0; + byte ret = ImGuiNative.igIsWindowFocused(flags); + return ret != 0; + } + public static bool IsWindowFocused(ImGuiFocusedFlags flags) + { + byte ret = ImGuiNative.igIsWindowFocused(flags); + return ret != 0; + } + public static bool IsWindowHovered() + { + ImGuiHoveredFlags flags = (ImGuiHoveredFlags)0; + byte ret = ImGuiNative.igIsWindowHovered(flags); + return ret != 0; + } + public static bool IsWindowHovered(ImGuiHoveredFlags flags) + { + byte ret = ImGuiNative.igIsWindowHovered(flags); + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void LabelText(ReadOnlySpan label, ReadOnlySpan fmt) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_fmt; + int fmt_byteCount = 0; + if (fmt != null) + { + fmt_byteCount = Encoding.UTF8.GetByteCount(fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + native_fmt = Util.Allocate(fmt_byteCount + 1); + } + else + { + byte* native_fmt_stackBytes = stackalloc byte[fmt_byteCount + 1]; + native_fmt = native_fmt_stackBytes; + } + int native_fmt_offset = Util.GetUtf8(fmt, native_fmt, fmt_byteCount); + native_fmt[native_fmt_offset] = 0; + } + else { native_fmt = null; } + ImGuiNative.igLabelText(native_label, native_fmt); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_fmt); + } + } +#endif + public static void LabelText(string label, string fmt) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_fmt; + int fmt_byteCount = 0; + if (fmt != null) + { + fmt_byteCount = Encoding.UTF8.GetByteCount(fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + native_fmt = Util.Allocate(fmt_byteCount + 1); + } + else + { + byte* native_fmt_stackBytes = stackalloc byte[fmt_byteCount + 1]; + native_fmt = native_fmt_stackBytes; + } + int native_fmt_offset = Util.GetUtf8(fmt, native_fmt, fmt_byteCount); + native_fmt[native_fmt_offset] = 0; + } + else { native_fmt = null; } + ImGuiNative.igLabelText(native_label, native_fmt); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_fmt); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool ListBox(ReadOnlySpan label, ref int current_item, string[] items, int items_count) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int* items_byteCounts = stackalloc int[items.Length]; + int items_byteCount = 0; + for (int i = 0; i < items.Length; i++) + { + string s = items[i]; + items_byteCounts[i] = Encoding.UTF8.GetByteCount(s); + items_byteCount += items_byteCounts[i] + 1; + } + byte* native_items_data = stackalloc byte[items_byteCount]; + int offset = 0; + for (int i = 0; i < items.Length; i++) + { + string s = items[i]; + offset += Util.GetUtf8(s, native_items_data + offset, items_byteCounts[i]); + native_items_data[offset++] = 0; + } + byte** native_items = stackalloc byte*[items.Length]; + offset = 0; + for (int i = 0; i < items.Length; i++) + { + native_items[i] = &native_items_data[offset]; + offset += items_byteCounts[i] + 1; + } + int height_in_items = -1; + fixed (int* native_current_item = ¤t_item) + { + byte ret = ImGuiNative.igListBox_Str_arr(native_label, native_current_item, native_items, items_count, height_in_items); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#endif + public static bool ListBox(string label, ref int current_item, string[] items, int items_count) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int* items_byteCounts = stackalloc int[items.Length]; + int items_byteCount = 0; + for (int i = 0; i < items.Length; i++) + { + string s = items[i]; + items_byteCounts[i] = Encoding.UTF8.GetByteCount(s); + items_byteCount += items_byteCounts[i] + 1; + } + byte* native_items_data = stackalloc byte[items_byteCount]; + int offset = 0; + for (int i = 0; i < items.Length; i++) + { + string s = items[i]; + offset += Util.GetUtf8(s, native_items_data + offset, items_byteCounts[i]); + native_items_data[offset++] = 0; + } + byte** native_items = stackalloc byte*[items.Length]; + offset = 0; + for (int i = 0; i < items.Length; i++) + { + native_items[i] = &native_items_data[offset]; + offset += items_byteCounts[i] + 1; + } + int height_in_items = -1; + fixed (int* native_current_item = ¤t_item) + { + byte ret = ImGuiNative.igListBox_Str_arr(native_label, native_current_item, native_items, items_count, height_in_items); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool ListBox(ReadOnlySpan label, ref int current_item, string[] items, int items_count, int height_in_items) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int* items_byteCounts = stackalloc int[items.Length]; + int items_byteCount = 0; + for (int i = 0; i < items.Length; i++) + { + string s = items[i]; + items_byteCounts[i] = Encoding.UTF8.GetByteCount(s); + items_byteCount += items_byteCounts[i] + 1; + } + byte* native_items_data = stackalloc byte[items_byteCount]; + int offset = 0; + for (int i = 0; i < items.Length; i++) + { + string s = items[i]; + offset += Util.GetUtf8(s, native_items_data + offset, items_byteCounts[i]); + native_items_data[offset++] = 0; + } + byte** native_items = stackalloc byte*[items.Length]; + offset = 0; + for (int i = 0; i < items.Length; i++) + { + native_items[i] = &native_items_data[offset]; + offset += items_byteCounts[i] + 1; + } + fixed (int* native_current_item = ¤t_item) + { + byte ret = ImGuiNative.igListBox_Str_arr(native_label, native_current_item, native_items, items_count, height_in_items); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#endif + public static bool ListBox(string label, ref int current_item, string[] items, int items_count, int height_in_items) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int* items_byteCounts = stackalloc int[items.Length]; + int items_byteCount = 0; + for (int i = 0; i < items.Length; i++) + { + string s = items[i]; + items_byteCounts[i] = Encoding.UTF8.GetByteCount(s); + items_byteCount += items_byteCounts[i] + 1; + } + byte* native_items_data = stackalloc byte[items_byteCount]; + int offset = 0; + for (int i = 0; i < items.Length; i++) + { + string s = items[i]; + offset += Util.GetUtf8(s, native_items_data + offset, items_byteCounts[i]); + native_items_data[offset++] = 0; + } + byte** native_items = stackalloc byte*[items.Length]; + offset = 0; + for (int i = 0; i < items.Length; i++) + { + native_items[i] = &native_items_data[offset]; + offset += items_byteCounts[i] + 1; + } + fixed (int* native_current_item = ¤t_item) + { + byte ret = ImGuiNative.igListBox_Str_arr(native_label, native_current_item, native_items, items_count, height_in_items); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void LoadIniSettingsFromDisk(ReadOnlySpan ini_filename) + { + byte* native_ini_filename; + int ini_filename_byteCount = 0; + if (ini_filename != null) + { + ini_filename_byteCount = Encoding.UTF8.GetByteCount(ini_filename); + if (ini_filename_byteCount > Util.StackAllocationSizeLimit) + { + native_ini_filename = Util.Allocate(ini_filename_byteCount + 1); + } + else + { + byte* native_ini_filename_stackBytes = stackalloc byte[ini_filename_byteCount + 1]; + native_ini_filename = native_ini_filename_stackBytes; + } + int native_ini_filename_offset = Util.GetUtf8(ini_filename, native_ini_filename, ini_filename_byteCount); + native_ini_filename[native_ini_filename_offset] = 0; + } + else { native_ini_filename = null; } + ImGuiNative.igLoadIniSettingsFromDisk(native_ini_filename); + if (ini_filename_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_ini_filename); + } + } +#endif + public static void LoadIniSettingsFromDisk(string ini_filename) + { + byte* native_ini_filename; + int ini_filename_byteCount = 0; + if (ini_filename != null) + { + ini_filename_byteCount = Encoding.UTF8.GetByteCount(ini_filename); + if (ini_filename_byteCount > Util.StackAllocationSizeLimit) + { + native_ini_filename = Util.Allocate(ini_filename_byteCount + 1); + } + else + { + byte* native_ini_filename_stackBytes = stackalloc byte[ini_filename_byteCount + 1]; + native_ini_filename = native_ini_filename_stackBytes; + } + int native_ini_filename_offset = Util.GetUtf8(ini_filename, native_ini_filename, ini_filename_byteCount); + native_ini_filename[native_ini_filename_offset] = 0; + } + else { native_ini_filename = null; } + ImGuiNative.igLoadIniSettingsFromDisk(native_ini_filename); + if (ini_filename_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_ini_filename); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void LoadIniSettingsFromMemory(ReadOnlySpan ini_data) + { + byte* native_ini_data; + int ini_data_byteCount = 0; + if (ini_data != null) + { + ini_data_byteCount = Encoding.UTF8.GetByteCount(ini_data); + if (ini_data_byteCount > Util.StackAllocationSizeLimit) + { + native_ini_data = Util.Allocate(ini_data_byteCount + 1); + } + else + { + byte* native_ini_data_stackBytes = stackalloc byte[ini_data_byteCount + 1]; + native_ini_data = native_ini_data_stackBytes; + } + int native_ini_data_offset = Util.GetUtf8(ini_data, native_ini_data, ini_data_byteCount); + native_ini_data[native_ini_data_offset] = 0; + } + else { native_ini_data = null; } + uint ini_size = 0; + ImGuiNative.igLoadIniSettingsFromMemory(native_ini_data, ini_size); + if (ini_data_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_ini_data); + } + } +#endif + public static void LoadIniSettingsFromMemory(string ini_data) + { + byte* native_ini_data; + int ini_data_byteCount = 0; + if (ini_data != null) + { + ini_data_byteCount = Encoding.UTF8.GetByteCount(ini_data); + if (ini_data_byteCount > Util.StackAllocationSizeLimit) + { + native_ini_data = Util.Allocate(ini_data_byteCount + 1); + } + else + { + byte* native_ini_data_stackBytes = stackalloc byte[ini_data_byteCount + 1]; + native_ini_data = native_ini_data_stackBytes; + } + int native_ini_data_offset = Util.GetUtf8(ini_data, native_ini_data, ini_data_byteCount); + native_ini_data[native_ini_data_offset] = 0; + } + else { native_ini_data = null; } + uint ini_size = 0; + ImGuiNative.igLoadIniSettingsFromMemory(native_ini_data, ini_size); + if (ini_data_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_ini_data); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void LoadIniSettingsFromMemory(ReadOnlySpan ini_data, uint ini_size) + { + byte* native_ini_data; + int ini_data_byteCount = 0; + if (ini_data != null) + { + ini_data_byteCount = Encoding.UTF8.GetByteCount(ini_data); + if (ini_data_byteCount > Util.StackAllocationSizeLimit) + { + native_ini_data = Util.Allocate(ini_data_byteCount + 1); + } + else + { + byte* native_ini_data_stackBytes = stackalloc byte[ini_data_byteCount + 1]; + native_ini_data = native_ini_data_stackBytes; + } + int native_ini_data_offset = Util.GetUtf8(ini_data, native_ini_data, ini_data_byteCount); + native_ini_data[native_ini_data_offset] = 0; + } + else { native_ini_data = null; } + ImGuiNative.igLoadIniSettingsFromMemory(native_ini_data, ini_size); + if (ini_data_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_ini_data); + } + } +#endif + public static void LoadIniSettingsFromMemory(string ini_data, uint ini_size) + { + byte* native_ini_data; + int ini_data_byteCount = 0; + if (ini_data != null) + { + ini_data_byteCount = Encoding.UTF8.GetByteCount(ini_data); + if (ini_data_byteCount > Util.StackAllocationSizeLimit) + { + native_ini_data = Util.Allocate(ini_data_byteCount + 1); + } + else + { + byte* native_ini_data_stackBytes = stackalloc byte[ini_data_byteCount + 1]; + native_ini_data = native_ini_data_stackBytes; + } + int native_ini_data_offset = Util.GetUtf8(ini_data, native_ini_data, ini_data_byteCount); + native_ini_data[native_ini_data_offset] = 0; + } + else { native_ini_data = null; } + ImGuiNative.igLoadIniSettingsFromMemory(native_ini_data, ini_size); + if (ini_data_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_ini_data); + } + } + public static void LogButtons() + { + ImGuiNative.igLogButtons(); + } + public static void LogFinish() + { + ImGuiNative.igLogFinish(); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void LogText(ReadOnlySpan fmt) + { + byte* native_fmt; + int fmt_byteCount = 0; + if (fmt != null) + { + fmt_byteCount = Encoding.UTF8.GetByteCount(fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + native_fmt = Util.Allocate(fmt_byteCount + 1); + } + else + { + byte* native_fmt_stackBytes = stackalloc byte[fmt_byteCount + 1]; + native_fmt = native_fmt_stackBytes; + } + int native_fmt_offset = Util.GetUtf8(fmt, native_fmt, fmt_byteCount); + native_fmt[native_fmt_offset] = 0; + } + else { native_fmt = null; } + ImGuiNative.igLogText(native_fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_fmt); + } + } +#endif + public static void LogText(string fmt) + { + byte* native_fmt; + int fmt_byteCount = 0; + if (fmt != null) + { + fmt_byteCount = Encoding.UTF8.GetByteCount(fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + native_fmt = Util.Allocate(fmt_byteCount + 1); + } + else + { + byte* native_fmt_stackBytes = stackalloc byte[fmt_byteCount + 1]; + native_fmt = native_fmt_stackBytes; + } + int native_fmt_offset = Util.GetUtf8(fmt, native_fmt, fmt_byteCount); + native_fmt[native_fmt_offset] = 0; + } + else { native_fmt = null; } + ImGuiNative.igLogText(native_fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_fmt); + } + } + public static void LogToClipboard() + { + int auto_open_depth = -1; + ImGuiNative.igLogToClipboard(auto_open_depth); + } + public static void LogToClipboard(int auto_open_depth) + { + ImGuiNative.igLogToClipboard(auto_open_depth); + } + public static void LogToFile() + { + int auto_open_depth = -1; + byte* native_filename = null; + ImGuiNative.igLogToFile(auto_open_depth, native_filename); + } + public static void LogToFile(int auto_open_depth) + { + byte* native_filename = null; + ImGuiNative.igLogToFile(auto_open_depth, native_filename); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void LogToFile(int auto_open_depth, ReadOnlySpan filename) + { + byte* native_filename; + int filename_byteCount = 0; + if (filename != null) + { + filename_byteCount = Encoding.UTF8.GetByteCount(filename); + if (filename_byteCount > Util.StackAllocationSizeLimit) + { + native_filename = Util.Allocate(filename_byteCount + 1); + } + else + { + byte* native_filename_stackBytes = stackalloc byte[filename_byteCount + 1]; + native_filename = native_filename_stackBytes; + } + int native_filename_offset = Util.GetUtf8(filename, native_filename, filename_byteCount); + native_filename[native_filename_offset] = 0; + } + else { native_filename = null; } + ImGuiNative.igLogToFile(auto_open_depth, native_filename); + if (filename_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_filename); + } + } +#endif + public static void LogToFile(int auto_open_depth, string filename) + { + byte* native_filename; + int filename_byteCount = 0; + if (filename != null) + { + filename_byteCount = Encoding.UTF8.GetByteCount(filename); + if (filename_byteCount > Util.StackAllocationSizeLimit) + { + native_filename = Util.Allocate(filename_byteCount + 1); + } + else + { + byte* native_filename_stackBytes = stackalloc byte[filename_byteCount + 1]; + native_filename = native_filename_stackBytes; + } + int native_filename_offset = Util.GetUtf8(filename, native_filename, filename_byteCount); + native_filename[native_filename_offset] = 0; + } + else { native_filename = null; } + ImGuiNative.igLogToFile(auto_open_depth, native_filename); + if (filename_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_filename); + } + } + public static void LogToTTY() + { + int auto_open_depth = -1; + ImGuiNative.igLogToTTY(auto_open_depth); + } + public static void LogToTTY(int auto_open_depth) + { + ImGuiNative.igLogToTTY(auto_open_depth); + } + public static IntPtr MemAlloc(uint size) + { + void* ret = ImGuiNative.igMemAlloc(size); + return (IntPtr)ret; + } + public static void MemFree(IntPtr ptr) + { + void* native_ptr = (void*)ptr.ToPointer(); + ImGuiNative.igMemFree(native_ptr); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool MenuItem(ReadOnlySpan label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_shortcut = null; + byte selected = 0; + byte enabled = 1; + byte ret = ImGuiNative.igMenuItem_Bool(native_label, native_shortcut, selected, enabled); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool MenuItem(string label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_shortcut = null; + byte selected = 0; + byte enabled = 1; + byte ret = ImGuiNative.igMenuItem_Bool(native_label, native_shortcut, selected, enabled); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool MenuItem(ReadOnlySpan label, ReadOnlySpan shortcut) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_shortcut; + int shortcut_byteCount = 0; + if (shortcut != null) + { + shortcut_byteCount = Encoding.UTF8.GetByteCount(shortcut); + if (shortcut_byteCount > Util.StackAllocationSizeLimit) + { + native_shortcut = Util.Allocate(shortcut_byteCount + 1); + } + else + { + byte* native_shortcut_stackBytes = stackalloc byte[shortcut_byteCount + 1]; + native_shortcut = native_shortcut_stackBytes; + } + int native_shortcut_offset = Util.GetUtf8(shortcut, native_shortcut, shortcut_byteCount); + native_shortcut[native_shortcut_offset] = 0; + } + else { native_shortcut = null; } + byte selected = 0; + byte enabled = 1; + byte ret = ImGuiNative.igMenuItem_Bool(native_label, native_shortcut, selected, enabled); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (shortcut_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_shortcut); + } + return ret != 0; + } +#endif + public static bool MenuItem(string label, string shortcut) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_shortcut; + int shortcut_byteCount = 0; + if (shortcut != null) + { + shortcut_byteCount = Encoding.UTF8.GetByteCount(shortcut); + if (shortcut_byteCount > Util.StackAllocationSizeLimit) + { + native_shortcut = Util.Allocate(shortcut_byteCount + 1); + } + else + { + byte* native_shortcut_stackBytes = stackalloc byte[shortcut_byteCount + 1]; + native_shortcut = native_shortcut_stackBytes; + } + int native_shortcut_offset = Util.GetUtf8(shortcut, native_shortcut, shortcut_byteCount); + native_shortcut[native_shortcut_offset] = 0; + } + else { native_shortcut = null; } + byte selected = 0; + byte enabled = 1; + byte ret = ImGuiNative.igMenuItem_Bool(native_label, native_shortcut, selected, enabled); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (shortcut_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_shortcut); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool MenuItem(ReadOnlySpan label, ReadOnlySpan shortcut, bool selected) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_shortcut; + int shortcut_byteCount = 0; + if (shortcut != null) + { + shortcut_byteCount = Encoding.UTF8.GetByteCount(shortcut); + if (shortcut_byteCount > Util.StackAllocationSizeLimit) + { + native_shortcut = Util.Allocate(shortcut_byteCount + 1); + } + else + { + byte* native_shortcut_stackBytes = stackalloc byte[shortcut_byteCount + 1]; + native_shortcut = native_shortcut_stackBytes; + } + int native_shortcut_offset = Util.GetUtf8(shortcut, native_shortcut, shortcut_byteCount); + native_shortcut[native_shortcut_offset] = 0; + } + else { native_shortcut = null; } + byte native_selected = selected ? (byte)1 : (byte)0; + byte enabled = 1; + byte ret = ImGuiNative.igMenuItem_Bool(native_label, native_shortcut, native_selected, enabled); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (shortcut_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_shortcut); + } + return ret != 0; + } +#endif + public static bool MenuItem(string label, string shortcut, bool selected) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_shortcut; + int shortcut_byteCount = 0; + if (shortcut != null) + { + shortcut_byteCount = Encoding.UTF8.GetByteCount(shortcut); + if (shortcut_byteCount > Util.StackAllocationSizeLimit) + { + native_shortcut = Util.Allocate(shortcut_byteCount + 1); + } + else + { + byte* native_shortcut_stackBytes = stackalloc byte[shortcut_byteCount + 1]; + native_shortcut = native_shortcut_stackBytes; + } + int native_shortcut_offset = Util.GetUtf8(shortcut, native_shortcut, shortcut_byteCount); + native_shortcut[native_shortcut_offset] = 0; + } + else { native_shortcut = null; } + byte native_selected = selected ? (byte)1 : (byte)0; + byte enabled = 1; + byte ret = ImGuiNative.igMenuItem_Bool(native_label, native_shortcut, native_selected, enabled); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (shortcut_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_shortcut); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool MenuItem(ReadOnlySpan label, ReadOnlySpan shortcut, bool selected, bool enabled) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_shortcut; + int shortcut_byteCount = 0; + if (shortcut != null) + { + shortcut_byteCount = Encoding.UTF8.GetByteCount(shortcut); + if (shortcut_byteCount > Util.StackAllocationSizeLimit) + { + native_shortcut = Util.Allocate(shortcut_byteCount + 1); + } + else + { + byte* native_shortcut_stackBytes = stackalloc byte[shortcut_byteCount + 1]; + native_shortcut = native_shortcut_stackBytes; + } + int native_shortcut_offset = Util.GetUtf8(shortcut, native_shortcut, shortcut_byteCount); + native_shortcut[native_shortcut_offset] = 0; + } + else { native_shortcut = null; } + byte native_selected = selected ? (byte)1 : (byte)0; + byte native_enabled = enabled ? (byte)1 : (byte)0; + byte ret = ImGuiNative.igMenuItem_Bool(native_label, native_shortcut, native_selected, native_enabled); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (shortcut_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_shortcut); + } + return ret != 0; + } +#endif + public static bool MenuItem(string label, string shortcut, bool selected, bool enabled) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_shortcut; + int shortcut_byteCount = 0; + if (shortcut != null) + { + shortcut_byteCount = Encoding.UTF8.GetByteCount(shortcut); + if (shortcut_byteCount > Util.StackAllocationSizeLimit) + { + native_shortcut = Util.Allocate(shortcut_byteCount + 1); + } + else + { + byte* native_shortcut_stackBytes = stackalloc byte[shortcut_byteCount + 1]; + native_shortcut = native_shortcut_stackBytes; + } + int native_shortcut_offset = Util.GetUtf8(shortcut, native_shortcut, shortcut_byteCount); + native_shortcut[native_shortcut_offset] = 0; + } + else { native_shortcut = null; } + byte native_selected = selected ? (byte)1 : (byte)0; + byte native_enabled = enabled ? (byte)1 : (byte)0; + byte ret = ImGuiNative.igMenuItem_Bool(native_label, native_shortcut, native_selected, native_enabled); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (shortcut_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_shortcut); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool MenuItem(ReadOnlySpan label, ReadOnlySpan shortcut, ref bool p_selected) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_shortcut; + int shortcut_byteCount = 0; + if (shortcut != null) + { + shortcut_byteCount = Encoding.UTF8.GetByteCount(shortcut); + if (shortcut_byteCount > Util.StackAllocationSizeLimit) + { + native_shortcut = Util.Allocate(shortcut_byteCount + 1); + } + else + { + byte* native_shortcut_stackBytes = stackalloc byte[shortcut_byteCount + 1]; + native_shortcut = native_shortcut_stackBytes; + } + int native_shortcut_offset = Util.GetUtf8(shortcut, native_shortcut, shortcut_byteCount); + native_shortcut[native_shortcut_offset] = 0; + } + else { native_shortcut = null; } + byte native_p_selected_val = p_selected ? (byte)1 : (byte)0; + byte* native_p_selected = &native_p_selected_val; + byte enabled = 1; + byte ret = ImGuiNative.igMenuItem_BoolPtr(native_label, native_shortcut, native_p_selected, enabled); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (shortcut_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_shortcut); + } + p_selected = native_p_selected_val != 0; + return ret != 0; + } +#endif + public static bool MenuItem(string label, string shortcut, ref bool p_selected) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_shortcut; + int shortcut_byteCount = 0; + if (shortcut != null) + { + shortcut_byteCount = Encoding.UTF8.GetByteCount(shortcut); + if (shortcut_byteCount > Util.StackAllocationSizeLimit) + { + native_shortcut = Util.Allocate(shortcut_byteCount + 1); + } + else + { + byte* native_shortcut_stackBytes = stackalloc byte[shortcut_byteCount + 1]; + native_shortcut = native_shortcut_stackBytes; + } + int native_shortcut_offset = Util.GetUtf8(shortcut, native_shortcut, shortcut_byteCount); + native_shortcut[native_shortcut_offset] = 0; + } + else { native_shortcut = null; } + byte native_p_selected_val = p_selected ? (byte)1 : (byte)0; + byte* native_p_selected = &native_p_selected_val; + byte enabled = 1; + byte ret = ImGuiNative.igMenuItem_BoolPtr(native_label, native_shortcut, native_p_selected, enabled); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (shortcut_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_shortcut); + } + p_selected = native_p_selected_val != 0; + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool MenuItem(ReadOnlySpan label, ReadOnlySpan shortcut, ref bool p_selected, bool enabled) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_shortcut; + int shortcut_byteCount = 0; + if (shortcut != null) + { + shortcut_byteCount = Encoding.UTF8.GetByteCount(shortcut); + if (shortcut_byteCount > Util.StackAllocationSizeLimit) + { + native_shortcut = Util.Allocate(shortcut_byteCount + 1); + } + else + { + byte* native_shortcut_stackBytes = stackalloc byte[shortcut_byteCount + 1]; + native_shortcut = native_shortcut_stackBytes; + } + int native_shortcut_offset = Util.GetUtf8(shortcut, native_shortcut, shortcut_byteCount); + native_shortcut[native_shortcut_offset] = 0; + } + else { native_shortcut = null; } + byte native_p_selected_val = p_selected ? (byte)1 : (byte)0; + byte* native_p_selected = &native_p_selected_val; + byte native_enabled = enabled ? (byte)1 : (byte)0; + byte ret = ImGuiNative.igMenuItem_BoolPtr(native_label, native_shortcut, native_p_selected, native_enabled); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (shortcut_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_shortcut); + } + p_selected = native_p_selected_val != 0; + return ret != 0; + } +#endif + public static bool MenuItem(string label, string shortcut, ref bool p_selected, bool enabled) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_shortcut; + int shortcut_byteCount = 0; + if (shortcut != null) + { + shortcut_byteCount = Encoding.UTF8.GetByteCount(shortcut); + if (shortcut_byteCount > Util.StackAllocationSizeLimit) + { + native_shortcut = Util.Allocate(shortcut_byteCount + 1); + } + else + { + byte* native_shortcut_stackBytes = stackalloc byte[shortcut_byteCount + 1]; + native_shortcut = native_shortcut_stackBytes; + } + int native_shortcut_offset = Util.GetUtf8(shortcut, native_shortcut, shortcut_byteCount); + native_shortcut[native_shortcut_offset] = 0; + } + else { native_shortcut = null; } + byte native_p_selected_val = p_selected ? (byte)1 : (byte)0; + byte* native_p_selected = &native_p_selected_val; + byte native_enabled = enabled ? (byte)1 : (byte)0; + byte ret = ImGuiNative.igMenuItem_BoolPtr(native_label, native_shortcut, native_p_selected, native_enabled); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (shortcut_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_shortcut); + } + p_selected = native_p_selected_val != 0; + return ret != 0; + } + public static void NewFrame() + { + ImGuiNative.igNewFrame(); + } + public static void NewLine() + { + ImGuiNative.igNewLine(); + } + public static void NextColumn() + { + ImGuiNative.igNextColumn(); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void OpenPopup(ReadOnlySpan str_id) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + ImGuiPopupFlags popup_flags = (ImGuiPopupFlags)0; + ImGuiNative.igOpenPopup_Str(native_str_id, popup_flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + } +#endif + public static void OpenPopup(string str_id) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + ImGuiPopupFlags popup_flags = (ImGuiPopupFlags)0; + ImGuiNative.igOpenPopup_Str(native_str_id, popup_flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void OpenPopup(ReadOnlySpan str_id, ImGuiPopupFlags popup_flags) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + ImGuiNative.igOpenPopup_Str(native_str_id, popup_flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + } +#endif + public static void OpenPopup(string str_id, ImGuiPopupFlags popup_flags) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + ImGuiNative.igOpenPopup_Str(native_str_id, popup_flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + } + public static void OpenPopup(uint id) + { + ImGuiPopupFlags popup_flags = (ImGuiPopupFlags)0; + ImGuiNative.igOpenPopup_ID(id, popup_flags); + } + public static void OpenPopup(uint id, ImGuiPopupFlags popup_flags) + { + ImGuiNative.igOpenPopup_ID(id, popup_flags); + } + public static void OpenPopupOnItemClick() + { + byte* native_str_id = null; + ImGuiPopupFlags popup_flags = (ImGuiPopupFlags)1; + ImGuiNative.igOpenPopupOnItemClick(native_str_id, popup_flags); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void OpenPopupOnItemClick(ReadOnlySpan str_id) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + ImGuiPopupFlags popup_flags = (ImGuiPopupFlags)1; + ImGuiNative.igOpenPopupOnItemClick(native_str_id, popup_flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + } +#endif + public static void OpenPopupOnItemClick(string str_id) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + ImGuiPopupFlags popup_flags = (ImGuiPopupFlags)1; + ImGuiNative.igOpenPopupOnItemClick(native_str_id, popup_flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void OpenPopupOnItemClick(ReadOnlySpan str_id, ImGuiPopupFlags popup_flags) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + ImGuiNative.igOpenPopupOnItemClick(native_str_id, popup_flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + } +#endif + public static void OpenPopupOnItemClick(string str_id, ImGuiPopupFlags popup_flags) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + ImGuiNative.igOpenPopupOnItemClick(native_str_id, popup_flags); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void PlotHistogram(ReadOnlySpan label, ref float values, int values_count) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int values_offset = 0; + byte* native_overlay_text = null; + float scale_min = float.MaxValue; + float scale_max = float.MaxValue; + Vector2 graph_size = new Vector2(); + int stride = sizeof(float); + fixed (float* native_values = &values) + { + ImGuiNative.igPlotHistogram_FloatPtr(native_label, native_values, values_count, values_offset, native_overlay_text, scale_min, scale_max, graph_size, stride); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + } + } +#endif + public static void PlotHistogram(string label, ref float values, int values_count) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int values_offset = 0; + byte* native_overlay_text = null; + float scale_min = float.MaxValue; + float scale_max = float.MaxValue; + Vector2 graph_size = new Vector2(); + int stride = sizeof(float); + fixed (float* native_values = &values) + { + ImGuiNative.igPlotHistogram_FloatPtr(native_label, native_values, values_count, values_offset, native_overlay_text, scale_min, scale_max, graph_size, stride); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void PlotHistogram(ReadOnlySpan label, ref float values, int values_count, int values_offset) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_overlay_text = null; + float scale_min = float.MaxValue; + float scale_max = float.MaxValue; + Vector2 graph_size = new Vector2(); + int stride = sizeof(float); + fixed (float* native_values = &values) + { + ImGuiNative.igPlotHistogram_FloatPtr(native_label, native_values, values_count, values_offset, native_overlay_text, scale_min, scale_max, graph_size, stride); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + } + } +#endif + public static void PlotHistogram(string label, ref float values, int values_count, int values_offset) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_overlay_text = null; + float scale_min = float.MaxValue; + float scale_max = float.MaxValue; + Vector2 graph_size = new Vector2(); + int stride = sizeof(float); + fixed (float* native_values = &values) + { + ImGuiNative.igPlotHistogram_FloatPtr(native_label, native_values, values_count, values_offset, native_overlay_text, scale_min, scale_max, graph_size, stride); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void PlotHistogram(ReadOnlySpan label, ref float values, int values_count, int values_offset, ReadOnlySpan overlay_text) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_overlay_text; + int overlay_text_byteCount = 0; + if (overlay_text != null) + { + overlay_text_byteCount = Encoding.UTF8.GetByteCount(overlay_text); + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + native_overlay_text = Util.Allocate(overlay_text_byteCount + 1); + } + else + { + byte* native_overlay_text_stackBytes = stackalloc byte[overlay_text_byteCount + 1]; + native_overlay_text = native_overlay_text_stackBytes; + } + int native_overlay_text_offset = Util.GetUtf8(overlay_text, native_overlay_text, overlay_text_byteCount); + native_overlay_text[native_overlay_text_offset] = 0; + } + else { native_overlay_text = null; } + float scale_min = float.MaxValue; + float scale_max = float.MaxValue; + Vector2 graph_size = new Vector2(); + int stride = sizeof(float); + fixed (float* native_values = &values) + { + ImGuiNative.igPlotHistogram_FloatPtr(native_label, native_values, values_count, values_offset, native_overlay_text, scale_min, scale_max, graph_size, stride); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_overlay_text); + } + } + } +#endif + public static void PlotHistogram(string label, ref float values, int values_count, int values_offset, string overlay_text) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_overlay_text; + int overlay_text_byteCount = 0; + if (overlay_text != null) + { + overlay_text_byteCount = Encoding.UTF8.GetByteCount(overlay_text); + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + native_overlay_text = Util.Allocate(overlay_text_byteCount + 1); + } + else + { + byte* native_overlay_text_stackBytes = stackalloc byte[overlay_text_byteCount + 1]; + native_overlay_text = native_overlay_text_stackBytes; + } + int native_overlay_text_offset = Util.GetUtf8(overlay_text, native_overlay_text, overlay_text_byteCount); + native_overlay_text[native_overlay_text_offset] = 0; + } + else { native_overlay_text = null; } + float scale_min = float.MaxValue; + float scale_max = float.MaxValue; + Vector2 graph_size = new Vector2(); + int stride = sizeof(float); + fixed (float* native_values = &values) + { + ImGuiNative.igPlotHistogram_FloatPtr(native_label, native_values, values_count, values_offset, native_overlay_text, scale_min, scale_max, graph_size, stride); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_overlay_text); + } + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void PlotHistogram(ReadOnlySpan label, ref float values, int values_count, int values_offset, ReadOnlySpan overlay_text, float scale_min) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_overlay_text; + int overlay_text_byteCount = 0; + if (overlay_text != null) + { + overlay_text_byteCount = Encoding.UTF8.GetByteCount(overlay_text); + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + native_overlay_text = Util.Allocate(overlay_text_byteCount + 1); + } + else + { + byte* native_overlay_text_stackBytes = stackalloc byte[overlay_text_byteCount + 1]; + native_overlay_text = native_overlay_text_stackBytes; + } + int native_overlay_text_offset = Util.GetUtf8(overlay_text, native_overlay_text, overlay_text_byteCount); + native_overlay_text[native_overlay_text_offset] = 0; + } + else { native_overlay_text = null; } + float scale_max = float.MaxValue; + Vector2 graph_size = new Vector2(); + int stride = sizeof(float); + fixed (float* native_values = &values) + { + ImGuiNative.igPlotHistogram_FloatPtr(native_label, native_values, values_count, values_offset, native_overlay_text, scale_min, scale_max, graph_size, stride); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_overlay_text); + } + } + } +#endif + public static void PlotHistogram(string label, ref float values, int values_count, int values_offset, string overlay_text, float scale_min) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_overlay_text; + int overlay_text_byteCount = 0; + if (overlay_text != null) + { + overlay_text_byteCount = Encoding.UTF8.GetByteCount(overlay_text); + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + native_overlay_text = Util.Allocate(overlay_text_byteCount + 1); + } + else + { + byte* native_overlay_text_stackBytes = stackalloc byte[overlay_text_byteCount + 1]; + native_overlay_text = native_overlay_text_stackBytes; + } + int native_overlay_text_offset = Util.GetUtf8(overlay_text, native_overlay_text, overlay_text_byteCount); + native_overlay_text[native_overlay_text_offset] = 0; + } + else { native_overlay_text = null; } + float scale_max = float.MaxValue; + Vector2 graph_size = new Vector2(); + int stride = sizeof(float); + fixed (float* native_values = &values) + { + ImGuiNative.igPlotHistogram_FloatPtr(native_label, native_values, values_count, values_offset, native_overlay_text, scale_min, scale_max, graph_size, stride); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_overlay_text); + } + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void PlotHistogram(ReadOnlySpan label, ref float values, int values_count, int values_offset, ReadOnlySpan overlay_text, float scale_min, float scale_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_overlay_text; + int overlay_text_byteCount = 0; + if (overlay_text != null) + { + overlay_text_byteCount = Encoding.UTF8.GetByteCount(overlay_text); + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + native_overlay_text = Util.Allocate(overlay_text_byteCount + 1); + } + else + { + byte* native_overlay_text_stackBytes = stackalloc byte[overlay_text_byteCount + 1]; + native_overlay_text = native_overlay_text_stackBytes; + } + int native_overlay_text_offset = Util.GetUtf8(overlay_text, native_overlay_text, overlay_text_byteCount); + native_overlay_text[native_overlay_text_offset] = 0; + } + else { native_overlay_text = null; } + Vector2 graph_size = new Vector2(); + int stride = sizeof(float); + fixed (float* native_values = &values) + { + ImGuiNative.igPlotHistogram_FloatPtr(native_label, native_values, values_count, values_offset, native_overlay_text, scale_min, scale_max, graph_size, stride); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_overlay_text); + } + } + } +#endif + public static void PlotHistogram(string label, ref float values, int values_count, int values_offset, string overlay_text, float scale_min, float scale_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_overlay_text; + int overlay_text_byteCount = 0; + if (overlay_text != null) + { + overlay_text_byteCount = Encoding.UTF8.GetByteCount(overlay_text); + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + native_overlay_text = Util.Allocate(overlay_text_byteCount + 1); + } + else + { + byte* native_overlay_text_stackBytes = stackalloc byte[overlay_text_byteCount + 1]; + native_overlay_text = native_overlay_text_stackBytes; + } + int native_overlay_text_offset = Util.GetUtf8(overlay_text, native_overlay_text, overlay_text_byteCount); + native_overlay_text[native_overlay_text_offset] = 0; + } + else { native_overlay_text = null; } + Vector2 graph_size = new Vector2(); + int stride = sizeof(float); + fixed (float* native_values = &values) + { + ImGuiNative.igPlotHistogram_FloatPtr(native_label, native_values, values_count, values_offset, native_overlay_text, scale_min, scale_max, graph_size, stride); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_overlay_text); + } + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void PlotHistogram(ReadOnlySpan label, ref float values, int values_count, int values_offset, ReadOnlySpan overlay_text, float scale_min, float scale_max, Vector2 graph_size) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_overlay_text; + int overlay_text_byteCount = 0; + if (overlay_text != null) + { + overlay_text_byteCount = Encoding.UTF8.GetByteCount(overlay_text); + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + native_overlay_text = Util.Allocate(overlay_text_byteCount + 1); + } + else + { + byte* native_overlay_text_stackBytes = stackalloc byte[overlay_text_byteCount + 1]; + native_overlay_text = native_overlay_text_stackBytes; + } + int native_overlay_text_offset = Util.GetUtf8(overlay_text, native_overlay_text, overlay_text_byteCount); + native_overlay_text[native_overlay_text_offset] = 0; + } + else { native_overlay_text = null; } + int stride = sizeof(float); + fixed (float* native_values = &values) + { + ImGuiNative.igPlotHistogram_FloatPtr(native_label, native_values, values_count, values_offset, native_overlay_text, scale_min, scale_max, graph_size, stride); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_overlay_text); + } + } + } +#endif + public static void PlotHistogram(string label, ref float values, int values_count, int values_offset, string overlay_text, float scale_min, float scale_max, Vector2 graph_size) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_overlay_text; + int overlay_text_byteCount = 0; + if (overlay_text != null) + { + overlay_text_byteCount = Encoding.UTF8.GetByteCount(overlay_text); + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + native_overlay_text = Util.Allocate(overlay_text_byteCount + 1); + } + else + { + byte* native_overlay_text_stackBytes = stackalloc byte[overlay_text_byteCount + 1]; + native_overlay_text = native_overlay_text_stackBytes; + } + int native_overlay_text_offset = Util.GetUtf8(overlay_text, native_overlay_text, overlay_text_byteCount); + native_overlay_text[native_overlay_text_offset] = 0; + } + else { native_overlay_text = null; } + int stride = sizeof(float); + fixed (float* native_values = &values) + { + ImGuiNative.igPlotHistogram_FloatPtr(native_label, native_values, values_count, values_offset, native_overlay_text, scale_min, scale_max, graph_size, stride); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_overlay_text); + } + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void PlotHistogram(ReadOnlySpan label, ref float values, int values_count, int values_offset, ReadOnlySpan overlay_text, float scale_min, float scale_max, Vector2 graph_size, int stride) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_overlay_text; + int overlay_text_byteCount = 0; + if (overlay_text != null) + { + overlay_text_byteCount = Encoding.UTF8.GetByteCount(overlay_text); + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + native_overlay_text = Util.Allocate(overlay_text_byteCount + 1); + } + else + { + byte* native_overlay_text_stackBytes = stackalloc byte[overlay_text_byteCount + 1]; + native_overlay_text = native_overlay_text_stackBytes; + } + int native_overlay_text_offset = Util.GetUtf8(overlay_text, native_overlay_text, overlay_text_byteCount); + native_overlay_text[native_overlay_text_offset] = 0; + } + else { native_overlay_text = null; } + fixed (float* native_values = &values) + { + ImGuiNative.igPlotHistogram_FloatPtr(native_label, native_values, values_count, values_offset, native_overlay_text, scale_min, scale_max, graph_size, stride); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_overlay_text); + } + } + } +#endif + public static void PlotHistogram(string label, ref float values, int values_count, int values_offset, string overlay_text, float scale_min, float scale_max, Vector2 graph_size, int stride) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_overlay_text; + int overlay_text_byteCount = 0; + if (overlay_text != null) + { + overlay_text_byteCount = Encoding.UTF8.GetByteCount(overlay_text); + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + native_overlay_text = Util.Allocate(overlay_text_byteCount + 1); + } + else + { + byte* native_overlay_text_stackBytes = stackalloc byte[overlay_text_byteCount + 1]; + native_overlay_text = native_overlay_text_stackBytes; + } + int native_overlay_text_offset = Util.GetUtf8(overlay_text, native_overlay_text, overlay_text_byteCount); + native_overlay_text[native_overlay_text_offset] = 0; + } + else { native_overlay_text = null; } + fixed (float* native_values = &values) + { + ImGuiNative.igPlotHistogram_FloatPtr(native_label, native_values, values_count, values_offset, native_overlay_text, scale_min, scale_max, graph_size, stride); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_overlay_text); + } + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void PlotLines(ReadOnlySpan label, ref float values, int values_count) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int values_offset = 0; + byte* native_overlay_text = null; + float scale_min = float.MaxValue; + float scale_max = float.MaxValue; + Vector2 graph_size = new Vector2(); + int stride = sizeof(float); + fixed (float* native_values = &values) + { + ImGuiNative.igPlotLines_FloatPtr(native_label, native_values, values_count, values_offset, native_overlay_text, scale_min, scale_max, graph_size, stride); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + } + } +#endif + public static void PlotLines(string label, ref float values, int values_count) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + int values_offset = 0; + byte* native_overlay_text = null; + float scale_min = float.MaxValue; + float scale_max = float.MaxValue; + Vector2 graph_size = new Vector2(); + int stride = sizeof(float); + fixed (float* native_values = &values) + { + ImGuiNative.igPlotLines_FloatPtr(native_label, native_values, values_count, values_offset, native_overlay_text, scale_min, scale_max, graph_size, stride); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void PlotLines(ReadOnlySpan label, ref float values, int values_count, int values_offset) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_overlay_text = null; + float scale_min = float.MaxValue; + float scale_max = float.MaxValue; + Vector2 graph_size = new Vector2(); + int stride = sizeof(float); + fixed (float* native_values = &values) + { + ImGuiNative.igPlotLines_FloatPtr(native_label, native_values, values_count, values_offset, native_overlay_text, scale_min, scale_max, graph_size, stride); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + } + } +#endif + public static void PlotLines(string label, ref float values, int values_count, int values_offset) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_overlay_text = null; + float scale_min = float.MaxValue; + float scale_max = float.MaxValue; + Vector2 graph_size = new Vector2(); + int stride = sizeof(float); + fixed (float* native_values = &values) + { + ImGuiNative.igPlotLines_FloatPtr(native_label, native_values, values_count, values_offset, native_overlay_text, scale_min, scale_max, graph_size, stride); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void PlotLines(ReadOnlySpan label, ref float values, int values_count, int values_offset, ReadOnlySpan overlay_text) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_overlay_text; + int overlay_text_byteCount = 0; + if (overlay_text != null) + { + overlay_text_byteCount = Encoding.UTF8.GetByteCount(overlay_text); + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + native_overlay_text = Util.Allocate(overlay_text_byteCount + 1); + } + else + { + byte* native_overlay_text_stackBytes = stackalloc byte[overlay_text_byteCount + 1]; + native_overlay_text = native_overlay_text_stackBytes; + } + int native_overlay_text_offset = Util.GetUtf8(overlay_text, native_overlay_text, overlay_text_byteCount); + native_overlay_text[native_overlay_text_offset] = 0; + } + else { native_overlay_text = null; } + float scale_min = float.MaxValue; + float scale_max = float.MaxValue; + Vector2 graph_size = new Vector2(); + int stride = sizeof(float); + fixed (float* native_values = &values) + { + ImGuiNative.igPlotLines_FloatPtr(native_label, native_values, values_count, values_offset, native_overlay_text, scale_min, scale_max, graph_size, stride); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_overlay_text); + } + } + } +#endif + public static void PlotLines(string label, ref float values, int values_count, int values_offset, string overlay_text) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_overlay_text; + int overlay_text_byteCount = 0; + if (overlay_text != null) + { + overlay_text_byteCount = Encoding.UTF8.GetByteCount(overlay_text); + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + native_overlay_text = Util.Allocate(overlay_text_byteCount + 1); + } + else + { + byte* native_overlay_text_stackBytes = stackalloc byte[overlay_text_byteCount + 1]; + native_overlay_text = native_overlay_text_stackBytes; + } + int native_overlay_text_offset = Util.GetUtf8(overlay_text, native_overlay_text, overlay_text_byteCount); + native_overlay_text[native_overlay_text_offset] = 0; + } + else { native_overlay_text = null; } + float scale_min = float.MaxValue; + float scale_max = float.MaxValue; + Vector2 graph_size = new Vector2(); + int stride = sizeof(float); + fixed (float* native_values = &values) + { + ImGuiNative.igPlotLines_FloatPtr(native_label, native_values, values_count, values_offset, native_overlay_text, scale_min, scale_max, graph_size, stride); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_overlay_text); + } + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void PlotLines(ReadOnlySpan label, ref float values, int values_count, int values_offset, ReadOnlySpan overlay_text, float scale_min) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_overlay_text; + int overlay_text_byteCount = 0; + if (overlay_text != null) + { + overlay_text_byteCount = Encoding.UTF8.GetByteCount(overlay_text); + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + native_overlay_text = Util.Allocate(overlay_text_byteCount + 1); + } + else + { + byte* native_overlay_text_stackBytes = stackalloc byte[overlay_text_byteCount + 1]; + native_overlay_text = native_overlay_text_stackBytes; + } + int native_overlay_text_offset = Util.GetUtf8(overlay_text, native_overlay_text, overlay_text_byteCount); + native_overlay_text[native_overlay_text_offset] = 0; + } + else { native_overlay_text = null; } + float scale_max = float.MaxValue; + Vector2 graph_size = new Vector2(); + int stride = sizeof(float); + fixed (float* native_values = &values) + { + ImGuiNative.igPlotLines_FloatPtr(native_label, native_values, values_count, values_offset, native_overlay_text, scale_min, scale_max, graph_size, stride); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_overlay_text); + } + } + } +#endif + public static void PlotLines(string label, ref float values, int values_count, int values_offset, string overlay_text, float scale_min) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_overlay_text; + int overlay_text_byteCount = 0; + if (overlay_text != null) + { + overlay_text_byteCount = Encoding.UTF8.GetByteCount(overlay_text); + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + native_overlay_text = Util.Allocate(overlay_text_byteCount + 1); + } + else + { + byte* native_overlay_text_stackBytes = stackalloc byte[overlay_text_byteCount + 1]; + native_overlay_text = native_overlay_text_stackBytes; + } + int native_overlay_text_offset = Util.GetUtf8(overlay_text, native_overlay_text, overlay_text_byteCount); + native_overlay_text[native_overlay_text_offset] = 0; + } + else { native_overlay_text = null; } + float scale_max = float.MaxValue; + Vector2 graph_size = new Vector2(); + int stride = sizeof(float); + fixed (float* native_values = &values) + { + ImGuiNative.igPlotLines_FloatPtr(native_label, native_values, values_count, values_offset, native_overlay_text, scale_min, scale_max, graph_size, stride); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_overlay_text); + } + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void PlotLines(ReadOnlySpan label, ref float values, int values_count, int values_offset, ReadOnlySpan overlay_text, float scale_min, float scale_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_overlay_text; + int overlay_text_byteCount = 0; + if (overlay_text != null) + { + overlay_text_byteCount = Encoding.UTF8.GetByteCount(overlay_text); + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + native_overlay_text = Util.Allocate(overlay_text_byteCount + 1); + } + else + { + byte* native_overlay_text_stackBytes = stackalloc byte[overlay_text_byteCount + 1]; + native_overlay_text = native_overlay_text_stackBytes; + } + int native_overlay_text_offset = Util.GetUtf8(overlay_text, native_overlay_text, overlay_text_byteCount); + native_overlay_text[native_overlay_text_offset] = 0; + } + else { native_overlay_text = null; } + Vector2 graph_size = new Vector2(); + int stride = sizeof(float); + fixed (float* native_values = &values) + { + ImGuiNative.igPlotLines_FloatPtr(native_label, native_values, values_count, values_offset, native_overlay_text, scale_min, scale_max, graph_size, stride); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_overlay_text); + } + } + } +#endif + public static void PlotLines(string label, ref float values, int values_count, int values_offset, string overlay_text, float scale_min, float scale_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_overlay_text; + int overlay_text_byteCount = 0; + if (overlay_text != null) + { + overlay_text_byteCount = Encoding.UTF8.GetByteCount(overlay_text); + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + native_overlay_text = Util.Allocate(overlay_text_byteCount + 1); + } + else + { + byte* native_overlay_text_stackBytes = stackalloc byte[overlay_text_byteCount + 1]; + native_overlay_text = native_overlay_text_stackBytes; + } + int native_overlay_text_offset = Util.GetUtf8(overlay_text, native_overlay_text, overlay_text_byteCount); + native_overlay_text[native_overlay_text_offset] = 0; + } + else { native_overlay_text = null; } + Vector2 graph_size = new Vector2(); + int stride = sizeof(float); + fixed (float* native_values = &values) + { + ImGuiNative.igPlotLines_FloatPtr(native_label, native_values, values_count, values_offset, native_overlay_text, scale_min, scale_max, graph_size, stride); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_overlay_text); + } + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void PlotLines(ReadOnlySpan label, ref float values, int values_count, int values_offset, ReadOnlySpan overlay_text, float scale_min, float scale_max, Vector2 graph_size) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_overlay_text; + int overlay_text_byteCount = 0; + if (overlay_text != null) + { + overlay_text_byteCount = Encoding.UTF8.GetByteCount(overlay_text); + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + native_overlay_text = Util.Allocate(overlay_text_byteCount + 1); + } + else + { + byte* native_overlay_text_stackBytes = stackalloc byte[overlay_text_byteCount + 1]; + native_overlay_text = native_overlay_text_stackBytes; + } + int native_overlay_text_offset = Util.GetUtf8(overlay_text, native_overlay_text, overlay_text_byteCount); + native_overlay_text[native_overlay_text_offset] = 0; + } + else { native_overlay_text = null; } + int stride = sizeof(float); + fixed (float* native_values = &values) + { + ImGuiNative.igPlotLines_FloatPtr(native_label, native_values, values_count, values_offset, native_overlay_text, scale_min, scale_max, graph_size, stride); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_overlay_text); + } + } + } +#endif + public static void PlotLines(string label, ref float values, int values_count, int values_offset, string overlay_text, float scale_min, float scale_max, Vector2 graph_size) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_overlay_text; + int overlay_text_byteCount = 0; + if (overlay_text != null) + { + overlay_text_byteCount = Encoding.UTF8.GetByteCount(overlay_text); + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + native_overlay_text = Util.Allocate(overlay_text_byteCount + 1); + } + else + { + byte* native_overlay_text_stackBytes = stackalloc byte[overlay_text_byteCount + 1]; + native_overlay_text = native_overlay_text_stackBytes; + } + int native_overlay_text_offset = Util.GetUtf8(overlay_text, native_overlay_text, overlay_text_byteCount); + native_overlay_text[native_overlay_text_offset] = 0; + } + else { native_overlay_text = null; } + int stride = sizeof(float); + fixed (float* native_values = &values) + { + ImGuiNative.igPlotLines_FloatPtr(native_label, native_values, values_count, values_offset, native_overlay_text, scale_min, scale_max, graph_size, stride); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_overlay_text); + } + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void PlotLines(ReadOnlySpan label, ref float values, int values_count, int values_offset, ReadOnlySpan overlay_text, float scale_min, float scale_max, Vector2 graph_size, int stride) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_overlay_text; + int overlay_text_byteCount = 0; + if (overlay_text != null) + { + overlay_text_byteCount = Encoding.UTF8.GetByteCount(overlay_text); + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + native_overlay_text = Util.Allocate(overlay_text_byteCount + 1); + } + else + { + byte* native_overlay_text_stackBytes = stackalloc byte[overlay_text_byteCount + 1]; + native_overlay_text = native_overlay_text_stackBytes; + } + int native_overlay_text_offset = Util.GetUtf8(overlay_text, native_overlay_text, overlay_text_byteCount); + native_overlay_text[native_overlay_text_offset] = 0; + } + else { native_overlay_text = null; } + fixed (float* native_values = &values) + { + ImGuiNative.igPlotLines_FloatPtr(native_label, native_values, values_count, values_offset, native_overlay_text, scale_min, scale_max, graph_size, stride); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_overlay_text); + } + } + } +#endif + public static void PlotLines(string label, ref float values, int values_count, int values_offset, string overlay_text, float scale_min, float scale_max, Vector2 graph_size, int stride) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_overlay_text; + int overlay_text_byteCount = 0; + if (overlay_text != null) + { + overlay_text_byteCount = Encoding.UTF8.GetByteCount(overlay_text); + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + native_overlay_text = Util.Allocate(overlay_text_byteCount + 1); + } + else + { + byte* native_overlay_text_stackBytes = stackalloc byte[overlay_text_byteCount + 1]; + native_overlay_text = native_overlay_text_stackBytes; + } + int native_overlay_text_offset = Util.GetUtf8(overlay_text, native_overlay_text, overlay_text_byteCount); + native_overlay_text[native_overlay_text_offset] = 0; + } + else { native_overlay_text = null; } + fixed (float* native_values = &values) + { + ImGuiNative.igPlotLines_FloatPtr(native_label, native_values, values_count, values_offset, native_overlay_text, scale_min, scale_max, graph_size, stride); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (overlay_text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_overlay_text); + } + } + } + public static void PopButtonRepeat() + { + ImGuiNative.igPopButtonRepeat(); + } + public static void PopClipRect() + { + ImGuiNative.igPopClipRect(); + } + public static void PopFont() + { + ImGuiNative.igPopFont(); + } + public static void PopID() + { + ImGuiNative.igPopID(); + } + public static void PopItemWidth() + { + ImGuiNative.igPopItemWidth(); + } + public static void PopStyleColor() + { + int count = 1; + ImGuiNative.igPopStyleColor(count); + } + public static void PopStyleColor(int count) + { + ImGuiNative.igPopStyleColor(count); + } + public static void PopStyleVar() + { + int count = 1; + ImGuiNative.igPopStyleVar(count); + } + public static void PopStyleVar(int count) + { + ImGuiNative.igPopStyleVar(count); + } + public static void PopTabStop() + { + ImGuiNative.igPopTabStop(); + } + public static void PopTextWrapPos() + { + ImGuiNative.igPopTextWrapPos(); + } + public static void ProgressBar(float fraction) + { + Vector2 size_arg = new Vector2(-float.MinValue, 0.0f); + byte* native_overlay = null; + ImGuiNative.igProgressBar(fraction, size_arg, native_overlay); + } + public static void ProgressBar(float fraction, Vector2 size_arg) + { + byte* native_overlay = null; + ImGuiNative.igProgressBar(fraction, size_arg, native_overlay); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void ProgressBar(float fraction, Vector2 size_arg, ReadOnlySpan overlay) + { + byte* native_overlay; + int overlay_byteCount = 0; + if (overlay != null) + { + overlay_byteCount = Encoding.UTF8.GetByteCount(overlay); + if (overlay_byteCount > Util.StackAllocationSizeLimit) + { + native_overlay = Util.Allocate(overlay_byteCount + 1); + } + else + { + byte* native_overlay_stackBytes = stackalloc byte[overlay_byteCount + 1]; + native_overlay = native_overlay_stackBytes; + } + int native_overlay_offset = Util.GetUtf8(overlay, native_overlay, overlay_byteCount); + native_overlay[native_overlay_offset] = 0; + } + else { native_overlay = null; } + ImGuiNative.igProgressBar(fraction, size_arg, native_overlay); + if (overlay_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_overlay); + } + } +#endif + public static void ProgressBar(float fraction, Vector2 size_arg, string overlay) + { + byte* native_overlay; + int overlay_byteCount = 0; + if (overlay != null) + { + overlay_byteCount = Encoding.UTF8.GetByteCount(overlay); + if (overlay_byteCount > Util.StackAllocationSizeLimit) + { + native_overlay = Util.Allocate(overlay_byteCount + 1); + } + else + { + byte* native_overlay_stackBytes = stackalloc byte[overlay_byteCount + 1]; + native_overlay = native_overlay_stackBytes; + } + int native_overlay_offset = Util.GetUtf8(overlay, native_overlay, overlay_byteCount); + native_overlay[native_overlay_offset] = 0; + } + else { native_overlay = null; } + ImGuiNative.igProgressBar(fraction, size_arg, native_overlay); + if (overlay_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_overlay); + } + } + public static void PushButtonRepeat(bool repeat) + { + byte native_repeat = repeat ? (byte)1 : (byte)0; + ImGuiNative.igPushButtonRepeat(native_repeat); + } + public static 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.igPushClipRect(clip_rect_min, clip_rect_max, native_intersect_with_current_clip_rect); + } + public static void PushFont(ImFontPtr font) + { + ImFont* native_font = font.NativePtr; + ImGuiNative.igPushFont(native_font); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void PushID(ReadOnlySpan str_id) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + ImGuiNative.igPushID_Str(native_str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + } +#endif + public static void PushID(string str_id) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + ImGuiNative.igPushID_Str(native_str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + } + public static void PushID(IntPtr ptr_id) + { + void* native_ptr_id = (void*)ptr_id.ToPointer(); + ImGuiNative.igPushID_Ptr(native_ptr_id); + } + public static void PushID(int int_id) + { + ImGuiNative.igPushID_Int(int_id); + } + public static void PushItemWidth(float item_width) + { + ImGuiNative.igPushItemWidth(item_width); + } + public static void PushStyleColor(ImGuiCol idx, uint col) + { + ImGuiNative.igPushStyleColor_U32(idx, col); + } + public static void PushStyleColor(ImGuiCol idx, Vector4 col) + { + ImGuiNative.igPushStyleColor_Vec4(idx, col); + } + public static void PushStyleVar(ImGuiStyleVar idx, float val) + { + ImGuiNative.igPushStyleVar_Float(idx, val); + } + public static void PushStyleVar(ImGuiStyleVar idx, Vector2 val) + { + ImGuiNative.igPushStyleVar_Vec2(idx, val); + } + public static void PushTabStop(bool tab_stop) + { + byte native_tab_stop = tab_stop ? (byte)1 : (byte)0; + ImGuiNative.igPushTabStop(native_tab_stop); + } + public static void PushTextWrapPos() + { + float wrap_local_pos_x = 0.0f; + ImGuiNative.igPushTextWrapPos(wrap_local_pos_x); + } + public static void PushTextWrapPos(float wrap_local_pos_x) + { + ImGuiNative.igPushTextWrapPos(wrap_local_pos_x); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool RadioButton(ReadOnlySpan label, bool active) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte native_active = active ? (byte)1 : (byte)0; + byte ret = ImGuiNative.igRadioButton_Bool(native_label, native_active); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool RadioButton(string label, bool active) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte native_active = active ? (byte)1 : (byte)0; + byte ret = ImGuiNative.igRadioButton_Bool(native_label, native_active); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool RadioButton(ReadOnlySpan label, ref int v, int v_button) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igRadioButton_IntPtr(native_label, native_v, v_button); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } +#endif + public static bool RadioButton(string label, ref int v, int v_button) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igRadioButton_IntPtr(native_label, native_v, v_button); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + } + public static void Render() + { + ImGuiNative.igRender(); + } + public static void RenderPlatformWindowsDefault() + { + void* platform_render_arg = null; + void* renderer_render_arg = null; + ImGuiNative.igRenderPlatformWindowsDefault(platform_render_arg, renderer_render_arg); + } + public static void RenderPlatformWindowsDefault(IntPtr platform_render_arg) + { + void* native_platform_render_arg = (void*)platform_render_arg.ToPointer(); + void* renderer_render_arg = null; + ImGuiNative.igRenderPlatformWindowsDefault(native_platform_render_arg, renderer_render_arg); + } + public static void RenderPlatformWindowsDefault(IntPtr platform_render_arg, IntPtr renderer_render_arg) + { + void* native_platform_render_arg = (void*)platform_render_arg.ToPointer(); + void* native_renderer_render_arg = (void*)renderer_render_arg.ToPointer(); + ImGuiNative.igRenderPlatformWindowsDefault(native_platform_render_arg, native_renderer_render_arg); + } + public static void ResetMouseDragDelta() + { + ImGuiMouseButton button = (ImGuiMouseButton)0; + ImGuiNative.igResetMouseDragDelta(button); + } + public static void ResetMouseDragDelta(ImGuiMouseButton button) + { + ImGuiNative.igResetMouseDragDelta(button); + } + public static void SameLine() + { + float offset_from_start_x = 0.0f; + float spacing = -1.0f; + ImGuiNative.igSameLine(offset_from_start_x, spacing); + } + public static void SameLine(float offset_from_start_x) + { + float spacing = -1.0f; + ImGuiNative.igSameLine(offset_from_start_x, spacing); + } + public static void SameLine(float offset_from_start_x, float spacing) + { + ImGuiNative.igSameLine(offset_from_start_x, spacing); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void SaveIniSettingsToDisk(ReadOnlySpan ini_filename) + { + byte* native_ini_filename; + int ini_filename_byteCount = 0; + if (ini_filename != null) + { + ini_filename_byteCount = Encoding.UTF8.GetByteCount(ini_filename); + if (ini_filename_byteCount > Util.StackAllocationSizeLimit) + { + native_ini_filename = Util.Allocate(ini_filename_byteCount + 1); + } + else + { + byte* native_ini_filename_stackBytes = stackalloc byte[ini_filename_byteCount + 1]; + native_ini_filename = native_ini_filename_stackBytes; + } + int native_ini_filename_offset = Util.GetUtf8(ini_filename, native_ini_filename, ini_filename_byteCount); + native_ini_filename[native_ini_filename_offset] = 0; + } + else { native_ini_filename = null; } + ImGuiNative.igSaveIniSettingsToDisk(native_ini_filename); + if (ini_filename_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_ini_filename); + } + } +#endif + public static void SaveIniSettingsToDisk(string ini_filename) + { + byte* native_ini_filename; + int ini_filename_byteCount = 0; + if (ini_filename != null) + { + ini_filename_byteCount = Encoding.UTF8.GetByteCount(ini_filename); + if (ini_filename_byteCount > Util.StackAllocationSizeLimit) + { + native_ini_filename = Util.Allocate(ini_filename_byteCount + 1); + } + else + { + byte* native_ini_filename_stackBytes = stackalloc byte[ini_filename_byteCount + 1]; + native_ini_filename = native_ini_filename_stackBytes; + } + int native_ini_filename_offset = Util.GetUtf8(ini_filename, native_ini_filename, ini_filename_byteCount); + native_ini_filename[native_ini_filename_offset] = 0; + } + else { native_ini_filename = null; } + ImGuiNative.igSaveIniSettingsToDisk(native_ini_filename); + if (ini_filename_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_ini_filename); + } + } + public static string SaveIniSettingsToMemory() + { + uint* out_ini_size = null; + byte* ret = ImGuiNative.igSaveIniSettingsToMemory(out_ini_size); + return Util.StringFromPtr(ret); + } + public static string SaveIniSettingsToMemory(out uint out_ini_size) + { + fixed (uint* native_out_ini_size = &out_ini_size) + { + byte* ret = ImGuiNative.igSaveIniSettingsToMemory(native_out_ini_size); + return Util.StringFromPtr(ret); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool Selectable(ReadOnlySpan label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte selected = 0; + ImGuiSelectableFlags flags = (ImGuiSelectableFlags)0; + Vector2 size = new Vector2(); + byte ret = ImGuiNative.igSelectable_Bool(native_label, selected, flags, size); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool Selectable(string label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte selected = 0; + ImGuiSelectableFlags flags = (ImGuiSelectableFlags)0; + Vector2 size = new Vector2(); + byte ret = ImGuiNative.igSelectable_Bool(native_label, selected, flags, size); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool Selectable(ReadOnlySpan label, bool selected) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte native_selected = selected ? (byte)1 : (byte)0; + ImGuiSelectableFlags flags = (ImGuiSelectableFlags)0; + Vector2 size = new Vector2(); + byte ret = ImGuiNative.igSelectable_Bool(native_label, native_selected, flags, size); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool Selectable(string label, bool selected) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte native_selected = selected ? (byte)1 : (byte)0; + ImGuiSelectableFlags flags = (ImGuiSelectableFlags)0; + Vector2 size = new Vector2(); + byte ret = ImGuiNative.igSelectable_Bool(native_label, native_selected, flags, size); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool Selectable(ReadOnlySpan label, bool selected, ImGuiSelectableFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte native_selected = selected ? (byte)1 : (byte)0; + Vector2 size = new Vector2(); + byte ret = ImGuiNative.igSelectable_Bool(native_label, native_selected, flags, size); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool Selectable(string label, bool selected, ImGuiSelectableFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte native_selected = selected ? (byte)1 : (byte)0; + Vector2 size = new Vector2(); + byte ret = ImGuiNative.igSelectable_Bool(native_label, native_selected, flags, size); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool Selectable(ReadOnlySpan label, bool selected, ImGuiSelectableFlags flags, Vector2 size) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte native_selected = selected ? (byte)1 : (byte)0; + byte ret = ImGuiNative.igSelectable_Bool(native_label, native_selected, flags, size); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool Selectable(string label, bool selected, ImGuiSelectableFlags flags, Vector2 size) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte native_selected = selected ? (byte)1 : (byte)0; + byte ret = ImGuiNative.igSelectable_Bool(native_label, native_selected, flags, size); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool Selectable(ReadOnlySpan label, ref bool p_selected) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte native_p_selected_val = p_selected ? (byte)1 : (byte)0; + byte* native_p_selected = &native_p_selected_val; + ImGuiSelectableFlags flags = (ImGuiSelectableFlags)0; + Vector2 size = new Vector2(); + byte ret = ImGuiNative.igSelectable_BoolPtr(native_label, native_p_selected, flags, size); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + p_selected = native_p_selected_val != 0; + return ret != 0; + } +#endif + public static bool Selectable(string label, ref bool p_selected) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte native_p_selected_val = p_selected ? (byte)1 : (byte)0; + byte* native_p_selected = &native_p_selected_val; + ImGuiSelectableFlags flags = (ImGuiSelectableFlags)0; + Vector2 size = new Vector2(); + byte ret = ImGuiNative.igSelectable_BoolPtr(native_label, native_p_selected, flags, size); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + p_selected = native_p_selected_val != 0; + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool Selectable(ReadOnlySpan label, ref bool p_selected, ImGuiSelectableFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte native_p_selected_val = p_selected ? (byte)1 : (byte)0; + byte* native_p_selected = &native_p_selected_val; + Vector2 size = new Vector2(); + byte ret = ImGuiNative.igSelectable_BoolPtr(native_label, native_p_selected, flags, size); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + p_selected = native_p_selected_val != 0; + return ret != 0; + } +#endif + public static bool Selectable(string label, ref bool p_selected, ImGuiSelectableFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte native_p_selected_val = p_selected ? (byte)1 : (byte)0; + byte* native_p_selected = &native_p_selected_val; + Vector2 size = new Vector2(); + byte ret = ImGuiNative.igSelectable_BoolPtr(native_label, native_p_selected, flags, size); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + p_selected = native_p_selected_val != 0; + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool Selectable(ReadOnlySpan label, ref bool p_selected, ImGuiSelectableFlags flags, Vector2 size) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte native_p_selected_val = p_selected ? (byte)1 : (byte)0; + byte* native_p_selected = &native_p_selected_val; + byte ret = ImGuiNative.igSelectable_BoolPtr(native_label, native_p_selected, flags, size); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + p_selected = native_p_selected_val != 0; + return ret != 0; + } +#endif + public static bool Selectable(string label, ref bool p_selected, ImGuiSelectableFlags flags, Vector2 size) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte native_p_selected_val = p_selected ? (byte)1 : (byte)0; + byte* native_p_selected = &native_p_selected_val; + byte ret = ImGuiNative.igSelectable_BoolPtr(native_label, native_p_selected, flags, size); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + p_selected = native_p_selected_val != 0; + return ret != 0; + } + public static void Separator() + { + ImGuiNative.igSeparator(); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void SeparatorText(ReadOnlySpan label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + ImGuiNative.igSeparatorText(native_label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + } +#endif + public static void SeparatorText(string label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + ImGuiNative.igSeparatorText(native_label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + } + public static void SetAllocatorFunctions(IntPtr alloc_func, IntPtr free_func) + { + void* user_data = null; + ImGuiNative.igSetAllocatorFunctions(alloc_func, free_func, user_data); + } + public static void SetAllocatorFunctions(IntPtr alloc_func, IntPtr free_func, IntPtr user_data) + { + void* native_user_data = (void*)user_data.ToPointer(); + ImGuiNative.igSetAllocatorFunctions(alloc_func, free_func, native_user_data); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void SetClipboardText(ReadOnlySpan text) + { + byte* native_text; + int text_byteCount = 0; + if (text != null) + { + text_byteCount = Encoding.UTF8.GetByteCount(text); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + native_text = Util.Allocate(text_byteCount + 1); + } + else + { + byte* native_text_stackBytes = stackalloc byte[text_byteCount + 1]; + native_text = native_text_stackBytes; + } + int native_text_offset = Util.GetUtf8(text, native_text, text_byteCount); + native_text[native_text_offset] = 0; + } + else { native_text = null; } + ImGuiNative.igSetClipboardText(native_text); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text); + } + } +#endif + public static void SetClipboardText(string text) + { + byte* native_text; + int text_byteCount = 0; + if (text != null) + { + text_byteCount = Encoding.UTF8.GetByteCount(text); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + native_text = Util.Allocate(text_byteCount + 1); + } + else + { + byte* native_text_stackBytes = stackalloc byte[text_byteCount + 1]; + native_text = native_text_stackBytes; + } + int native_text_offset = Util.GetUtf8(text, native_text, text_byteCount); + native_text[native_text_offset] = 0; + } + else { native_text = null; } + ImGuiNative.igSetClipboardText(native_text); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text); + } + } + public static void SetColorEditOptions(ImGuiColorEditFlags flags) + { + ImGuiNative.igSetColorEditOptions(flags); + } + public static void SetColumnOffset(int column_index, float offset_x) + { + ImGuiNative.igSetColumnOffset(column_index, offset_x); + } + public static void SetColumnWidth(int column_index, float width) + { + ImGuiNative.igSetColumnWidth(column_index, width); + } + public static void SetCurrentContext(IntPtr ctx) + { + ImGuiNative.igSetCurrentContext(ctx); + } + public static void SetCursorPos(Vector2 local_pos) + { + ImGuiNative.igSetCursorPos(local_pos); + } + public static void SetCursorPosX(float local_x) + { + ImGuiNative.igSetCursorPosX(local_x); + } + public static void SetCursorPosY(float local_y) + { + ImGuiNative.igSetCursorPosY(local_y); + } + public static void SetCursorScreenPos(Vector2 pos) + { + ImGuiNative.igSetCursorScreenPos(pos); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SetDragDropPayload(ReadOnlySpan type, IntPtr data, uint sz) + { + byte* native_type; + int type_byteCount = 0; + if (type != null) + { + type_byteCount = Encoding.UTF8.GetByteCount(type); + if (type_byteCount > Util.StackAllocationSizeLimit) + { + native_type = Util.Allocate(type_byteCount + 1); + } + else + { + byte* native_type_stackBytes = stackalloc byte[type_byteCount + 1]; + native_type = native_type_stackBytes; + } + int native_type_offset = Util.GetUtf8(type, native_type, type_byteCount); + native_type[native_type_offset] = 0; + } + else { native_type = null; } + void* native_data = (void*)data.ToPointer(); + ImGuiCond cond = (ImGuiCond)0; + byte ret = ImGuiNative.igSetDragDropPayload(native_type, native_data, sz, cond); + if (type_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_type); + } + return ret != 0; + } +#endif + public static bool SetDragDropPayload(string type, IntPtr data, uint sz) + { + byte* native_type; + int type_byteCount = 0; + if (type != null) + { + type_byteCount = Encoding.UTF8.GetByteCount(type); + if (type_byteCount > Util.StackAllocationSizeLimit) + { + native_type = Util.Allocate(type_byteCount + 1); + } + else + { + byte* native_type_stackBytes = stackalloc byte[type_byteCount + 1]; + native_type = native_type_stackBytes; + } + int native_type_offset = Util.GetUtf8(type, native_type, type_byteCount); + native_type[native_type_offset] = 0; + } + else { native_type = null; } + void* native_data = (void*)data.ToPointer(); + ImGuiCond cond = (ImGuiCond)0; + byte ret = ImGuiNative.igSetDragDropPayload(native_type, native_data, sz, cond); + if (type_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_type); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SetDragDropPayload(ReadOnlySpan type, IntPtr data, uint sz, ImGuiCond cond) + { + byte* native_type; + int type_byteCount = 0; + if (type != null) + { + type_byteCount = Encoding.UTF8.GetByteCount(type); + if (type_byteCount > Util.StackAllocationSizeLimit) + { + native_type = Util.Allocate(type_byteCount + 1); + } + else + { + byte* native_type_stackBytes = stackalloc byte[type_byteCount + 1]; + native_type = native_type_stackBytes; + } + int native_type_offset = Util.GetUtf8(type, native_type, type_byteCount); + native_type[native_type_offset] = 0; + } + else { native_type = null; } + void* native_data = (void*)data.ToPointer(); + byte ret = ImGuiNative.igSetDragDropPayload(native_type, native_data, sz, cond); + if (type_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_type); + } + return ret != 0; + } +#endif + public static bool SetDragDropPayload(string type, IntPtr data, uint sz, ImGuiCond cond) + { + byte* native_type; + int type_byteCount = 0; + if (type != null) + { + type_byteCount = Encoding.UTF8.GetByteCount(type); + if (type_byteCount > Util.StackAllocationSizeLimit) + { + native_type = Util.Allocate(type_byteCount + 1); + } + else + { + byte* native_type_stackBytes = stackalloc byte[type_byteCount + 1]; + native_type = native_type_stackBytes; + } + int native_type_offset = Util.GetUtf8(type, native_type, type_byteCount); + native_type[native_type_offset] = 0; + } + else { native_type = null; } + void* native_data = (void*)data.ToPointer(); + byte ret = ImGuiNative.igSetDragDropPayload(native_type, native_data, sz, cond); + if (type_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_type); + } + return ret != 0; + } + public static void SetItemDefaultFocus() + { + ImGuiNative.igSetItemDefaultFocus(); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void SetItemTooltip(ReadOnlySpan fmt) + { + byte* native_fmt; + int fmt_byteCount = 0; + if (fmt != null) + { + fmt_byteCount = Encoding.UTF8.GetByteCount(fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + native_fmt = Util.Allocate(fmt_byteCount + 1); + } + else + { + byte* native_fmt_stackBytes = stackalloc byte[fmt_byteCount + 1]; + native_fmt = native_fmt_stackBytes; + } + int native_fmt_offset = Util.GetUtf8(fmt, native_fmt, fmt_byteCount); + native_fmt[native_fmt_offset] = 0; + } + else { native_fmt = null; } + ImGuiNative.igSetItemTooltip(native_fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_fmt); + } + } +#endif + public static void SetItemTooltip(string fmt) + { + byte* native_fmt; + int fmt_byteCount = 0; + if (fmt != null) + { + fmt_byteCount = Encoding.UTF8.GetByteCount(fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + native_fmt = Util.Allocate(fmt_byteCount + 1); + } + else + { + byte* native_fmt_stackBytes = stackalloc byte[fmt_byteCount + 1]; + native_fmt = native_fmt_stackBytes; + } + int native_fmt_offset = Util.GetUtf8(fmt, native_fmt, fmt_byteCount); + native_fmt[native_fmt_offset] = 0; + } + else { native_fmt = null; } + ImGuiNative.igSetItemTooltip(native_fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_fmt); + } + } + public static void SetKeyboardFocusHere() + { + int offset = 0; + ImGuiNative.igSetKeyboardFocusHere(offset); + } + public static void SetKeyboardFocusHere(int offset) + { + ImGuiNative.igSetKeyboardFocusHere(offset); + } + public static void SetMouseCursor(ImGuiMouseCursor cursor_type) + { + ImGuiNative.igSetMouseCursor(cursor_type); + } + public static void SetNextFrameWantCaptureKeyboard(bool want_capture_keyboard) + { + byte native_want_capture_keyboard = want_capture_keyboard ? (byte)1 : (byte)0; + ImGuiNative.igSetNextFrameWantCaptureKeyboard(native_want_capture_keyboard); + } + public static void SetNextFrameWantCaptureMouse(bool want_capture_mouse) + { + byte native_want_capture_mouse = want_capture_mouse ? (byte)1 : (byte)0; + ImGuiNative.igSetNextFrameWantCaptureMouse(native_want_capture_mouse); + } + public static void SetNextItemAllowOverlap() + { + ImGuiNative.igSetNextItemAllowOverlap(); + } + public static void SetNextItemOpen(bool is_open) + { + byte native_is_open = is_open ? (byte)1 : (byte)0; + ImGuiCond cond = (ImGuiCond)0; + ImGuiNative.igSetNextItemOpen(native_is_open, cond); + } + public static void SetNextItemOpen(bool is_open, ImGuiCond cond) + { + byte native_is_open = is_open ? (byte)1 : (byte)0; + ImGuiNative.igSetNextItemOpen(native_is_open, cond); + } + public static void SetNextItemWidth(float item_width) + { + ImGuiNative.igSetNextItemWidth(item_width); + } + public static void SetNextWindowBgAlpha(float alpha) + { + ImGuiNative.igSetNextWindowBgAlpha(alpha); + } + public static void SetNextWindowClass(ImGuiWindowClassPtr window_class) + { + ImGuiWindowClass* native_window_class = window_class.NativePtr; + ImGuiNative.igSetNextWindowClass(native_window_class); + } + public static void SetNextWindowCollapsed(bool collapsed) + { + byte native_collapsed = collapsed ? (byte)1 : (byte)0; + ImGuiCond cond = (ImGuiCond)0; + ImGuiNative.igSetNextWindowCollapsed(native_collapsed, cond); + } + public static void SetNextWindowCollapsed(bool collapsed, ImGuiCond cond) + { + byte native_collapsed = collapsed ? (byte)1 : (byte)0; + ImGuiNative.igSetNextWindowCollapsed(native_collapsed, cond); + } + public static void SetNextWindowContentSize(Vector2 size) + { + ImGuiNative.igSetNextWindowContentSize(size); + } + public static void SetNextWindowDockID(uint dock_id) + { + ImGuiCond cond = (ImGuiCond)0; + ImGuiNative.igSetNextWindowDockID(dock_id, cond); + } + public static void SetNextWindowDockID(uint dock_id, ImGuiCond cond) + { + ImGuiNative.igSetNextWindowDockID(dock_id, cond); + } + public static void SetNextWindowFocus() + { + ImGuiNative.igSetNextWindowFocus(); + } + public static void SetNextWindowPos(Vector2 pos) + { + ImGuiCond cond = (ImGuiCond)0; + Vector2 pivot = new Vector2(); + ImGuiNative.igSetNextWindowPos(pos, cond, pivot); + } + public static void SetNextWindowPos(Vector2 pos, ImGuiCond cond) + { + Vector2 pivot = new Vector2(); + ImGuiNative.igSetNextWindowPos(pos, cond, pivot); + } + public static void SetNextWindowPos(Vector2 pos, ImGuiCond cond, Vector2 pivot) + { + ImGuiNative.igSetNextWindowPos(pos, cond, pivot); + } + public static void SetNextWindowScroll(Vector2 scroll) + { + ImGuiNative.igSetNextWindowScroll(scroll); + } + public static void SetNextWindowSize(Vector2 size) + { + ImGuiCond cond = (ImGuiCond)0; + ImGuiNative.igSetNextWindowSize(size, cond); + } + public static void SetNextWindowSize(Vector2 size, ImGuiCond cond) + { + ImGuiNative.igSetNextWindowSize(size, cond); + } + public static void SetNextWindowSizeConstraints(Vector2 size_min, Vector2 size_max) + { + ImGuiSizeCallback custom_callback = null; + void* custom_callback_data = null; + ImGuiNative.igSetNextWindowSizeConstraints(size_min, size_max, custom_callback, custom_callback_data); + } + public static void SetNextWindowSizeConstraints(Vector2 size_min, Vector2 size_max, ImGuiSizeCallback custom_callback) + { + void* custom_callback_data = null; + ImGuiNative.igSetNextWindowSizeConstraints(size_min, size_max, custom_callback, custom_callback_data); + } + public static void SetNextWindowSizeConstraints(Vector2 size_min, Vector2 size_max, ImGuiSizeCallback custom_callback, IntPtr custom_callback_data) + { + void* native_custom_callback_data = (void*)custom_callback_data.ToPointer(); + ImGuiNative.igSetNextWindowSizeConstraints(size_min, size_max, custom_callback, native_custom_callback_data); + } + public static void SetNextWindowViewport(uint viewport_id) + { + ImGuiNative.igSetNextWindowViewport(viewport_id); + } + public static void SetScrollFromPosX(float local_x) + { + float center_x_ratio = 0.5f; + ImGuiNative.igSetScrollFromPosX_Float(local_x, center_x_ratio); + } + public static void SetScrollFromPosX(float local_x, float center_x_ratio) + { + ImGuiNative.igSetScrollFromPosX_Float(local_x, center_x_ratio); + } + public static void SetScrollFromPosY(float local_y) + { + float center_y_ratio = 0.5f; + ImGuiNative.igSetScrollFromPosY_Float(local_y, center_y_ratio); + } + public static void SetScrollFromPosY(float local_y, float center_y_ratio) + { + ImGuiNative.igSetScrollFromPosY_Float(local_y, center_y_ratio); + } + public static void SetScrollHereX() + { + float center_x_ratio = 0.5f; + ImGuiNative.igSetScrollHereX(center_x_ratio); + } + public static void SetScrollHereX(float center_x_ratio) + { + ImGuiNative.igSetScrollHereX(center_x_ratio); + } + public static void SetScrollHereY() + { + float center_y_ratio = 0.5f; + ImGuiNative.igSetScrollHereY(center_y_ratio); + } + public static void SetScrollHereY(float center_y_ratio) + { + ImGuiNative.igSetScrollHereY(center_y_ratio); + } + public static void SetScrollX(float scroll_x) + { + ImGuiNative.igSetScrollX_Float(scroll_x); + } + public static void SetScrollY(float scroll_y) + { + ImGuiNative.igSetScrollY_Float(scroll_y); + } + public static void SetStateStorage(ImGuiStoragePtr storage) + { + ImGuiStorage* native_storage = storage.NativePtr; + ImGuiNative.igSetStateStorage(native_storage); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void SetTabItemClosed(ReadOnlySpan tab_or_docked_window_label) + { + byte* native_tab_or_docked_window_label; + int tab_or_docked_window_label_byteCount = 0; + if (tab_or_docked_window_label != null) + { + tab_or_docked_window_label_byteCount = Encoding.UTF8.GetByteCount(tab_or_docked_window_label); + if (tab_or_docked_window_label_byteCount > Util.StackAllocationSizeLimit) + { + native_tab_or_docked_window_label = Util.Allocate(tab_or_docked_window_label_byteCount + 1); + } + else + { + byte* native_tab_or_docked_window_label_stackBytes = stackalloc byte[tab_or_docked_window_label_byteCount + 1]; + native_tab_or_docked_window_label = native_tab_or_docked_window_label_stackBytes; + } + int native_tab_or_docked_window_label_offset = Util.GetUtf8(tab_or_docked_window_label, native_tab_or_docked_window_label, tab_or_docked_window_label_byteCount); + native_tab_or_docked_window_label[native_tab_or_docked_window_label_offset] = 0; + } + else { native_tab_or_docked_window_label = null; } + ImGuiNative.igSetTabItemClosed(native_tab_or_docked_window_label); + if (tab_or_docked_window_label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_tab_or_docked_window_label); + } + } +#endif + public static void SetTabItemClosed(string tab_or_docked_window_label) + { + byte* native_tab_or_docked_window_label; + int tab_or_docked_window_label_byteCount = 0; + if (tab_or_docked_window_label != null) + { + tab_or_docked_window_label_byteCount = Encoding.UTF8.GetByteCount(tab_or_docked_window_label); + if (tab_or_docked_window_label_byteCount > Util.StackAllocationSizeLimit) + { + native_tab_or_docked_window_label = Util.Allocate(tab_or_docked_window_label_byteCount + 1); + } + else + { + byte* native_tab_or_docked_window_label_stackBytes = stackalloc byte[tab_or_docked_window_label_byteCount + 1]; + native_tab_or_docked_window_label = native_tab_or_docked_window_label_stackBytes; + } + int native_tab_or_docked_window_label_offset = Util.GetUtf8(tab_or_docked_window_label, native_tab_or_docked_window_label, tab_or_docked_window_label_byteCount); + native_tab_or_docked_window_label[native_tab_or_docked_window_label_offset] = 0; + } + else { native_tab_or_docked_window_label = null; } + ImGuiNative.igSetTabItemClosed(native_tab_or_docked_window_label); + if (tab_or_docked_window_label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_tab_or_docked_window_label); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void SetTooltip(ReadOnlySpan fmt) + { + byte* native_fmt; + int fmt_byteCount = 0; + if (fmt != null) + { + fmt_byteCount = Encoding.UTF8.GetByteCount(fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + native_fmt = Util.Allocate(fmt_byteCount + 1); + } + else + { + byte* native_fmt_stackBytes = stackalloc byte[fmt_byteCount + 1]; + native_fmt = native_fmt_stackBytes; + } + int native_fmt_offset = Util.GetUtf8(fmt, native_fmt, fmt_byteCount); + native_fmt[native_fmt_offset] = 0; + } + else { native_fmt = null; } + ImGuiNative.igSetTooltip(native_fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_fmt); + } + } +#endif + public static void SetTooltip(string fmt) + { + byte* native_fmt; + int fmt_byteCount = 0; + if (fmt != null) + { + fmt_byteCount = Encoding.UTF8.GetByteCount(fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + native_fmt = Util.Allocate(fmt_byteCount + 1); + } + else + { + byte* native_fmt_stackBytes = stackalloc byte[fmt_byteCount + 1]; + native_fmt = native_fmt_stackBytes; + } + int native_fmt_offset = Util.GetUtf8(fmt, native_fmt, fmt_byteCount); + native_fmt[native_fmt_offset] = 0; + } + else { native_fmt = null; } + ImGuiNative.igSetTooltip(native_fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_fmt); + } + } + public static void SetWindowCollapsed(bool collapsed) + { + byte native_collapsed = collapsed ? (byte)1 : (byte)0; + ImGuiCond cond = (ImGuiCond)0; + ImGuiNative.igSetWindowCollapsed_Bool(native_collapsed, cond); + } + public static void SetWindowCollapsed(bool collapsed, ImGuiCond cond) + { + byte native_collapsed = collapsed ? (byte)1 : (byte)0; + ImGuiNative.igSetWindowCollapsed_Bool(native_collapsed, cond); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void SetWindowCollapsed(ReadOnlySpan name, bool collapsed) + { + byte* native_name; + int name_byteCount = 0; + if (name != null) + { + name_byteCount = Encoding.UTF8.GetByteCount(name); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + native_name = Util.Allocate(name_byteCount + 1); + } + else + { + byte* native_name_stackBytes = stackalloc byte[name_byteCount + 1]; + native_name = native_name_stackBytes; + } + int native_name_offset = Util.GetUtf8(name, native_name, name_byteCount); + native_name[native_name_offset] = 0; + } + else { native_name = null; } + byte native_collapsed = collapsed ? (byte)1 : (byte)0; + ImGuiCond cond = (ImGuiCond)0; + ImGuiNative.igSetWindowCollapsed_Str(native_name, native_collapsed, cond); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_name); + } + } +#endif + public static void SetWindowCollapsed(string name, bool collapsed) + { + byte* native_name; + int name_byteCount = 0; + if (name != null) + { + name_byteCount = Encoding.UTF8.GetByteCount(name); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + native_name = Util.Allocate(name_byteCount + 1); + } + else + { + byte* native_name_stackBytes = stackalloc byte[name_byteCount + 1]; + native_name = native_name_stackBytes; + } + int native_name_offset = Util.GetUtf8(name, native_name, name_byteCount); + native_name[native_name_offset] = 0; + } + else { native_name = null; } + byte native_collapsed = collapsed ? (byte)1 : (byte)0; + ImGuiCond cond = (ImGuiCond)0; + ImGuiNative.igSetWindowCollapsed_Str(native_name, native_collapsed, cond); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_name); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void SetWindowCollapsed(ReadOnlySpan name, bool collapsed, ImGuiCond cond) + { + byte* native_name; + int name_byteCount = 0; + if (name != null) + { + name_byteCount = Encoding.UTF8.GetByteCount(name); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + native_name = Util.Allocate(name_byteCount + 1); + } + else + { + byte* native_name_stackBytes = stackalloc byte[name_byteCount + 1]; + native_name = native_name_stackBytes; + } + int native_name_offset = Util.GetUtf8(name, native_name, name_byteCount); + native_name[native_name_offset] = 0; + } + else { native_name = null; } + byte native_collapsed = collapsed ? (byte)1 : (byte)0; + ImGuiNative.igSetWindowCollapsed_Str(native_name, native_collapsed, cond); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_name); + } + } +#endif + public static void SetWindowCollapsed(string name, bool collapsed, ImGuiCond cond) + { + byte* native_name; + int name_byteCount = 0; + if (name != null) + { + name_byteCount = Encoding.UTF8.GetByteCount(name); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + native_name = Util.Allocate(name_byteCount + 1); + } + else + { + byte* native_name_stackBytes = stackalloc byte[name_byteCount + 1]; + native_name = native_name_stackBytes; + } + int native_name_offset = Util.GetUtf8(name, native_name, name_byteCount); + native_name[native_name_offset] = 0; + } + else { native_name = null; } + byte native_collapsed = collapsed ? (byte)1 : (byte)0; + ImGuiNative.igSetWindowCollapsed_Str(native_name, native_collapsed, cond); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_name); + } + } + public static void SetWindowFocus() + { + ImGuiNative.igSetWindowFocus_Nil(); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void SetWindowFocus(ReadOnlySpan name) + { + byte* native_name; + int name_byteCount = 0; + if (name != null) + { + name_byteCount = Encoding.UTF8.GetByteCount(name); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + native_name = Util.Allocate(name_byteCount + 1); + } + else + { + byte* native_name_stackBytes = stackalloc byte[name_byteCount + 1]; + native_name = native_name_stackBytes; + } + int native_name_offset = Util.GetUtf8(name, native_name, name_byteCount); + native_name[native_name_offset] = 0; + } + else { native_name = null; } + ImGuiNative.igSetWindowFocus_Str(native_name); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_name); + } + } +#endif + public static void SetWindowFocus(string name) + { + byte* native_name; + int name_byteCount = 0; + if (name != null) + { + name_byteCount = Encoding.UTF8.GetByteCount(name); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + native_name = Util.Allocate(name_byteCount + 1); + } + else + { + byte* native_name_stackBytes = stackalloc byte[name_byteCount + 1]; + native_name = native_name_stackBytes; + } + int native_name_offset = Util.GetUtf8(name, native_name, name_byteCount); + native_name[native_name_offset] = 0; + } + else { native_name = null; } + ImGuiNative.igSetWindowFocus_Str(native_name); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_name); + } + } + public static void SetWindowFontScale(float scale) + { + ImGuiNative.igSetWindowFontScale(scale); + } + public static void SetWindowPos(Vector2 pos) + { + ImGuiCond cond = (ImGuiCond)0; + ImGuiNative.igSetWindowPos_Vec2(pos, cond); + } + public static void SetWindowPos(Vector2 pos, ImGuiCond cond) + { + ImGuiNative.igSetWindowPos_Vec2(pos, cond); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void SetWindowPos(ReadOnlySpan name, Vector2 pos) + { + byte* native_name; + int name_byteCount = 0; + if (name != null) + { + name_byteCount = Encoding.UTF8.GetByteCount(name); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + native_name = Util.Allocate(name_byteCount + 1); + } + else + { + byte* native_name_stackBytes = stackalloc byte[name_byteCount + 1]; + native_name = native_name_stackBytes; + } + int native_name_offset = Util.GetUtf8(name, native_name, name_byteCount); + native_name[native_name_offset] = 0; + } + else { native_name = null; } + ImGuiCond cond = (ImGuiCond)0; + ImGuiNative.igSetWindowPos_Str(native_name, pos, cond); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_name); + } + } +#endif + public static void SetWindowPos(string name, Vector2 pos) + { + byte* native_name; + int name_byteCount = 0; + if (name != null) + { + name_byteCount = Encoding.UTF8.GetByteCount(name); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + native_name = Util.Allocate(name_byteCount + 1); + } + else + { + byte* native_name_stackBytes = stackalloc byte[name_byteCount + 1]; + native_name = native_name_stackBytes; + } + int native_name_offset = Util.GetUtf8(name, native_name, name_byteCount); + native_name[native_name_offset] = 0; + } + else { native_name = null; } + ImGuiCond cond = (ImGuiCond)0; + ImGuiNative.igSetWindowPos_Str(native_name, pos, cond); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_name); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void SetWindowPos(ReadOnlySpan name, Vector2 pos, ImGuiCond cond) + { + byte* native_name; + int name_byteCount = 0; + if (name != null) + { + name_byteCount = Encoding.UTF8.GetByteCount(name); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + native_name = Util.Allocate(name_byteCount + 1); + } + else + { + byte* native_name_stackBytes = stackalloc byte[name_byteCount + 1]; + native_name = native_name_stackBytes; + } + int native_name_offset = Util.GetUtf8(name, native_name, name_byteCount); + native_name[native_name_offset] = 0; + } + else { native_name = null; } + ImGuiNative.igSetWindowPos_Str(native_name, pos, cond); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_name); + } + } +#endif + public static void SetWindowPos(string name, Vector2 pos, ImGuiCond cond) + { + byte* native_name; + int name_byteCount = 0; + if (name != null) + { + name_byteCount = Encoding.UTF8.GetByteCount(name); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + native_name = Util.Allocate(name_byteCount + 1); + } + else + { + byte* native_name_stackBytes = stackalloc byte[name_byteCount + 1]; + native_name = native_name_stackBytes; + } + int native_name_offset = Util.GetUtf8(name, native_name, name_byteCount); + native_name[native_name_offset] = 0; + } + else { native_name = null; } + ImGuiNative.igSetWindowPos_Str(native_name, pos, cond); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_name); + } + } + public static void SetWindowSize(Vector2 size) + { + ImGuiCond cond = (ImGuiCond)0; + ImGuiNative.igSetWindowSize_Vec2(size, cond); + } + public static void SetWindowSize(Vector2 size, ImGuiCond cond) + { + ImGuiNative.igSetWindowSize_Vec2(size, cond); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void SetWindowSize(ReadOnlySpan name, Vector2 size) + { + byte* native_name; + int name_byteCount = 0; + if (name != null) + { + name_byteCount = Encoding.UTF8.GetByteCount(name); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + native_name = Util.Allocate(name_byteCount + 1); + } + else + { + byte* native_name_stackBytes = stackalloc byte[name_byteCount + 1]; + native_name = native_name_stackBytes; + } + int native_name_offset = Util.GetUtf8(name, native_name, name_byteCount); + native_name[native_name_offset] = 0; + } + else { native_name = null; } + ImGuiCond cond = (ImGuiCond)0; + ImGuiNative.igSetWindowSize_Str(native_name, size, cond); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_name); + } + } +#endif + public static void SetWindowSize(string name, Vector2 size) + { + byte* native_name; + int name_byteCount = 0; + if (name != null) + { + name_byteCount = Encoding.UTF8.GetByteCount(name); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + native_name = Util.Allocate(name_byteCount + 1); + } + else + { + byte* native_name_stackBytes = stackalloc byte[name_byteCount + 1]; + native_name = native_name_stackBytes; + } + int native_name_offset = Util.GetUtf8(name, native_name, name_byteCount); + native_name[native_name_offset] = 0; + } + else { native_name = null; } + ImGuiCond cond = (ImGuiCond)0; + ImGuiNative.igSetWindowSize_Str(native_name, size, cond); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_name); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void SetWindowSize(ReadOnlySpan name, Vector2 size, ImGuiCond cond) + { + byte* native_name; + int name_byteCount = 0; + if (name != null) + { + name_byteCount = Encoding.UTF8.GetByteCount(name); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + native_name = Util.Allocate(name_byteCount + 1); + } + else + { + byte* native_name_stackBytes = stackalloc byte[name_byteCount + 1]; + native_name = native_name_stackBytes; + } + int native_name_offset = Util.GetUtf8(name, native_name, name_byteCount); + native_name[native_name_offset] = 0; + } + else { native_name = null; } + ImGuiNative.igSetWindowSize_Str(native_name, size, cond); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_name); + } + } +#endif + public static void SetWindowSize(string name, Vector2 size, ImGuiCond cond) + { + byte* native_name; + int name_byteCount = 0; + if (name != null) + { + name_byteCount = Encoding.UTF8.GetByteCount(name); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + native_name = Util.Allocate(name_byteCount + 1); + } + else + { + byte* native_name_stackBytes = stackalloc byte[name_byteCount + 1]; + native_name = native_name_stackBytes; + } + int native_name_offset = Util.GetUtf8(name, native_name, name_byteCount); + native_name[native_name_offset] = 0; + } + else { native_name = null; } + ImGuiNative.igSetWindowSize_Str(native_name, size, cond); + if (name_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_name); + } + } + public static void ShowAboutWindow() + { + byte* p_open = null; + ImGuiNative.igShowAboutWindow(p_open); + } + public static void ShowAboutWindow(ref bool p_open) + { + byte native_p_open_val = p_open ? (byte)1 : (byte)0; + byte* native_p_open = &native_p_open_val; + ImGuiNative.igShowAboutWindow(native_p_open); + p_open = native_p_open_val != 0; + } + public static void ShowDebugLogWindow() + { + byte* p_open = null; + ImGuiNative.igShowDebugLogWindow(p_open); + } + public static void ShowDebugLogWindow(ref bool p_open) + { + byte native_p_open_val = p_open ? (byte)1 : (byte)0; + byte* native_p_open = &native_p_open_val; + ImGuiNative.igShowDebugLogWindow(native_p_open); + p_open = native_p_open_val != 0; + } + public static void ShowDemoWindow() + { + byte* p_open = null; + ImGuiNative.igShowDemoWindow(p_open); + } + public static void ShowDemoWindow(ref bool p_open) + { + byte native_p_open_val = p_open ? (byte)1 : (byte)0; + byte* native_p_open = &native_p_open_val; + ImGuiNative.igShowDemoWindow(native_p_open); + p_open = native_p_open_val != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void ShowFontSelector(ReadOnlySpan label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + ImGuiNative.igShowFontSelector(native_label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + } +#endif + public static void ShowFontSelector(string label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + ImGuiNative.igShowFontSelector(native_label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + } + public static void ShowIDStackToolWindow() + { + byte* p_open = null; + ImGuiNative.igShowIDStackToolWindow(p_open); + } + public static void ShowIDStackToolWindow(ref bool p_open) + { + byte native_p_open_val = p_open ? (byte)1 : (byte)0; + byte* native_p_open = &native_p_open_val; + ImGuiNative.igShowIDStackToolWindow(native_p_open); + p_open = native_p_open_val != 0; + } + public static void ShowMetricsWindow() + { + byte* p_open = null; + ImGuiNative.igShowMetricsWindow(p_open); + } + public static void ShowMetricsWindow(ref bool p_open) + { + byte native_p_open_val = p_open ? (byte)1 : (byte)0; + byte* native_p_open = &native_p_open_val; + ImGuiNative.igShowMetricsWindow(native_p_open); + p_open = native_p_open_val != 0; + } + public static void ShowStyleEditor() + { + ImGuiStyle* @ref = null; + ImGuiNative.igShowStyleEditor(@ref); + } + public static void ShowStyleEditor(ImGuiStylePtr @ref) + { + ImGuiStyle* native_ref = @ref.NativePtr; + ImGuiNative.igShowStyleEditor(native_ref); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool ShowStyleSelector(ReadOnlySpan label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte ret = ImGuiNative.igShowStyleSelector(native_label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool ShowStyleSelector(string label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte ret = ImGuiNative.igShowStyleSelector(native_label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + public static void ShowUserGuide() + { + ImGuiNative.igShowUserGuide(); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderAngle(ReadOnlySpan label, ref float v_rad) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_degrees_min = -360.0f; + float v_degrees_max = +360.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.0f deg"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.0f deg", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v_rad = &v_rad) + { + byte ret = ImGuiNative.igSliderAngle(native_label, native_v_rad, v_degrees_min, v_degrees_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool SliderAngle(string label, ref float v_rad) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_degrees_min = -360.0f; + float v_degrees_max = +360.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.0f deg"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.0f deg", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v_rad = &v_rad) + { + byte ret = ImGuiNative.igSliderAngle(native_label, native_v_rad, v_degrees_min, v_degrees_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderAngle(ReadOnlySpan label, ref float v_rad, float v_degrees_min) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_degrees_max = +360.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.0f deg"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.0f deg", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v_rad = &v_rad) + { + byte ret = ImGuiNative.igSliderAngle(native_label, native_v_rad, v_degrees_min, v_degrees_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool SliderAngle(string label, ref float v_rad, float v_degrees_min) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float v_degrees_max = +360.0f; + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.0f deg"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.0f deg", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v_rad = &v_rad) + { + byte ret = ImGuiNative.igSliderAngle(native_label, native_v_rad, v_degrees_min, v_degrees_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderAngle(ReadOnlySpan label, ref float v_rad, float v_degrees_min, float v_degrees_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.0f deg"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.0f deg", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v_rad = &v_rad) + { + byte ret = ImGuiNative.igSliderAngle(native_label, native_v_rad, v_degrees_min, v_degrees_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool SliderAngle(string label, ref float v_rad, float v_degrees_min, float v_degrees_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.0f deg"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.0f deg", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v_rad = &v_rad) + { + byte ret = ImGuiNative.igSliderAngle(native_label, native_v_rad, v_degrees_min, v_degrees_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderAngle(ReadOnlySpan label, ref float v_rad, float v_degrees_min, float v_degrees_max, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v_rad = &v_rad) + { + byte ret = ImGuiNative.igSliderAngle(native_label, native_v_rad, v_degrees_min, v_degrees_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool SliderAngle(string label, ref float v_rad, float v_degrees_min, float v_degrees_max, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v_rad = &v_rad) + { + byte ret = ImGuiNative.igSliderAngle(native_label, native_v_rad, v_degrees_min, v_degrees_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderAngle(ReadOnlySpan label, ref float v_rad, float v_degrees_min, float v_degrees_max, ReadOnlySpan format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (float* native_v_rad = &v_rad) + { + byte ret = ImGuiNative.igSliderAngle(native_label, native_v_rad, v_degrees_min, v_degrees_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool SliderAngle(string label, ref float v_rad, float v_degrees_min, float v_degrees_max, string format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (float* native_v_rad = &v_rad) + { + byte ret = ImGuiNative.igSliderAngle(native_label, native_v_rad, v_degrees_min, v_degrees_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderFloat(ReadOnlySpan label, ref float v, float v_min, float v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igSliderFloat(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool SliderFloat(string label, ref float v, float v_min, float v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igSliderFloat(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderFloat(ReadOnlySpan label, ref float v, float v_min, float v_max, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igSliderFloat(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool SliderFloat(string label, ref float v, float v_min, float v_max, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igSliderFloat(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderFloat(ReadOnlySpan label, ref float v, float v_min, float v_max, ReadOnlySpan format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igSliderFloat(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool SliderFloat(string label, ref float v, float v_min, float v_max, string format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igSliderFloat(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderFloat2(ReadOnlySpan label, ref Vector2 v, float v_min, float v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector2* native_v = &v) + { + byte ret = ImGuiNative.igSliderFloat2(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool SliderFloat2(string label, ref Vector2 v, float v_min, float v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector2* native_v = &v) + { + byte ret = ImGuiNative.igSliderFloat2(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderFloat2(ReadOnlySpan label, ref Vector2 v, float v_min, float v_max, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector2* native_v = &v) + { + byte ret = ImGuiNative.igSliderFloat2(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool SliderFloat2(string label, ref Vector2 v, float v_min, float v_max, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector2* native_v = &v) + { + byte ret = ImGuiNative.igSliderFloat2(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderFloat2(ReadOnlySpan label, ref Vector2 v, float v_min, float v_max, ReadOnlySpan format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (Vector2* native_v = &v) + { + byte ret = ImGuiNative.igSliderFloat2(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool SliderFloat2(string label, ref Vector2 v, float v_min, float v_max, string format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (Vector2* native_v = &v) + { + byte ret = ImGuiNative.igSliderFloat2(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderFloat3(ReadOnlySpan label, ref Vector3 v, float v_min, float v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector3* native_v = &v) + { + byte ret = ImGuiNative.igSliderFloat3(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool SliderFloat3(string label, ref Vector3 v, float v_min, float v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector3* native_v = &v) + { + byte ret = ImGuiNative.igSliderFloat3(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderFloat3(ReadOnlySpan label, ref Vector3 v, float v_min, float v_max, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector3* native_v = &v) + { + byte ret = ImGuiNative.igSliderFloat3(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool SliderFloat3(string label, ref Vector3 v, float v_min, float v_max, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector3* native_v = &v) + { + byte ret = ImGuiNative.igSliderFloat3(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderFloat3(ReadOnlySpan label, ref Vector3 v, float v_min, float v_max, ReadOnlySpan format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (Vector3* native_v = &v) + { + byte ret = ImGuiNative.igSliderFloat3(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool SliderFloat3(string label, ref Vector3 v, float v_min, float v_max, string format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (Vector3* native_v = &v) + { + byte ret = ImGuiNative.igSliderFloat3(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderFloat4(ReadOnlySpan label, ref Vector4 v, float v_min, float v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector4* native_v = &v) + { + byte ret = ImGuiNative.igSliderFloat4(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool SliderFloat4(string label, ref Vector4 v, float v_min, float v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector4* native_v = &v) + { + byte ret = ImGuiNative.igSliderFloat4(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderFloat4(ReadOnlySpan label, ref Vector4 v, float v_min, float v_max, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector4* native_v = &v) + { + byte ret = ImGuiNative.igSliderFloat4(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool SliderFloat4(string label, ref Vector4 v, float v_min, float v_max, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (Vector4* native_v = &v) + { + byte ret = ImGuiNative.igSliderFloat4(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderFloat4(ReadOnlySpan label, ref Vector4 v, float v_min, float v_max, ReadOnlySpan format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (Vector4* native_v = &v) + { + byte ret = ImGuiNative.igSliderFloat4(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool SliderFloat4(string label, ref Vector4 v, float v_min, float v_max, string format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (Vector4* native_v = &v) + { + byte ret = ImGuiNative.igSliderFloat4(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderInt(ReadOnlySpan label, ref int v, int v_min, int v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igSliderInt(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool SliderInt(string label, ref int v, int v_min, int v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igSliderInt(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderInt(ReadOnlySpan label, ref int v, int v_min, int v_max, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igSliderInt(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool SliderInt(string label, ref int v, int v_min, int v_max, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igSliderInt(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderInt(ReadOnlySpan label, ref int v, int v_min, int v_max, ReadOnlySpan format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igSliderInt(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool SliderInt(string label, ref int v, int v_min, int v_max, string format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igSliderInt(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderInt2(ReadOnlySpan label, ref int v, int v_min, int v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igSliderInt2(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool SliderInt2(string label, ref int v, int v_min, int v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igSliderInt2(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderInt2(ReadOnlySpan label, ref int v, int v_min, int v_max, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igSliderInt2(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool SliderInt2(string label, ref int v, int v_min, int v_max, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igSliderInt2(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderInt2(ReadOnlySpan label, ref int v, int v_min, int v_max, ReadOnlySpan format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igSliderInt2(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool SliderInt2(string label, ref int v, int v_min, int v_max, string format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igSliderInt2(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderInt3(ReadOnlySpan label, ref int v, int v_min, int v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igSliderInt3(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool SliderInt3(string label, ref int v, int v_min, int v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igSliderInt3(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderInt3(ReadOnlySpan label, ref int v, int v_min, int v_max, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igSliderInt3(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool SliderInt3(string label, ref int v, int v_min, int v_max, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igSliderInt3(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderInt3(ReadOnlySpan label, ref int v, int v_min, int v_max, ReadOnlySpan format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igSliderInt3(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool SliderInt3(string label, ref int v, int v_min, int v_max, string format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igSliderInt3(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderInt4(ReadOnlySpan label, ref int v, int v_min, int v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igSliderInt4(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool SliderInt4(string label, ref int v, int v_min, int v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igSliderInt4(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderInt4(ReadOnlySpan label, ref int v, int v_min, int v_max, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igSliderInt4(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool SliderInt4(string label, ref int v, int v_min, int v_max, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igSliderInt4(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderInt4(ReadOnlySpan label, ref int v, int v_min, int v_max, ReadOnlySpan format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igSliderInt4(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool SliderInt4(string label, ref int v, int v_min, int v_max, string format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igSliderInt4(native_label, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderScalar(ReadOnlySpan label, ImGuiDataType data_type, IntPtr p_data, IntPtr p_min, IntPtr p_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* native_p_max = (void*)p_max.ToPointer(); + byte* native_format = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + byte ret = ImGuiNative.igSliderScalar(native_label, data_type, native_p_data, native_p_min, native_p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool SliderScalar(string label, ImGuiDataType data_type, IntPtr p_data, IntPtr p_min, IntPtr p_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* native_p_max = (void*)p_max.ToPointer(); + byte* native_format = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + byte ret = ImGuiNative.igSliderScalar(native_label, data_type, native_p_data, native_p_min, native_p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderScalar(ReadOnlySpan label, ImGuiDataType data_type, IntPtr p_data, IntPtr p_min, IntPtr p_max, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* native_p_max = (void*)p_max.ToPointer(); + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + byte ret = ImGuiNative.igSliderScalar(native_label, data_type, native_p_data, native_p_min, native_p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } +#endif + public static bool SliderScalar(string label, ImGuiDataType data_type, IntPtr p_data, IntPtr p_min, IntPtr p_max, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* native_p_max = (void*)p_max.ToPointer(); + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + byte ret = ImGuiNative.igSliderScalar(native_label, data_type, native_p_data, native_p_min, native_p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderScalar(ReadOnlySpan label, ImGuiDataType data_type, IntPtr p_data, IntPtr p_min, IntPtr p_max, ReadOnlySpan format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* native_p_max = (void*)p_max.ToPointer(); + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + byte ret = ImGuiNative.igSliderScalar(native_label, data_type, native_p_data, native_p_min, native_p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } +#endif + public static bool SliderScalar(string label, ImGuiDataType data_type, IntPtr p_data, IntPtr p_min, IntPtr p_max, string format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* native_p_max = (void*)p_max.ToPointer(); + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + byte ret = ImGuiNative.igSliderScalar(native_label, data_type, native_p_data, native_p_min, native_p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderScalarN(ReadOnlySpan label, ImGuiDataType data_type, IntPtr p_data, int components, IntPtr p_min, IntPtr p_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* native_p_max = (void*)p_max.ToPointer(); + byte* native_format = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + byte ret = ImGuiNative.igSliderScalarN(native_label, data_type, native_p_data, components, native_p_min, native_p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool SliderScalarN(string label, ImGuiDataType data_type, IntPtr p_data, int components, IntPtr p_min, IntPtr p_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* native_p_max = (void*)p_max.ToPointer(); + byte* native_format = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + byte ret = ImGuiNative.igSliderScalarN(native_label, data_type, native_p_data, components, native_p_min, native_p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderScalarN(ReadOnlySpan label, ImGuiDataType data_type, IntPtr p_data, int components, IntPtr p_min, IntPtr p_max, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* native_p_max = (void*)p_max.ToPointer(); + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + byte ret = ImGuiNative.igSliderScalarN(native_label, data_type, native_p_data, components, native_p_min, native_p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } +#endif + public static bool SliderScalarN(string label, ImGuiDataType data_type, IntPtr p_data, int components, IntPtr p_min, IntPtr p_max, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* native_p_max = (void*)p_max.ToPointer(); + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + byte ret = ImGuiNative.igSliderScalarN(native_label, data_type, native_p_data, components, native_p_min, native_p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SliderScalarN(ReadOnlySpan label, ImGuiDataType data_type, IntPtr p_data, int components, IntPtr p_min, IntPtr p_max, ReadOnlySpan format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* native_p_max = (void*)p_max.ToPointer(); + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + byte ret = ImGuiNative.igSliderScalarN(native_label, data_type, native_p_data, components, native_p_min, native_p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } +#endif + public static bool SliderScalarN(string label, ImGuiDataType data_type, IntPtr p_data, int components, IntPtr p_min, IntPtr p_max, string format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* native_p_max = (void*)p_max.ToPointer(); + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + byte ret = ImGuiNative.igSliderScalarN(native_label, data_type, native_p_data, components, native_p_min, native_p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool SmallButton(ReadOnlySpan label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte ret = ImGuiNative.igSmallButton(native_label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool SmallButton(string label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte ret = ImGuiNative.igSmallButton(native_label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + public static void Spacing() + { + ImGuiNative.igSpacing(); + } + public static void StyleColorsClassic() + { + ImGuiStyle* dst = null; + ImGuiNative.igStyleColorsClassic(dst); + } + public static void StyleColorsClassic(ImGuiStylePtr dst) + { + ImGuiStyle* native_dst = dst.NativePtr; + ImGuiNative.igStyleColorsClassic(native_dst); + } + public static void StyleColorsDark() + { + ImGuiStyle* dst = null; + ImGuiNative.igStyleColorsDark(dst); + } + public static void StyleColorsDark(ImGuiStylePtr dst) + { + ImGuiStyle* native_dst = dst.NativePtr; + ImGuiNative.igStyleColorsDark(native_dst); + } + public static void StyleColorsLight() + { + ImGuiStyle* dst = null; + ImGuiNative.igStyleColorsLight(dst); + } + public static void StyleColorsLight(ImGuiStylePtr dst) + { + ImGuiStyle* native_dst = dst.NativePtr; + ImGuiNative.igStyleColorsLight(native_dst); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool TabItemButton(ReadOnlySpan label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + ImGuiTabItemFlags flags = (ImGuiTabItemFlags)0; + byte ret = ImGuiNative.igTabItemButton(native_label, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool TabItemButton(string label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + ImGuiTabItemFlags flags = (ImGuiTabItemFlags)0; + byte ret = ImGuiNative.igTabItemButton(native_label, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool TabItemButton(ReadOnlySpan label, ImGuiTabItemFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte ret = ImGuiNative.igTabItemButton(native_label, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool TabItemButton(string label, ImGuiTabItemFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte ret = ImGuiNative.igTabItemButton(native_label, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + public static void TableAngledHeadersRow() + { + ImGuiNative.igTableAngledHeadersRow(); + } + public static int TableGetColumnCount() + { + int ret = ImGuiNative.igTableGetColumnCount(); + return ret; + } + public static ImGuiTableColumnFlags TableGetColumnFlags() + { + int column_n = -1; + ImGuiTableColumnFlags ret = ImGuiNative.igTableGetColumnFlags(column_n); + return ret; + } + public static ImGuiTableColumnFlags TableGetColumnFlags(int column_n) + { + ImGuiTableColumnFlags ret = ImGuiNative.igTableGetColumnFlags(column_n); + return ret; + } + public static int TableGetColumnIndex() + { + int ret = ImGuiNative.igTableGetColumnIndex(); + return ret; + } + public static string TableGetColumnName() + { + int column_n = -1; + byte* ret = ImGuiNative.igTableGetColumnName_Int(column_n); + return Util.StringFromPtr(ret); + } + public static string TableGetColumnName(int column_n) + { + byte* ret = ImGuiNative.igTableGetColumnName_Int(column_n); + return Util.StringFromPtr(ret); + } + public static int TableGetRowIndex() + { + int ret = ImGuiNative.igTableGetRowIndex(); + return ret; + } + public static ImGuiTableSortSpecsPtr TableGetSortSpecs() + { + ImGuiTableSortSpecs* ret = ImGuiNative.igTableGetSortSpecs(); + return new ImGuiTableSortSpecsPtr(ret); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void TableHeader(ReadOnlySpan label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + ImGuiNative.igTableHeader(native_label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + } +#endif + public static void TableHeader(string label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + ImGuiNative.igTableHeader(native_label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + } + public static void TableHeadersRow() + { + ImGuiNative.igTableHeadersRow(); + } + public static bool TableNextColumn() + { + byte ret = ImGuiNative.igTableNextColumn(); + return ret != 0; + } + public static void TableNextRow() + { + ImGuiTableRowFlags row_flags = (ImGuiTableRowFlags)0; + float min_row_height = 0.0f; + ImGuiNative.igTableNextRow(row_flags, min_row_height); + } + public static void TableNextRow(ImGuiTableRowFlags row_flags) + { + float min_row_height = 0.0f; + ImGuiNative.igTableNextRow(row_flags, min_row_height); + } + public static void TableNextRow(ImGuiTableRowFlags row_flags, float min_row_height) + { + ImGuiNative.igTableNextRow(row_flags, min_row_height); + } + public static void TableSetBgColor(ImGuiTableBgTarget target, uint color) + { + int column_n = -1; + ImGuiNative.igTableSetBgColor(target, color, column_n); + } + public static void TableSetBgColor(ImGuiTableBgTarget target, uint color, int column_n) + { + ImGuiNative.igTableSetBgColor(target, color, column_n); + } + public static void TableSetColumnEnabled(int column_n, bool v) + { + byte native_v = v ? (byte)1 : (byte)0; + ImGuiNative.igTableSetColumnEnabled(column_n, native_v); + } + public static bool TableSetColumnIndex(int column_n) + { + byte ret = ImGuiNative.igTableSetColumnIndex(column_n); + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void TableSetupColumn(ReadOnlySpan label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + ImGuiTableColumnFlags flags = (ImGuiTableColumnFlags)0; + float init_width_or_weight = 0.0f; + uint user_id = 0; + ImGuiNative.igTableSetupColumn(native_label, flags, init_width_or_weight, user_id); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + } +#endif + public static void TableSetupColumn(string label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + ImGuiTableColumnFlags flags = (ImGuiTableColumnFlags)0; + float init_width_or_weight = 0.0f; + uint user_id = 0; + ImGuiNative.igTableSetupColumn(native_label, flags, init_width_or_weight, user_id); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void TableSetupColumn(ReadOnlySpan label, ImGuiTableColumnFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float init_width_or_weight = 0.0f; + uint user_id = 0; + ImGuiNative.igTableSetupColumn(native_label, flags, init_width_or_weight, user_id); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + } +#endif + public static void TableSetupColumn(string label, ImGuiTableColumnFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float init_width_or_weight = 0.0f; + uint user_id = 0; + ImGuiNative.igTableSetupColumn(native_label, flags, init_width_or_weight, user_id); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void TableSetupColumn(ReadOnlySpan label, ImGuiTableColumnFlags flags, float init_width_or_weight) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + uint user_id = 0; + ImGuiNative.igTableSetupColumn(native_label, flags, init_width_or_weight, user_id); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + } +#endif + public static void TableSetupColumn(string label, ImGuiTableColumnFlags flags, float init_width_or_weight) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + uint user_id = 0; + ImGuiNative.igTableSetupColumn(native_label, flags, init_width_or_weight, user_id); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void TableSetupColumn(ReadOnlySpan label, ImGuiTableColumnFlags flags, float init_width_or_weight, uint user_id) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + ImGuiNative.igTableSetupColumn(native_label, flags, init_width_or_weight, user_id); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + } +#endif + public static void TableSetupColumn(string label, ImGuiTableColumnFlags flags, float init_width_or_weight, uint user_id) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + ImGuiNative.igTableSetupColumn(native_label, flags, init_width_or_weight, user_id); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + } + public static void TableSetupScrollFreeze(int cols, int rows) + { + ImGuiNative.igTableSetupScrollFreeze(cols, rows); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void Text(ReadOnlySpan fmt) + { + byte* native_fmt; + int fmt_byteCount = 0; + if (fmt != null) + { + fmt_byteCount = Encoding.UTF8.GetByteCount(fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + native_fmt = Util.Allocate(fmt_byteCount + 1); + } + else + { + byte* native_fmt_stackBytes = stackalloc byte[fmt_byteCount + 1]; + native_fmt = native_fmt_stackBytes; + } + int native_fmt_offset = Util.GetUtf8(fmt, native_fmt, fmt_byteCount); + native_fmt[native_fmt_offset] = 0; + } + else { native_fmt = null; } + ImGuiNative.igText(native_fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_fmt); + } + } +#endif + public static void Text(string fmt) + { + byte* native_fmt; + int fmt_byteCount = 0; + if (fmt != null) + { + fmt_byteCount = Encoding.UTF8.GetByteCount(fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + native_fmt = Util.Allocate(fmt_byteCount + 1); + } + else + { + byte* native_fmt_stackBytes = stackalloc byte[fmt_byteCount + 1]; + native_fmt = native_fmt_stackBytes; + } + int native_fmt_offset = Util.GetUtf8(fmt, native_fmt, fmt_byteCount); + native_fmt[native_fmt_offset] = 0; + } + else { native_fmt = null; } + ImGuiNative.igText(native_fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_fmt); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void TextColored(Vector4 col, ReadOnlySpan fmt) + { + byte* native_fmt; + int fmt_byteCount = 0; + if (fmt != null) + { + fmt_byteCount = Encoding.UTF8.GetByteCount(fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + native_fmt = Util.Allocate(fmt_byteCount + 1); + } + else + { + byte* native_fmt_stackBytes = stackalloc byte[fmt_byteCount + 1]; + native_fmt = native_fmt_stackBytes; + } + int native_fmt_offset = Util.GetUtf8(fmt, native_fmt, fmt_byteCount); + native_fmt[native_fmt_offset] = 0; + } + else { native_fmt = null; } + ImGuiNative.igTextColored(col, native_fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_fmt); + } + } +#endif + public static void TextColored(Vector4 col, string fmt) + { + byte* native_fmt; + int fmt_byteCount = 0; + if (fmt != null) + { + fmt_byteCount = Encoding.UTF8.GetByteCount(fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + native_fmt = Util.Allocate(fmt_byteCount + 1); + } + else + { + byte* native_fmt_stackBytes = stackalloc byte[fmt_byteCount + 1]; + native_fmt = native_fmt_stackBytes; + } + int native_fmt_offset = Util.GetUtf8(fmt, native_fmt, fmt_byteCount); + native_fmt[native_fmt_offset] = 0; + } + else { native_fmt = null; } + ImGuiNative.igTextColored(col, native_fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_fmt); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void TextDisabled(ReadOnlySpan fmt) + { + byte* native_fmt; + int fmt_byteCount = 0; + if (fmt != null) + { + fmt_byteCount = Encoding.UTF8.GetByteCount(fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + native_fmt = Util.Allocate(fmt_byteCount + 1); + } + else + { + byte* native_fmt_stackBytes = stackalloc byte[fmt_byteCount + 1]; + native_fmt = native_fmt_stackBytes; + } + int native_fmt_offset = Util.GetUtf8(fmt, native_fmt, fmt_byteCount); + native_fmt[native_fmt_offset] = 0; + } + else { native_fmt = null; } + ImGuiNative.igTextDisabled(native_fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_fmt); + } + } +#endif + public static void TextDisabled(string fmt) + { + byte* native_fmt; + int fmt_byteCount = 0; + if (fmt != null) + { + fmt_byteCount = Encoding.UTF8.GetByteCount(fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + native_fmt = Util.Allocate(fmt_byteCount + 1); + } + else + { + byte* native_fmt_stackBytes = stackalloc byte[fmt_byteCount + 1]; + native_fmt = native_fmt_stackBytes; + } + int native_fmt_offset = Util.GetUtf8(fmt, native_fmt, fmt_byteCount); + native_fmt[native_fmt_offset] = 0; + } + else { native_fmt = null; } + ImGuiNative.igTextDisabled(native_fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_fmt); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void TextUnformatted(ReadOnlySpan text) + { + byte* native_text; + int text_byteCount = 0; + if (text != null) + { + text_byteCount = Encoding.UTF8.GetByteCount(text); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + native_text = Util.Allocate(text_byteCount + 1); + } + else + { + byte* native_text_stackBytes = stackalloc byte[text_byteCount + 1]; + native_text = native_text_stackBytes; + } + int native_text_offset = Util.GetUtf8(text, native_text, text_byteCount); + native_text[native_text_offset] = 0; + } + else { native_text = null; } + ImGuiNative.igTextUnformatted(native_text, native_text+text_byteCount); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text); + } + } +#endif + public static void TextUnformatted(string text) + { + byte* native_text; + int text_byteCount = 0; + if (text != null) + { + text_byteCount = Encoding.UTF8.GetByteCount(text); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + native_text = Util.Allocate(text_byteCount + 1); + } + else + { + byte* native_text_stackBytes = stackalloc byte[text_byteCount + 1]; + native_text = native_text_stackBytes; + } + int native_text_offset = Util.GetUtf8(text, native_text, text_byteCount); + native_text[native_text_offset] = 0; + } + else { native_text = null; } + ImGuiNative.igTextUnformatted(native_text, native_text+text_byteCount); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void TextWrapped(ReadOnlySpan fmt) + { + byte* native_fmt; + int fmt_byteCount = 0; + if (fmt != null) + { + fmt_byteCount = Encoding.UTF8.GetByteCount(fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + native_fmt = Util.Allocate(fmt_byteCount + 1); + } + else + { + byte* native_fmt_stackBytes = stackalloc byte[fmt_byteCount + 1]; + native_fmt = native_fmt_stackBytes; + } + int native_fmt_offset = Util.GetUtf8(fmt, native_fmt, fmt_byteCount); + native_fmt[native_fmt_offset] = 0; + } + else { native_fmt = null; } + ImGuiNative.igTextWrapped(native_fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_fmt); + } + } +#endif + public static void TextWrapped(string fmt) + { + byte* native_fmt; + int fmt_byteCount = 0; + if (fmt != null) + { + fmt_byteCount = Encoding.UTF8.GetByteCount(fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + native_fmt = Util.Allocate(fmt_byteCount + 1); + } + else + { + byte* native_fmt_stackBytes = stackalloc byte[fmt_byteCount + 1]; + native_fmt = native_fmt_stackBytes; + } + int native_fmt_offset = Util.GetUtf8(fmt, native_fmt, fmt_byteCount); + native_fmt[native_fmt_offset] = 0; + } + else { native_fmt = null; } + ImGuiNative.igTextWrapped(native_fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_fmt); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool TreeNode(ReadOnlySpan label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte ret = ImGuiNative.igTreeNode_Str(native_label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool TreeNode(string label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte ret = ImGuiNative.igTreeNode_Str(native_label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool TreeNode(ReadOnlySpan str_id, ReadOnlySpan fmt) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + byte* native_fmt; + int fmt_byteCount = 0; + if (fmt != null) + { + fmt_byteCount = Encoding.UTF8.GetByteCount(fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + native_fmt = Util.Allocate(fmt_byteCount + 1); + } + else + { + byte* native_fmt_stackBytes = stackalloc byte[fmt_byteCount + 1]; + native_fmt = native_fmt_stackBytes; + } + int native_fmt_offset = Util.GetUtf8(fmt, native_fmt, fmt_byteCount); + native_fmt[native_fmt_offset] = 0; + } + else { native_fmt = null; } + byte ret = ImGuiNative.igTreeNode_StrStr(native_str_id, native_fmt); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_fmt); + } + return ret != 0; + } +#endif + public static bool TreeNode(string str_id, string fmt) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + byte* native_fmt; + int fmt_byteCount = 0; + if (fmt != null) + { + fmt_byteCount = Encoding.UTF8.GetByteCount(fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + native_fmt = Util.Allocate(fmt_byteCount + 1); + } + else + { + byte* native_fmt_stackBytes = stackalloc byte[fmt_byteCount + 1]; + native_fmt = native_fmt_stackBytes; + } + int native_fmt_offset = Util.GetUtf8(fmt, native_fmt, fmt_byteCount); + native_fmt[native_fmt_offset] = 0; + } + else { native_fmt = null; } + byte ret = ImGuiNative.igTreeNode_StrStr(native_str_id, native_fmt); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_fmt); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool TreeNode(IntPtr ptr_id, ReadOnlySpan fmt) + { + void* native_ptr_id = (void*)ptr_id.ToPointer(); + byte* native_fmt; + int fmt_byteCount = 0; + if (fmt != null) + { + fmt_byteCount = Encoding.UTF8.GetByteCount(fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + native_fmt = Util.Allocate(fmt_byteCount + 1); + } + else + { + byte* native_fmt_stackBytes = stackalloc byte[fmt_byteCount + 1]; + native_fmt = native_fmt_stackBytes; + } + int native_fmt_offset = Util.GetUtf8(fmt, native_fmt, fmt_byteCount); + native_fmt[native_fmt_offset] = 0; + } + else { native_fmt = null; } + byte ret = ImGuiNative.igTreeNode_Ptr(native_ptr_id, native_fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_fmt); + } + return ret != 0; + } +#endif + public static bool TreeNode(IntPtr ptr_id, string fmt) + { + void* native_ptr_id = (void*)ptr_id.ToPointer(); + byte* native_fmt; + int fmt_byteCount = 0; + if (fmt != null) + { + fmt_byteCount = Encoding.UTF8.GetByteCount(fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + native_fmt = Util.Allocate(fmt_byteCount + 1); + } + else + { + byte* native_fmt_stackBytes = stackalloc byte[fmt_byteCount + 1]; + native_fmt = native_fmt_stackBytes; + } + int native_fmt_offset = Util.GetUtf8(fmt, native_fmt, fmt_byteCount); + native_fmt[native_fmt_offset] = 0; + } + else { native_fmt = null; } + byte ret = ImGuiNative.igTreeNode_Ptr(native_ptr_id, native_fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_fmt); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool TreeNodeEx(ReadOnlySpan label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + ImGuiTreeNodeFlags flags = (ImGuiTreeNodeFlags)0; + byte ret = ImGuiNative.igTreeNodeEx_Str(native_label, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool TreeNodeEx(string label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + ImGuiTreeNodeFlags flags = (ImGuiTreeNodeFlags)0; + byte ret = ImGuiNative.igTreeNodeEx_Str(native_label, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool TreeNodeEx(ReadOnlySpan label, ImGuiTreeNodeFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte ret = ImGuiNative.igTreeNodeEx_Str(native_label, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool TreeNodeEx(string label, ImGuiTreeNodeFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte ret = ImGuiNative.igTreeNodeEx_Str(native_label, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool TreeNodeEx(ReadOnlySpan str_id, ImGuiTreeNodeFlags flags, ReadOnlySpan fmt) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + byte* native_fmt; + int fmt_byteCount = 0; + if (fmt != null) + { + fmt_byteCount = Encoding.UTF8.GetByteCount(fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + native_fmt = Util.Allocate(fmt_byteCount + 1); + } + else + { + byte* native_fmt_stackBytes = stackalloc byte[fmt_byteCount + 1]; + native_fmt = native_fmt_stackBytes; + } + int native_fmt_offset = Util.GetUtf8(fmt, native_fmt, fmt_byteCount); + native_fmt[native_fmt_offset] = 0; + } + else { native_fmt = null; } + byte ret = ImGuiNative.igTreeNodeEx_StrStr(native_str_id, flags, native_fmt); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_fmt); + } + return ret != 0; + } +#endif + public static bool TreeNodeEx(string str_id, ImGuiTreeNodeFlags flags, string fmt) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + byte* native_fmt; + int fmt_byteCount = 0; + if (fmt != null) + { + fmt_byteCount = Encoding.UTF8.GetByteCount(fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + native_fmt = Util.Allocate(fmt_byteCount + 1); + } + else + { + byte* native_fmt_stackBytes = stackalloc byte[fmt_byteCount + 1]; + native_fmt = native_fmt_stackBytes; + } + int native_fmt_offset = Util.GetUtf8(fmt, native_fmt, fmt_byteCount); + native_fmt[native_fmt_offset] = 0; + } + else { native_fmt = null; } + byte ret = ImGuiNative.igTreeNodeEx_StrStr(native_str_id, flags, native_fmt); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_fmt); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool TreeNodeEx(IntPtr ptr_id, ImGuiTreeNodeFlags flags, ReadOnlySpan fmt) + { + void* native_ptr_id = (void*)ptr_id.ToPointer(); + byte* native_fmt; + int fmt_byteCount = 0; + if (fmt != null) + { + fmt_byteCount = Encoding.UTF8.GetByteCount(fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + native_fmt = Util.Allocate(fmt_byteCount + 1); + } + else + { + byte* native_fmt_stackBytes = stackalloc byte[fmt_byteCount + 1]; + native_fmt = native_fmt_stackBytes; + } + int native_fmt_offset = Util.GetUtf8(fmt, native_fmt, fmt_byteCount); + native_fmt[native_fmt_offset] = 0; + } + else { native_fmt = null; } + byte ret = ImGuiNative.igTreeNodeEx_Ptr(native_ptr_id, flags, native_fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_fmt); + } + return ret != 0; + } +#endif + public static bool TreeNodeEx(IntPtr ptr_id, ImGuiTreeNodeFlags flags, string fmt) + { + void* native_ptr_id = (void*)ptr_id.ToPointer(); + byte* native_fmt; + int fmt_byteCount = 0; + if (fmt != null) + { + fmt_byteCount = Encoding.UTF8.GetByteCount(fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + native_fmt = Util.Allocate(fmt_byteCount + 1); + } + else + { + byte* native_fmt_stackBytes = stackalloc byte[fmt_byteCount + 1]; + native_fmt = native_fmt_stackBytes; + } + int native_fmt_offset = Util.GetUtf8(fmt, native_fmt, fmt_byteCount); + native_fmt[native_fmt_offset] = 0; + } + else { native_fmt = null; } + byte ret = ImGuiNative.igTreeNodeEx_Ptr(native_ptr_id, flags, native_fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_fmt); + } + return ret != 0; + } + public static void TreePop() + { + ImGuiNative.igTreePop(); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void TreePush(ReadOnlySpan str_id) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + ImGuiNative.igTreePush_Str(native_str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + } +#endif + public static void TreePush(string str_id) + { + byte* native_str_id; + int str_id_byteCount = 0; + if (str_id != null) + { + str_id_byteCount = Encoding.UTF8.GetByteCount(str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + native_str_id = Util.Allocate(str_id_byteCount + 1); + } + else + { + byte* native_str_id_stackBytes = stackalloc byte[str_id_byteCount + 1]; + native_str_id = native_str_id_stackBytes; + } + int native_str_id_offset = Util.GetUtf8(str_id, native_str_id, str_id_byteCount); + native_str_id[native_str_id_offset] = 0; + } + else { native_str_id = null; } + ImGuiNative.igTreePush_Str(native_str_id); + if (str_id_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str_id); + } + } + public static void TreePush(IntPtr ptr_id) + { + void* native_ptr_id = (void*)ptr_id.ToPointer(); + ImGuiNative.igTreePush_Ptr(native_ptr_id); + } + public static void Unindent() + { + float indent_w = 0.0f; + ImGuiNative.igUnindent(indent_w); + } + public static void Unindent(float indent_w) + { + ImGuiNative.igUnindent(indent_w); + } + public static void UpdatePlatformWindows() + { + ImGuiNative.igUpdatePlatformWindows(); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void Value(ReadOnlySpan prefix, bool b) + { + byte* native_prefix; + int prefix_byteCount = 0; + if (prefix != null) + { + prefix_byteCount = Encoding.UTF8.GetByteCount(prefix); + if (prefix_byteCount > Util.StackAllocationSizeLimit) + { + native_prefix = Util.Allocate(prefix_byteCount + 1); + } + else + { + byte* native_prefix_stackBytes = stackalloc byte[prefix_byteCount + 1]; + native_prefix = native_prefix_stackBytes; + } + int native_prefix_offset = Util.GetUtf8(prefix, native_prefix, prefix_byteCount); + native_prefix[native_prefix_offset] = 0; + } + else { native_prefix = null; } + byte native_b = b ? (byte)1 : (byte)0; + ImGuiNative.igValue_Bool(native_prefix, native_b); + if (prefix_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_prefix); + } + } +#endif + public static void Value(string prefix, bool b) + { + byte* native_prefix; + int prefix_byteCount = 0; + if (prefix != null) + { + prefix_byteCount = Encoding.UTF8.GetByteCount(prefix); + if (prefix_byteCount > Util.StackAllocationSizeLimit) + { + native_prefix = Util.Allocate(prefix_byteCount + 1); + } + else + { + byte* native_prefix_stackBytes = stackalloc byte[prefix_byteCount + 1]; + native_prefix = native_prefix_stackBytes; + } + int native_prefix_offset = Util.GetUtf8(prefix, native_prefix, prefix_byteCount); + native_prefix[native_prefix_offset] = 0; + } + else { native_prefix = null; } + byte native_b = b ? (byte)1 : (byte)0; + ImGuiNative.igValue_Bool(native_prefix, native_b); + if (prefix_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_prefix); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void Value(ReadOnlySpan prefix, int v) + { + byte* native_prefix; + int prefix_byteCount = 0; + if (prefix != null) + { + prefix_byteCount = Encoding.UTF8.GetByteCount(prefix); + if (prefix_byteCount > Util.StackAllocationSizeLimit) + { + native_prefix = Util.Allocate(prefix_byteCount + 1); + } + else + { + byte* native_prefix_stackBytes = stackalloc byte[prefix_byteCount + 1]; + native_prefix = native_prefix_stackBytes; + } + int native_prefix_offset = Util.GetUtf8(prefix, native_prefix, prefix_byteCount); + native_prefix[native_prefix_offset] = 0; + } + else { native_prefix = null; } + ImGuiNative.igValue_Int(native_prefix, v); + if (prefix_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_prefix); + } + } +#endif + public static void Value(string prefix, int v) + { + byte* native_prefix; + int prefix_byteCount = 0; + if (prefix != null) + { + prefix_byteCount = Encoding.UTF8.GetByteCount(prefix); + if (prefix_byteCount > Util.StackAllocationSizeLimit) + { + native_prefix = Util.Allocate(prefix_byteCount + 1); + } + else + { + byte* native_prefix_stackBytes = stackalloc byte[prefix_byteCount + 1]; + native_prefix = native_prefix_stackBytes; + } + int native_prefix_offset = Util.GetUtf8(prefix, native_prefix, prefix_byteCount); + native_prefix[native_prefix_offset] = 0; + } + else { native_prefix = null; } + ImGuiNative.igValue_Int(native_prefix, v); + if (prefix_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_prefix); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void Value(ReadOnlySpan prefix, uint v) + { + byte* native_prefix; + int prefix_byteCount = 0; + if (prefix != null) + { + prefix_byteCount = Encoding.UTF8.GetByteCount(prefix); + if (prefix_byteCount > Util.StackAllocationSizeLimit) + { + native_prefix = Util.Allocate(prefix_byteCount + 1); + } + else + { + byte* native_prefix_stackBytes = stackalloc byte[prefix_byteCount + 1]; + native_prefix = native_prefix_stackBytes; + } + int native_prefix_offset = Util.GetUtf8(prefix, native_prefix, prefix_byteCount); + native_prefix[native_prefix_offset] = 0; + } + else { native_prefix = null; } + ImGuiNative.igValue_Uint(native_prefix, v); + if (prefix_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_prefix); + } + } +#endif + public static void Value(string prefix, uint v) + { + byte* native_prefix; + int prefix_byteCount = 0; + if (prefix != null) + { + prefix_byteCount = Encoding.UTF8.GetByteCount(prefix); + if (prefix_byteCount > Util.StackAllocationSizeLimit) + { + native_prefix = Util.Allocate(prefix_byteCount + 1); + } + else + { + byte* native_prefix_stackBytes = stackalloc byte[prefix_byteCount + 1]; + native_prefix = native_prefix_stackBytes; + } + int native_prefix_offset = Util.GetUtf8(prefix, native_prefix, prefix_byteCount); + native_prefix[native_prefix_offset] = 0; + } + else { native_prefix = null; } + ImGuiNative.igValue_Uint(native_prefix, v); + if (prefix_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_prefix); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void Value(ReadOnlySpan prefix, float v) + { + byte* native_prefix; + int prefix_byteCount = 0; + if (prefix != null) + { + prefix_byteCount = Encoding.UTF8.GetByteCount(prefix); + if (prefix_byteCount > Util.StackAllocationSizeLimit) + { + native_prefix = Util.Allocate(prefix_byteCount + 1); + } + else + { + byte* native_prefix_stackBytes = stackalloc byte[prefix_byteCount + 1]; + native_prefix = native_prefix_stackBytes; + } + int native_prefix_offset = Util.GetUtf8(prefix, native_prefix, prefix_byteCount); + native_prefix[native_prefix_offset] = 0; + } + else { native_prefix = null; } + byte* native_float_format = null; + ImGuiNative.igValue_Float(native_prefix, v, native_float_format); + if (prefix_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_prefix); + } + } +#endif + public static void Value(string prefix, float v) + { + byte* native_prefix; + int prefix_byteCount = 0; + if (prefix != null) + { + prefix_byteCount = Encoding.UTF8.GetByteCount(prefix); + if (prefix_byteCount > Util.StackAllocationSizeLimit) + { + native_prefix = Util.Allocate(prefix_byteCount + 1); + } + else + { + byte* native_prefix_stackBytes = stackalloc byte[prefix_byteCount + 1]; + native_prefix = native_prefix_stackBytes; + } + int native_prefix_offset = Util.GetUtf8(prefix, native_prefix, prefix_byteCount); + native_prefix[native_prefix_offset] = 0; + } + else { native_prefix = null; } + byte* native_float_format = null; + ImGuiNative.igValue_Float(native_prefix, v, native_float_format); + if (prefix_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_prefix); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static void Value(ReadOnlySpan prefix, float v, ReadOnlySpan float_format) + { + byte* native_prefix; + int prefix_byteCount = 0; + if (prefix != null) + { + prefix_byteCount = Encoding.UTF8.GetByteCount(prefix); + if (prefix_byteCount > Util.StackAllocationSizeLimit) + { + native_prefix = Util.Allocate(prefix_byteCount + 1); + } + else + { + byte* native_prefix_stackBytes = stackalloc byte[prefix_byteCount + 1]; + native_prefix = native_prefix_stackBytes; + } + int native_prefix_offset = Util.GetUtf8(prefix, native_prefix, prefix_byteCount); + native_prefix[native_prefix_offset] = 0; + } + else { native_prefix = null; } + byte* native_float_format; + int float_format_byteCount = 0; + if (float_format != null) + { + float_format_byteCount = Encoding.UTF8.GetByteCount(float_format); + if (float_format_byteCount > Util.StackAllocationSizeLimit) + { + native_float_format = Util.Allocate(float_format_byteCount + 1); + } + else + { + byte* native_float_format_stackBytes = stackalloc byte[float_format_byteCount + 1]; + native_float_format = native_float_format_stackBytes; + } + int native_float_format_offset = Util.GetUtf8(float_format, native_float_format, float_format_byteCount); + native_float_format[native_float_format_offset] = 0; + } + else { native_float_format = null; } + ImGuiNative.igValue_Float(native_prefix, v, native_float_format); + if (prefix_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_prefix); + } + if (float_format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_float_format); + } + } +#endif + public static void Value(string prefix, float v, string float_format) + { + byte* native_prefix; + int prefix_byteCount = 0; + if (prefix != null) + { + prefix_byteCount = Encoding.UTF8.GetByteCount(prefix); + if (prefix_byteCount > Util.StackAllocationSizeLimit) + { + native_prefix = Util.Allocate(prefix_byteCount + 1); + } + else + { + byte* native_prefix_stackBytes = stackalloc byte[prefix_byteCount + 1]; + native_prefix = native_prefix_stackBytes; + } + int native_prefix_offset = Util.GetUtf8(prefix, native_prefix, prefix_byteCount); + native_prefix[native_prefix_offset] = 0; + } + else { native_prefix = null; } + byte* native_float_format; + int float_format_byteCount = 0; + if (float_format != null) + { + float_format_byteCount = Encoding.UTF8.GetByteCount(float_format); + if (float_format_byteCount > Util.StackAllocationSizeLimit) + { + native_float_format = Util.Allocate(float_format_byteCount + 1); + } + else + { + byte* native_float_format_stackBytes = stackalloc byte[float_format_byteCount + 1]; + native_float_format = native_float_format_stackBytes; + } + int native_float_format_offset = Util.GetUtf8(float_format, native_float_format, float_format_byteCount); + native_float_format[native_float_format_offset] = 0; + } + else { native_float_format = null; } + ImGuiNative.igValue_Float(native_prefix, v, native_float_format); + if (prefix_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_prefix); + } + if (float_format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_float_format); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool VSliderFloat(ReadOnlySpan label, Vector2 size, ref float v, float v_min, float v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igVSliderFloat(native_label, size, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool VSliderFloat(string label, Vector2 size, ref float v, float v_min, float v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%.3f"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%.3f", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igVSliderFloat(native_label, size, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool VSliderFloat(ReadOnlySpan label, Vector2 size, ref float v, float v_min, float v_max, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igVSliderFloat(native_label, size, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool VSliderFloat(string label, Vector2 size, ref float v, float v_min, float v_max, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igVSliderFloat(native_label, size, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool VSliderFloat(ReadOnlySpan label, Vector2 size, ref float v, float v_min, float v_max, ReadOnlySpan format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igVSliderFloat(native_label, size, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool VSliderFloat(string label, Vector2 size, ref float v, float v_min, float v_max, string format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (float* native_v = &v) + { + byte ret = ImGuiNative.igVSliderFloat(native_label, size, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool VSliderInt(ReadOnlySpan label, Vector2 size, ref int v, int v_min, int v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igVSliderInt(native_label, size, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool VSliderInt(string label, Vector2 size, ref int v, int v_min, int v_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + format_byteCount = Encoding.UTF8.GetByteCount("%d"); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8("%d", native_format, format_byteCount); + native_format[native_format_offset] = 0; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igVSliderInt(native_label, size, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool VSliderInt(ReadOnlySpan label, Vector2 size, ref int v, int v_min, int v_max, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igVSliderInt(native_label, size, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool VSliderInt(string label, Vector2 size, ref int v, int v_min, int v_max, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igVSliderInt(native_label, size, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool VSliderInt(ReadOnlySpan label, Vector2 size, ref int v, int v_min, int v_max, ReadOnlySpan format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igVSliderInt(native_label, size, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#endif + public static bool VSliderInt(string label, Vector2 size, ref int v, int v_min, int v_max, string format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + fixed (int* native_v = &v) + { + byte ret = ImGuiNative.igVSliderInt(native_label, size, native_v, v_min, v_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool VSliderScalar(ReadOnlySpan label, Vector2 size, ImGuiDataType data_type, IntPtr p_data, IntPtr p_min, IntPtr p_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* native_p_max = (void*)p_max.ToPointer(); + byte* native_format = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + byte ret = ImGuiNative.igVSliderScalar(native_label, size, data_type, native_p_data, native_p_min, native_p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public static bool VSliderScalar(string label, Vector2 size, ImGuiDataType data_type, IntPtr p_data, IntPtr p_min, IntPtr p_max) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* native_p_max = (void*)p_max.ToPointer(); + byte* native_format = null; + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + byte ret = ImGuiNative.igVSliderScalar(native_label, size, data_type, native_p_data, native_p_min, native_p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool VSliderScalar(ReadOnlySpan label, Vector2 size, ImGuiDataType data_type, IntPtr p_data, IntPtr p_min, IntPtr p_max, ReadOnlySpan format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* native_p_max = (void*)p_max.ToPointer(); + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + byte ret = ImGuiNative.igVSliderScalar(native_label, size, data_type, native_p_data, native_p_min, native_p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } +#endif + public static bool VSliderScalar(string label, Vector2 size, ImGuiDataType data_type, IntPtr p_data, IntPtr p_min, IntPtr p_max, string format) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* native_p_max = (void*)p_max.ToPointer(); + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + ImGuiSliderFlags flags = (ImGuiSliderFlags)0; + byte ret = ImGuiNative.igVSliderScalar(native_label, size, data_type, native_p_data, native_p_min, native_p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public static bool VSliderScalar(ReadOnlySpan label, Vector2 size, ImGuiDataType data_type, IntPtr p_data, IntPtr p_min, IntPtr p_max, ReadOnlySpan format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* native_p_max = (void*)p_max.ToPointer(); + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + byte ret = ImGuiNative.igVSliderScalar(native_label, size, data_type, native_p_data, native_p_min, native_p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } +#endif + public static bool VSliderScalar(string label, Vector2 size, ImGuiDataType data_type, IntPtr p_data, IntPtr p_min, IntPtr p_max, string format, ImGuiSliderFlags flags) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + void* native_p_data = (void*)p_data.ToPointer(); + void* native_p_min = (void*)p_min.ToPointer(); + void* native_p_max = (void*)p_max.ToPointer(); + byte* native_format; + int format_byteCount = 0; + if (format != null) + { + format_byteCount = Encoding.UTF8.GetByteCount(format); + if (format_byteCount > Util.StackAllocationSizeLimit) + { + native_format = Util.Allocate(format_byteCount + 1); + } + else + { + byte* native_format_stackBytes = stackalloc byte[format_byteCount + 1]; + native_format = native_format_stackBytes; + } + int native_format_offset = Util.GetUtf8(format, native_format, format_byteCount); + native_format[native_format_offset] = 0; + } + else { native_format = null; } + byte ret = ImGuiNative.igVSliderScalar(native_label, size, data_type, native_p_data, native_p_min, native_p_max, native_format, flags); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + if (format_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_format); + } + return ret != 0; + } + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiBackendFlags.gen.cs b/lib/ImGui.NET/Generated/ImGuiBackendFlags.gen.cs new file mode 100644 index 0000000..704dec4 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiBackendFlags.gen.cs @@ -0,0 +1,15 @@ +namespace ImGuiNET +{ + [System.Flags] + public enum ImGuiBackendFlags + { + None = 0, + HasGamepad = 1, + HasMouseCursors = 2, + HasSetMousePos = 4, + RendererHasVtxOffset = 8, + PlatformHasViewports = 1024, + HasMouseHoveredViewport = 2048, + RendererHasViewports = 4096, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiButtonFlags.gen.cs b/lib/ImGui.NET/Generated/ImGuiButtonFlags.gen.cs new file mode 100644 index 0000000..7964d5e --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiButtonFlags.gen.cs @@ -0,0 +1,13 @@ +namespace ImGuiNET +{ + [System.Flags] + public enum ImGuiButtonFlags + { + None = 0, + MouseButtonLeft = 1, + MouseButtonRight = 2, + MouseButtonMiddle = 4, + MouseButtonMask = 7, + MouseButtonDefault = 1, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiChildFlags.gen.cs b/lib/ImGui.NET/Generated/ImGuiChildFlags.gen.cs new file mode 100644 index 0000000..bbb0f50 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiChildFlags.gen.cs @@ -0,0 +1,16 @@ +namespace ImGuiNET +{ + [System.Flags] + public enum ImGuiChildFlags + { + None = 0, + Border = 1, + AlwaysUseWindowPadding = 2, + ResizeX = 4, + ResizeY = 8, + AutoResizeX = 16, + AutoResizeY = 32, + AlwaysAutoResize = 64, + FrameStyle = 128, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiCol.gen.cs b/lib/ImGui.NET/Generated/ImGuiCol.gen.cs new file mode 100644 index 0000000..38401f1 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiCol.gen.cs @@ -0,0 +1,62 @@ +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, + Tab = 33, + TabHovered = 34, + TabActive = 35, + TabUnfocused = 36, + TabUnfocusedActive = 37, + DockingPreview = 38, + DockingEmptyBg = 39, + PlotLines = 40, + PlotLinesHovered = 41, + PlotHistogram = 42, + PlotHistogramHovered = 43, + TableHeaderBg = 44, + TableBorderStrong = 45, + TableBorderLight = 46, + TableRowBg = 47, + TableRowBgAlt = 48, + TextSelectedBg = 49, + DragDropTarget = 50, + NavHighlight = 51, + NavWindowingHighlight = 52, + NavWindowingDimBg = 53, + ModalWindowDimBg = 54, + COUNT = 55, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiColorEditFlags.gen.cs b/lib/ImGui.NET/Generated/ImGuiColorEditFlags.gen.cs new file mode 100644 index 0000000..ede1457 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiColorEditFlags.gen.cs @@ -0,0 +1,36 @@ +namespace ImGuiNET +{ + [System.Flags] + public enum ImGuiColorEditFlags + { + None = 0, + NoAlpha = 2, + NoPicker = 4, + NoOptions = 8, + NoSmallPreview = 16, + NoInputs = 32, + NoTooltip = 64, + NoLabel = 128, + NoSidePreview = 256, + NoDragDrop = 512, + NoBorder = 1024, + AlphaBar = 65536, + AlphaPreview = 131072, + AlphaPreviewHalf = 262144, + HDR = 524288, + DisplayRGB = 1048576, + DisplayHSV = 2097152, + DisplayHex = 4194304, + Uint8 = 8388608, + Float = 16777216, + PickerHueBar = 33554432, + PickerHueWheel = 67108864, + InputRGB = 134217728, + InputHSV = 268435456, + DefaultOptions = 177209344, + DisplayMask = 7340032, + DataTypeMask = 25165824, + PickerMask = 100663296, + InputMask = 402653184, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiComboFlags.gen.cs b/lib/ImGui.NET/Generated/ImGuiComboFlags.gen.cs new file mode 100644 index 0000000..eec4309 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiComboFlags.gen.cs @@ -0,0 +1,17 @@ +namespace ImGuiNET +{ + [System.Flags] + public enum ImGuiComboFlags + { + None = 0, + PopupAlignLeft = 1, + HeightSmall = 2, + HeightRegular = 4, + HeightLarge = 8, + HeightLargest = 16, + NoArrowButton = 32, + NoPreview = 64, + WidthFitPreview = 128, + HeightMask = 30, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiCond.gen.cs b/lib/ImGui.NET/Generated/ImGuiCond.gen.cs new file mode 100644 index 0000000..23a4cbb --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiCond.gen.cs @@ -0,0 +1,11 @@ +namespace ImGuiNET +{ + public enum ImGuiCond + { + None = 0, + Always = 1, + Once = 2, + FirstUseEver = 4, + Appearing = 8, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiConfigFlags.gen.cs b/lib/ImGui.NET/Generated/ImGuiConfigFlags.gen.cs new file mode 100644 index 0000000..c64b184 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiConfigFlags.gen.cs @@ -0,0 +1,20 @@ +namespace ImGuiNET +{ + [System.Flags] + public enum ImGuiConfigFlags + { + None = 0, + NavEnableKeyboard = 1, + NavEnableGamepad = 2, + NavEnableSetMousePos = 4, + NavNoCaptureKeyboard = 8, + NoMouse = 16, + NoMouseCursorChange = 32, + DockingEnable = 64, + ViewportsEnable = 1024, + DpiEnableScaleViewports = 16384, + DpiEnableScaleFonts = 32768, + IsSRGB = 1048576, + IsTouchScreen = 2097152, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiDataType.gen.cs b/lib/ImGui.NET/Generated/ImGuiDataType.gen.cs new file mode 100644 index 0000000..3e1f232 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiDataType.gen.cs @@ -0,0 +1,17 @@ +namespace ImGuiNET +{ + public enum ImGuiDataType + { + S8 = 0, + U8 = 1, + S16 = 2, + U16 = 3, + S32 = 4, + U32 = 5, + S64 = 6, + U64 = 7, + Float = 8, + Double = 9, + COUNT = 10, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiDir.gen.cs b/lib/ImGui.NET/Generated/ImGuiDir.gen.cs new file mode 100644 index 0000000..f409d80 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiDir.gen.cs @@ -0,0 +1,12 @@ +namespace ImGuiNET +{ + public enum ImGuiDir + { + None = -1, + Left = 0, + Right = 1, + Up = 2, + Down = 3, + COUNT = 4, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiDockNodeFlags.gen.cs b/lib/ImGui.NET/Generated/ImGuiDockNodeFlags.gen.cs new file mode 100644 index 0000000..9f8aff3 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiDockNodeFlags.gen.cs @@ -0,0 +1,15 @@ +namespace ImGuiNET +{ + [System.Flags] + public enum ImGuiDockNodeFlags + { + None = 0, + KeepAliveOnly = 1, + NoDockingOverCentralNode = 4, + PassthruCentralNode = 8, + NoDockingSplit = 16, + NoResize = 32, + AutoHideTabBar = 64, + NoUndocking = 128, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiDragDropFlags.gen.cs b/lib/ImGui.NET/Generated/ImGuiDragDropFlags.gen.cs new file mode 100644 index 0000000..00fdf8a --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiDragDropFlags.gen.cs @@ -0,0 +1,18 @@ +namespace ImGuiNET +{ + [System.Flags] + public enum ImGuiDragDropFlags + { + None = 0, + SourceNoPreviewTooltip = 1, + SourceNoDisableHover = 2, + SourceNoHoldToOpenOthers = 4, + SourceAllowNullID = 8, + SourceExtern = 16, + SourceAutoExpirePayload = 32, + AcceptBeforeDelivery = 1024, + AcceptNoDrawDefaultRect = 2048, + AcceptNoPreviewTooltip = 4096, + AcceptPeekOnly = 3072, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiFocusedFlags.gen.cs b/lib/ImGui.NET/Generated/ImGuiFocusedFlags.gen.cs new file mode 100644 index 0000000..249a42f --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiFocusedFlags.gen.cs @@ -0,0 +1,14 @@ +namespace ImGuiNET +{ + [System.Flags] + public enum ImGuiFocusedFlags + { + None = 0, + ChildWindows = 1, + RootWindow = 2, + AnyWindow = 4, + NoPopupHierarchy = 8, + DockHierarchy = 16, + RootAndChildWindows = 3, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiHoveredFlags.gen.cs b/lib/ImGui.NET/Generated/ImGuiHoveredFlags.gen.cs new file mode 100644 index 0000000..fa1b7ad --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiHoveredFlags.gen.cs @@ -0,0 +1,28 @@ +namespace ImGuiNET +{ + [System.Flags] + public enum ImGuiHoveredFlags + { + None = 0, + ChildWindows = 1, + RootWindow = 2, + AnyWindow = 4, + NoPopupHierarchy = 8, + DockHierarchy = 16, + AllowWhenBlockedByPopup = 32, + AllowWhenBlockedByActiveItem = 128, + AllowWhenOverlappedByItem = 256, + AllowWhenOverlappedByWindow = 512, + AllowWhenDisabled = 1024, + NoNavOverride = 2048, + AllowWhenOverlapped = 768, + RectOnly = 928, + RootAndChildWindows = 3, + ForTooltip = 4096, + Stationary = 8192, + DelayNone = 16384, + DelayShort = 32768, + DelayNormal = 65536, + NoSharedDelay = 131072, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiIO.gen.cs b/lib/ImGui.NET/Generated/ImGuiIO.gen.cs new file mode 100644 index 0000000..23cbb4d --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiIO.gen.cs @@ -0,0 +1,503 @@ +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 void* UserData; + public ImFontAtlas* Fonts; + public float FontGlobalScale; + public byte FontAllowUserScaling; + public ImFont* FontDefault; + public Vector2 DisplayFramebufferScale; + public byte ConfigDockingNoSplit; + public byte ConfigDockingWithShift; + public byte ConfigDockingAlwaysTabBar; + public byte ConfigDockingTransparentPayload; + public byte ConfigViewportsNoAutoMerge; + public byte ConfigViewportsNoTaskBarIcon; + public byte ConfigViewportsNoDecoration; + public byte ConfigViewportsNoDefaultParent; + public byte MouseDrawCursor; + public byte ConfigMacOSXBehaviors; + public byte ConfigInputTrickleEventQueue; + public byte ConfigInputTextCursorBlink; + public byte ConfigInputTextEnterKeepActive; + public byte ConfigDragClickToInputText; + public byte ConfigWindowsResizeFromEdges; + public byte ConfigWindowsMoveFromTitleBarOnly; + public float ConfigMemoryCompactTimer; + public float MouseDoubleClickTime; + public float MouseDoubleClickMaxDist; + public float MouseDragThreshold; + public float KeyRepeatDelay; + public float KeyRepeatRate; + public byte ConfigDebugBeginReturnValueOnce; + public byte ConfigDebugBeginReturnValueLoop; + public byte ConfigDebugIgnoreFocusLoss; + public byte ConfigDebugIniSettings; + public byte* BackendPlatformName; + public byte* BackendRendererName; + public void* BackendPlatformUserData; + public void* BackendRendererUserData; + public void* BackendLanguageUserData; + public IntPtr GetClipboardTextFn; + public IntPtr SetClipboardTextFn; + public void* ClipboardUserData; + public IntPtr SetPlatformImeDataFn; + public ushort PlatformLocaleDecimalPoint; + 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 Vector2 MouseDelta; + public void* _UnusedPadding; + public IntPtr Ctx; + public Vector2 MousePos; + public fixed byte MouseDown[5]; + public float MouseWheel; + public float MouseWheelH; + public ImGuiMouseSource MouseSource; + public uint MouseHoveredViewport; + public byte KeyCtrl; + public byte KeyShift; + public byte KeyAlt; + public byte KeySuper; + public ImGuiKey KeyMods; + public ImGuiKeyData KeysData_0; + public ImGuiKeyData KeysData_1; + public ImGuiKeyData KeysData_2; + public ImGuiKeyData KeysData_3; + public ImGuiKeyData KeysData_4; + public ImGuiKeyData KeysData_5; + public ImGuiKeyData KeysData_6; + public ImGuiKeyData KeysData_7; + public ImGuiKeyData KeysData_8; + public ImGuiKeyData KeysData_9; + public ImGuiKeyData KeysData_10; + public ImGuiKeyData KeysData_11; + public ImGuiKeyData KeysData_12; + public ImGuiKeyData KeysData_13; + public ImGuiKeyData KeysData_14; + public ImGuiKeyData KeysData_15; + public ImGuiKeyData KeysData_16; + public ImGuiKeyData KeysData_17; + public ImGuiKeyData KeysData_18; + public ImGuiKeyData KeysData_19; + public ImGuiKeyData KeysData_20; + public ImGuiKeyData KeysData_21; + public ImGuiKeyData KeysData_22; + public ImGuiKeyData KeysData_23; + public ImGuiKeyData KeysData_24; + public ImGuiKeyData KeysData_25; + public ImGuiKeyData KeysData_26; + public ImGuiKeyData KeysData_27; + public ImGuiKeyData KeysData_28; + public ImGuiKeyData KeysData_29; + public ImGuiKeyData KeysData_30; + public ImGuiKeyData KeysData_31; + public ImGuiKeyData KeysData_32; + public ImGuiKeyData KeysData_33; + public ImGuiKeyData KeysData_34; + public ImGuiKeyData KeysData_35; + public ImGuiKeyData KeysData_36; + public ImGuiKeyData KeysData_37; + public ImGuiKeyData KeysData_38; + public ImGuiKeyData KeysData_39; + public ImGuiKeyData KeysData_40; + public ImGuiKeyData KeysData_41; + public ImGuiKeyData KeysData_42; + public ImGuiKeyData KeysData_43; + public ImGuiKeyData KeysData_44; + public ImGuiKeyData KeysData_45; + public ImGuiKeyData KeysData_46; + public ImGuiKeyData KeysData_47; + public ImGuiKeyData KeysData_48; + public ImGuiKeyData KeysData_49; + public ImGuiKeyData KeysData_50; + public ImGuiKeyData KeysData_51; + public ImGuiKeyData KeysData_52; + public ImGuiKeyData KeysData_53; + public ImGuiKeyData KeysData_54; + public ImGuiKeyData KeysData_55; + public ImGuiKeyData KeysData_56; + public ImGuiKeyData KeysData_57; + public ImGuiKeyData KeysData_58; + public ImGuiKeyData KeysData_59; + public ImGuiKeyData KeysData_60; + public ImGuiKeyData KeysData_61; + public ImGuiKeyData KeysData_62; + public ImGuiKeyData KeysData_63; + public ImGuiKeyData KeysData_64; + public ImGuiKeyData KeysData_65; + public ImGuiKeyData KeysData_66; + public ImGuiKeyData KeysData_67; + public ImGuiKeyData KeysData_68; + public ImGuiKeyData KeysData_69; + public ImGuiKeyData KeysData_70; + public ImGuiKeyData KeysData_71; + public ImGuiKeyData KeysData_72; + public ImGuiKeyData KeysData_73; + public ImGuiKeyData KeysData_74; + public ImGuiKeyData KeysData_75; + public ImGuiKeyData KeysData_76; + public ImGuiKeyData KeysData_77; + public ImGuiKeyData KeysData_78; + public ImGuiKeyData KeysData_79; + public ImGuiKeyData KeysData_80; + public ImGuiKeyData KeysData_81; + public ImGuiKeyData KeysData_82; + public ImGuiKeyData KeysData_83; + public ImGuiKeyData KeysData_84; + public ImGuiKeyData KeysData_85; + public ImGuiKeyData KeysData_86; + public ImGuiKeyData KeysData_87; + public ImGuiKeyData KeysData_88; + public ImGuiKeyData KeysData_89; + public ImGuiKeyData KeysData_90; + public ImGuiKeyData KeysData_91; + public ImGuiKeyData KeysData_92; + public ImGuiKeyData KeysData_93; + public ImGuiKeyData KeysData_94; + public ImGuiKeyData KeysData_95; + public ImGuiKeyData KeysData_96; + public ImGuiKeyData KeysData_97; + public ImGuiKeyData KeysData_98; + public ImGuiKeyData KeysData_99; + public ImGuiKeyData KeysData_100; + public ImGuiKeyData KeysData_101; + public ImGuiKeyData KeysData_102; + public ImGuiKeyData KeysData_103; + public ImGuiKeyData KeysData_104; + public ImGuiKeyData KeysData_105; + public ImGuiKeyData KeysData_106; + public ImGuiKeyData KeysData_107; + public ImGuiKeyData KeysData_108; + public ImGuiKeyData KeysData_109; + public ImGuiKeyData KeysData_110; + public ImGuiKeyData KeysData_111; + public ImGuiKeyData KeysData_112; + public ImGuiKeyData KeysData_113; + public ImGuiKeyData KeysData_114; + public ImGuiKeyData KeysData_115; + public ImGuiKeyData KeysData_116; + public ImGuiKeyData KeysData_117; + public ImGuiKeyData KeysData_118; + public ImGuiKeyData KeysData_119; + public ImGuiKeyData KeysData_120; + public ImGuiKeyData KeysData_121; + public ImGuiKeyData KeysData_122; + public ImGuiKeyData KeysData_123; + public ImGuiKeyData KeysData_124; + public ImGuiKeyData KeysData_125; + public ImGuiKeyData KeysData_126; + public ImGuiKeyData KeysData_127; + public ImGuiKeyData KeysData_128; + public ImGuiKeyData KeysData_129; + public ImGuiKeyData KeysData_130; + public ImGuiKeyData KeysData_131; + public ImGuiKeyData KeysData_132; + public ImGuiKeyData KeysData_133; + public ImGuiKeyData KeysData_134; + public ImGuiKeyData KeysData_135; + public ImGuiKeyData KeysData_136; + public ImGuiKeyData KeysData_137; + public ImGuiKeyData KeysData_138; + public ImGuiKeyData KeysData_139; + public ImGuiKeyData KeysData_140; + public ImGuiKeyData KeysData_141; + public ImGuiKeyData KeysData_142; + public ImGuiKeyData KeysData_143; + public ImGuiKeyData KeysData_144; + public ImGuiKeyData KeysData_145; + public ImGuiKeyData KeysData_146; + public ImGuiKeyData KeysData_147; + public ImGuiKeyData KeysData_148; + public ImGuiKeyData KeysData_149; + public ImGuiKeyData KeysData_150; + public ImGuiKeyData KeysData_151; + public ImGuiKeyData KeysData_152; + public ImGuiKeyData KeysData_153; + public byte WantCaptureMouseUnlessPopupClose; + 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 ushort MouseClickedCount[5]; + public fixed ushort MouseClickedLastCount[5]; + public fixed byte MouseReleased[5]; + public fixed byte MouseDownOwned[5]; + public fixed byte MouseDownOwnedUnlessPopupClose[5]; + public byte MouseWheelRequestAxisSwap; + 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 float PenPressure; + public byte AppFocusLost; + public byte AppAcceptingEvents; + public sbyte BackendUsingLegacyKeyArrays; + public byte BackendUsingLegacyNavInputArray; + public ushort InputQueueSurrogate; + public ImVector InputQueueCharacters; + } + 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(&NativePtr->ConfigFlags); + public ref ImGuiBackendFlags BackendFlags => ref Unsafe.AsRef(&NativePtr->BackendFlags); + public ref Vector2 DisplaySize => ref Unsafe.AsRef(&NativePtr->DisplaySize); + public ref float DeltaTime => ref Unsafe.AsRef(&NativePtr->DeltaTime); + public ref float IniSavingRate => ref Unsafe.AsRef(&NativePtr->IniSavingRate); + public NullTerminatedString IniFilename => new NullTerminatedString(NativePtr->IniFilename); + public NullTerminatedString LogFilename => new NullTerminatedString(NativePtr->LogFilename); + 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(&NativePtr->FontGlobalScale); + public ref bool FontAllowUserScaling => ref Unsafe.AsRef(&NativePtr->FontAllowUserScaling); + public ImFontPtr FontDefault => new ImFontPtr(NativePtr->FontDefault); + public ref Vector2 DisplayFramebufferScale => ref Unsafe.AsRef(&NativePtr->DisplayFramebufferScale); + public ref bool ConfigDockingNoSplit => ref Unsafe.AsRef(&NativePtr->ConfigDockingNoSplit); + public ref bool ConfigDockingWithShift => ref Unsafe.AsRef(&NativePtr->ConfigDockingWithShift); + public ref bool ConfigDockingAlwaysTabBar => ref Unsafe.AsRef(&NativePtr->ConfigDockingAlwaysTabBar); + public ref bool ConfigDockingTransparentPayload => ref Unsafe.AsRef(&NativePtr->ConfigDockingTransparentPayload); + public ref bool ConfigViewportsNoAutoMerge => ref Unsafe.AsRef(&NativePtr->ConfigViewportsNoAutoMerge); + public ref bool ConfigViewportsNoTaskBarIcon => ref Unsafe.AsRef(&NativePtr->ConfigViewportsNoTaskBarIcon); + public ref bool ConfigViewportsNoDecoration => ref Unsafe.AsRef(&NativePtr->ConfigViewportsNoDecoration); + public ref bool ConfigViewportsNoDefaultParent => ref Unsafe.AsRef(&NativePtr->ConfigViewportsNoDefaultParent); + public ref bool MouseDrawCursor => ref Unsafe.AsRef(&NativePtr->MouseDrawCursor); + public ref bool ConfigMacOSXBehaviors => ref Unsafe.AsRef(&NativePtr->ConfigMacOSXBehaviors); + public ref bool ConfigInputTrickleEventQueue => ref Unsafe.AsRef(&NativePtr->ConfigInputTrickleEventQueue); + public ref bool ConfigInputTextCursorBlink => ref Unsafe.AsRef(&NativePtr->ConfigInputTextCursorBlink); + public ref bool ConfigInputTextEnterKeepActive => ref Unsafe.AsRef(&NativePtr->ConfigInputTextEnterKeepActive); + public ref bool ConfigDragClickToInputText => ref Unsafe.AsRef(&NativePtr->ConfigDragClickToInputText); + public ref bool ConfigWindowsResizeFromEdges => ref Unsafe.AsRef(&NativePtr->ConfigWindowsResizeFromEdges); + public ref bool ConfigWindowsMoveFromTitleBarOnly => ref Unsafe.AsRef(&NativePtr->ConfigWindowsMoveFromTitleBarOnly); + public ref float ConfigMemoryCompactTimer => ref Unsafe.AsRef(&NativePtr->ConfigMemoryCompactTimer); + public ref float MouseDoubleClickTime => ref Unsafe.AsRef(&NativePtr->MouseDoubleClickTime); + public ref float MouseDoubleClickMaxDist => ref Unsafe.AsRef(&NativePtr->MouseDoubleClickMaxDist); + public ref float MouseDragThreshold => ref Unsafe.AsRef(&NativePtr->MouseDragThreshold); + public ref float KeyRepeatDelay => ref Unsafe.AsRef(&NativePtr->KeyRepeatDelay); + public ref float KeyRepeatRate => ref Unsafe.AsRef(&NativePtr->KeyRepeatRate); + public ref bool ConfigDebugBeginReturnValueOnce => ref Unsafe.AsRef(&NativePtr->ConfigDebugBeginReturnValueOnce); + public ref bool ConfigDebugBeginReturnValueLoop => ref Unsafe.AsRef(&NativePtr->ConfigDebugBeginReturnValueLoop); + public ref bool ConfigDebugIgnoreFocusLoss => ref Unsafe.AsRef(&NativePtr->ConfigDebugIgnoreFocusLoss); + public ref bool ConfigDebugIniSettings => ref Unsafe.AsRef(&NativePtr->ConfigDebugIniSettings); + public NullTerminatedString BackendPlatformName => new NullTerminatedString(NativePtr->BackendPlatformName); + public NullTerminatedString BackendRendererName => new NullTerminatedString(NativePtr->BackendRendererName); + public IntPtr BackendPlatformUserData { get => (IntPtr)NativePtr->BackendPlatformUserData; set => NativePtr->BackendPlatformUserData = (void*)value; } + public IntPtr BackendRendererUserData { get => (IntPtr)NativePtr->BackendRendererUserData; set => NativePtr->BackendRendererUserData = (void*)value; } + public IntPtr BackendLanguageUserData { get => (IntPtr)NativePtr->BackendLanguageUserData; set => NativePtr->BackendLanguageUserData = (void*)value; } + public ref IntPtr GetClipboardTextFn => ref Unsafe.AsRef(&NativePtr->GetClipboardTextFn); + public ref IntPtr SetClipboardTextFn => ref Unsafe.AsRef(&NativePtr->SetClipboardTextFn); + public IntPtr ClipboardUserData { get => (IntPtr)NativePtr->ClipboardUserData; set => NativePtr->ClipboardUserData = (void*)value; } + public ref IntPtr SetPlatformImeDataFn => ref Unsafe.AsRef(&NativePtr->SetPlatformImeDataFn); + public ref ushort PlatformLocaleDecimalPoint => ref Unsafe.AsRef(&NativePtr->PlatformLocaleDecimalPoint); + public ref bool WantCaptureMouse => ref Unsafe.AsRef(&NativePtr->WantCaptureMouse); + public ref bool WantCaptureKeyboard => ref Unsafe.AsRef(&NativePtr->WantCaptureKeyboard); + public ref bool WantTextInput => ref Unsafe.AsRef(&NativePtr->WantTextInput); + public ref bool WantSetMousePos => ref Unsafe.AsRef(&NativePtr->WantSetMousePos); + public ref bool WantSaveIniSettings => ref Unsafe.AsRef(&NativePtr->WantSaveIniSettings); + public ref bool NavActive => ref Unsafe.AsRef(&NativePtr->NavActive); + public ref bool NavVisible => ref Unsafe.AsRef(&NativePtr->NavVisible); + public ref float Framerate => ref Unsafe.AsRef(&NativePtr->Framerate); + public ref int MetricsRenderVertices => ref Unsafe.AsRef(&NativePtr->MetricsRenderVertices); + public ref int MetricsRenderIndices => ref Unsafe.AsRef(&NativePtr->MetricsRenderIndices); + public ref int MetricsRenderWindows => ref Unsafe.AsRef(&NativePtr->MetricsRenderWindows); + public ref int MetricsActiveWindows => ref Unsafe.AsRef(&NativePtr->MetricsActiveWindows); + public ref Vector2 MouseDelta => ref Unsafe.AsRef(&NativePtr->MouseDelta); + public IntPtr _UnusedPadding { get => (IntPtr)NativePtr->_UnusedPadding; set => NativePtr->_UnusedPadding = (void*)value; } + public ref IntPtr Ctx => ref Unsafe.AsRef(&NativePtr->Ctx); + public ref Vector2 MousePos => ref Unsafe.AsRef(&NativePtr->MousePos); + public RangeAccessor MouseDown => new RangeAccessor(NativePtr->MouseDown, 5); + public ref float MouseWheel => ref Unsafe.AsRef(&NativePtr->MouseWheel); + public ref float MouseWheelH => ref Unsafe.AsRef(&NativePtr->MouseWheelH); + public ref ImGuiMouseSource MouseSource => ref Unsafe.AsRef(&NativePtr->MouseSource); + public ref uint MouseHoveredViewport => ref Unsafe.AsRef(&NativePtr->MouseHoveredViewport); + public ref bool KeyCtrl => ref Unsafe.AsRef(&NativePtr->KeyCtrl); + public ref bool KeyShift => ref Unsafe.AsRef(&NativePtr->KeyShift); + public ref bool KeyAlt => ref Unsafe.AsRef(&NativePtr->KeyAlt); + public ref bool KeySuper => ref Unsafe.AsRef(&NativePtr->KeySuper); + public ref ImGuiKey KeyMods => ref Unsafe.AsRef(&NativePtr->KeyMods); + public RangeAccessor KeysData => new RangeAccessor(&NativePtr->KeysData_0, 154); + public ref bool WantCaptureMouseUnlessPopupClose => ref Unsafe.AsRef(&NativePtr->WantCaptureMouseUnlessPopupClose); + public ref Vector2 MousePosPrev => ref Unsafe.AsRef(&NativePtr->MousePosPrev); + public RangeAccessor MouseClickedPos => new RangeAccessor(&NativePtr->MouseClickedPos_0, 5); + public RangeAccessor MouseClickedTime => new RangeAccessor(NativePtr->MouseClickedTime, 5); + public RangeAccessor MouseClicked => new RangeAccessor(NativePtr->MouseClicked, 5); + public RangeAccessor MouseDoubleClicked => new RangeAccessor(NativePtr->MouseDoubleClicked, 5); + public RangeAccessor MouseClickedCount => new RangeAccessor(NativePtr->MouseClickedCount, 5); + public RangeAccessor MouseClickedLastCount => new RangeAccessor(NativePtr->MouseClickedLastCount, 5); + public RangeAccessor MouseReleased => new RangeAccessor(NativePtr->MouseReleased, 5); + public RangeAccessor MouseDownOwned => new RangeAccessor(NativePtr->MouseDownOwned, 5); + public RangeAccessor MouseDownOwnedUnlessPopupClose => new RangeAccessor(NativePtr->MouseDownOwnedUnlessPopupClose, 5); + public ref bool MouseWheelRequestAxisSwap => ref Unsafe.AsRef(&NativePtr->MouseWheelRequestAxisSwap); + public RangeAccessor MouseDownDuration => new RangeAccessor(NativePtr->MouseDownDuration, 5); + public RangeAccessor MouseDownDurationPrev => new RangeAccessor(NativePtr->MouseDownDurationPrev, 5); + public RangeAccessor MouseDragMaxDistanceAbs => new RangeAccessor(&NativePtr->MouseDragMaxDistanceAbs_0, 5); + public RangeAccessor MouseDragMaxDistanceSqr => new RangeAccessor(NativePtr->MouseDragMaxDistanceSqr, 5); + public ref float PenPressure => ref Unsafe.AsRef(&NativePtr->PenPressure); + public ref bool AppFocusLost => ref Unsafe.AsRef(&NativePtr->AppFocusLost); + public ref bool AppAcceptingEvents => ref Unsafe.AsRef(&NativePtr->AppAcceptingEvents); + public ref sbyte BackendUsingLegacyKeyArrays => ref Unsafe.AsRef(&NativePtr->BackendUsingLegacyKeyArrays); + public ref bool BackendUsingLegacyNavInputArray => ref Unsafe.AsRef(&NativePtr->BackendUsingLegacyNavInputArray); + public ref ushort InputQueueSurrogate => ref Unsafe.AsRef(&NativePtr->InputQueueSurrogate); + public ImVector InputQueueCharacters => new ImVector(NativePtr->InputQueueCharacters); + public void AddFocusEvent(bool focused) + { + byte native_focused = focused ? (byte)1 : (byte)0; + ImGuiNative.ImGuiIO_AddFocusEvent((ImGuiIO*)(NativePtr), native_focused); + } + public void AddInputCharacter(uint c) + { + ImGuiNative.ImGuiIO_AddInputCharacter((ImGuiIO*)(NativePtr), c); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public void AddInputCharactersUTF8(ReadOnlySpan str) + { + byte* native_str; + int str_byteCount = 0; + if (str != null) + { + str_byteCount = Encoding.UTF8.GetByteCount(str); + if (str_byteCount > Util.StackAllocationSizeLimit) + { + native_str = Util.Allocate(str_byteCount + 1); + } + else + { + byte* native_str_stackBytes = stackalloc byte[str_byteCount + 1]; + native_str = native_str_stackBytes; + } + int native_str_offset = Util.GetUtf8(str, native_str, str_byteCount); + native_str[native_str_offset] = 0; + } + else { native_str = null; } + ImGuiNative.ImGuiIO_AddInputCharactersUTF8((ImGuiIO*)(NativePtr), native_str); + if (str_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str); + } + } +#endif + public void AddInputCharactersUTF8(string str) + { + byte* native_str; + int str_byteCount = 0; + if (str != null) + { + str_byteCount = Encoding.UTF8.GetByteCount(str); + if (str_byteCount > Util.StackAllocationSizeLimit) + { + native_str = Util.Allocate(str_byteCount + 1); + } + else + { + byte* native_str_stackBytes = stackalloc byte[str_byteCount + 1]; + native_str = native_str_stackBytes; + } + int native_str_offset = Util.GetUtf8(str, native_str, str_byteCount); + native_str[native_str_offset] = 0; + } + else { native_str = null; } + ImGuiNative.ImGuiIO_AddInputCharactersUTF8((ImGuiIO*)(NativePtr), native_str); + if (str_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str); + } + } + public void AddInputCharacterUTF16(ushort c) + { + ImGuiNative.ImGuiIO_AddInputCharacterUTF16((ImGuiIO*)(NativePtr), c); + } + public void AddKeyAnalogEvent(ImGuiKey key, bool down, float v) + { + byte native_down = down ? (byte)1 : (byte)0; + ImGuiNative.ImGuiIO_AddKeyAnalogEvent((ImGuiIO*)(NativePtr), key, native_down, v); + } + public void AddKeyEvent(ImGuiKey key, bool down) + { + byte native_down = down ? (byte)1 : (byte)0; + ImGuiNative.ImGuiIO_AddKeyEvent((ImGuiIO*)(NativePtr), key, native_down); + } + public void AddMouseButtonEvent(int button, bool down) + { + byte native_down = down ? (byte)1 : (byte)0; + ImGuiNative.ImGuiIO_AddMouseButtonEvent((ImGuiIO*)(NativePtr), button, native_down); + } + public void AddMousePosEvent(float x, float y) + { + ImGuiNative.ImGuiIO_AddMousePosEvent((ImGuiIO*)(NativePtr), x, y); + } + public void AddMouseSourceEvent(ImGuiMouseSource source) + { + ImGuiNative.ImGuiIO_AddMouseSourceEvent((ImGuiIO*)(NativePtr), source); + } + public void AddMouseViewportEvent(uint id) + { + ImGuiNative.ImGuiIO_AddMouseViewportEvent((ImGuiIO*)(NativePtr), id); + } + public void AddMouseWheelEvent(float wheel_x, float wheel_y) + { + ImGuiNative.ImGuiIO_AddMouseWheelEvent((ImGuiIO*)(NativePtr), wheel_x, wheel_y); + } + public void ClearEventsQueue() + { + ImGuiNative.ImGuiIO_ClearEventsQueue((ImGuiIO*)(NativePtr)); + } + public void ClearInputKeys() + { + ImGuiNative.ImGuiIO_ClearInputKeys((ImGuiIO*)(NativePtr)); + } + public void Destroy() + { + ImGuiNative.ImGuiIO_destroy((ImGuiIO*)(NativePtr)); + } + public void SetAppAcceptingEvents(bool accepting_events) + { + byte native_accepting_events = accepting_events ? (byte)1 : (byte)0; + ImGuiNative.ImGuiIO_SetAppAcceptingEvents((ImGuiIO*)(NativePtr), native_accepting_events); + } + public void SetKeyEventNativeData(ImGuiKey key, int native_keycode, int native_scancode) + { + int native_legacy_index = -1; + ImGuiNative.ImGuiIO_SetKeyEventNativeData((ImGuiIO*)(NativePtr), key, native_keycode, native_scancode, native_legacy_index); + } + public void SetKeyEventNativeData(ImGuiKey key, int native_keycode, int native_scancode, int native_legacy_index) + { + ImGuiNative.ImGuiIO_SetKeyEventNativeData((ImGuiIO*)(NativePtr), key, native_keycode, native_scancode, native_legacy_index); + } + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiInputTextCallbackData.gen.cs b/lib/ImGui.NET/Generated/ImGuiInputTextCallbackData.gen.cs new file mode 100644 index 0000000..10bd0fa --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiInputTextCallbackData.gen.cs @@ -0,0 +1,121 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ImGuiNET +{ + public unsafe partial struct ImGuiInputTextCallbackData + { + public IntPtr Ctx; + 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 IntPtr Ctx => ref Unsafe.AsRef(&NativePtr->Ctx); + public ref ImGuiInputTextFlags EventFlag => ref Unsafe.AsRef(&NativePtr->EventFlag); + public ref ImGuiInputTextFlags Flags => ref Unsafe.AsRef(&NativePtr->Flags); + public IntPtr UserData { get => (IntPtr)NativePtr->UserData; set => NativePtr->UserData = (void*)value; } + public ref ushort EventChar => ref Unsafe.AsRef(&NativePtr->EventChar); + public ref ImGuiKey EventKey => ref Unsafe.AsRef(&NativePtr->EventKey); + public IntPtr Buf { get => (IntPtr)NativePtr->Buf; set => NativePtr->Buf = (byte*)value; } + public ref int BufTextLen => ref Unsafe.AsRef(&NativePtr->BufTextLen); + public ref int BufSize => ref Unsafe.AsRef(&NativePtr->BufSize); + public ref bool BufDirty => ref Unsafe.AsRef(&NativePtr->BufDirty); + public ref int CursorPos => ref Unsafe.AsRef(&NativePtr->CursorPos); + public ref int SelectionStart => ref Unsafe.AsRef(&NativePtr->SelectionStart); + public ref int SelectionEnd => ref Unsafe.AsRef(&NativePtr->SelectionEnd); + public void ClearSelection() + { + ImGuiNative.ImGuiInputTextCallbackData_ClearSelection((ImGuiInputTextCallbackData*)(NativePtr)); + } + public void DeleteChars(int pos, int bytes_count) + { + ImGuiNative.ImGuiInputTextCallbackData_DeleteChars((ImGuiInputTextCallbackData*)(NativePtr), pos, bytes_count); + } + public void Destroy() + { + ImGuiNative.ImGuiInputTextCallbackData_destroy((ImGuiInputTextCallbackData*)(NativePtr)); + } + public bool HasSelection() + { + byte ret = ImGuiNative.ImGuiInputTextCallbackData_HasSelection((ImGuiInputTextCallbackData*)(NativePtr)); + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public void InsertChars(int pos, ReadOnlySpan text) + { + byte* native_text; + int text_byteCount = 0; + if (text != null) + { + text_byteCount = Encoding.UTF8.GetByteCount(text); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + native_text = Util.Allocate(text_byteCount + 1); + } + else + { + byte* native_text_stackBytes = stackalloc byte[text_byteCount + 1]; + native_text = native_text_stackBytes; + } + int native_text_offset = Util.GetUtf8(text, native_text, text_byteCount); + native_text[native_text_offset] = 0; + } + else { native_text = null; } + ImGuiNative.ImGuiInputTextCallbackData_InsertChars((ImGuiInputTextCallbackData*)(NativePtr), pos, native_text, native_text+text_byteCount); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text); + } + } +#endif + public void InsertChars(int pos, string text) + { + byte* native_text; + int text_byteCount = 0; + if (text != null) + { + text_byteCount = Encoding.UTF8.GetByteCount(text); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + native_text = Util.Allocate(text_byteCount + 1); + } + else + { + byte* native_text_stackBytes = stackalloc byte[text_byteCount + 1]; + native_text = native_text_stackBytes; + } + int native_text_offset = Util.GetUtf8(text, native_text, text_byteCount); + native_text[native_text_offset] = 0; + } + else { native_text = null; } + ImGuiNative.ImGuiInputTextCallbackData_InsertChars((ImGuiInputTextCallbackData*)(NativePtr), pos, native_text, native_text+text_byteCount); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text); + } + } + public void SelectAll() + { + ImGuiNative.ImGuiInputTextCallbackData_SelectAll((ImGuiInputTextCallbackData*)(NativePtr)); + } + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiInputTextFlags.gen.cs b/lib/ImGui.NET/Generated/ImGuiInputTextFlags.gen.cs new file mode 100644 index 0000000..b74d8d6 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiInputTextFlags.gen.cs @@ -0,0 +1,29 @@ +namespace ImGuiNET +{ + [System.Flags] + public enum ImGuiInputTextFlags + { + None = 0, + CharsDecimal = 1, + CharsHexadecimal = 2, + CharsUppercase = 4, + CharsNoBlank = 8, + AutoSelectAll = 16, + EnterReturnsTrue = 32, + CallbackCompletion = 64, + CallbackHistory = 128, + CallbackAlways = 256, + CallbackCharFilter = 512, + AllowTabInput = 1024, + CtrlEnterForNewLine = 2048, + NoHorizontalScroll = 4096, + AlwaysOverwrite = 8192, + ReadOnly = 16384, + Password = 32768, + NoUndoRedo = 65536, + CharsScientific = 131072, + CallbackResize = 262144, + CallbackEdit = 524288, + EscapeClearsAll = 1048576, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiKey.gen.cs b/lib/ImGui.NET/Generated/ImGuiKey.gen.cs new file mode 100644 index 0000000..4e1028d --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiKey.gen.cs @@ -0,0 +1,174 @@ +namespace ImGuiNET +{ + public enum ImGuiKey + { + None = 0, + Tab = 512, + LeftArrow = 513, + RightArrow = 514, + UpArrow = 515, + DownArrow = 516, + PageUp = 517, + PageDown = 518, + Home = 519, + End = 520, + Insert = 521, + Delete = 522, + Backspace = 523, + Space = 524, + Enter = 525, + Escape = 526, + LeftCtrl = 527, + LeftShift = 528, + LeftAlt = 529, + LeftSuper = 530, + RightCtrl = 531, + RightShift = 532, + RightAlt = 533, + RightSuper = 534, + Menu = 535, + _0 = 536, + _1 = 537, + _2 = 538, + _3 = 539, + _4 = 540, + _5 = 541, + _6 = 542, + _7 = 543, + _8 = 544, + _9 = 545, + A = 546, + B = 547, + C = 548, + D = 549, + E = 550, + F = 551, + G = 552, + H = 553, + I = 554, + J = 555, + K = 556, + L = 557, + M = 558, + N = 559, + O = 560, + P = 561, + Q = 562, + R = 563, + S = 564, + T = 565, + U = 566, + V = 567, + W = 568, + X = 569, + Y = 570, + Z = 571, + F1 = 572, + F2 = 573, + F3 = 574, + F4 = 575, + F5 = 576, + F6 = 577, + F7 = 578, + F8 = 579, + F9 = 580, + F10 = 581, + F11 = 582, + F12 = 583, + F13 = 584, + F14 = 585, + F15 = 586, + F16 = 587, + F17 = 588, + F18 = 589, + F19 = 590, + F20 = 591, + F21 = 592, + F22 = 593, + F23 = 594, + F24 = 595, + Apostrophe = 596, + Comma = 597, + Minus = 598, + Period = 599, + Slash = 600, + Semicolon = 601, + Equal = 602, + LeftBracket = 603, + Backslash = 604, + RightBracket = 605, + GraveAccent = 606, + CapsLock = 607, + ScrollLock = 608, + NumLock = 609, + PrintScreen = 610, + Pause = 611, + Keypad0 = 612, + Keypad1 = 613, + Keypad2 = 614, + Keypad3 = 615, + Keypad4 = 616, + Keypad5 = 617, + Keypad6 = 618, + Keypad7 = 619, + Keypad8 = 620, + Keypad9 = 621, + KeypadDecimal = 622, + KeypadDivide = 623, + KeypadMultiply = 624, + KeypadSubtract = 625, + KeypadAdd = 626, + KeypadEnter = 627, + KeypadEqual = 628, + AppBack = 629, + AppForward = 630, + GamepadStart = 631, + GamepadBack = 632, + GamepadFaceLeft = 633, + GamepadFaceRight = 634, + GamepadFaceUp = 635, + GamepadFaceDown = 636, + GamepadDpadLeft = 637, + GamepadDpadRight = 638, + GamepadDpadUp = 639, + GamepadDpadDown = 640, + GamepadL1 = 641, + GamepadR1 = 642, + GamepadL2 = 643, + GamepadR2 = 644, + GamepadL3 = 645, + GamepadR3 = 646, + GamepadLStickLeft = 647, + GamepadLStickRight = 648, + GamepadLStickUp = 649, + GamepadLStickDown = 650, + GamepadRStickLeft = 651, + GamepadRStickRight = 652, + GamepadRStickUp = 653, + GamepadRStickDown = 654, + MouseLeft = 655, + MouseRight = 656, + MouseMiddle = 657, + MouseX1 = 658, + MouseX2 = 659, + MouseWheelX = 660, + MouseWheelY = 661, + ReservedForModCtrl = 662, + ReservedForModShift = 663, + ReservedForModAlt = 664, + ReservedForModSuper = 665, + COUNT = 666, + ModNone = 0, + ModCtrl = 4096, + ModShift = 8192, + ModAlt = 16384, + ModSuper = 32768, + ModShortcut = 2048, + ModMask = 63488, + NamedKey_BEGIN = 512, + NamedKey_END = 666, + NamedKey_COUNT = 154, + KeysData_SIZE = 154, + KeysData_OFFSET = 512, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiKeyData.gen.cs b/lib/ImGui.NET/Generated/ImGuiKeyData.gen.cs new file mode 100644 index 0000000..68ebbdc --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiKeyData.gen.cs @@ -0,0 +1,28 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ImGuiNET +{ + public unsafe partial struct ImGuiKeyData + { + public byte Down; + public float DownDuration; + public float DownDurationPrev; + public float AnalogValue; + } + public unsafe partial struct ImGuiKeyDataPtr + { + public ImGuiKeyData* NativePtr { get; } + public ImGuiKeyDataPtr(ImGuiKeyData* nativePtr) => NativePtr = nativePtr; + public ImGuiKeyDataPtr(IntPtr nativePtr) => NativePtr = (ImGuiKeyData*)nativePtr; + public static implicit operator ImGuiKeyDataPtr(ImGuiKeyData* nativePtr) => new ImGuiKeyDataPtr(nativePtr); + public static implicit operator ImGuiKeyData* (ImGuiKeyDataPtr wrappedPtr) => wrappedPtr.NativePtr; + public static implicit operator ImGuiKeyDataPtr(IntPtr nativePtr) => new ImGuiKeyDataPtr(nativePtr); + public ref bool Down => ref Unsafe.AsRef(&NativePtr->Down); + public ref float DownDuration => ref Unsafe.AsRef(&NativePtr->DownDuration); + public ref float DownDurationPrev => ref Unsafe.AsRef(&NativePtr->DownDurationPrev); + public ref float AnalogValue => ref Unsafe.AsRef(&NativePtr->AnalogValue); + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiListClipper.gen.cs b/lib/ImGui.NET/Generated/ImGuiListClipper.gen.cs new file mode 100644 index 0000000..5f728d9 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiListClipper.gen.cs @@ -0,0 +1,60 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ImGuiNET +{ + public unsafe partial struct ImGuiListClipper + { + public IntPtr Ctx; + public int DisplayStart; + public int DisplayEnd; + public int ItemsCount; + public float ItemsHeight; + public float StartPosY; + public void* TempData; + } + 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 IntPtr Ctx => ref Unsafe.AsRef(&NativePtr->Ctx); + public ref int DisplayStart => ref Unsafe.AsRef(&NativePtr->DisplayStart); + public ref int DisplayEnd => ref Unsafe.AsRef(&NativePtr->DisplayEnd); + public ref int ItemsCount => ref Unsafe.AsRef(&NativePtr->ItemsCount); + public ref float ItemsHeight => ref Unsafe.AsRef(&NativePtr->ItemsHeight); + public ref float StartPosY => ref Unsafe.AsRef(&NativePtr->StartPosY); + public IntPtr TempData { get => (IntPtr)NativePtr->TempData; set => NativePtr->TempData = (void*)value; } + public void Begin(int items_count) + { + float items_height = -1.0f; + ImGuiNative.ImGuiListClipper_Begin((ImGuiListClipper*)(NativePtr), items_count, items_height); + } + public void Begin(int items_count, float items_height) + { + ImGuiNative.ImGuiListClipper_Begin((ImGuiListClipper*)(NativePtr), items_count, items_height); + } + public void Destroy() + { + ImGuiNative.ImGuiListClipper_destroy((ImGuiListClipper*)(NativePtr)); + } + public void End() + { + ImGuiNative.ImGuiListClipper_End((ImGuiListClipper*)(NativePtr)); + } + public void IncludeItemByIndex(int item_index) + { + ImGuiNative.ImGuiListClipper_IncludeItemByIndex((ImGuiListClipper*)(NativePtr), item_index); + } + public bool Step() + { + byte ret = ImGuiNative.ImGuiListClipper_Step((ImGuiListClipper*)(NativePtr)); + return ret != 0; + } + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiModFlags.gen.cs b/lib/ImGui.NET/Generated/ImGuiModFlags.gen.cs new file mode 100644 index 0000000..0490b82 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiModFlags.gen.cs @@ -0,0 +1,12 @@ +namespace ImGuiNET +{ + [System.Flags] + public enum ImGuiModFlags + { + None = 0, + Ctrl = 1, + Shift = 2, + Alt = 4, + Super = 8, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiMouseButton.gen.cs b/lib/ImGui.NET/Generated/ImGuiMouseButton.gen.cs new file mode 100644 index 0000000..96a3fd1 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiMouseButton.gen.cs @@ -0,0 +1,10 @@ +namespace ImGuiNET +{ + public enum ImGuiMouseButton + { + Left = 0, + Right = 1, + Middle = 2, + COUNT = 5, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiMouseCursor.gen.cs b/lib/ImGui.NET/Generated/ImGuiMouseCursor.gen.cs new file mode 100644 index 0000000..fcf21e1 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiMouseCursor.gen.cs @@ -0,0 +1,17 @@ +namespace ImGuiNET +{ + public enum ImGuiMouseCursor + { + None = -1, + Arrow = 0, + TextInput = 1, + ResizeAll = 2, + ResizeNS = 3, + ResizeEW = 4, + ResizeNESW = 5, + ResizeNWSE = 6, + Hand = 7, + NotAllowed = 8, + COUNT = 9, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiMouseSource.gen.cs b/lib/ImGui.NET/Generated/ImGuiMouseSource.gen.cs new file mode 100644 index 0000000..58877f3 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiMouseSource.gen.cs @@ -0,0 +1,10 @@ +namespace ImGuiNET +{ + public enum ImGuiMouseSource + { + Mouse = 0, + TouchScreen = 1, + Pen = 2, + COUNT = 3, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiNative.gen.cs b/lib/ImGui.NET/Generated/ImGuiNative.gen.cs new file mode 100644 index 0000000..27ae739 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiNative.gen.cs @@ -0,0 +1,1296 @@ +using System; +using System.Numerics; +using System.Runtime.InteropServices; + +namespace ImGuiNET +{ + public static unsafe partial class ImGuiNative + { + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiPayload* igAcceptDragDropPayload(byte* type, ImGuiDragDropFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igAlignTextToFramePadding(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igArrowButton(byte* str_id, ImGuiDir dir); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igBegin(byte* name, byte* p_open, ImGuiWindowFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igBeginChild_Str(byte* str_id, Vector2 size, ImGuiChildFlags child_flags, ImGuiWindowFlags window_flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igBeginChild_ID(uint id, Vector2 size, ImGuiChildFlags child_flags, ImGuiWindowFlags window_flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igBeginCombo(byte* label, byte* preview_value, ImGuiComboFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igBeginDisabled(byte disabled); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igBeginDragDropSource(ImGuiDragDropFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igBeginDragDropTarget(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igBeginGroup(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igBeginItemTooltip(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igBeginListBox(byte* label, Vector2 size); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igBeginMainMenuBar(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igBeginMenu(byte* label, byte enabled); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igBeginMenuBar(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igBeginPopup(byte* str_id, ImGuiWindowFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igBeginPopupContextItem(byte* str_id, ImGuiPopupFlags popup_flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igBeginPopupContextVoid(byte* str_id, ImGuiPopupFlags popup_flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igBeginPopupContextWindow(byte* str_id, ImGuiPopupFlags popup_flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igBeginPopupModal(byte* name, byte* p_open, ImGuiWindowFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igBeginTabBar(byte* str_id, ImGuiTabBarFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igBeginTabItem(byte* label, byte* p_open, ImGuiTabItemFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igBeginTable(byte* str_id, int column, ImGuiTableFlags flags, Vector2 outer_size, float inner_width); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igBeginTooltip(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igBullet(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igBulletText(byte* fmt); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igButton(byte* label, Vector2 size); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern float igCalcItemWidth(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igCalcTextSize(Vector2* pOut, byte* text, byte* text_end, byte hide_text_after_double_hash, float wrap_width); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igCheckbox(byte* label, byte* v); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igCheckboxFlags_IntPtr(byte* label, int* flags, int flags_value); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igCheckboxFlags_UintPtr(byte* label, uint* flags, uint flags_value); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igCloseCurrentPopup(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igCollapsingHeader_TreeNodeFlags(byte* label, ImGuiTreeNodeFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igCollapsingHeader_BoolPtr(byte* label, byte* p_visible, ImGuiTreeNodeFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igColorButton(byte* desc_id, Vector4 col, ImGuiColorEditFlags flags, Vector2 size); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern uint igColorConvertFloat4ToU32(Vector4 @in); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igColorConvertHSVtoRGB(float h, float s, float v, float* out_r, float* out_g, float* out_b); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igColorConvertRGBtoHSV(float r, float g, float b, float* out_h, float* out_s, float* out_v); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igColorConvertU32ToFloat4(Vector4* pOut, uint @in); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igColorEdit3(byte* label, Vector3* col, ImGuiColorEditFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igColorEdit4(byte* label, Vector4* col, ImGuiColorEditFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igColorPicker3(byte* label, Vector3* col, ImGuiColorEditFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igColorPicker4(byte* label, Vector4* col, ImGuiColorEditFlags flags, float* ref_col); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igColumns(int count, byte* id, byte border); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igCombo_Str_arr(byte* label, int* current_item, byte** items, int items_count, int popup_max_height_in_items); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igCombo_Str(byte* label, int* current_item, byte* items_separated_by_zeros, int popup_max_height_in_items); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr igCreateContext(ImFontAtlas* shared_font_atlas); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igDebugCheckVersionAndDataLayout(byte* version_str, uint sz_io, uint sz_style, uint sz_vec2, uint sz_vec4, uint sz_drawvert, uint sz_drawidx); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igDebugTextEncoding(byte* text); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igDestroyContext(IntPtr ctx); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igDestroyPlatformWindows(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern uint igDockSpace(uint id, Vector2 size, ImGuiDockNodeFlags flags, ImGuiWindowClass* window_class); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern uint igDockSpaceOverViewport(ImGuiViewport* viewport, ImGuiDockNodeFlags flags, ImGuiWindowClass* window_class); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igDragFloat(byte* label, float* v, float v_speed, float v_min, float v_max, byte* format, ImGuiSliderFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igDragFloat2(byte* label, Vector2* v, float v_speed, float v_min, float v_max, byte* format, ImGuiSliderFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igDragFloat3(byte* label, Vector3* v, float v_speed, float v_min, float v_max, byte* format, ImGuiSliderFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igDragFloat4(byte* label, Vector4* v, float v_speed, float v_min, float v_max, byte* format, ImGuiSliderFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igDragFloatRange2(byte* label, float* v_current_min, float* v_current_max, float v_speed, float v_min, float v_max, byte* format, byte* format_max, ImGuiSliderFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igDragInt(byte* label, int* v, float v_speed, int v_min, int v_max, byte* format, ImGuiSliderFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igDragInt2(byte* label, int* v, float v_speed, int v_min, int v_max, byte* format, ImGuiSliderFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igDragInt3(byte* label, int* v, float v_speed, int v_min, int v_max, byte* format, ImGuiSliderFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igDragInt4(byte* label, int* v, float v_speed, int v_min, int v_max, byte* format, ImGuiSliderFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igDragIntRange2(byte* label, int* v_current_min, int* v_current_max, float v_speed, int v_min, int v_max, byte* format, byte* format_max, ImGuiSliderFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igDragScalar(byte* label, ImGuiDataType data_type, void* p_data, float v_speed, void* p_min, void* p_max, byte* format, ImGuiSliderFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igDragScalarN(byte* label, ImGuiDataType data_type, void* p_data, int components, float v_speed, void* p_min, void* p_max, byte* format, ImGuiSliderFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igDummy(Vector2 size); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igEnd(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igEndChild(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igEndCombo(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igEndDisabled(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igEndDragDropSource(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igEndDragDropTarget(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igEndFrame(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igEndGroup(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igEndListBox(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igEndMainMenuBar(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igEndMenu(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igEndMenuBar(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igEndPopup(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igEndTabBar(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igEndTabItem(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igEndTable(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igEndTooltip(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiViewport* igFindViewportByID(uint id); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiViewport* igFindViewportByPlatformHandle(void* platform_handle); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igGetAllocatorFunctions(IntPtr* p_alloc_func, IntPtr* p_free_func, void** p_user_data); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImDrawList* igGetBackgroundDrawList_Nil(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImDrawList* igGetBackgroundDrawList_ViewportPtr(ImGuiViewport* viewport); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte* igGetClipboardText(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern uint igGetColorU32_Col(ImGuiCol idx, float alpha_mul); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern uint igGetColorU32_Vec4(Vector4 col); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern uint igGetColorU32_U32(uint col); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern int igGetColumnIndex(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern float igGetColumnOffset(int column_index); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern int igGetColumnsCount(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern float igGetColumnWidth(int column_index); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igGetContentRegionAvail(Vector2* pOut); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igGetContentRegionMax(Vector2* pOut); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr igGetCurrentContext(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igGetCursorPos(Vector2* pOut); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern float igGetCursorPosX(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern float igGetCursorPosY(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igGetCursorScreenPos(Vector2* pOut); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igGetCursorStartPos(Vector2* pOut); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiPayload* igGetDragDropPayload(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImDrawData* igGetDrawData(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr igGetDrawListSharedData(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImFont* igGetFont(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern float igGetFontSize(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igGetFontTexUvWhitePixel(Vector2* pOut); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImDrawList* igGetForegroundDrawList_Nil(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImDrawList* igGetForegroundDrawList_ViewportPtr(ImGuiViewport* viewport); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern int igGetFrameCount(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern float igGetFrameHeight(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern float igGetFrameHeightWithSpacing(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern uint igGetID_Str(byte* str_id); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern uint igGetID_StrStr(byte* str_id_begin, byte* str_id_end); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern uint igGetID_Ptr(void* ptr_id); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiIO* igGetIO(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern uint igGetItemID(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igGetItemRectMax(Vector2* pOut); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igGetItemRectMin(Vector2* pOut); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igGetItemRectSize(Vector2* pOut); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiKey igGetKeyIndex(ImGuiKey key); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte* igGetKeyName(ImGuiKey key); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern int igGetKeyPressedAmount(ImGuiKey key, float repeat_delay, float rate); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiViewport* igGetMainViewport(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern int igGetMouseClickedCount(ImGuiMouseButton button); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiMouseCursor igGetMouseCursor(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igGetMouseDragDelta(Vector2* pOut, ImGuiMouseButton button, float lock_threshold); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igGetMousePos(Vector2* pOut); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igGetMousePosOnOpeningCurrentPopup(Vector2* pOut); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiPlatformIO* igGetPlatformIO(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern float igGetScrollMaxX(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern float igGetScrollMaxY(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern float igGetScrollX(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern float igGetScrollY(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiStorage* igGetStateStorage(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiStyle* igGetStyle(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte* igGetStyleColorName(ImGuiCol idx); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern Vector4* igGetStyleColorVec4(ImGuiCol idx); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern float igGetTextLineHeight(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern float igGetTextLineHeightWithSpacing(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern double igGetTime(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern float igGetTreeNodeToLabelSpacing(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte* igGetVersion(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igGetWindowContentRegionMax(Vector2* pOut); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igGetWindowContentRegionMin(Vector2* pOut); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern uint igGetWindowDockID(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern float igGetWindowDpiScale(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImDrawList* igGetWindowDrawList(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern float igGetWindowHeight(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igGetWindowPos(Vector2* pOut); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igGetWindowSize(Vector2* pOut); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiViewport* igGetWindowViewport(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern float igGetWindowWidth(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igImage(IntPtr user_texture_id, Vector2 size, Vector2 uv0, Vector2 uv1, Vector4 tint_col, Vector4 border_col); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igImageButton(byte* str_id, IntPtr user_texture_id, Vector2 image_size, Vector2 uv0, Vector2 uv1, Vector4 bg_col, Vector4 tint_col); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igIndent(float indent_w); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igInputDouble(byte* label, double* v, double step, double step_fast, byte* format, ImGuiInputTextFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igInputFloat(byte* label, float* v, float step, float step_fast, byte* format, ImGuiInputTextFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igInputFloat2(byte* label, Vector2* v, byte* format, ImGuiInputTextFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igInputFloat3(byte* label, Vector3* v, byte* format, ImGuiInputTextFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igInputFloat4(byte* label, Vector4* v, byte* format, ImGuiInputTextFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igInputInt(byte* label, int* v, int step, int step_fast, ImGuiInputTextFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igInputInt2(byte* label, int* v, ImGuiInputTextFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igInputInt3(byte* label, int* v, ImGuiInputTextFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igInputInt4(byte* label, int* v, ImGuiInputTextFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igInputScalar(byte* label, ImGuiDataType data_type, void* p_data, void* p_step, void* p_step_fast, byte* format, ImGuiInputTextFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igInputScalarN(byte* label, ImGuiDataType data_type, void* p_data, int components, void* p_step, void* p_step_fast, byte* format, ImGuiInputTextFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igInputText(byte* label, byte* buf, uint buf_size, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igInputTextMultiline(byte* label, byte* buf, uint buf_size, Vector2 size, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igInputTextWithHint(byte* label, byte* hint, byte* buf, uint buf_size, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igInvisibleButton(byte* str_id, Vector2 size, ImGuiButtonFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsAnyItemActive(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsAnyItemFocused(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsAnyItemHovered(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsAnyMouseDown(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsItemActivated(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsItemActive(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsItemClicked(ImGuiMouseButton mouse_button); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsItemDeactivated(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsItemDeactivatedAfterEdit(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsItemEdited(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsItemFocused(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsItemHovered(ImGuiHoveredFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsItemToggledOpen(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsItemVisible(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsKeyChordPressed_Nil(ImGuiKey key_chord); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsKeyDown_Nil(ImGuiKey key); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsKeyPressed_Bool(ImGuiKey key, byte repeat); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsKeyReleased_Nil(ImGuiKey key); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsMouseClicked_Bool(ImGuiMouseButton button, byte repeat); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsMouseDoubleClicked_Nil(ImGuiMouseButton button); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsMouseDown_Nil(ImGuiMouseButton button); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsMouseDragging(ImGuiMouseButton button, float lock_threshold); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsMouseHoveringRect(Vector2 r_min, Vector2 r_max, byte clip); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsMousePosValid(Vector2* mouse_pos); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsMouseReleased_Nil(ImGuiMouseButton button); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsPopupOpen_Str(byte* str_id, ImGuiPopupFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsRectVisible_Nil(Vector2 size); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsRectVisible_Vec2(Vector2 rect_min, Vector2 rect_max); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsWindowAppearing(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsWindowCollapsed(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsWindowDocked(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsWindowFocused(ImGuiFocusedFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igIsWindowHovered(ImGuiHoveredFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igLabelText(byte* label, byte* fmt); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igListBox_Str_arr(byte* label, int* current_item, byte** items, int items_count, int height_in_items); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igLoadIniSettingsFromDisk(byte* ini_filename); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igLoadIniSettingsFromMemory(byte* ini_data, uint ini_size); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igLogButtons(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igLogFinish(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igLogText(byte* fmt); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igLogToClipboard(int auto_open_depth); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igLogToFile(int auto_open_depth, byte* filename); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igLogToTTY(int auto_open_depth); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void* igMemAlloc(uint size); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igMemFree(void* ptr); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igMenuItem_Bool(byte* label, byte* shortcut, byte selected, byte enabled); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igMenuItem_BoolPtr(byte* label, byte* shortcut, byte* p_selected, byte enabled); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igNewFrame(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igNewLine(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igNextColumn(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igOpenPopup_Str(byte* str_id, ImGuiPopupFlags popup_flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igOpenPopup_ID(uint id, ImGuiPopupFlags popup_flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igOpenPopupOnItemClick(byte* str_id, ImGuiPopupFlags popup_flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igPlotHistogram_FloatPtr(byte* label, float* values, int values_count, int values_offset, byte* overlay_text, float scale_min, float scale_max, Vector2 graph_size, int stride); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igPlotLines_FloatPtr(byte* label, float* values, int values_count, int values_offset, byte* overlay_text, float scale_min, float scale_max, Vector2 graph_size, int stride); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igPopButtonRepeat(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igPopClipRect(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igPopFont(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igPopID(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igPopItemWidth(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igPopStyleColor(int count); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igPopStyleVar(int count); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igPopTabStop(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igPopTextWrapPos(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igProgressBar(float fraction, Vector2 size_arg, byte* overlay); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igPushButtonRepeat(byte repeat); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igPushClipRect(Vector2 clip_rect_min, Vector2 clip_rect_max, byte intersect_with_current_clip_rect); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igPushFont(ImFont* font); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igPushID_Str(byte* str_id); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igPushID_StrStr(byte* str_id_begin, byte* str_id_end); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igPushID_Ptr(void* ptr_id); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igPushID_Int(int int_id); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igPushItemWidth(float item_width); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igPushStyleColor_U32(ImGuiCol idx, uint col); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igPushStyleColor_Vec4(ImGuiCol idx, Vector4 col); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igPushStyleVar_Float(ImGuiStyleVar idx, float val); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igPushStyleVar_Vec2(ImGuiStyleVar idx, Vector2 val); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igPushTabStop(byte tab_stop); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igPushTextWrapPos(float wrap_local_pos_x); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igRadioButton_Bool(byte* label, byte active); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igRadioButton_IntPtr(byte* label, int* v, int v_button); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igRender(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igRenderPlatformWindowsDefault(void* platform_render_arg, void* renderer_render_arg); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igResetMouseDragDelta(ImGuiMouseButton button); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSameLine(float offset_from_start_x, float spacing); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSaveIniSettingsToDisk(byte* ini_filename); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte* igSaveIniSettingsToMemory(uint* out_ini_size); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igSelectable_Bool(byte* label, byte selected, ImGuiSelectableFlags flags, Vector2 size); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igSelectable_BoolPtr(byte* label, byte* p_selected, ImGuiSelectableFlags flags, Vector2 size); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSeparator(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSeparatorText(byte* label); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetAllocatorFunctions(IntPtr alloc_func, IntPtr free_func, void* user_data); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetClipboardText(byte* text); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetColorEditOptions(ImGuiColorEditFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetColumnOffset(int column_index, float offset_x); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetColumnWidth(int column_index, float width); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetCurrentContext(IntPtr ctx); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetCursorPos(Vector2 local_pos); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetCursorPosX(float local_x); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetCursorPosY(float local_y); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetCursorScreenPos(Vector2 pos); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igSetDragDropPayload(byte* type, void* data, uint sz, ImGuiCond cond); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetItemDefaultFocus(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetItemTooltip(byte* fmt); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetKeyboardFocusHere(int offset); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetMouseCursor(ImGuiMouseCursor cursor_type); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetNextFrameWantCaptureKeyboard(byte want_capture_keyboard); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetNextFrameWantCaptureMouse(byte want_capture_mouse); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetNextItemAllowOverlap(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetNextItemOpen(byte is_open, ImGuiCond cond); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetNextItemWidth(float item_width); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetNextWindowBgAlpha(float alpha); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetNextWindowClass(ImGuiWindowClass* window_class); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetNextWindowCollapsed(byte collapsed, ImGuiCond cond); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetNextWindowContentSize(Vector2 size); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetNextWindowDockID(uint dock_id, ImGuiCond cond); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetNextWindowFocus(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetNextWindowPos(Vector2 pos, ImGuiCond cond, Vector2 pivot); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetNextWindowScroll(Vector2 scroll); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetNextWindowSize(Vector2 size, ImGuiCond cond); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetNextWindowSizeConstraints(Vector2 size_min, Vector2 size_max, ImGuiSizeCallback custom_callback, void* custom_callback_data); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetNextWindowViewport(uint viewport_id); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetScrollFromPosX_Float(float local_x, float center_x_ratio); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetScrollFromPosY_Float(float local_y, float center_y_ratio); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetScrollHereX(float center_x_ratio); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetScrollHereY(float center_y_ratio); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetScrollX_Float(float scroll_x); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetScrollY_Float(float scroll_y); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetStateStorage(ImGuiStorage* storage); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetTabItemClosed(byte* tab_or_docked_window_label); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetTooltip(byte* fmt); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetWindowCollapsed_Bool(byte collapsed, ImGuiCond cond); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetWindowCollapsed_Str(byte* name, byte collapsed, ImGuiCond cond); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetWindowFocus_Nil(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetWindowFocus_Str(byte* name); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetWindowFontScale(float scale); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetWindowPos_Vec2(Vector2 pos, ImGuiCond cond); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetWindowPos_Str(byte* name, Vector2 pos, ImGuiCond cond); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetWindowSize_Vec2(Vector2 size, ImGuiCond cond); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetWindowSize_Str(byte* name, Vector2 size, ImGuiCond cond); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igShowAboutWindow(byte* p_open); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igShowDebugLogWindow(byte* p_open); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igShowDemoWindow(byte* p_open); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igShowFontSelector(byte* label); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igShowIDStackToolWindow(byte* p_open); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igShowMetricsWindow(byte* p_open); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igShowStyleEditor(ImGuiStyle* @ref); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igShowStyleSelector(byte* label); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igShowUserGuide(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igSliderAngle(byte* label, float* v_rad, float v_degrees_min, float v_degrees_max, byte* format, ImGuiSliderFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igSliderFloat(byte* label, float* v, float v_min, float v_max, byte* format, ImGuiSliderFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igSliderFloat2(byte* label, Vector2* v, float v_min, float v_max, byte* format, ImGuiSliderFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igSliderFloat3(byte* label, Vector3* v, float v_min, float v_max, byte* format, ImGuiSliderFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igSliderFloat4(byte* label, Vector4* v, float v_min, float v_max, byte* format, ImGuiSliderFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igSliderInt(byte* label, int* v, int v_min, int v_max, byte* format, ImGuiSliderFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igSliderInt2(byte* label, int* v, int v_min, int v_max, byte* format, ImGuiSliderFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igSliderInt3(byte* label, int* v, int v_min, int v_max, byte* format, ImGuiSliderFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igSliderInt4(byte* label, int* v, int v_min, int v_max, byte* format, ImGuiSliderFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igSliderScalar(byte* label, ImGuiDataType data_type, void* p_data, void* p_min, void* p_max, byte* format, ImGuiSliderFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igSliderScalarN(byte* label, ImGuiDataType data_type, void* p_data, int components, void* p_min, void* p_max, byte* format, ImGuiSliderFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igSmallButton(byte* label); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSpacing(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igStyleColorsClassic(ImGuiStyle* dst); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igStyleColorsDark(ImGuiStyle* dst); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igStyleColorsLight(ImGuiStyle* dst); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igTabItemButton(byte* label, ImGuiTabItemFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igTableAngledHeadersRow(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern int igTableGetColumnCount(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiTableColumnFlags igTableGetColumnFlags(int column_n); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern int igTableGetColumnIndex(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte* igTableGetColumnName_Int(int column_n); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern int igTableGetRowIndex(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiTableSortSpecs* igTableGetSortSpecs(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igTableHeader(byte* label); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igTableHeadersRow(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igTableNextColumn(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igTableNextRow(ImGuiTableRowFlags row_flags, float min_row_height); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igTableSetBgColor(ImGuiTableBgTarget target, uint color, int column_n); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igTableSetColumnEnabled(int column_n, byte v); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igTableSetColumnIndex(int column_n); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igTableSetupColumn(byte* label, ImGuiTableColumnFlags flags, float init_width_or_weight, uint user_id); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igTableSetupScrollFreeze(int cols, int rows); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igText(byte* fmt); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igTextColored(Vector4 col, byte* fmt); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igTextDisabled(byte* fmt); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igTextUnformatted(byte* text, byte* text_end); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igTextWrapped(byte* fmt); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igTreeNode_Str(byte* label); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igTreeNode_StrStr(byte* str_id, byte* fmt); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igTreeNode_Ptr(void* ptr_id, byte* fmt); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igTreeNodeEx_Str(byte* label, ImGuiTreeNodeFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igTreeNodeEx_StrStr(byte* str_id, ImGuiTreeNodeFlags flags, byte* fmt); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igTreeNodeEx_Ptr(void* ptr_id, ImGuiTreeNodeFlags flags, byte* fmt); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igTreePop(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igTreePush_Str(byte* str_id); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igTreePush_Ptr(void* ptr_id); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igUnindent(float indent_w); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igUpdatePlatformWindows(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igValue_Bool(byte* prefix, byte b); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igValue_Int(byte* prefix, int v); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igValue_Uint(byte* prefix, uint v); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igValue_Float(byte* prefix, float v, byte* float_format); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igVSliderFloat(byte* label, Vector2 size, float* v, float v_min, float v_max, byte* format, ImGuiSliderFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igVSliderInt(byte* label, Vector2 size, int* v, int v_min, int v_max, byte* format, ImGuiSliderFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte igVSliderScalar(byte* label, Vector2 size, ImGuiDataType data_type, void* p_data, void* p_min, void* p_max, byte* format, ImGuiSliderFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImColor_destroy(ImColor* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImColor_HSV(ImColor* pOut, float h, float s, float v, float a); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImColor* ImColor_ImColor_Nil(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImColor* ImColor_ImColor_Float(float r, float g, float b, float a); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImColor* ImColor_ImColor_Vec4(Vector4 col); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImColor* ImColor_ImColor_Int(int r, int g, int b, int a); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImColor* ImColor_ImColor_U32(uint rgba); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImColor_SetHSV(ImColor* self, float h, float s, float v, float a); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawCmd_destroy(ImDrawCmd* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ImDrawCmd_GetTexID(ImDrawCmd* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImDrawCmd* ImDrawCmd_ImDrawCmd(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawData_AddDrawList(ImDrawData* self, ImDrawList* draw_list); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawData_Clear(ImDrawData* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawData_DeIndexAllBuffers(ImDrawData* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawData_destroy(ImDrawData* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImDrawData* ImDrawData_ImDrawData(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawData_ScaleClipRects(ImDrawData* self, Vector2 fb_scale); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern int ImDrawList__CalcCircleAutoSegmentCount(ImDrawList* self, float radius); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList__ClearFreeMemory(ImDrawList* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList__OnChangedClipRect(ImDrawList* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList__OnChangedTextureID(ImDrawList* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList__OnChangedVtxOffset(ImDrawList* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList__PathArcToFastEx(ImDrawList* self, Vector2 center, float radius, int a_min_sample, int a_max_sample, int a_step); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList__PathArcToN(ImDrawList* self, Vector2 center, float radius, float a_min, float a_max, int num_segments); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList__PopUnusedDrawCmd(ImDrawList* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList__ResetForNewFrame(ImDrawList* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList__TryMergeDrawCmds(ImDrawList* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_AddBezierCubic(ImDrawList* self, Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, uint col, float thickness, int num_segments); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_AddBezierQuadratic(ImDrawList* self, Vector2 p1, Vector2 p2, Vector2 p3, uint col, float thickness, int num_segments); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_AddCallback(ImDrawList* self, IntPtr callback, void* callback_data); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_AddCircle(ImDrawList* self, Vector2 center, float radius, uint col, int num_segments, float thickness); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_AddCircleFilled(ImDrawList* self, Vector2 center, float radius, uint col, int num_segments); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_AddConvexPolyFilled(ImDrawList* self, Vector2* points, int num_points, uint col); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_AddDrawCmd(ImDrawList* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_AddEllipse(ImDrawList* self, Vector2 center, float radius_x, float radius_y, uint col, float rot, int num_segments, float thickness); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_AddEllipseFilled(ImDrawList* self, Vector2 center, float radius_x, float radius_y, uint col, float rot, int num_segments); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_AddImage(ImDrawList* self, IntPtr user_texture_id, Vector2 p_min, Vector2 p_max, Vector2 uv_min, Vector2 uv_max, uint col); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_AddImageQuad(ImDrawList* self, IntPtr user_texture_id, Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, Vector2 uv1, Vector2 uv2, Vector2 uv3, Vector2 uv4, uint col); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_AddImageRounded(ImDrawList* self, IntPtr user_texture_id, Vector2 p_min, Vector2 p_max, Vector2 uv_min, Vector2 uv_max, uint col, float rounding, ImDrawFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_AddLine(ImDrawList* self, Vector2 p1, Vector2 p2, uint col, float thickness); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_AddNgon(ImDrawList* self, Vector2 center, float radius, uint col, int num_segments, float thickness); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_AddNgonFilled(ImDrawList* self, Vector2 center, float radius, uint col, int num_segments); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_AddPolyline(ImDrawList* self, Vector2* points, int num_points, uint col, ImDrawFlags flags, float thickness); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_AddQuad(ImDrawList* self, Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, uint col, float thickness); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_AddQuadFilled(ImDrawList* self, Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, uint col); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_AddRect(ImDrawList* self, Vector2 p_min, Vector2 p_max, uint col, float rounding, ImDrawFlags flags, float thickness); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_AddRectFilled(ImDrawList* self, Vector2 p_min, Vector2 p_max, uint col, float rounding, ImDrawFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_AddRectFilledMultiColor(ImDrawList* self, Vector2 p_min, Vector2 p_max, uint col_upr_left, uint col_upr_right, uint col_bot_right, uint col_bot_left); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_AddText_Vec2(ImDrawList* self, Vector2 pos, uint col, byte* text_begin, byte* text_end); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_AddText_FontPtr(ImDrawList* self, ImFont* font, float font_size, Vector2 pos, uint col, byte* text_begin, byte* text_end, float wrap_width, Vector4* cpu_fine_clip_rect); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_AddTriangle(ImDrawList* self, Vector2 p1, Vector2 p2, Vector2 p3, uint col, float thickness); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_AddTriangleFilled(ImDrawList* self, Vector2 p1, Vector2 p2, Vector2 p3, uint col); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_ChannelsMerge(ImDrawList* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_ChannelsSetCurrent(ImDrawList* self, int n); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_ChannelsSplit(ImDrawList* self, int count); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImDrawList* ImDrawList_CloneOutput(ImDrawList* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_destroy(ImDrawList* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_GetClipRectMax(Vector2* pOut, ImDrawList* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_GetClipRectMin(Vector2* pOut, ImDrawList* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImDrawList* ImDrawList_ImDrawList(IntPtr shared_data); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_PathArcTo(ImDrawList* self, Vector2 center, float radius, float a_min, float a_max, int num_segments); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_PathArcToFast(ImDrawList* self, Vector2 center, float radius, int a_min_of_12, int a_max_of_12); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_PathBezierCubicCurveTo(ImDrawList* self, Vector2 p2, Vector2 p3, Vector2 p4, int num_segments); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_PathBezierQuadraticCurveTo(ImDrawList* self, Vector2 p2, Vector2 p3, int num_segments); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_PathClear(ImDrawList* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_PathEllipticalArcTo(ImDrawList* self, Vector2 center, float radius_x, float radius_y, float rot, float a_min, float a_max, int num_segments); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_PathFillConvex(ImDrawList* self, uint col); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_PathLineTo(ImDrawList* self, Vector2 pos); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_PathLineToMergeDuplicate(ImDrawList* self, Vector2 pos); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_PathRect(ImDrawList* self, Vector2 rect_min, Vector2 rect_max, float rounding, ImDrawFlags flags); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_PathStroke(ImDrawList* self, uint col, ImDrawFlags flags, float thickness); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_PopClipRect(ImDrawList* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_PopTextureID(ImDrawList* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_PrimQuadUV(ImDrawList* self, Vector2 a, Vector2 b, Vector2 c, Vector2 d, Vector2 uv_a, Vector2 uv_b, Vector2 uv_c, Vector2 uv_d, uint col); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_PrimRect(ImDrawList* self, Vector2 a, Vector2 b, uint col); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_PrimRectUV(ImDrawList* self, Vector2 a, Vector2 b, Vector2 uv_a, Vector2 uv_b, uint col); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_PrimReserve(ImDrawList* self, int idx_count, int vtx_count); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_PrimUnreserve(ImDrawList* self, int idx_count, int vtx_count); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_PrimVtx(ImDrawList* self, Vector2 pos, Vector2 uv, uint col); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_PrimWriteIdx(ImDrawList* self, ushort idx); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_PrimWriteVtx(ImDrawList* self, Vector2 pos, Vector2 uv, uint col); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_PushClipRect(ImDrawList* self, Vector2 clip_rect_min, Vector2 clip_rect_max, byte intersect_with_current_clip_rect); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_PushClipRectFullScreen(ImDrawList* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawList_PushTextureID(ImDrawList* self, IntPtr texture_id); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawListSplitter_Clear(ImDrawListSplitter* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawListSplitter_ClearFreeMemory(ImDrawListSplitter* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawListSplitter_destroy(ImDrawListSplitter* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImDrawListSplitter* ImDrawListSplitter_ImDrawListSplitter(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawListSplitter_Merge(ImDrawListSplitter* self, ImDrawList* draw_list); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawListSplitter_SetCurrentChannel(ImDrawListSplitter* self, ImDrawList* draw_list, int channel_idx); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImDrawListSplitter_Split(ImDrawListSplitter* self, ImDrawList* draw_list, int count); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImFont_AddGlyph(ImFont* self, ImFontConfig* src_cfg, ushort c, float x0, float y0, float x1, float y1, float u0, float v0, float u1, float v1, float advance_x); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImFont_AddRemapChar(ImFont* self, ushort dst, ushort src, byte overwrite_dst); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImFont_BuildLookupTable(ImFont* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImFont_CalcTextSizeA(Vector2* pOut, ImFont* self, float size, float max_width, float wrap_width, byte* text_begin, byte* text_end, byte** remaining); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte* ImFont_CalcWordWrapPositionA(ImFont* self, float scale, byte* text, byte* text_end, float wrap_width); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImFont_ClearOutputData(ImFont* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImFont_destroy(ImFont* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImFontGlyph* ImFont_FindGlyph(ImFont* self, ushort c); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImFontGlyph* ImFont_FindGlyphNoFallback(ImFont* self, ushort c); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern float ImFont_GetCharAdvance(ImFont* self, ushort c); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte* ImFont_GetDebugName(ImFont* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImFont_GrowIndex(ImFont* self, int new_size); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImFont* ImFont_ImFont(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte ImFont_IsGlyphRangeUnused(ImFont* self, uint c_begin, uint c_last); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte ImFont_IsLoaded(ImFont* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImFont_RenderChar(ImFont* self, ImDrawList* draw_list, float size, Vector2 pos, uint col, ushort c); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImFont_RenderText(ImFont* self, ImDrawList* draw_list, float size, Vector2 pos, uint col, Vector4 clip_rect, byte* text_begin, byte* text_end, float wrap_width, byte cpu_fine_clip); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImFont_SetGlyphVisible(ImFont* self, ushort c, byte visible); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern int ImFontAtlas_AddCustomRectFontGlyph(ImFontAtlas* self, ImFont* font, ushort id, int width, int height, float advance_x, Vector2 offset); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern int ImFontAtlas_AddCustomRectRegular(ImFontAtlas* self, int width, int height); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImFont* ImFontAtlas_AddFont(ImFontAtlas* self, ImFontConfig* font_cfg); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImFont* ImFontAtlas_AddFontDefault(ImFontAtlas* self, ImFontConfig* font_cfg); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImFont* ImFontAtlas_AddFontFromFileTTF(ImFontAtlas* self, byte* filename, float size_pixels, ImFontConfig* font_cfg, ushort* glyph_ranges); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImFont* ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(ImFontAtlas* self, byte* compressed_font_data_base85, float size_pixels, ImFontConfig* font_cfg, ushort* glyph_ranges); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImFont* ImFontAtlas_AddFontFromMemoryCompressedTTF(ImFontAtlas* self, void* compressed_font_data, int compressed_font_data_size, float size_pixels, ImFontConfig* font_cfg, ushort* glyph_ranges); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImFont* ImFontAtlas_AddFontFromMemoryTTF(ImFontAtlas* self, void* font_data, int font_data_size, float size_pixels, ImFontConfig* font_cfg, ushort* glyph_ranges); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte ImFontAtlas_Build(ImFontAtlas* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImFontAtlas_CalcCustomRectUV(ImFontAtlas* self, ImFontAtlasCustomRect* rect, Vector2* out_uv_min, Vector2* out_uv_max); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImFontAtlas_Clear(ImFontAtlas* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImFontAtlas_ClearFonts(ImFontAtlas* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImFontAtlas_ClearInputData(ImFontAtlas* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImFontAtlas_ClearTexData(ImFontAtlas* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImFontAtlas_destroy(ImFontAtlas* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImFontAtlasCustomRect* ImFontAtlas_GetCustomRectByIndex(ImFontAtlas* self, int index); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ushort* ImFontAtlas_GetGlyphRangesChineseFull(ImFontAtlas* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ushort* ImFontAtlas_GetGlyphRangesChineseSimplifiedCommon(ImFontAtlas* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ushort* ImFontAtlas_GetGlyphRangesCyrillic(ImFontAtlas* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ushort* ImFontAtlas_GetGlyphRangesDefault(ImFontAtlas* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ushort* ImFontAtlas_GetGlyphRangesGreek(ImFontAtlas* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ushort* ImFontAtlas_GetGlyphRangesJapanese(ImFontAtlas* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ushort* ImFontAtlas_GetGlyphRangesKorean(ImFontAtlas* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ushort* ImFontAtlas_GetGlyphRangesThai(ImFontAtlas* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ushort* ImFontAtlas_GetGlyphRangesVietnamese(ImFontAtlas* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte ImFontAtlas_GetMouseCursorTexData(ImFontAtlas* self, ImGuiMouseCursor cursor, Vector2* out_offset, Vector2* out_size, Vector2* out_uv_border, Vector2* out_uv_fill); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImFontAtlas_GetTexDataAsAlpha8(ImFontAtlas* self, byte** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImFontAtlas_GetTexDataAsAlpha8(ImFontAtlas* self, IntPtr* out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImFontAtlas_GetTexDataAsRGBA32(ImFontAtlas* self, byte** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImFontAtlas_GetTexDataAsRGBA32(ImFontAtlas* self, IntPtr* out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImFontAtlas* ImFontAtlas_ImFontAtlas(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte ImFontAtlas_IsBuilt(ImFontAtlas* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImFontAtlas_SetTexID(ImFontAtlas* self, IntPtr id); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImFontAtlasCustomRect_destroy(ImFontAtlasCustomRect* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImFontAtlasCustomRect* ImFontAtlasCustomRect_ImFontAtlasCustomRect(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte ImFontAtlasCustomRect_IsPacked(ImFontAtlasCustomRect* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImFontConfig_destroy(ImFontConfig* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImFontConfig* ImFontConfig_ImFontConfig(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImFontGlyphRangesBuilder_AddChar(ImFontGlyphRangesBuilder* self, ushort c); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImFontGlyphRangesBuilder_AddRanges(ImFontGlyphRangesBuilder* self, ushort* ranges); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImFontGlyphRangesBuilder_AddText(ImFontGlyphRangesBuilder* self, byte* text, byte* text_end); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImFontGlyphRangesBuilder_BuildRanges(ImFontGlyphRangesBuilder* self, ImVector* out_ranges); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImFontGlyphRangesBuilder_Clear(ImFontGlyphRangesBuilder* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImFontGlyphRangesBuilder_destroy(ImFontGlyphRangesBuilder* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte ImFontGlyphRangesBuilder_GetBit(ImFontGlyphRangesBuilder* self, uint n); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImFontGlyphRangesBuilder* ImFontGlyphRangesBuilder_ImFontGlyphRangesBuilder(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImFontGlyphRangesBuilder_SetBit(ImFontGlyphRangesBuilder* self, uint n); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiInputTextCallbackData_ClearSelection(ImGuiInputTextCallbackData* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiInputTextCallbackData_DeleteChars(ImGuiInputTextCallbackData* self, int pos, int bytes_count); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiInputTextCallbackData_destroy(ImGuiInputTextCallbackData* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte ImGuiInputTextCallbackData_HasSelection(ImGuiInputTextCallbackData* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiInputTextCallbackData* ImGuiInputTextCallbackData_ImGuiInputTextCallbackData(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiInputTextCallbackData_InsertChars(ImGuiInputTextCallbackData* self, int pos, byte* text, byte* text_end); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiInputTextCallbackData_SelectAll(ImGuiInputTextCallbackData* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiIO_AddFocusEvent(ImGuiIO* self, byte focused); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiIO_AddInputCharacter(ImGuiIO* self, uint c); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiIO_AddInputCharactersUTF8(ImGuiIO* self, byte* str); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiIO_AddInputCharacterUTF16(ImGuiIO* self, ushort c); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiIO_AddKeyAnalogEvent(ImGuiIO* self, ImGuiKey key, byte down, float v); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiIO_AddKeyEvent(ImGuiIO* self, ImGuiKey key, byte down); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiIO_AddMouseButtonEvent(ImGuiIO* self, int button, byte down); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiIO_AddMousePosEvent(ImGuiIO* self, float x, float y); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiIO_AddMouseSourceEvent(ImGuiIO* self, ImGuiMouseSource source); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiIO_AddMouseViewportEvent(ImGuiIO* self, uint id); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiIO_AddMouseWheelEvent(ImGuiIO* self, float wheel_x, float wheel_y); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiIO_ClearEventsQueue(ImGuiIO* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiIO_ClearInputKeys(ImGuiIO* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiIO_destroy(ImGuiIO* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiIO* ImGuiIO_ImGuiIO(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiIO_SetAppAcceptingEvents(ImGuiIO* self, byte accepting_events); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiIO_SetKeyEventNativeData(ImGuiIO* self, ImGuiKey key, int native_keycode, int native_scancode, int native_legacy_index); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiListClipper_Begin(ImGuiListClipper* self, int items_count, float items_height); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiListClipper_destroy(ImGuiListClipper* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiListClipper_End(ImGuiListClipper* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiListClipper* ImGuiListClipper_ImGuiListClipper(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiListClipper_IncludeItemByIndex(ImGuiListClipper* self, int item_index); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiListClipper_IncludeItemsByIndex(ImGuiListClipper* self, int item_begin, int item_end); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte ImGuiListClipper_Step(ImGuiListClipper* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiOnceUponAFrame_destroy(ImGuiOnceUponAFrame* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiOnceUponAFrame* ImGuiOnceUponAFrame_ImGuiOnceUponAFrame(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiPayload_Clear(ImGuiPayload* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiPayload_destroy(ImGuiPayload* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiPayload* ImGuiPayload_ImGuiPayload(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte ImGuiPayload_IsDataType(ImGuiPayload* self, byte* type); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte ImGuiPayload_IsDelivery(ImGuiPayload* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte ImGuiPayload_IsPreview(ImGuiPayload* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiPlatformImeData_destroy(ImGuiPlatformImeData* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiPlatformImeData* ImGuiPlatformImeData_ImGuiPlatformImeData(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiPlatformIO_destroy(ImGuiPlatformIO* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiPlatformIO* ImGuiPlatformIO_ImGuiPlatformIO(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiPlatformMonitor_destroy(ImGuiPlatformMonitor* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiPlatformMonitor* ImGuiPlatformMonitor_ImGuiPlatformMonitor(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiStorage_BuildSortByKey(ImGuiStorage* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiStorage_Clear(ImGuiStorage* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte ImGuiStorage_GetBool(ImGuiStorage* self, uint key, byte default_val); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte* ImGuiStorage_GetBoolRef(ImGuiStorage* self, uint key, byte default_val); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern float ImGuiStorage_GetFloat(ImGuiStorage* self, uint key, float default_val); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern float* ImGuiStorage_GetFloatRef(ImGuiStorage* self, uint key, float default_val); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern int ImGuiStorage_GetInt(ImGuiStorage* self, uint key, int default_val); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern int* ImGuiStorage_GetIntRef(ImGuiStorage* self, uint key, int default_val); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void* ImGuiStorage_GetVoidPtr(ImGuiStorage* self, uint key); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void** ImGuiStorage_GetVoidPtrRef(ImGuiStorage* self, uint key, void* default_val); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiStorage_SetAllInt(ImGuiStorage* self, int val); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiStorage_SetBool(ImGuiStorage* self, uint key, byte val); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiStorage_SetFloat(ImGuiStorage* self, uint key, float val); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiStorage_SetInt(ImGuiStorage* self, uint key, int val); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiStorage_SetVoidPtr(ImGuiStorage* self, uint key, void* val); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiStoragePair_destroy(ImGuiStoragePair* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiStoragePair* ImGuiStoragePair_ImGuiStoragePair_Int(uint _key, int _val); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiStoragePair* ImGuiStoragePair_ImGuiStoragePair_Float(uint _key, float _val); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiStoragePair* ImGuiStoragePair_ImGuiStoragePair_Ptr(uint _key, void* _val); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiStyle_destroy(ImGuiStyle* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiStyle* ImGuiStyle_ImGuiStyle(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiStyle_ScaleAllSizes(ImGuiStyle* self, float scale_factor); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiTableColumnSortSpecs_destroy(ImGuiTableColumnSortSpecs* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiTableColumnSortSpecs* ImGuiTableColumnSortSpecs_ImGuiTableColumnSortSpecs(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiTableSortSpecs_destroy(ImGuiTableSortSpecs* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiTableSortSpecs* ImGuiTableSortSpecs_ImGuiTableSortSpecs(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiTextBuffer_append(ImGuiTextBuffer* self, byte* str, byte* str_end); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiTextBuffer_appendf(ImGuiTextBuffer* self, byte* fmt); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte* ImGuiTextBuffer_begin(ImGuiTextBuffer* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte* ImGuiTextBuffer_c_str(ImGuiTextBuffer* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiTextBuffer_clear(ImGuiTextBuffer* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiTextBuffer_destroy(ImGuiTextBuffer* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte ImGuiTextBuffer_empty(ImGuiTextBuffer* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte* ImGuiTextBuffer_end(ImGuiTextBuffer* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiTextBuffer* ImGuiTextBuffer_ImGuiTextBuffer(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiTextBuffer_reserve(ImGuiTextBuffer* self, int capacity); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern int ImGuiTextBuffer_size(ImGuiTextBuffer* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiTextFilter_Build(ImGuiTextFilter* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiTextFilter_Clear(ImGuiTextFilter* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiTextFilter_destroy(ImGuiTextFilter* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte ImGuiTextFilter_Draw(ImGuiTextFilter* self, byte* label, float width); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiTextFilter* ImGuiTextFilter_ImGuiTextFilter(byte* default_filter); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte ImGuiTextFilter_IsActive(ImGuiTextFilter* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte ImGuiTextFilter_PassFilter(ImGuiTextFilter* self, byte* text, byte* text_end); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiTextRange_destroy(ImGuiTextRange* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern byte ImGuiTextRange_empty(ImGuiTextRange* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiTextRange* ImGuiTextRange_ImGuiTextRange_Nil(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiTextRange* ImGuiTextRange_ImGuiTextRange_Str(byte* _b, byte* _e); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiTextRange_split(ImGuiTextRange* self, byte separator, ImVector* @out); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiViewport_destroy(ImGuiViewport* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiViewport_GetCenter(Vector2* pOut, ImGuiViewport* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiViewport_GetWorkCenter(Vector2* pOut, ImGuiViewport* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiViewport* ImGuiViewport_ImGuiViewport(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiWindowClass_destroy(ImGuiWindowClass* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern ImGuiWindowClass* ImGuiWindowClass_ImGuiWindowClass(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImVec2_destroy(Vector2* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern Vector2* ImVec2_ImVec2_Nil(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern Vector2* ImVec2_ImVec2_Float(float _x, float _y); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImVec4_destroy(Vector4* self); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern Vector4* ImVec4_ImVec4_Nil(); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern Vector4* ImVec4_ImVec4_Float(float _x, float _y, float _z, float _w); + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiNavInput.gen.cs b/lib/ImGui.NET/Generated/ImGuiNavInput.gen.cs new file mode 100644 index 0000000..fa8ead2 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiNavInput.gen.cs @@ -0,0 +1,23 @@ +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, + COUNT = 16, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiOnceUponAFrame.gen.cs b/lib/ImGui.NET/Generated/ImGuiOnceUponAFrame.gen.cs new file mode 100644 index 0000000..d6d7db8 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiOnceUponAFrame.gen.cs @@ -0,0 +1,26 @@ +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(&NativePtr->RefFrame); + public void Destroy() + { + ImGuiNative.ImGuiOnceUponAFrame_destroy((ImGuiOnceUponAFrame*)(NativePtr)); + } + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiPayload.gen.cs b/lib/ImGui.NET/Generated/ImGuiPayload.gen.cs new file mode 100644 index 0000000..6f4ba79 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiPayload.gen.cs @@ -0,0 +1,110 @@ +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(&NativePtr->DataSize); + public ref uint SourceId => ref Unsafe.AsRef(&NativePtr->SourceId); + public ref uint SourceParentId => ref Unsafe.AsRef(&NativePtr->SourceParentId); + public ref int DataFrameCount => ref Unsafe.AsRef(&NativePtr->DataFrameCount); + public RangeAccessor DataType => new RangeAccessor(NativePtr->DataType, 33); + public ref bool Preview => ref Unsafe.AsRef(&NativePtr->Preview); + public ref bool Delivery => ref Unsafe.AsRef(&NativePtr->Delivery); + public void Clear() + { + ImGuiNative.ImGuiPayload_Clear((ImGuiPayload*)(NativePtr)); + } + public void Destroy() + { + ImGuiNative.ImGuiPayload_destroy((ImGuiPayload*)(NativePtr)); + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public bool IsDataType(ReadOnlySpan type) + { + byte* native_type; + int type_byteCount = 0; + if (type != null) + { + type_byteCount = Encoding.UTF8.GetByteCount(type); + if (type_byteCount > Util.StackAllocationSizeLimit) + { + native_type = Util.Allocate(type_byteCount + 1); + } + else + { + byte* native_type_stackBytes = stackalloc byte[type_byteCount + 1]; + native_type = native_type_stackBytes; + } + int native_type_offset = Util.GetUtf8(type, native_type, type_byteCount); + native_type[native_type_offset] = 0; + } + else { native_type = null; } + byte ret = ImGuiNative.ImGuiPayload_IsDataType((ImGuiPayload*)(NativePtr), native_type); + if (type_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_type); + } + return ret != 0; + } +#endif + public bool IsDataType(string type) + { + byte* native_type; + int type_byteCount = 0; + if (type != null) + { + type_byteCount = Encoding.UTF8.GetByteCount(type); + if (type_byteCount > Util.StackAllocationSizeLimit) + { + native_type = Util.Allocate(type_byteCount + 1); + } + else + { + byte* native_type_stackBytes = stackalloc byte[type_byteCount + 1]; + native_type = native_type_stackBytes; + } + int native_type_offset = Util.GetUtf8(type, native_type, type_byteCount); + native_type[native_type_offset] = 0; + } + else { native_type = null; } + byte ret = ImGuiNative.ImGuiPayload_IsDataType((ImGuiPayload*)(NativePtr), native_type); + if (type_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_type); + } + return ret != 0; + } + public bool IsDelivery() + { + byte ret = ImGuiNative.ImGuiPayload_IsDelivery((ImGuiPayload*)(NativePtr)); + return ret != 0; + } + public bool IsPreview() + { + byte ret = ImGuiNative.ImGuiPayload_IsPreview((ImGuiPayload*)(NativePtr)); + return ret != 0; + } + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiPlatformIO.gen.cs b/lib/ImGui.NET/Generated/ImGuiPlatformIO.gen.cs new file mode 100644 index 0000000..602e369 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiPlatformIO.gen.cs @@ -0,0 +1,74 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ImGuiNET +{ + public unsafe partial struct ImGuiPlatformIO + { + public IntPtr Platform_CreateWindow; + public IntPtr Platform_DestroyWindow; + public IntPtr Platform_ShowWindow; + public IntPtr Platform_SetWindowPos; + public IntPtr Platform_GetWindowPos; + public IntPtr Platform_SetWindowSize; + public IntPtr Platform_GetWindowSize; + public IntPtr Platform_SetWindowFocus; + public IntPtr Platform_GetWindowFocus; + public IntPtr Platform_GetWindowMinimized; + public IntPtr Platform_SetWindowTitle; + public IntPtr Platform_SetWindowAlpha; + public IntPtr Platform_UpdateWindow; + public IntPtr Platform_RenderWindow; + public IntPtr Platform_SwapBuffers; + public IntPtr Platform_GetWindowDpiScale; + public IntPtr Platform_OnChangedViewport; + public IntPtr Platform_CreateVkSurface; + public IntPtr Renderer_CreateWindow; + public IntPtr Renderer_DestroyWindow; + public IntPtr Renderer_SetWindowSize; + public IntPtr Renderer_RenderWindow; + public IntPtr Renderer_SwapBuffers; + public ImVector Monitors; + public ImVector Viewports; + } + public unsafe partial struct ImGuiPlatformIOPtr + { + public ImGuiPlatformIO* NativePtr { get; } + public ImGuiPlatformIOPtr(ImGuiPlatformIO* nativePtr) => NativePtr = nativePtr; + public ImGuiPlatformIOPtr(IntPtr nativePtr) => NativePtr = (ImGuiPlatformIO*)nativePtr; + public static implicit operator ImGuiPlatformIOPtr(ImGuiPlatformIO* nativePtr) => new ImGuiPlatformIOPtr(nativePtr); + public static implicit operator ImGuiPlatformIO* (ImGuiPlatformIOPtr wrappedPtr) => wrappedPtr.NativePtr; + public static implicit operator ImGuiPlatformIOPtr(IntPtr nativePtr) => new ImGuiPlatformIOPtr(nativePtr); + public ref IntPtr Platform_CreateWindow => ref Unsafe.AsRef(&NativePtr->Platform_CreateWindow); + public ref IntPtr Platform_DestroyWindow => ref Unsafe.AsRef(&NativePtr->Platform_DestroyWindow); + public ref IntPtr Platform_ShowWindow => ref Unsafe.AsRef(&NativePtr->Platform_ShowWindow); + public ref IntPtr Platform_SetWindowPos => ref Unsafe.AsRef(&NativePtr->Platform_SetWindowPos); + public ref IntPtr Platform_GetWindowPos => ref Unsafe.AsRef(&NativePtr->Platform_GetWindowPos); + public ref IntPtr Platform_SetWindowSize => ref Unsafe.AsRef(&NativePtr->Platform_SetWindowSize); + public ref IntPtr Platform_GetWindowSize => ref Unsafe.AsRef(&NativePtr->Platform_GetWindowSize); + public ref IntPtr Platform_SetWindowFocus => ref Unsafe.AsRef(&NativePtr->Platform_SetWindowFocus); + public ref IntPtr Platform_GetWindowFocus => ref Unsafe.AsRef(&NativePtr->Platform_GetWindowFocus); + public ref IntPtr Platform_GetWindowMinimized => ref Unsafe.AsRef(&NativePtr->Platform_GetWindowMinimized); + public ref IntPtr Platform_SetWindowTitle => ref Unsafe.AsRef(&NativePtr->Platform_SetWindowTitle); + public ref IntPtr Platform_SetWindowAlpha => ref Unsafe.AsRef(&NativePtr->Platform_SetWindowAlpha); + public ref IntPtr Platform_UpdateWindow => ref Unsafe.AsRef(&NativePtr->Platform_UpdateWindow); + public ref IntPtr Platform_RenderWindow => ref Unsafe.AsRef(&NativePtr->Platform_RenderWindow); + public ref IntPtr Platform_SwapBuffers => ref Unsafe.AsRef(&NativePtr->Platform_SwapBuffers); + public ref IntPtr Platform_GetWindowDpiScale => ref Unsafe.AsRef(&NativePtr->Platform_GetWindowDpiScale); + public ref IntPtr Platform_OnChangedViewport => ref Unsafe.AsRef(&NativePtr->Platform_OnChangedViewport); + public ref IntPtr Platform_CreateVkSurface => ref Unsafe.AsRef(&NativePtr->Platform_CreateVkSurface); + public ref IntPtr Renderer_CreateWindow => ref Unsafe.AsRef(&NativePtr->Renderer_CreateWindow); + public ref IntPtr Renderer_DestroyWindow => ref Unsafe.AsRef(&NativePtr->Renderer_DestroyWindow); + public ref IntPtr Renderer_SetWindowSize => ref Unsafe.AsRef(&NativePtr->Renderer_SetWindowSize); + public ref IntPtr Renderer_RenderWindow => ref Unsafe.AsRef(&NativePtr->Renderer_RenderWindow); + public ref IntPtr Renderer_SwapBuffers => ref Unsafe.AsRef(&NativePtr->Renderer_SwapBuffers); + public ImPtrVector Monitors => new ImPtrVector(NativePtr->Monitors, Unsafe.SizeOf()); + public ImVector Viewports => new ImVector(NativePtr->Viewports); + public void Destroy() + { + ImGuiNative.ImGuiPlatformIO_destroy((ImGuiPlatformIO*)(NativePtr)); + } + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiPlatformImeData.gen.cs b/lib/ImGui.NET/Generated/ImGuiPlatformImeData.gen.cs new file mode 100644 index 0000000..fa0cdcc --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiPlatformImeData.gen.cs @@ -0,0 +1,30 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ImGuiNET +{ + public unsafe partial struct ImGuiPlatformImeData + { + public byte WantVisible; + public Vector2 InputPos; + public float InputLineHeight; + } + public unsafe partial struct ImGuiPlatformImeDataPtr + { + public ImGuiPlatformImeData* NativePtr { get; } + public ImGuiPlatformImeDataPtr(ImGuiPlatformImeData* nativePtr) => NativePtr = nativePtr; + public ImGuiPlatformImeDataPtr(IntPtr nativePtr) => NativePtr = (ImGuiPlatformImeData*)nativePtr; + public static implicit operator ImGuiPlatformImeDataPtr(ImGuiPlatformImeData* nativePtr) => new ImGuiPlatformImeDataPtr(nativePtr); + public static implicit operator ImGuiPlatformImeData* (ImGuiPlatformImeDataPtr wrappedPtr) => wrappedPtr.NativePtr; + public static implicit operator ImGuiPlatformImeDataPtr(IntPtr nativePtr) => new ImGuiPlatformImeDataPtr(nativePtr); + public ref bool WantVisible => ref Unsafe.AsRef(&NativePtr->WantVisible); + public ref Vector2 InputPos => ref Unsafe.AsRef(&NativePtr->InputPos); + public ref float InputLineHeight => ref Unsafe.AsRef(&NativePtr->InputLineHeight); + public void Destroy() + { + ImGuiNative.ImGuiPlatformImeData_destroy((ImGuiPlatformImeData*)(NativePtr)); + } + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiPlatformMonitor.gen.cs b/lib/ImGui.NET/Generated/ImGuiPlatformMonitor.gen.cs new file mode 100644 index 0000000..4013834 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiPlatformMonitor.gen.cs @@ -0,0 +1,36 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ImGuiNET +{ + public unsafe partial struct ImGuiPlatformMonitor + { + public Vector2 MainPos; + public Vector2 MainSize; + public Vector2 WorkPos; + public Vector2 WorkSize; + public float DpiScale; + public void* PlatformHandle; + } + public unsafe partial struct ImGuiPlatformMonitorPtr + { + public ImGuiPlatformMonitor* NativePtr { get; } + public ImGuiPlatformMonitorPtr(ImGuiPlatformMonitor* nativePtr) => NativePtr = nativePtr; + public ImGuiPlatformMonitorPtr(IntPtr nativePtr) => NativePtr = (ImGuiPlatformMonitor*)nativePtr; + public static implicit operator ImGuiPlatformMonitorPtr(ImGuiPlatformMonitor* nativePtr) => new ImGuiPlatformMonitorPtr(nativePtr); + public static implicit operator ImGuiPlatformMonitor* (ImGuiPlatformMonitorPtr wrappedPtr) => wrappedPtr.NativePtr; + public static implicit operator ImGuiPlatformMonitorPtr(IntPtr nativePtr) => new ImGuiPlatformMonitorPtr(nativePtr); + public ref Vector2 MainPos => ref Unsafe.AsRef(&NativePtr->MainPos); + public ref Vector2 MainSize => ref Unsafe.AsRef(&NativePtr->MainSize); + public ref Vector2 WorkPos => ref Unsafe.AsRef(&NativePtr->WorkPos); + public ref Vector2 WorkSize => ref Unsafe.AsRef(&NativePtr->WorkSize); + public ref float DpiScale => ref Unsafe.AsRef(&NativePtr->DpiScale); + public IntPtr PlatformHandle { get => (IntPtr)NativePtr->PlatformHandle; set => NativePtr->PlatformHandle = (void*)value; } + public void Destroy() + { + ImGuiNative.ImGuiPlatformMonitor_destroy((ImGuiPlatformMonitor*)(NativePtr)); + } + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiPopupFlags.gen.cs b/lib/ImGui.NET/Generated/ImGuiPopupFlags.gen.cs new file mode 100644 index 0000000..5fbe608 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiPopupFlags.gen.cs @@ -0,0 +1,18 @@ +namespace ImGuiNET +{ + [System.Flags] + public enum ImGuiPopupFlags + { + None = 0, + MouseButtonLeft = 0, + MouseButtonRight = 1, + MouseButtonMiddle = 2, + MouseButtonMask = 31, + MouseButtonDefault = 1, + NoOpenOverExistingPopup = 32, + NoOpenOverItems = 64, + AnyPopupId = 128, + AnyPopupLevel = 256, + AnyPopup = 384, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiSelectableFlags.gen.cs b/lib/ImGui.NET/Generated/ImGuiSelectableFlags.gen.cs new file mode 100644 index 0000000..79e2068 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiSelectableFlags.gen.cs @@ -0,0 +1,13 @@ +namespace ImGuiNET +{ + [System.Flags] + public enum ImGuiSelectableFlags + { + None = 0, + DontClosePopups = 1, + SpanAllColumns = 2, + AllowDoubleClick = 4, + Disabled = 8, + AllowOverlap = 16, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiSizeCallbackData.gen.cs b/lib/ImGui.NET/Generated/ImGuiSizeCallbackData.gen.cs new file mode 100644 index 0000000..83c3196 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiSizeCallbackData.gen.cs @@ -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(&NativePtr->Pos); + public ref Vector2 CurrentSize => ref Unsafe.AsRef(&NativePtr->CurrentSize); + public ref Vector2 DesiredSize => ref Unsafe.AsRef(&NativePtr->DesiredSize); + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiSliderFlags.gen.cs b/lib/ImGui.NET/Generated/ImGuiSliderFlags.gen.cs new file mode 100644 index 0000000..f87859c --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiSliderFlags.gen.cs @@ -0,0 +1,13 @@ +namespace ImGuiNET +{ + [System.Flags] + public enum ImGuiSliderFlags + { + None = 0, + AlwaysClamp = 16, + Logarithmic = 32, + NoRoundToFormat = 64, + NoInput = 128, + InvalidMask = 1879048207, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiSortDirection.gen.cs b/lib/ImGui.NET/Generated/ImGuiSortDirection.gen.cs new file mode 100644 index 0000000..7b4fae9 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiSortDirection.gen.cs @@ -0,0 +1,9 @@ +namespace ImGuiNET +{ + public enum ImGuiSortDirection + { + None = 0, + Ascending = 1, + Descending = 2, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiStorage.gen.cs b/lib/ImGui.NET/Generated/ImGuiStorage.gen.cs new file mode 100644 index 0000000..7838589 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiStorage.gen.cs @@ -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 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 ImPtrVector Data => new ImPtrVector(NativePtr->Data, Unsafe.SizeOf()); + public void BuildSortByKey() + { + ImGuiNative.ImGuiStorage_BuildSortByKey((ImGuiStorage*)(NativePtr)); + } + public void Clear() + { + ImGuiNative.ImGuiStorage_Clear((ImGuiStorage*)(NativePtr)); + } + public bool GetBool(uint key) + { + byte default_val = 0; + byte ret = ImGuiNative.ImGuiStorage_GetBool((ImGuiStorage*)(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((ImGuiStorage*)(NativePtr), key, native_default_val); + return ret != 0; + } + public byte* GetBoolRef(uint key) + { + byte default_val = 0; + byte* ret = ImGuiNative.ImGuiStorage_GetBoolRef((ImGuiStorage*)(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((ImGuiStorage*)(NativePtr), key, native_default_val); + return ret; + } + public float GetFloat(uint key) + { + float default_val = 0.0f; + float ret = ImGuiNative.ImGuiStorage_GetFloat((ImGuiStorage*)(NativePtr), key, default_val); + return ret; + } + public float GetFloat(uint key, float default_val) + { + float ret = ImGuiNative.ImGuiStorage_GetFloat((ImGuiStorage*)(NativePtr), key, default_val); + return ret; + } + public float* GetFloatRef(uint key) + { + float default_val = 0.0f; + float* ret = ImGuiNative.ImGuiStorage_GetFloatRef((ImGuiStorage*)(NativePtr), key, default_val); + return ret; + } + public float* GetFloatRef(uint key, float default_val) + { + float* ret = ImGuiNative.ImGuiStorage_GetFloatRef((ImGuiStorage*)(NativePtr), key, default_val); + return ret; + } + public int GetInt(uint key) + { + int default_val = 0; + int ret = ImGuiNative.ImGuiStorage_GetInt((ImGuiStorage*)(NativePtr), key, default_val); + return ret; + } + public int GetInt(uint key, int default_val) + { + int ret = ImGuiNative.ImGuiStorage_GetInt((ImGuiStorage*)(NativePtr), key, default_val); + return ret; + } + public int* GetIntRef(uint key) + { + int default_val = 0; + int* ret = ImGuiNative.ImGuiStorage_GetIntRef((ImGuiStorage*)(NativePtr), key, default_val); + return ret; + } + public int* GetIntRef(uint key, int default_val) + { + int* ret = ImGuiNative.ImGuiStorage_GetIntRef((ImGuiStorage*)(NativePtr), key, default_val); + return ret; + } + public IntPtr GetVoidPtr(uint key) + { + void* ret = ImGuiNative.ImGuiStorage_GetVoidPtr((ImGuiStorage*)(NativePtr), key); + return (IntPtr)ret; + } + public void** GetVoidPtrRef(uint key) + { + void* default_val = null; + void** ret = ImGuiNative.ImGuiStorage_GetVoidPtrRef((ImGuiStorage*)(NativePtr), key, default_val); + return ret; + } + public void** GetVoidPtrRef(uint key, IntPtr default_val) + { + void* native_default_val = (void*)default_val.ToPointer(); + void** ret = ImGuiNative.ImGuiStorage_GetVoidPtrRef((ImGuiStorage*)(NativePtr), key, native_default_val); + return ret; + } + public void SetAllInt(int val) + { + ImGuiNative.ImGuiStorage_SetAllInt((ImGuiStorage*)(NativePtr), val); + } + public void SetBool(uint key, bool val) + { + byte native_val = val ? (byte)1 : (byte)0; + ImGuiNative.ImGuiStorage_SetBool((ImGuiStorage*)(NativePtr), key, native_val); + } + public void SetFloat(uint key, float val) + { + ImGuiNative.ImGuiStorage_SetFloat((ImGuiStorage*)(NativePtr), key, val); + } + public void SetInt(uint key, int val) + { + ImGuiNative.ImGuiStorage_SetInt((ImGuiStorage*)(NativePtr), key, val); + } + public void SetVoidPtr(uint key, IntPtr val) + { + void* native_val = (void*)val.ToPointer(); + ImGuiNative.ImGuiStorage_SetVoidPtr((ImGuiStorage*)(NativePtr), key, native_val); + } + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiStyle.gen.cs b/lib/ImGui.NET/Generated/ImGuiStyle.gen.cs new file mode 100644 index 0000000..3c5e257 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiStyle.gen.cs @@ -0,0 +1,186 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ImGuiNET +{ + public unsafe partial struct ImGuiStyle + { + public float Alpha; + public float DisabledAlpha; + public Vector2 WindowPadding; + public float WindowRounding; + public float WindowBorderSize; + public Vector2 WindowMinSize; + public Vector2 WindowTitleAlign; + public ImGuiDir WindowMenuButtonPosition; + 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 CellPadding; + public Vector2 TouchExtraPadding; + public float IndentSpacing; + public float ColumnsMinSpacing; + public float ScrollbarSize; + public float ScrollbarRounding; + public float GrabMinSize; + public float GrabRounding; + public float LogSliderDeadzone; + public float TabRounding; + public float TabBorderSize; + public float TabMinWidthForCloseButton; + public float TabBarBorderSize; + public float TableAngledHeadersAngle; + public ImGuiDir ColorButtonPosition; + public Vector2 ButtonTextAlign; + public Vector2 SelectableTextAlign; + public float SeparatorTextBorderSize; + public Vector2 SeparatorTextAlign; + public Vector2 SeparatorTextPadding; + public Vector2 DisplayWindowPadding; + public Vector2 DisplaySafeAreaPadding; + public float DockingSeparatorSize; + public float MouseCursorScale; + public byte AntiAliasedLines; + public byte AntiAliasedLinesUseTex; + public byte AntiAliasedFill; + public float CurveTessellationTol; + public float CircleTessellationMaxError; + 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 Vector4 Colors_43; + public Vector4 Colors_44; + public Vector4 Colors_45; + public Vector4 Colors_46; + public Vector4 Colors_47; + public Vector4 Colors_48; + public Vector4 Colors_49; + public Vector4 Colors_50; + public Vector4 Colors_51; + public Vector4 Colors_52; + public Vector4 Colors_53; + public Vector4 Colors_54; + public float HoverStationaryDelay; + public float HoverDelayShort; + public float HoverDelayNormal; + public ImGuiHoveredFlags HoverFlagsForTooltipMouse; + public ImGuiHoveredFlags HoverFlagsForTooltipNav; + } + 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(&NativePtr->Alpha); + public ref float DisabledAlpha => ref Unsafe.AsRef(&NativePtr->DisabledAlpha); + public ref Vector2 WindowPadding => ref Unsafe.AsRef(&NativePtr->WindowPadding); + public ref float WindowRounding => ref Unsafe.AsRef(&NativePtr->WindowRounding); + public ref float WindowBorderSize => ref Unsafe.AsRef(&NativePtr->WindowBorderSize); + public ref Vector2 WindowMinSize => ref Unsafe.AsRef(&NativePtr->WindowMinSize); + public ref Vector2 WindowTitleAlign => ref Unsafe.AsRef(&NativePtr->WindowTitleAlign); + public ref ImGuiDir WindowMenuButtonPosition => ref Unsafe.AsRef(&NativePtr->WindowMenuButtonPosition); + public ref float ChildRounding => ref Unsafe.AsRef(&NativePtr->ChildRounding); + public ref float ChildBorderSize => ref Unsafe.AsRef(&NativePtr->ChildBorderSize); + public ref float PopupRounding => ref Unsafe.AsRef(&NativePtr->PopupRounding); + public ref float PopupBorderSize => ref Unsafe.AsRef(&NativePtr->PopupBorderSize); + public ref Vector2 FramePadding => ref Unsafe.AsRef(&NativePtr->FramePadding); + public ref float FrameRounding => ref Unsafe.AsRef(&NativePtr->FrameRounding); + public ref float FrameBorderSize => ref Unsafe.AsRef(&NativePtr->FrameBorderSize); + public ref Vector2 ItemSpacing => ref Unsafe.AsRef(&NativePtr->ItemSpacing); + public ref Vector2 ItemInnerSpacing => ref Unsafe.AsRef(&NativePtr->ItemInnerSpacing); + public ref Vector2 CellPadding => ref Unsafe.AsRef(&NativePtr->CellPadding); + public ref Vector2 TouchExtraPadding => ref Unsafe.AsRef(&NativePtr->TouchExtraPadding); + public ref float IndentSpacing => ref Unsafe.AsRef(&NativePtr->IndentSpacing); + public ref float ColumnsMinSpacing => ref Unsafe.AsRef(&NativePtr->ColumnsMinSpacing); + public ref float ScrollbarSize => ref Unsafe.AsRef(&NativePtr->ScrollbarSize); + public ref float ScrollbarRounding => ref Unsafe.AsRef(&NativePtr->ScrollbarRounding); + public ref float GrabMinSize => ref Unsafe.AsRef(&NativePtr->GrabMinSize); + public ref float GrabRounding => ref Unsafe.AsRef(&NativePtr->GrabRounding); + public ref float LogSliderDeadzone => ref Unsafe.AsRef(&NativePtr->LogSliderDeadzone); + public ref float TabRounding => ref Unsafe.AsRef(&NativePtr->TabRounding); + public ref float TabBorderSize => ref Unsafe.AsRef(&NativePtr->TabBorderSize); + public ref float TabMinWidthForCloseButton => ref Unsafe.AsRef(&NativePtr->TabMinWidthForCloseButton); + public ref float TabBarBorderSize => ref Unsafe.AsRef(&NativePtr->TabBarBorderSize); + public ref float TableAngledHeadersAngle => ref Unsafe.AsRef(&NativePtr->TableAngledHeadersAngle); + public ref ImGuiDir ColorButtonPosition => ref Unsafe.AsRef(&NativePtr->ColorButtonPosition); + public ref Vector2 ButtonTextAlign => ref Unsafe.AsRef(&NativePtr->ButtonTextAlign); + public ref Vector2 SelectableTextAlign => ref Unsafe.AsRef(&NativePtr->SelectableTextAlign); + public ref float SeparatorTextBorderSize => ref Unsafe.AsRef(&NativePtr->SeparatorTextBorderSize); + public ref Vector2 SeparatorTextAlign => ref Unsafe.AsRef(&NativePtr->SeparatorTextAlign); + public ref Vector2 SeparatorTextPadding => ref Unsafe.AsRef(&NativePtr->SeparatorTextPadding); + public ref Vector2 DisplayWindowPadding => ref Unsafe.AsRef(&NativePtr->DisplayWindowPadding); + public ref Vector2 DisplaySafeAreaPadding => ref Unsafe.AsRef(&NativePtr->DisplaySafeAreaPadding); + public ref float DockingSeparatorSize => ref Unsafe.AsRef(&NativePtr->DockingSeparatorSize); + public ref float MouseCursorScale => ref Unsafe.AsRef(&NativePtr->MouseCursorScale); + public ref bool AntiAliasedLines => ref Unsafe.AsRef(&NativePtr->AntiAliasedLines); + public ref bool AntiAliasedLinesUseTex => ref Unsafe.AsRef(&NativePtr->AntiAliasedLinesUseTex); + public ref bool AntiAliasedFill => ref Unsafe.AsRef(&NativePtr->AntiAliasedFill); + public ref float CurveTessellationTol => ref Unsafe.AsRef(&NativePtr->CurveTessellationTol); + public ref float CircleTessellationMaxError => ref Unsafe.AsRef(&NativePtr->CircleTessellationMaxError); + public RangeAccessor Colors => new RangeAccessor(&NativePtr->Colors_0, 55); + public ref float HoverStationaryDelay => ref Unsafe.AsRef(&NativePtr->HoverStationaryDelay); + public ref float HoverDelayShort => ref Unsafe.AsRef(&NativePtr->HoverDelayShort); + public ref float HoverDelayNormal => ref Unsafe.AsRef(&NativePtr->HoverDelayNormal); + public ref ImGuiHoveredFlags HoverFlagsForTooltipMouse => ref Unsafe.AsRef(&NativePtr->HoverFlagsForTooltipMouse); + public ref ImGuiHoveredFlags HoverFlagsForTooltipNav => ref Unsafe.AsRef(&NativePtr->HoverFlagsForTooltipNav); + public void Destroy() + { + ImGuiNative.ImGuiStyle_destroy((ImGuiStyle*)(NativePtr)); + } + public void ScaleAllSizes(float scale_factor) + { + ImGuiNative.ImGuiStyle_ScaleAllSizes((ImGuiStyle*)(NativePtr), scale_factor); + } + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiStyleVar.gen.cs b/lib/ImGui.NET/Generated/ImGuiStyleVar.gen.cs new file mode 100644 index 0000000..99a3c33 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiStyleVar.gen.cs @@ -0,0 +1,37 @@ +namespace ImGuiNET +{ + public enum ImGuiStyleVar + { + Alpha = 0, + DisabledAlpha = 1, + WindowPadding = 2, + WindowRounding = 3, + WindowBorderSize = 4, + WindowMinSize = 5, + WindowTitleAlign = 6, + ChildRounding = 7, + ChildBorderSize = 8, + PopupRounding = 9, + PopupBorderSize = 10, + FramePadding = 11, + FrameRounding = 12, + FrameBorderSize = 13, + ItemSpacing = 14, + ItemInnerSpacing = 15, + IndentSpacing = 16, + CellPadding = 17, + ScrollbarSize = 18, + ScrollbarRounding = 19, + GrabMinSize = 20, + GrabRounding = 21, + TabRounding = 22, + TabBarBorderSize = 23, + ButtonTextAlign = 24, + SelectableTextAlign = 25, + SeparatorTextBorderSize = 26, + SeparatorTextAlign = 27, + SeparatorTextPadding = 28, + DockingSeparatorSize = 29, + COUNT = 30, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiTabBarFlags.gen.cs b/lib/ImGui.NET/Generated/ImGuiTabBarFlags.gen.cs new file mode 100644 index 0000000..c5b82bf --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiTabBarFlags.gen.cs @@ -0,0 +1,18 @@ +namespace ImGuiNET +{ + [System.Flags] + public enum ImGuiTabBarFlags + { + None = 0, + Reorderable = 1, + AutoSelectNewTabs = 2, + TabListPopupButton = 4, + NoCloseWithMiddleMouseButton = 8, + NoTabListScrollingButtons = 16, + NoTooltip = 32, + FittingPolicyResizeDown = 64, + FittingPolicyScroll = 128, + FittingPolicyMask = 192, + FittingPolicyDefault = 64, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiTabItemFlags.gen.cs b/lib/ImGui.NET/Generated/ImGuiTabItemFlags.gen.cs new file mode 100644 index 0000000..18e2c01 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiTabItemFlags.gen.cs @@ -0,0 +1,16 @@ +namespace ImGuiNET +{ + [System.Flags] + public enum ImGuiTabItemFlags + { + None = 0, + UnsavedDocument = 1, + SetSelected = 2, + NoCloseWithMiddleMouseButton = 4, + NoPushId = 8, + NoTooltip = 16, + NoReorder = 32, + Leading = 64, + Trailing = 128, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiTableBgTarget.gen.cs b/lib/ImGui.NET/Generated/ImGuiTableBgTarget.gen.cs new file mode 100644 index 0000000..83a1102 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiTableBgTarget.gen.cs @@ -0,0 +1,10 @@ +namespace ImGuiNET +{ + public enum ImGuiTableBgTarget + { + None = 0, + RowBg0 = 1, + RowBg1 = 2, + CellBg = 3, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiTableColumnFlags.gen.cs b/lib/ImGui.NET/Generated/ImGuiTableColumnFlags.gen.cs new file mode 100644 index 0000000..cdeb4f5 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiTableColumnFlags.gen.cs @@ -0,0 +1,35 @@ +namespace ImGuiNET +{ + [System.Flags] + public enum ImGuiTableColumnFlags + { + None = 0, + Disabled = 1, + DefaultHide = 2, + DefaultSort = 4, + WidthStretch = 8, + WidthFixed = 16, + NoResize = 32, + NoReorder = 64, + NoHide = 128, + NoClip = 256, + NoSort = 512, + NoSortAscending = 1024, + NoSortDescending = 2048, + NoHeaderLabel = 4096, + NoHeaderWidth = 8192, + PreferSortAscending = 16384, + PreferSortDescending = 32768, + IndentEnable = 65536, + IndentDisable = 131072, + AngledHeader = 262144, + IsEnabled = 16777216, + IsVisible = 33554432, + IsSorted = 67108864, + IsHovered = 134217728, + WidthMask = 24, + IndentMask = 196608, + StatusMask = 251658240, + NoDirectResize = 1073741824, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiTableColumnSortSpecs.gen.cs b/lib/ImGui.NET/Generated/ImGuiTableColumnSortSpecs.gen.cs new file mode 100644 index 0000000..ef1d61b --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiTableColumnSortSpecs.gen.cs @@ -0,0 +1,32 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ImGuiNET +{ + public unsafe partial struct ImGuiTableColumnSortSpecs + { + public uint ColumnUserID; + public short ColumnIndex; + public short SortOrder; + public ImGuiSortDirection SortDirection; + } + public unsafe partial struct ImGuiTableColumnSortSpecsPtr + { + public ImGuiTableColumnSortSpecs* NativePtr { get; } + public ImGuiTableColumnSortSpecsPtr(ImGuiTableColumnSortSpecs* nativePtr) => NativePtr = nativePtr; + public ImGuiTableColumnSortSpecsPtr(IntPtr nativePtr) => NativePtr = (ImGuiTableColumnSortSpecs*)nativePtr; + public static implicit operator ImGuiTableColumnSortSpecsPtr(ImGuiTableColumnSortSpecs* nativePtr) => new ImGuiTableColumnSortSpecsPtr(nativePtr); + public static implicit operator ImGuiTableColumnSortSpecs* (ImGuiTableColumnSortSpecsPtr wrappedPtr) => wrappedPtr.NativePtr; + public static implicit operator ImGuiTableColumnSortSpecsPtr(IntPtr nativePtr) => new ImGuiTableColumnSortSpecsPtr(nativePtr); + public ref uint ColumnUserID => ref Unsafe.AsRef(&NativePtr->ColumnUserID); + public ref short ColumnIndex => ref Unsafe.AsRef(&NativePtr->ColumnIndex); + public ref short SortOrder => ref Unsafe.AsRef(&NativePtr->SortOrder); + public ref ImGuiSortDirection SortDirection => ref Unsafe.AsRef(&NativePtr->SortDirection); + public void Destroy() + { + ImGuiNative.ImGuiTableColumnSortSpecs_destroy((ImGuiTableColumnSortSpecs*)(NativePtr)); + } + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiTableFlags.gen.cs b/lib/ImGui.NET/Generated/ImGuiTableFlags.gen.cs new file mode 100644 index 0000000..715caff --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiTableFlags.gen.cs @@ -0,0 +1,44 @@ +namespace ImGuiNET +{ + [System.Flags] + public enum ImGuiTableFlags + { + None = 0, + Resizable = 1, + Reorderable = 2, + Hideable = 4, + Sortable = 8, + NoSavedSettings = 16, + ContextMenuInBody = 32, + RowBg = 64, + BordersInnerH = 128, + BordersOuterH = 256, + BordersInnerV = 512, + BordersOuterV = 1024, + BordersH = 384, + BordersV = 1536, + BordersInner = 640, + BordersOuter = 1280, + Borders = 1920, + NoBordersInBody = 2048, + NoBordersInBodyUntilResize = 4096, + SizingFixedFit = 8192, + SizingFixedSame = 16384, + SizingStretchProp = 24576, + SizingStretchSame = 32768, + NoHostExtendX = 65536, + NoHostExtendY = 131072, + NoKeepColumnsVisible = 262144, + PreciseWidths = 524288, + NoClip = 1048576, + PadOuterX = 2097152, + NoPadOuterX = 4194304, + NoPadInnerX = 8388608, + ScrollX = 16777216, + ScrollY = 33554432, + SortMulti = 67108864, + SortTristate = 134217728, + HighlightHoveredColumn = 268435456, + SizingMask = 57344, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiTableRowFlags.gen.cs b/lib/ImGui.NET/Generated/ImGuiTableRowFlags.gen.cs new file mode 100644 index 0000000..e90a011 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiTableRowFlags.gen.cs @@ -0,0 +1,9 @@ +namespace ImGuiNET +{ + [System.Flags] + public enum ImGuiTableRowFlags + { + None = 0, + Headers = 1, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiTableSortSpecs.gen.cs b/lib/ImGui.NET/Generated/ImGuiTableSortSpecs.gen.cs new file mode 100644 index 0000000..626eeef --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiTableSortSpecs.gen.cs @@ -0,0 +1,30 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ImGuiNET +{ + public unsafe partial struct ImGuiTableSortSpecs + { + public ImGuiTableColumnSortSpecs* Specs; + public int SpecsCount; + public byte SpecsDirty; + } + public unsafe partial struct ImGuiTableSortSpecsPtr + { + public ImGuiTableSortSpecs* NativePtr { get; } + public ImGuiTableSortSpecsPtr(ImGuiTableSortSpecs* nativePtr) => NativePtr = nativePtr; + public ImGuiTableSortSpecsPtr(IntPtr nativePtr) => NativePtr = (ImGuiTableSortSpecs*)nativePtr; + public static implicit operator ImGuiTableSortSpecsPtr(ImGuiTableSortSpecs* nativePtr) => new ImGuiTableSortSpecsPtr(nativePtr); + public static implicit operator ImGuiTableSortSpecs* (ImGuiTableSortSpecsPtr wrappedPtr) => wrappedPtr.NativePtr; + public static implicit operator ImGuiTableSortSpecsPtr(IntPtr nativePtr) => new ImGuiTableSortSpecsPtr(nativePtr); + public ImGuiTableColumnSortSpecsPtr Specs => new ImGuiTableColumnSortSpecsPtr(NativePtr->Specs); + public ref int SpecsCount => ref Unsafe.AsRef(&NativePtr->SpecsCount); + public ref bool SpecsDirty => ref Unsafe.AsRef(&NativePtr->SpecsDirty); + public void Destroy() + { + ImGuiNative.ImGuiTableSortSpecs_destroy((ImGuiTableSortSpecs*)(NativePtr)); + } + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiTextBuffer.gen.cs b/lib/ImGui.NET/Generated/ImGuiTextBuffer.gen.cs new file mode 100644 index 0000000..e4de209 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiTextBuffer.gen.cs @@ -0,0 +1,167 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ImGuiNET +{ + public unsafe partial struct ImGuiTextBuffer + { + public ImVector 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 Buf => new ImVector(NativePtr->Buf); +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public void append(ReadOnlySpan str) + { + byte* native_str; + int str_byteCount = 0; + if (str != null) + { + str_byteCount = Encoding.UTF8.GetByteCount(str); + if (str_byteCount > Util.StackAllocationSizeLimit) + { + native_str = Util.Allocate(str_byteCount + 1); + } + else + { + byte* native_str_stackBytes = stackalloc byte[str_byteCount + 1]; + native_str = native_str_stackBytes; + } + int native_str_offset = Util.GetUtf8(str, native_str, str_byteCount); + native_str[native_str_offset] = 0; + } + else { native_str = null; } + ImGuiNative.ImGuiTextBuffer_append((ImGuiTextBuffer*)(NativePtr), native_str, native_str+str_byteCount); + if (str_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str); + } + } +#endif + public void append(string str) + { + byte* native_str; + int str_byteCount = 0; + if (str != null) + { + str_byteCount = Encoding.UTF8.GetByteCount(str); + if (str_byteCount > Util.StackAllocationSizeLimit) + { + native_str = Util.Allocate(str_byteCount + 1); + } + else + { + byte* native_str_stackBytes = stackalloc byte[str_byteCount + 1]; + native_str = native_str_stackBytes; + } + int native_str_offset = Util.GetUtf8(str, native_str, str_byteCount); + native_str[native_str_offset] = 0; + } + else { native_str = null; } + ImGuiNative.ImGuiTextBuffer_append((ImGuiTextBuffer*)(NativePtr), native_str, native_str+str_byteCount); + if (str_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_str); + } + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public void appendf(ReadOnlySpan fmt) + { + byte* native_fmt; + int fmt_byteCount = 0; + if (fmt != null) + { + fmt_byteCount = Encoding.UTF8.GetByteCount(fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + native_fmt = Util.Allocate(fmt_byteCount + 1); + } + else + { + byte* native_fmt_stackBytes = stackalloc byte[fmt_byteCount + 1]; + native_fmt = native_fmt_stackBytes; + } + int native_fmt_offset = Util.GetUtf8(fmt, native_fmt, fmt_byteCount); + native_fmt[native_fmt_offset] = 0; + } + else { native_fmt = null; } + ImGuiNative.ImGuiTextBuffer_appendf((ImGuiTextBuffer*)(NativePtr), native_fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_fmt); + } + } +#endif + public void appendf(string fmt) + { + byte* native_fmt; + int fmt_byteCount = 0; + if (fmt != null) + { + fmt_byteCount = Encoding.UTF8.GetByteCount(fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + native_fmt = Util.Allocate(fmt_byteCount + 1); + } + else + { + byte* native_fmt_stackBytes = stackalloc byte[fmt_byteCount + 1]; + native_fmt = native_fmt_stackBytes; + } + int native_fmt_offset = Util.GetUtf8(fmt, native_fmt, fmt_byteCount); + native_fmt[native_fmt_offset] = 0; + } + else { native_fmt = null; } + ImGuiNative.ImGuiTextBuffer_appendf((ImGuiTextBuffer*)(NativePtr), native_fmt); + if (fmt_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_fmt); + } + } + public string begin() + { + byte* ret = ImGuiNative.ImGuiTextBuffer_begin((ImGuiTextBuffer*)(NativePtr)); + return Util.StringFromPtr(ret); + } + public string c_str() + { + byte* ret = ImGuiNative.ImGuiTextBuffer_c_str((ImGuiTextBuffer*)(NativePtr)); + return Util.StringFromPtr(ret); + } + public void clear() + { + ImGuiNative.ImGuiTextBuffer_clear((ImGuiTextBuffer*)(NativePtr)); + } + public void Destroy() + { + ImGuiNative.ImGuiTextBuffer_destroy((ImGuiTextBuffer*)(NativePtr)); + } + public bool empty() + { + byte ret = ImGuiNative.ImGuiTextBuffer_empty((ImGuiTextBuffer*)(NativePtr)); + return ret != 0; + } + public string end() + { + byte* ret = ImGuiNative.ImGuiTextBuffer_end((ImGuiTextBuffer*)(NativePtr)); + return Util.StringFromPtr(ret); + } + public void reserve(int capacity) + { + ImGuiNative.ImGuiTextBuffer_reserve((ImGuiTextBuffer*)(NativePtr), capacity); + } + public int size() + { + int ret = ImGuiNative.ImGuiTextBuffer_size((ImGuiTextBuffer*)(NativePtr)); + return ret; + } + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiTextFilter.gen.cs b/lib/ImGui.NET/Generated/ImGuiTextFilter.gen.cs new file mode 100644 index 0000000..e8dff5f --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiTextFilter.gen.cs @@ -0,0 +1,237 @@ +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 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 InputBuf => new RangeAccessor(NativePtr->InputBuf, 256); + public ImPtrVector Filters => new ImPtrVector(NativePtr->Filters, Unsafe.SizeOf()); + public ref int CountGrep => ref Unsafe.AsRef(&NativePtr->CountGrep); + public void Build() + { + ImGuiNative.ImGuiTextFilter_Build((ImGuiTextFilter*)(NativePtr)); + } + public void Clear() + { + ImGuiNative.ImGuiTextFilter_Clear((ImGuiTextFilter*)(NativePtr)); + } + public void Destroy() + { + ImGuiNative.ImGuiTextFilter_destroy((ImGuiTextFilter*)(NativePtr)); + } + public bool Draw() + { + byte* native_label; + int label_byteCount = 0; + label_byteCount = Encoding.UTF8.GetByteCount("Filter(inc,-exc)"); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8("Filter(inc,-exc)", native_label, label_byteCount); + native_label[native_label_offset] = 0; + float width = 0.0f; + byte ret = ImGuiNative.ImGuiTextFilter_Draw((ImGuiTextFilter*)(NativePtr), native_label, width); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public bool Draw(ReadOnlySpan label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float width = 0.0f; + byte ret = ImGuiNative.ImGuiTextFilter_Draw((ImGuiTextFilter*)(NativePtr), native_label, width); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public bool Draw(string label) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + float width = 0.0f; + byte ret = ImGuiNative.ImGuiTextFilter_Draw((ImGuiTextFilter*)(NativePtr), native_label, width); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public bool Draw(ReadOnlySpan label, float width) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte ret = ImGuiNative.ImGuiTextFilter_Draw((ImGuiTextFilter*)(NativePtr), native_label, width); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } +#endif + public bool Draw(string label, float width) + { + byte* native_label; + int label_byteCount = 0; + if (label != null) + { + label_byteCount = Encoding.UTF8.GetByteCount(label); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + native_label = Util.Allocate(label_byteCount + 1); + } + else + { + byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1]; + native_label = native_label_stackBytes; + } + int native_label_offset = Util.GetUtf8(label, native_label, label_byteCount); + native_label[native_label_offset] = 0; + } + else { native_label = null; } + byte ret = ImGuiNative.ImGuiTextFilter_Draw((ImGuiTextFilter*)(NativePtr), native_label, width); + if (label_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_label); + } + return ret != 0; + } + public bool IsActive() + { + byte ret = ImGuiNative.ImGuiTextFilter_IsActive((ImGuiTextFilter*)(NativePtr)); + return ret != 0; + } +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + public bool PassFilter(ReadOnlySpan text) + { + byte* native_text; + int text_byteCount = 0; + if (text != null) + { + text_byteCount = Encoding.UTF8.GetByteCount(text); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + native_text = Util.Allocate(text_byteCount + 1); + } + else + { + byte* native_text_stackBytes = stackalloc byte[text_byteCount + 1]; + native_text = native_text_stackBytes; + } + int native_text_offset = Util.GetUtf8(text, native_text, text_byteCount); + native_text[native_text_offset] = 0; + } + else { native_text = null; } + byte ret = ImGuiNative.ImGuiTextFilter_PassFilter((ImGuiTextFilter*)(NativePtr), native_text, native_text+text_byteCount); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text); + } + return ret != 0; + } +#endif + public bool PassFilter(string text) + { + byte* native_text; + int text_byteCount = 0; + if (text != null) + { + text_byteCount = Encoding.UTF8.GetByteCount(text); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + native_text = Util.Allocate(text_byteCount + 1); + } + else + { + byte* native_text_stackBytes = stackalloc byte[text_byteCount + 1]; + native_text = native_text_stackBytes; + } + int native_text_offset = Util.GetUtf8(text, native_text, text_byteCount); + native_text[native_text_offset] = 0; + } + else { native_text = null; } + byte ret = ImGuiNative.ImGuiTextFilter_PassFilter((ImGuiTextFilter*)(NativePtr), native_text, native_text+text_byteCount); + if (text_byteCount > Util.StackAllocationSizeLimit) + { + Util.Free(native_text); + } + return ret != 0; + } + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiTextRange.gen.cs b/lib/ImGui.NET/Generated/ImGuiTextRange.gen.cs new file mode 100644 index 0000000..1f00fd6 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiTextRange.gen.cs @@ -0,0 +1,40 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ImGuiNET +{ + public unsafe partial struct ImGuiTextRange + { + public byte* b; + public byte* e; + } + public unsafe partial struct ImGuiTextRangePtr + { + public ImGuiTextRange* NativePtr { get; } + public ImGuiTextRangePtr(ImGuiTextRange* nativePtr) => NativePtr = nativePtr; + public ImGuiTextRangePtr(IntPtr nativePtr) => NativePtr = (ImGuiTextRange*)nativePtr; + public static implicit operator ImGuiTextRangePtr(ImGuiTextRange* nativePtr) => new ImGuiTextRangePtr(nativePtr); + public static implicit operator ImGuiTextRange* (ImGuiTextRangePtr wrappedPtr) => wrappedPtr.NativePtr; + public static implicit operator ImGuiTextRangePtr(IntPtr nativePtr) => new ImGuiTextRangePtr(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 Destroy() + { + ImGuiNative.ImGuiTextRange_destroy((ImGuiTextRange*)(NativePtr)); + } + public bool empty() + { + byte ret = ImGuiNative.ImGuiTextRange_empty((ImGuiTextRange*)(NativePtr)); + return ret != 0; + } + public void split(byte separator, out ImVector @out) + { + fixed (ImVector* native_out = &@out) + { + ImGuiNative.ImGuiTextRange_split((ImGuiTextRange*)(NativePtr), separator, native_out); + } + } + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiTreeNodeFlags.gen.cs b/lib/ImGui.NET/Generated/ImGuiTreeNodeFlags.gen.cs new file mode 100644 index 0000000..4d36086 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiTreeNodeFlags.gen.cs @@ -0,0 +1,24 @@ +namespace ImGuiNET +{ + [System.Flags] + public enum ImGuiTreeNodeFlags + { + None = 0, + Selected = 1, + Framed = 2, + AllowOverlap = 4, + NoTreePushOnOpen = 8, + NoAutoOpenOnLog = 16, + DefaultOpen = 32, + OpenOnDoubleClick = 64, + OpenOnArrow = 128, + Leaf = 256, + Bullet = 512, + FramePadding = 1024, + SpanAvailWidth = 2048, + SpanFullWidth = 4096, + SpanAllColumns = 8192, + NavLeftJumpsBackHere = 16384, + CollapsingHeader = 26, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiViewport.gen.cs b/lib/ImGui.NET/Generated/ImGuiViewport.gen.cs new file mode 100644 index 0000000..1f57aa4 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiViewport.gen.cs @@ -0,0 +1,70 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ImGuiNET +{ + public unsafe partial struct ImGuiViewport + { + public uint ID; + public ImGuiViewportFlags Flags; + public Vector2 Pos; + public Vector2 Size; + public Vector2 WorkPos; + public Vector2 WorkSize; + public float DpiScale; + public uint ParentViewportId; + public ImDrawData* DrawData; + public void* RendererUserData; + public void* PlatformUserData; + public void* PlatformHandle; + public void* PlatformHandleRaw; + public byte PlatformWindowCreated; + public byte PlatformRequestMove; + public byte PlatformRequestResize; + public byte PlatformRequestClose; + } + public unsafe partial struct ImGuiViewportPtr + { + public ImGuiViewport* NativePtr { get; } + public ImGuiViewportPtr(ImGuiViewport* nativePtr) => NativePtr = nativePtr; + public ImGuiViewportPtr(IntPtr nativePtr) => NativePtr = (ImGuiViewport*)nativePtr; + public static implicit operator ImGuiViewportPtr(ImGuiViewport* nativePtr) => new ImGuiViewportPtr(nativePtr); + public static implicit operator ImGuiViewport* (ImGuiViewportPtr wrappedPtr) => wrappedPtr.NativePtr; + public static implicit operator ImGuiViewportPtr(IntPtr nativePtr) => new ImGuiViewportPtr(nativePtr); + public ref uint ID => ref Unsafe.AsRef(&NativePtr->ID); + public ref ImGuiViewportFlags Flags => ref Unsafe.AsRef(&NativePtr->Flags); + public ref Vector2 Pos => ref Unsafe.AsRef(&NativePtr->Pos); + public ref Vector2 Size => ref Unsafe.AsRef(&NativePtr->Size); + public ref Vector2 WorkPos => ref Unsafe.AsRef(&NativePtr->WorkPos); + public ref Vector2 WorkSize => ref Unsafe.AsRef(&NativePtr->WorkSize); + public ref float DpiScale => ref Unsafe.AsRef(&NativePtr->DpiScale); + public ref uint ParentViewportId => ref Unsafe.AsRef(&NativePtr->ParentViewportId); + public ImDrawDataPtr DrawData => new ImDrawDataPtr(NativePtr->DrawData); + public IntPtr RendererUserData { get => (IntPtr)NativePtr->RendererUserData; set => NativePtr->RendererUserData = (void*)value; } + public IntPtr PlatformUserData { get => (IntPtr)NativePtr->PlatformUserData; set => NativePtr->PlatformUserData = (void*)value; } + public IntPtr PlatformHandle { get => (IntPtr)NativePtr->PlatformHandle; set => NativePtr->PlatformHandle = (void*)value; } + public IntPtr PlatformHandleRaw { get => (IntPtr)NativePtr->PlatformHandleRaw; set => NativePtr->PlatformHandleRaw = (void*)value; } + public ref bool PlatformWindowCreated => ref Unsafe.AsRef(&NativePtr->PlatformWindowCreated); + public ref bool PlatformRequestMove => ref Unsafe.AsRef(&NativePtr->PlatformRequestMove); + public ref bool PlatformRequestResize => ref Unsafe.AsRef(&NativePtr->PlatformRequestResize); + public ref bool PlatformRequestClose => ref Unsafe.AsRef(&NativePtr->PlatformRequestClose); + public void Destroy() + { + ImGuiNative.ImGuiViewport_destroy((ImGuiViewport*)(NativePtr)); + } + public Vector2 GetCenter() + { + Vector2 __retval; + ImGuiNative.ImGuiViewport_GetCenter(&__retval, (ImGuiViewport*)(NativePtr)); + return __retval; + } + public Vector2 GetWorkCenter() + { + Vector2 __retval; + ImGuiNative.ImGuiViewport_GetWorkCenter(&__retval, (ImGuiViewport*)(NativePtr)); + return __retval; + } + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiViewportFlags.gen.cs b/lib/ImGui.NET/Generated/ImGuiViewportFlags.gen.cs new file mode 100644 index 0000000..720967f --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiViewportFlags.gen.cs @@ -0,0 +1,22 @@ +namespace ImGuiNET +{ + [System.Flags] + public enum ImGuiViewportFlags + { + None = 0, + IsPlatformWindow = 1, + IsPlatformMonitor = 2, + OwnedByApp = 4, + NoDecoration = 8, + NoTaskBarIcon = 16, + NoFocusOnAppearing = 32, + NoFocusOnClick = 64, + NoInputs = 128, + NoRendererClear = 256, + NoAutoMerge = 512, + TopMost = 1024, + CanHostOtherWindows = 2048, + IsMinimized = 4096, + IsFocused = 8192, + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiWindowClass.gen.cs b/lib/ImGui.NET/Generated/ImGuiWindowClass.gen.cs new file mode 100644 index 0000000..e34c501 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiWindowClass.gen.cs @@ -0,0 +1,40 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ImGuiNET +{ + public unsafe partial struct ImGuiWindowClass + { + public uint ClassId; + public uint ParentViewportId; + public ImGuiViewportFlags ViewportFlagsOverrideSet; + public ImGuiViewportFlags ViewportFlagsOverrideClear; + public ImGuiTabItemFlags TabItemFlagsOverrideSet; + public ImGuiDockNodeFlags DockNodeFlagsOverrideSet; + public byte DockingAlwaysTabBar; + public byte DockingAllowUnclassed; + } + public unsafe partial struct ImGuiWindowClassPtr + { + public ImGuiWindowClass* NativePtr { get; } + public ImGuiWindowClassPtr(ImGuiWindowClass* nativePtr) => NativePtr = nativePtr; + public ImGuiWindowClassPtr(IntPtr nativePtr) => NativePtr = (ImGuiWindowClass*)nativePtr; + public static implicit operator ImGuiWindowClassPtr(ImGuiWindowClass* nativePtr) => new ImGuiWindowClassPtr(nativePtr); + public static implicit operator ImGuiWindowClass* (ImGuiWindowClassPtr wrappedPtr) => wrappedPtr.NativePtr; + public static implicit operator ImGuiWindowClassPtr(IntPtr nativePtr) => new ImGuiWindowClassPtr(nativePtr); + public ref uint ClassId => ref Unsafe.AsRef(&NativePtr->ClassId); + public ref uint ParentViewportId => ref Unsafe.AsRef(&NativePtr->ParentViewportId); + public ref ImGuiViewportFlags ViewportFlagsOverrideSet => ref Unsafe.AsRef(&NativePtr->ViewportFlagsOverrideSet); + public ref ImGuiViewportFlags ViewportFlagsOverrideClear => ref Unsafe.AsRef(&NativePtr->ViewportFlagsOverrideClear); + public ref ImGuiTabItemFlags TabItemFlagsOverrideSet => ref Unsafe.AsRef(&NativePtr->TabItemFlagsOverrideSet); + public ref ImGuiDockNodeFlags DockNodeFlagsOverrideSet => ref Unsafe.AsRef(&NativePtr->DockNodeFlagsOverrideSet); + public ref bool DockingAlwaysTabBar => ref Unsafe.AsRef(&NativePtr->DockingAlwaysTabBar); + public ref bool DockingAllowUnclassed => ref Unsafe.AsRef(&NativePtr->DockingAllowUnclassed); + public void Destroy() + { + ImGuiNative.ImGuiWindowClass_destroy((ImGuiWindowClass*)(NativePtr)); + } + } +} diff --git a/lib/ImGui.NET/Generated/ImGuiWindowFlags.gen.cs b/lib/ImGui.NET/Generated/ImGuiWindowFlags.gen.cs new file mode 100644 index 0000000..8e5b372 --- /dev/null +++ b/lib/ImGui.NET/Generated/ImGuiWindowFlags.gen.cs @@ -0,0 +1,38 @@ +namespace ImGuiNET +{ + [System.Flags] + public enum ImGuiWindowFlags + { + None = 0, + NoTitleBar = 1, + NoResize = 2, + NoMove = 4, + NoScrollbar = 8, + NoScrollWithMouse = 16, + NoCollapse = 32, + AlwaysAutoResize = 64, + NoBackground = 128, + NoSavedSettings = 256, + NoMouseInputs = 512, + MenuBar = 1024, + HorizontalScrollbar = 2048, + NoFocusOnAppearing = 4096, + NoBringToFrontOnFocus = 8192, + AlwaysVerticalScrollbar = 16384, + AlwaysHorizontalScrollbar = 32768, + NoNavInputs = 65536, + NoNavFocus = 131072, + UnsavedDocument = 262144, + NoDocking = 524288, + NoNav = 196608, + NoDecoration = 43, + NoInputs = 197120, + NavFlattened = 8388608, + ChildWindow = 16777216, + Tooltip = 33554432, + Popup = 67108864, + Modal = 134217728, + ChildMenu = 268435456, + DockNodeHost = 536870912, + } +} diff --git a/lib/ImGui.NET/Generated/STB_TexteditState.gen.cs b/lib/ImGui.NET/Generated/STB_TexteditState.gen.cs new file mode 100644 index 0000000..9260756 --- /dev/null +++ b/lib/ImGui.NET/Generated/STB_TexteditState.gen.cs @@ -0,0 +1,48 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ImGuiNET +{ + public unsafe partial struct STB_TexteditState + { + public int cursor; + public int select_start; + public int select_end; + public byte insert_mode; + public int row_count_per_page; + public byte cursor_at_end_of_line; + public byte initialized; + public byte has_preferred_x; + public byte single_line; + public byte padding1; + public byte padding2; + public byte padding3; + public float preferred_x; + public StbUndoState undostate; + } + public unsafe partial struct STB_TexteditStatePtr + { + public STB_TexteditState* NativePtr { get; } + public STB_TexteditStatePtr(STB_TexteditState* nativePtr) => NativePtr = nativePtr; + public STB_TexteditStatePtr(IntPtr nativePtr) => NativePtr = (STB_TexteditState*)nativePtr; + public static implicit operator STB_TexteditStatePtr(STB_TexteditState* nativePtr) => new STB_TexteditStatePtr(nativePtr); + public static implicit operator STB_TexteditState* (STB_TexteditStatePtr wrappedPtr) => wrappedPtr.NativePtr; + public static implicit operator STB_TexteditStatePtr(IntPtr nativePtr) => new STB_TexteditStatePtr(nativePtr); + public ref int cursor => ref Unsafe.AsRef(&NativePtr->cursor); + public ref int select_start => ref Unsafe.AsRef(&NativePtr->select_start); + public ref int select_end => ref Unsafe.AsRef(&NativePtr->select_end); + public ref byte insert_mode => ref Unsafe.AsRef(&NativePtr->insert_mode); + public ref int row_count_per_page => ref Unsafe.AsRef(&NativePtr->row_count_per_page); + public ref byte cursor_at_end_of_line => ref Unsafe.AsRef(&NativePtr->cursor_at_end_of_line); + public ref byte initialized => ref Unsafe.AsRef(&NativePtr->initialized); + public ref byte has_preferred_x => ref Unsafe.AsRef(&NativePtr->has_preferred_x); + public ref byte single_line => ref Unsafe.AsRef(&NativePtr->single_line); + public ref byte padding1 => ref Unsafe.AsRef(&NativePtr->padding1); + public ref byte padding2 => ref Unsafe.AsRef(&NativePtr->padding2); + public ref byte padding3 => ref Unsafe.AsRef(&NativePtr->padding3); + public ref float preferred_x => ref Unsafe.AsRef(&NativePtr->preferred_x); + public ref StbUndoState undostate => ref Unsafe.AsRef(&NativePtr->undostate); + } +} diff --git a/lib/ImGui.NET/Generated/StbTexteditRow.gen.cs b/lib/ImGui.NET/Generated/StbTexteditRow.gen.cs new file mode 100644 index 0000000..331edfa --- /dev/null +++ b/lib/ImGui.NET/Generated/StbTexteditRow.gen.cs @@ -0,0 +1,32 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ImGuiNET +{ + public unsafe partial struct StbTexteditRow + { + public float x0; + public float x1; + public float baseline_y_delta; + public float ymin; + public float ymax; + public int num_chars; + } + public unsafe partial struct StbTexteditRowPtr + { + public StbTexteditRow* NativePtr { get; } + public StbTexteditRowPtr(StbTexteditRow* nativePtr) => NativePtr = nativePtr; + public StbTexteditRowPtr(IntPtr nativePtr) => NativePtr = (StbTexteditRow*)nativePtr; + public static implicit operator StbTexteditRowPtr(StbTexteditRow* nativePtr) => new StbTexteditRowPtr(nativePtr); + public static implicit operator StbTexteditRow* (StbTexteditRowPtr wrappedPtr) => wrappedPtr.NativePtr; + public static implicit operator StbTexteditRowPtr(IntPtr nativePtr) => new StbTexteditRowPtr(nativePtr); + public ref float x0 => ref Unsafe.AsRef(&NativePtr->x0); + public ref float x1 => ref Unsafe.AsRef(&NativePtr->x1); + public ref float baseline_y_delta => ref Unsafe.AsRef(&NativePtr->baseline_y_delta); + public ref float ymin => ref Unsafe.AsRef(&NativePtr->ymin); + public ref float ymax => ref Unsafe.AsRef(&NativePtr->ymax); + public ref int num_chars => ref Unsafe.AsRef(&NativePtr->num_chars); + } +} diff --git a/lib/ImGui.NET/Generated/StbUndoRecord.gen.cs b/lib/ImGui.NET/Generated/StbUndoRecord.gen.cs new file mode 100644 index 0000000..78d660f --- /dev/null +++ b/lib/ImGui.NET/Generated/StbUndoRecord.gen.cs @@ -0,0 +1,28 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ImGuiNET +{ + public unsafe partial struct StbUndoRecord + { + public int where; + public int insert_length; + public int delete_length; + public int char_storage; + } + public unsafe partial struct StbUndoRecordPtr + { + public StbUndoRecord* NativePtr { get; } + public StbUndoRecordPtr(StbUndoRecord* nativePtr) => NativePtr = nativePtr; + public StbUndoRecordPtr(IntPtr nativePtr) => NativePtr = (StbUndoRecord*)nativePtr; + public static implicit operator StbUndoRecordPtr(StbUndoRecord* nativePtr) => new StbUndoRecordPtr(nativePtr); + public static implicit operator StbUndoRecord* (StbUndoRecordPtr wrappedPtr) => wrappedPtr.NativePtr; + public static implicit operator StbUndoRecordPtr(IntPtr nativePtr) => new StbUndoRecordPtr(nativePtr); + public ref int where => ref Unsafe.AsRef(&NativePtr->where); + public ref int insert_length => ref Unsafe.AsRef(&NativePtr->insert_length); + public ref int delete_length => ref Unsafe.AsRef(&NativePtr->delete_length); + public ref int char_storage => ref Unsafe.AsRef(&NativePtr->char_storage); + } +} diff --git a/lib/ImGui.NET/Generated/StbUndoState.gen.cs b/lib/ImGui.NET/Generated/StbUndoState.gen.cs new file mode 100644 index 0000000..a8428a6 --- /dev/null +++ b/lib/ImGui.NET/Generated/StbUndoState.gen.cs @@ -0,0 +1,130 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ImGuiNET +{ + public unsafe partial struct StbUndoState + { + public StbUndoRecord undo_rec_0; + public StbUndoRecord undo_rec_1; + public StbUndoRecord undo_rec_2; + public StbUndoRecord undo_rec_3; + public StbUndoRecord undo_rec_4; + public StbUndoRecord undo_rec_5; + public StbUndoRecord undo_rec_6; + public StbUndoRecord undo_rec_7; + public StbUndoRecord undo_rec_8; + public StbUndoRecord undo_rec_9; + public StbUndoRecord undo_rec_10; + public StbUndoRecord undo_rec_11; + public StbUndoRecord undo_rec_12; + public StbUndoRecord undo_rec_13; + public StbUndoRecord undo_rec_14; + public StbUndoRecord undo_rec_15; + public StbUndoRecord undo_rec_16; + public StbUndoRecord undo_rec_17; + public StbUndoRecord undo_rec_18; + public StbUndoRecord undo_rec_19; + public StbUndoRecord undo_rec_20; + public StbUndoRecord undo_rec_21; + public StbUndoRecord undo_rec_22; + public StbUndoRecord undo_rec_23; + public StbUndoRecord undo_rec_24; + public StbUndoRecord undo_rec_25; + public StbUndoRecord undo_rec_26; + public StbUndoRecord undo_rec_27; + public StbUndoRecord undo_rec_28; + public StbUndoRecord undo_rec_29; + public StbUndoRecord undo_rec_30; + public StbUndoRecord undo_rec_31; + public StbUndoRecord undo_rec_32; + public StbUndoRecord undo_rec_33; + public StbUndoRecord undo_rec_34; + public StbUndoRecord undo_rec_35; + public StbUndoRecord undo_rec_36; + public StbUndoRecord undo_rec_37; + public StbUndoRecord undo_rec_38; + public StbUndoRecord undo_rec_39; + public StbUndoRecord undo_rec_40; + public StbUndoRecord undo_rec_41; + public StbUndoRecord undo_rec_42; + public StbUndoRecord undo_rec_43; + public StbUndoRecord undo_rec_44; + public StbUndoRecord undo_rec_45; + public StbUndoRecord undo_rec_46; + public StbUndoRecord undo_rec_47; + public StbUndoRecord undo_rec_48; + public StbUndoRecord undo_rec_49; + public StbUndoRecord undo_rec_50; + public StbUndoRecord undo_rec_51; + public StbUndoRecord undo_rec_52; + public StbUndoRecord undo_rec_53; + public StbUndoRecord undo_rec_54; + public StbUndoRecord undo_rec_55; + public StbUndoRecord undo_rec_56; + public StbUndoRecord undo_rec_57; + public StbUndoRecord undo_rec_58; + public StbUndoRecord undo_rec_59; + public StbUndoRecord undo_rec_60; + public StbUndoRecord undo_rec_61; + public StbUndoRecord undo_rec_62; + public StbUndoRecord undo_rec_63; + public StbUndoRecord undo_rec_64; + public StbUndoRecord undo_rec_65; + public StbUndoRecord undo_rec_66; + public StbUndoRecord undo_rec_67; + public StbUndoRecord undo_rec_68; + public StbUndoRecord undo_rec_69; + public StbUndoRecord undo_rec_70; + public StbUndoRecord undo_rec_71; + public StbUndoRecord undo_rec_72; + public StbUndoRecord undo_rec_73; + public StbUndoRecord undo_rec_74; + public StbUndoRecord undo_rec_75; + public StbUndoRecord undo_rec_76; + public StbUndoRecord undo_rec_77; + public StbUndoRecord undo_rec_78; + public StbUndoRecord undo_rec_79; + public StbUndoRecord undo_rec_80; + public StbUndoRecord undo_rec_81; + public StbUndoRecord undo_rec_82; + public StbUndoRecord undo_rec_83; + public StbUndoRecord undo_rec_84; + public StbUndoRecord undo_rec_85; + public StbUndoRecord undo_rec_86; + public StbUndoRecord undo_rec_87; + public StbUndoRecord undo_rec_88; + public StbUndoRecord undo_rec_89; + public StbUndoRecord undo_rec_90; + public StbUndoRecord undo_rec_91; + public StbUndoRecord undo_rec_92; + public StbUndoRecord undo_rec_93; + public StbUndoRecord undo_rec_94; + public StbUndoRecord undo_rec_95; + public StbUndoRecord undo_rec_96; + public StbUndoRecord undo_rec_97; + public StbUndoRecord undo_rec_98; + public fixed ushort undo_char[999]; + public short undo_point; + public short redo_point; + public int undo_char_point; + public int redo_char_point; + } + public unsafe partial struct StbUndoStatePtr + { + public StbUndoState* NativePtr { get; } + public StbUndoStatePtr(StbUndoState* nativePtr) => NativePtr = nativePtr; + public StbUndoStatePtr(IntPtr nativePtr) => NativePtr = (StbUndoState*)nativePtr; + public static implicit operator StbUndoStatePtr(StbUndoState* nativePtr) => new StbUndoStatePtr(nativePtr); + public static implicit operator StbUndoState* (StbUndoStatePtr wrappedPtr) => wrappedPtr.NativePtr; + public static implicit operator StbUndoStatePtr(IntPtr nativePtr) => new StbUndoStatePtr(nativePtr); + public RangeAccessor undo_rec => new RangeAccessor(&NativePtr->undo_rec_0, 99); + public RangeAccessor undo_char => new RangeAccessor(NativePtr->undo_char, 999); + public ref short undo_point => ref Unsafe.AsRef(&NativePtr->undo_point); + public ref short redo_point => ref Unsafe.AsRef(&NativePtr->redo_point); + public ref int undo_char_point => ref Unsafe.AsRef(&NativePtr->undo_char_point); + public ref int redo_char_point => ref Unsafe.AsRef(&NativePtr->redo_char_point); + } +} diff --git a/lib/ImGui.NET/ImGui.Manual.ReadOnlySpan.cs b/lib/ImGui.NET/ImGui.Manual.ReadOnlySpan.cs new file mode 100644 index 0000000..ca2b333 --- /dev/null +++ b/lib/ImGui.NET/ImGui.Manual.ReadOnlySpan.cs @@ -0,0 +1,485 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; + +// NOTE: +// This is a direct copy from ImGui.Manual.cs with all string parameters (not ref string) changed to ReadOnlySpan. +// This is far from ideal right now, maybe we could update the generator to do this for us. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER +namespace ImGuiNET +{ + public static unsafe partial class ImGui + { + public static bool InputText( + ReadOnlySpan label, + byte[] buf, + uint buf_size) + { + return InputText(label, buf, buf_size, 0, null, IntPtr.Zero); + } + + public static bool InputText( + ReadOnlySpan label, + byte[] buf, + uint buf_size, + ImGuiInputTextFlags flags) + { + return InputText(label, buf, buf_size, flags, null, IntPtr.Zero); + } + + public static bool InputText( + ReadOnlySpan label, + byte[] buf, + uint buf_size, + ImGuiInputTextFlags flags, + ImGuiInputTextCallback callback) + { + return InputText(label, buf, buf_size, flags, callback, IntPtr.Zero); + } + + public static bool InputText( + ReadOnlySpan label, + byte[] buf, + uint buf_size, + ImGuiInputTextFlags flags, + ImGuiInputTextCallback callback, + IntPtr user_data) + { + int utf8LabelByteCount = Encoding.UTF8.GetByteCount(label); + byte* utf8LabelBytes; + if (utf8LabelByteCount > Util.StackAllocationSizeLimit) + { + utf8LabelBytes = Util.Allocate(utf8LabelByteCount + 1); + } + else + { + byte* stackPtr = stackalloc byte[utf8LabelByteCount + 1]; + utf8LabelBytes = stackPtr; + } + Util.GetUtf8(label, utf8LabelBytes, utf8LabelByteCount); + + bool ret; + fixed (byte* bufPtr = buf) + { + ret = ImGuiNative.igInputText(utf8LabelBytes, bufPtr, buf_size, flags, callback, user_data.ToPointer()) != 0; + } + + if (utf8LabelByteCount > Util.StackAllocationSizeLimit) + { + Util.Free(utf8LabelBytes); + } + + return ret; + } + + public static bool InputText( + ReadOnlySpan label, + ref string input, + uint maxLength) => InputText(label, ref input, maxLength, 0, null, IntPtr.Zero); + + public static bool InputText( + ReadOnlySpan label, + ref string input, + uint maxLength, + ImGuiInputTextFlags flags) => InputText(label, ref input, maxLength, flags, null, IntPtr.Zero); + + public static bool InputText( + ReadOnlySpan label, + ref string input, + uint maxLength, + ImGuiInputTextFlags flags, + ImGuiInputTextCallback callback) => InputText(label, ref input, maxLength, flags, callback, IntPtr.Zero); + + public static bool InputText( + ReadOnlySpan label, + ref string input, + uint maxLength, + ImGuiInputTextFlags flags, + ImGuiInputTextCallback callback, + IntPtr user_data) + { + int utf8LabelByteCount = Encoding.UTF8.GetByteCount(label); + byte* utf8LabelBytes; + if (utf8LabelByteCount > Util.StackAllocationSizeLimit) + { + utf8LabelBytes = Util.Allocate(utf8LabelByteCount + 1); + } + else + { + byte* stackPtr = stackalloc byte[utf8LabelByteCount + 1]; + utf8LabelBytes = stackPtr; + } + Util.GetUtf8(label, utf8LabelBytes, utf8LabelByteCount); + + int utf8InputByteCount = Encoding.UTF8.GetByteCount(input); + int inputBufSize = Math.Max((int)maxLength + 1, utf8InputByteCount + 1); + + byte* utf8InputBytes; + byte* originalUtf8InputBytes; + if (inputBufSize > Util.StackAllocationSizeLimit) + { + utf8InputBytes = Util.Allocate(inputBufSize); + originalUtf8InputBytes = Util.Allocate(inputBufSize); + } + else + { + byte* inputStackBytes = stackalloc byte[inputBufSize]; + utf8InputBytes = inputStackBytes; + byte* originalInputStackBytes = stackalloc byte[inputBufSize]; + originalUtf8InputBytes = originalInputStackBytes; + } + Util.GetUtf8(input, utf8InputBytes, inputBufSize); + uint clearBytesCount = (uint)(inputBufSize - utf8InputByteCount); + Unsafe.InitBlockUnaligned(utf8InputBytes + utf8InputByteCount, 0, clearBytesCount); + Unsafe.CopyBlock(originalUtf8InputBytes, utf8InputBytes, (uint)inputBufSize); + + byte result = ImGuiNative.igInputText( + utf8LabelBytes, + utf8InputBytes, + (uint)inputBufSize, + flags, + callback, + user_data.ToPointer()); + if (!Util.AreStringsEqual(originalUtf8InputBytes, inputBufSize, utf8InputBytes)) + { + input = Util.StringFromPtr(utf8InputBytes); + } + + if (utf8LabelByteCount > Util.StackAllocationSizeLimit) + { + Util.Free(utf8LabelBytes); + } + if (inputBufSize > Util.StackAllocationSizeLimit) + { + Util.Free(utf8InputBytes); + Util.Free(originalUtf8InputBytes); + } + + return result != 0; + } + + public static bool InputTextMultiline( + ReadOnlySpan label, + ref string input, + uint maxLength, + Vector2 size) => InputTextMultiline(label, ref input, maxLength, size, 0, null, IntPtr.Zero); + + public static bool InputTextMultiline( + ReadOnlySpan label, + ref string input, + uint maxLength, + Vector2 size, + ImGuiInputTextFlags flags) => InputTextMultiline(label, ref input, maxLength, size, flags, null, IntPtr.Zero); + + public static bool InputTextMultiline( + ReadOnlySpan label, + ref string input, + uint maxLength, + Vector2 size, + ImGuiInputTextFlags flags, + ImGuiInputTextCallback callback) => InputTextMultiline(label, ref input, maxLength, size, flags, callback, IntPtr.Zero); + + public static bool InputTextMultiline( + ReadOnlySpan label, + ref string input, + uint maxLength, + Vector2 size, + ImGuiInputTextFlags flags, + ImGuiInputTextCallback callback, + IntPtr user_data) + { + int utf8LabelByteCount = Encoding.UTF8.GetByteCount(label); + byte* utf8LabelBytes; + if (utf8LabelByteCount > Util.StackAllocationSizeLimit) + { + utf8LabelBytes = Util.Allocate(utf8LabelByteCount + 1); + } + else + { + byte* stackPtr = stackalloc byte[utf8LabelByteCount + 1]; + utf8LabelBytes = stackPtr; + } + Util.GetUtf8(label, utf8LabelBytes, utf8LabelByteCount); + + int utf8InputByteCount = Encoding.UTF8.GetByteCount(input); + int inputBufSize = Math.Max((int)maxLength + 1, utf8InputByteCount + 1); + + byte* utf8InputBytes; + byte* originalUtf8InputBytes; + if (inputBufSize > Util.StackAllocationSizeLimit) + { + utf8InputBytes = Util.Allocate(inputBufSize); + originalUtf8InputBytes = Util.Allocate(inputBufSize); + } + else + { + byte* inputStackBytes = stackalloc byte[inputBufSize]; + utf8InputBytes = inputStackBytes; + byte* originalInputStackBytes = stackalloc byte[inputBufSize]; + originalUtf8InputBytes = originalInputStackBytes; + } + Util.GetUtf8(input, utf8InputBytes, inputBufSize); + uint clearBytesCount = (uint)(inputBufSize - utf8InputByteCount); + Unsafe.InitBlockUnaligned(utf8InputBytes + utf8InputByteCount, 0, clearBytesCount); + Unsafe.CopyBlock(originalUtf8InputBytes, utf8InputBytes, (uint)inputBufSize); + + byte result = ImGuiNative.igInputTextMultiline( + utf8LabelBytes, + utf8InputBytes, + (uint)inputBufSize, + size, + flags, + callback, + user_data.ToPointer()); + if (!Util.AreStringsEqual(originalUtf8InputBytes, inputBufSize, utf8InputBytes)) + { + input = Util.StringFromPtr(utf8InputBytes); + } + + if (utf8LabelByteCount > Util.StackAllocationSizeLimit) + { + Util.Free(utf8LabelBytes); + } + if (inputBufSize > Util.StackAllocationSizeLimit) + { + Util.Free(utf8InputBytes); + Util.Free(originalUtf8InputBytes); + } + + return result != 0; + } + + public static bool InputTextWithHint( + ReadOnlySpan label, + ReadOnlySpan hint, + ref string input, + uint maxLength) => InputTextWithHint(label, hint, ref input, maxLength, 0, null, IntPtr.Zero); + + public static bool InputTextWithHint( + ReadOnlySpan label, + ReadOnlySpan hint, + ref string input, + uint maxLength, + ImGuiInputTextFlags flags) => InputTextWithHint(label, hint, ref input, maxLength, flags, null, IntPtr.Zero); + + public static bool InputTextWithHint( + ReadOnlySpan label, + ReadOnlySpan hint, + ref string input, + uint maxLength, + ImGuiInputTextFlags flags, + ImGuiInputTextCallback callback) => InputTextWithHint(label, hint, ref input, maxLength, flags, callback, IntPtr.Zero); + + public static bool InputTextWithHint( + ReadOnlySpan label, + ReadOnlySpan hint, + ref string input, + uint maxLength, + ImGuiInputTextFlags flags, + ImGuiInputTextCallback callback, + IntPtr user_data) + { + int utf8LabelByteCount = Encoding.UTF8.GetByteCount(label); + byte* utf8LabelBytes; + if (utf8LabelByteCount > Util.StackAllocationSizeLimit) + { + utf8LabelBytes = Util.Allocate(utf8LabelByteCount + 1); + } + else + { + byte* stackPtr = stackalloc byte[utf8LabelByteCount + 1]; + utf8LabelBytes = stackPtr; + } + Util.GetUtf8(label, utf8LabelBytes, utf8LabelByteCount); + + int utf8HintByteCount = Encoding.UTF8.GetByteCount(hint); + byte* utf8HintBytes; + if (utf8HintByteCount > Util.StackAllocationSizeLimit) + { + utf8HintBytes = Util.Allocate(utf8HintByteCount + 1); + } + else + { + byte* stackPtr = stackalloc byte[utf8HintByteCount + 1]; + utf8HintBytes = stackPtr; + } + Util.GetUtf8(hint, utf8HintBytes, utf8HintByteCount); + + int utf8InputByteCount = Encoding.UTF8.GetByteCount(input); + int inputBufSize = Math.Max((int)maxLength + 1, utf8InputByteCount + 1); + + byte* utf8InputBytes; + byte* originalUtf8InputBytes; + if (inputBufSize > Util.StackAllocationSizeLimit) + { + utf8InputBytes = Util.Allocate(inputBufSize); + originalUtf8InputBytes = Util.Allocate(inputBufSize); + } + else + { + byte* inputStackBytes = stackalloc byte[inputBufSize]; + utf8InputBytes = inputStackBytes; + byte* originalInputStackBytes = stackalloc byte[inputBufSize]; + originalUtf8InputBytes = originalInputStackBytes; + } + Util.GetUtf8(input, utf8InputBytes, inputBufSize); + uint clearBytesCount = (uint)(inputBufSize - utf8InputByteCount); + Unsafe.InitBlockUnaligned(utf8InputBytes + utf8InputByteCount, 0, clearBytesCount); + Unsafe.CopyBlock(originalUtf8InputBytes, utf8InputBytes, (uint)inputBufSize); + + byte result = ImGuiNative.igInputTextWithHint( + utf8LabelBytes, + utf8HintBytes, + utf8InputBytes, + (uint)inputBufSize, + flags, + callback, + user_data.ToPointer()); + if (!Util.AreStringsEqual(originalUtf8InputBytes, inputBufSize, utf8InputBytes)) + { + input = Util.StringFromPtr(utf8InputBytes); + } + + if (utf8LabelByteCount > Util.StackAllocationSizeLimit) + { + Util.Free(utf8LabelBytes); + } + if (utf8HintByteCount > Util.StackAllocationSizeLimit) + { + Util.Free(utf8HintBytes); + } + if (inputBufSize > Util.StackAllocationSizeLimit) + { + Util.Free(utf8InputBytes); + Util.Free(originalUtf8InputBytes); + } + + return result != 0; + } + + public static Vector2 CalcTextSize(ReadOnlySpan text, int start) + => CalcTextSizeImpl(text, start); + + public static Vector2 CalcTextSize(ReadOnlySpan text, float wrapWidth) + => CalcTextSizeImpl(text, wrapWidth: wrapWidth); + + public static Vector2 CalcTextSize(ReadOnlySpan text, int start, int length) + => CalcTextSizeImpl(text, start, length); + + public static Vector2 CalcTextSize(ReadOnlySpan text, int start, bool hideTextAfterDoubleHash) + => CalcTextSizeImpl(text, start, hideTextAfterDoubleHash: hideTextAfterDoubleHash); + + public static Vector2 CalcTextSize(ReadOnlySpan text, int start, float wrapWidth) + => CalcTextSizeImpl(text, start, wrapWidth: wrapWidth); + + public static Vector2 CalcTextSize(ReadOnlySpan text, int start, int length, bool hideTextAfterDoubleHash) + => CalcTextSizeImpl(text, start, length, hideTextAfterDoubleHash); + + public static Vector2 CalcTextSize(ReadOnlySpan text, int start, int length, float wrapWidth) + => CalcTextSizeImpl(text, start, length, wrapWidth: wrapWidth); + + public static Vector2 CalcTextSize(ReadOnlySpan text, int start, int length, bool hideTextAfterDoubleHash, float wrapWidth) + => CalcTextSizeImpl(text, start, length, hideTextAfterDoubleHash, wrapWidth); + + private static Vector2 CalcTextSizeImpl( + ReadOnlySpan text, + int start = 0, + int? length = null, + bool hideTextAfterDoubleHash = false, + float wrapWidth = -1.0f) + { + return CalcTextSize(text.Slice(start, length ?? text.Length-start), hideTextAfterDoubleHash, wrapWidth); + } + + public static bool InputText( + ReadOnlySpan label, + IntPtr buf, + uint buf_size) + { + return InputText(label, buf, buf_size, 0, null, IntPtr.Zero); + } + + public static bool InputText( + ReadOnlySpan label, + IntPtr buf, + uint buf_size, + ImGuiInputTextFlags flags) + { + return InputText(label, buf, buf_size, flags, null, IntPtr.Zero); + } + + public static bool InputText( + ReadOnlySpan label, + IntPtr buf, + uint buf_size, + ImGuiInputTextFlags flags, + ImGuiInputTextCallback callback) + { + return InputText(label, buf, buf_size, flags, callback, IntPtr.Zero); + } + + public static bool InputText( + ReadOnlySpan label, + IntPtr buf, + uint buf_size, + ImGuiInputTextFlags flags, + ImGuiInputTextCallback callback, + IntPtr user_data) + { + int utf8LabelByteCount = Encoding.UTF8.GetByteCount(label); + byte* utf8LabelBytes; + if (utf8LabelByteCount > Util.StackAllocationSizeLimit) + { + utf8LabelBytes = Util.Allocate(utf8LabelByteCount + 1); + } + else + { + byte* stackPtr = stackalloc byte[utf8LabelByteCount + 1]; + utf8LabelBytes = stackPtr; + } + Util.GetUtf8(label, utf8LabelBytes, utf8LabelByteCount); + + bool ret = ImGuiNative.igInputText(utf8LabelBytes, (byte*)buf.ToPointer(), buf_size, flags, callback, user_data.ToPointer()) != 0; + + if (utf8LabelByteCount > Util.StackAllocationSizeLimit) + { + Util.Free(utf8LabelBytes); + } + + return ret; + } + + public static bool Begin(ReadOnlySpan name, ImGuiWindowFlags flags) + { + int utf8NameByteCount = Encoding.UTF8.GetByteCount(name); + byte* utf8NameBytes; + if (utf8NameByteCount > Util.StackAllocationSizeLimit) + { + utf8NameBytes = Util.Allocate(utf8NameByteCount + 1); + } + else + { + byte* stackPtr = stackalloc byte[utf8NameByteCount + 1]; + utf8NameBytes = stackPtr; + } + Util.GetUtf8(name, utf8NameBytes, utf8NameByteCount); + + byte* p_open = null; + byte ret = ImGuiNative.igBegin(utf8NameBytes, p_open, flags); + + if (utf8NameByteCount > Util.StackAllocationSizeLimit) + { + Util.Free(utf8NameBytes); + } + + return ret != 0; + } + + public static bool MenuItem(ReadOnlySpan label, bool enabled) + { + return MenuItem(label, string.Empty, false, enabled); + } + } +} +#endif diff --git a/lib/ImGui.NET/ImGui.Manual.cs b/lib/ImGui.NET/ImGui.Manual.cs new file mode 100644 index 0000000..d47d1c7 --- /dev/null +++ b/lib/ImGui.NET/ImGui.Manual.cs @@ -0,0 +1,481 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; + +namespace ImGuiNET +{ + public static unsafe partial class ImGui + { + public static bool InputText( + string label, + byte[] buf, + uint buf_size) + { + return InputText(label, buf, buf_size, 0, null, IntPtr.Zero); + } + + public static bool InputText( + string label, + byte[] buf, + uint buf_size, + ImGuiInputTextFlags flags) + { + return InputText(label, buf, buf_size, flags, null, IntPtr.Zero); + } + + public static bool InputText( + string label, + byte[] buf, + uint buf_size, + ImGuiInputTextFlags flags, + ImGuiInputTextCallback callback) + { + return InputText(label, buf, buf_size, flags, callback, IntPtr.Zero); + } + + public static bool InputText( + string label, + byte[] buf, + uint buf_size, + ImGuiInputTextFlags flags, + ImGuiInputTextCallback callback, + IntPtr user_data) + { + int utf8LabelByteCount = Encoding.UTF8.GetByteCount(label); + byte* utf8LabelBytes; + if (utf8LabelByteCount > Util.StackAllocationSizeLimit) + { + utf8LabelBytes = Util.Allocate(utf8LabelByteCount + 1); + } + else + { + byte* stackPtr = stackalloc byte[utf8LabelByteCount + 1]; + utf8LabelBytes = stackPtr; + } + Util.GetUtf8(label, utf8LabelBytes, utf8LabelByteCount); + + bool ret; + fixed (byte* bufPtr = buf) + { + ret = ImGuiNative.igInputText(utf8LabelBytes, bufPtr, buf_size, flags, callback, user_data.ToPointer()) != 0; + } + + if (utf8LabelByteCount > Util.StackAllocationSizeLimit) + { + Util.Free(utf8LabelBytes); + } + + return ret; + } + + public static bool InputText( + string label, + ref string input, + uint maxLength) => InputText(label, ref input, maxLength, 0, null, IntPtr.Zero); + + public static bool InputText( + string label, + ref string input, + uint maxLength, + ImGuiInputTextFlags flags) => InputText(label, ref input, maxLength, flags, null, IntPtr.Zero); + + public static bool InputText( + string label, + ref string input, + uint maxLength, + ImGuiInputTextFlags flags, + ImGuiInputTextCallback callback) => InputText(label, ref input, maxLength, flags, callback, IntPtr.Zero); + + public static bool InputText( + string label, + ref string input, + uint maxLength, + ImGuiInputTextFlags flags, + ImGuiInputTextCallback callback, + IntPtr user_data) + { + int utf8LabelByteCount = Encoding.UTF8.GetByteCount(label); + byte* utf8LabelBytes; + if (utf8LabelByteCount > Util.StackAllocationSizeLimit) + { + utf8LabelBytes = Util.Allocate(utf8LabelByteCount + 1); + } + else + { + byte* stackPtr = stackalloc byte[utf8LabelByteCount + 1]; + utf8LabelBytes = stackPtr; + } + Util.GetUtf8(label, utf8LabelBytes, utf8LabelByteCount); + + int utf8InputByteCount = Encoding.UTF8.GetByteCount(input); + int inputBufSize = Math.Max((int)maxLength + 1, utf8InputByteCount + 1); + + byte* utf8InputBytes; + byte* originalUtf8InputBytes; + if (inputBufSize > Util.StackAllocationSizeLimit) + { + utf8InputBytes = Util.Allocate(inputBufSize); + originalUtf8InputBytes = Util.Allocate(inputBufSize); + } + else + { + byte* inputStackBytes = stackalloc byte[inputBufSize]; + utf8InputBytes = inputStackBytes; + byte* originalInputStackBytes = stackalloc byte[inputBufSize]; + originalUtf8InputBytes = originalInputStackBytes; + } + Util.GetUtf8(input, utf8InputBytes, inputBufSize); + uint clearBytesCount = (uint)(inputBufSize - utf8InputByteCount); + Unsafe.InitBlockUnaligned(utf8InputBytes + utf8InputByteCount, 0, clearBytesCount); + Unsafe.CopyBlock(originalUtf8InputBytes, utf8InputBytes, (uint)inputBufSize); + + byte result = ImGuiNative.igInputText( + utf8LabelBytes, + utf8InputBytes, + (uint)inputBufSize, + flags, + callback, + user_data.ToPointer()); + if (!Util.AreStringsEqual(originalUtf8InputBytes, inputBufSize, utf8InputBytes)) + { + input = Util.StringFromPtr(utf8InputBytes); + } + + if (utf8LabelByteCount > Util.StackAllocationSizeLimit) + { + Util.Free(utf8LabelBytes); + } + if (inputBufSize > Util.StackAllocationSizeLimit) + { + Util.Free(utf8InputBytes); + Util.Free(originalUtf8InputBytes); + } + + return result != 0; + } + + public static bool InputTextMultiline( + string label, + ref string input, + uint maxLength, + Vector2 size) => InputTextMultiline(label, ref input, maxLength, size, 0, null, IntPtr.Zero); + + public static bool InputTextMultiline( + string label, + ref string input, + uint maxLength, + Vector2 size, + ImGuiInputTextFlags flags) => InputTextMultiline(label, ref input, maxLength, size, flags, null, IntPtr.Zero); + + public static bool InputTextMultiline( + string label, + ref string input, + uint maxLength, + Vector2 size, + ImGuiInputTextFlags flags, + ImGuiInputTextCallback callback) => InputTextMultiline(label, ref input, maxLength, size, flags, callback, IntPtr.Zero); + + public static bool InputTextMultiline( + string label, + ref string input, + uint maxLength, + Vector2 size, + ImGuiInputTextFlags flags, + ImGuiInputTextCallback callback, + IntPtr user_data) + { + int utf8LabelByteCount = Encoding.UTF8.GetByteCount(label); + byte* utf8LabelBytes; + if (utf8LabelByteCount > Util.StackAllocationSizeLimit) + { + utf8LabelBytes = Util.Allocate(utf8LabelByteCount + 1); + } + else + { + byte* stackPtr = stackalloc byte[utf8LabelByteCount + 1]; + utf8LabelBytes = stackPtr; + } + Util.GetUtf8(label, utf8LabelBytes, utf8LabelByteCount); + + int utf8InputByteCount = Encoding.UTF8.GetByteCount(input); + int inputBufSize = Math.Max((int)maxLength + 1, utf8InputByteCount + 1); + + byte* utf8InputBytes; + byte* originalUtf8InputBytes; + if (inputBufSize > Util.StackAllocationSizeLimit) + { + utf8InputBytes = Util.Allocate(inputBufSize); + originalUtf8InputBytes = Util.Allocate(inputBufSize); + } + else + { + byte* inputStackBytes = stackalloc byte[inputBufSize]; + utf8InputBytes = inputStackBytes; + byte* originalInputStackBytes = stackalloc byte[inputBufSize]; + originalUtf8InputBytes = originalInputStackBytes; + } + Util.GetUtf8(input, utf8InputBytes, inputBufSize); + uint clearBytesCount = (uint)(inputBufSize - utf8InputByteCount); + Unsafe.InitBlockUnaligned(utf8InputBytes + utf8InputByteCount, 0, clearBytesCount); + Unsafe.CopyBlock(originalUtf8InputBytes, utf8InputBytes, (uint)inputBufSize); + + byte result = ImGuiNative.igInputTextMultiline( + utf8LabelBytes, + utf8InputBytes, + (uint)inputBufSize, + size, + flags, + callback, + user_data.ToPointer()); + if (!Util.AreStringsEqual(originalUtf8InputBytes, inputBufSize, utf8InputBytes)) + { + input = Util.StringFromPtr(utf8InputBytes); + } + + if (utf8LabelByteCount > Util.StackAllocationSizeLimit) + { + Util.Free(utf8LabelBytes); + } + if (inputBufSize > Util.StackAllocationSizeLimit) + { + Util.Free(utf8InputBytes); + Util.Free(originalUtf8InputBytes); + } + + return result != 0; + } + + public static bool InputTextWithHint( + string label, + string hint, + ref string input, + uint maxLength) => InputTextWithHint(label, hint, ref input, maxLength, 0, null, IntPtr.Zero); + + public static bool InputTextWithHint( + string label, + string hint, + ref string input, + uint maxLength, + ImGuiInputTextFlags flags) => InputTextWithHint(label, hint, ref input, maxLength, flags, null, IntPtr.Zero); + + public static bool InputTextWithHint( + string label, + string hint, + ref string input, + uint maxLength, + ImGuiInputTextFlags flags, + ImGuiInputTextCallback callback) => InputTextWithHint(label, hint, ref input, maxLength, flags, callback, IntPtr.Zero); + + public static bool InputTextWithHint( + string label, + string hint, + ref string input, + uint maxLength, + ImGuiInputTextFlags flags, + ImGuiInputTextCallback callback, + IntPtr user_data) + { + int utf8LabelByteCount = Encoding.UTF8.GetByteCount(label); + byte* utf8LabelBytes; + if (utf8LabelByteCount > Util.StackAllocationSizeLimit) + { + utf8LabelBytes = Util.Allocate(utf8LabelByteCount + 1); + } + else + { + byte* stackPtr = stackalloc byte[utf8LabelByteCount + 1]; + utf8LabelBytes = stackPtr; + } + Util.GetUtf8(label, utf8LabelBytes, utf8LabelByteCount); + + int utf8HintByteCount = Encoding.UTF8.GetByteCount(hint); + byte* utf8HintBytes; + if (utf8HintByteCount > Util.StackAllocationSizeLimit) + { + utf8HintBytes = Util.Allocate(utf8HintByteCount + 1); + } + else + { + byte* stackPtr = stackalloc byte[utf8HintByteCount + 1]; + utf8HintBytes = stackPtr; + } + Util.GetUtf8(hint, utf8HintBytes, utf8HintByteCount); + + int utf8InputByteCount = Encoding.UTF8.GetByteCount(input); + int inputBufSize = Math.Max((int)maxLength + 1, utf8InputByteCount + 1); + + byte* utf8InputBytes; + byte* originalUtf8InputBytes; + if (inputBufSize > Util.StackAllocationSizeLimit) + { + utf8InputBytes = Util.Allocate(inputBufSize); + originalUtf8InputBytes = Util.Allocate(inputBufSize); + } + else + { + byte* inputStackBytes = stackalloc byte[inputBufSize]; + utf8InputBytes = inputStackBytes; + byte* originalInputStackBytes = stackalloc byte[inputBufSize]; + originalUtf8InputBytes = originalInputStackBytes; + } + Util.GetUtf8(input, utf8InputBytes, inputBufSize); + uint clearBytesCount = (uint)(inputBufSize - utf8InputByteCount); + Unsafe.InitBlockUnaligned(utf8InputBytes + utf8InputByteCount, 0, clearBytesCount); + Unsafe.CopyBlock(originalUtf8InputBytes, utf8InputBytes, (uint)inputBufSize); + + byte result = ImGuiNative.igInputTextWithHint( + utf8LabelBytes, + utf8HintBytes, + utf8InputBytes, + (uint)inputBufSize, + flags, + callback, + user_data.ToPointer()); + if (!Util.AreStringsEqual(originalUtf8InputBytes, inputBufSize, utf8InputBytes)) + { + input = Util.StringFromPtr(utf8InputBytes); + } + + if (utf8LabelByteCount > Util.StackAllocationSizeLimit) + { + Util.Free(utf8LabelBytes); + } + if (utf8HintByteCount > Util.StackAllocationSizeLimit) + { + Util.Free(utf8HintBytes); + } + if (inputBufSize > Util.StackAllocationSizeLimit) + { + Util.Free(utf8InputBytes); + Util.Free(originalUtf8InputBytes); + } + + return result != 0; + } + + public static Vector2 CalcTextSize(string text, int start) + => CalcTextSizeImpl(text, start); + + public static Vector2 CalcTextSize(string text, float wrapWidth) + => CalcTextSizeImpl(text, wrapWidth: wrapWidth); + + public static Vector2 CalcTextSize(string text, int start, int length) + => CalcTextSizeImpl(text, start, length); + + public static Vector2 CalcTextSize(string text, int start, bool hideTextAfterDoubleHash) + => CalcTextSizeImpl(text, start, hideTextAfterDoubleHash: hideTextAfterDoubleHash); + + public static Vector2 CalcTextSize(string text, int start, float wrapWidth) + => CalcTextSizeImpl(text, start, wrapWidth: wrapWidth); + + public static Vector2 CalcTextSize(string text, int start, int length, bool hideTextAfterDoubleHash) + => CalcTextSizeImpl(text, start, length, hideTextAfterDoubleHash); + + public static Vector2 CalcTextSize(string text, int start, int length, float wrapWidth) + => CalcTextSizeImpl(text, start, length, wrapWidth: wrapWidth); + + public static Vector2 CalcTextSize(string text, int start, int length, bool hideTextAfterDoubleHash, float wrapWidth) + => CalcTextSizeImpl(text, start, length, hideTextAfterDoubleHash, wrapWidth); + + private static Vector2 CalcTextSizeImpl( + string text, + int start = 0, + int? length = null, + bool hideTextAfterDoubleHash = false, + float wrapWidth = -1.0f) + { + return CalcTextSize(text.Substring(start, length ?? text.Length-start), hideTextAfterDoubleHash, wrapWidth); + } + + public static bool InputText( + string label, + IntPtr buf, + uint buf_size) + { + return InputText(label, buf, buf_size, 0, null, IntPtr.Zero); + } + + public static bool InputText( + string label, + IntPtr buf, + uint buf_size, + ImGuiInputTextFlags flags) + { + return InputText(label, buf, buf_size, flags, null, IntPtr.Zero); + } + + public static bool InputText( + string label, + IntPtr buf, + uint buf_size, + ImGuiInputTextFlags flags, + ImGuiInputTextCallback callback) + { + return InputText(label, buf, buf_size, flags, callback, IntPtr.Zero); + } + + public static bool InputText( + string label, + IntPtr buf, + uint buf_size, + ImGuiInputTextFlags flags, + ImGuiInputTextCallback callback, + IntPtr user_data) + { + int utf8LabelByteCount = Encoding.UTF8.GetByteCount(label); + byte* utf8LabelBytes; + if (utf8LabelByteCount > Util.StackAllocationSizeLimit) + { + utf8LabelBytes = Util.Allocate(utf8LabelByteCount + 1); + } + else + { + byte* stackPtr = stackalloc byte[utf8LabelByteCount + 1]; + utf8LabelBytes = stackPtr; + } + Util.GetUtf8(label, utf8LabelBytes, utf8LabelByteCount); + + bool ret = ImGuiNative.igInputText(utf8LabelBytes, (byte*)buf.ToPointer(), buf_size, flags, callback, user_data.ToPointer()) != 0; + + if (utf8LabelByteCount > Util.StackAllocationSizeLimit) + { + Util.Free(utf8LabelBytes); + } + + return ret; + } + + public static bool Begin(string name, ImGuiWindowFlags flags) + { + int utf8NameByteCount = Encoding.UTF8.GetByteCount(name); + byte* utf8NameBytes; + if (utf8NameByteCount > Util.StackAllocationSizeLimit) + { + utf8NameBytes = Util.Allocate(utf8NameByteCount + 1); + } + else + { + byte* stackPtr = stackalloc byte[utf8NameByteCount + 1]; + utf8NameBytes = stackPtr; + } + Util.GetUtf8(name, utf8NameBytes, utf8NameByteCount); + + byte* p_open = null; + byte ret = ImGuiNative.igBegin(utf8NameBytes, p_open, flags); + + if (utf8NameByteCount > Util.StackAllocationSizeLimit) + { + Util.Free(utf8NameBytes); + } + + return ret != 0; + } + + public static bool MenuItem(string label, bool enabled) + { + return MenuItem(label, string.Empty, false, enabled); + } + } +} diff --git a/lib/ImGui.NET/ImGui.NET.csproj b/lib/ImGui.NET/ImGui.NET.csproj new file mode 100644 index 0000000..a4ff2a1 --- /dev/null +++ b/lib/ImGui.NET/ImGui.NET.csproj @@ -0,0 +1,60 @@ + + + A .NET wrapper for the Dear ImGui library. + 1.90.0.1 + Eric Mellino + netstandard2.0;net6.0 + true + portable + ImGui.NET + ImGui.NET + + $(AssemblyVersion)$(PackagePrereleaseIdentifier) + ImGui ImGui.NET Immediate Mode GUI + https://github.com/mellinoe/imgui.net + $(OutputPath)\ImGui.NET.xml + ImGuiNET + + + + + + + + + <_Parameter1>ImPlot.NET + + + <_Parameter1>ImNodes.NET + + + + + runtimes/win-x86/native + true + + + runtimes/win-x64/native + true + + + runtimes/win-arm64/native + true + + + runtimes/linux-x64/native/libcimgui.so + true + + + runtimes/osx/native/libcimgui.dylib + true + + + build/net40/ImGui.NET.targets + true + + + + + + diff --git a/lib/ImGui.NET/ImGuiNative.Manual.cs b/lib/ImGui.NET/ImGuiNative.Manual.cs new file mode 100644 index 0000000..be8cbdc --- /dev/null +++ b/lib/ImGui.NET/ImGuiNative.Manual.cs @@ -0,0 +1,13 @@ +using System; +using System.Runtime.InteropServices; + +namespace ImGuiNET +{ + public static unsafe partial class ImGuiNative + { + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiPlatformIO_Set_Platform_GetWindowPos(ImGuiPlatformIO* platform_io, IntPtr funcPtr); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void ImGuiPlatformIO_Set_Platform_GetWindowSize(ImGuiPlatformIO* platform_io, IntPtr funcPtr); + } +} diff --git a/lib/ImGui.NET/ImGuiSizeCallback.cs b/lib/ImGui.NET/ImGuiSizeCallback.cs new file mode 100644 index 0000000..b70ebca --- /dev/null +++ b/lib/ImGui.NET/ImGuiSizeCallback.cs @@ -0,0 +1,4 @@ +namespace ImGuiNET +{ + public unsafe delegate void ImGuiSizeCallback(ImGuiSizeCallbackData* data); +} diff --git a/lib/ImGui.NET/ImGuiTextEditCallback.cs b/lib/ImGui.NET/ImGuiTextEditCallback.cs new file mode 100644 index 0000000..4c67dcc --- /dev/null +++ b/lib/ImGui.NET/ImGuiTextEditCallback.cs @@ -0,0 +1,7 @@ +using System.Runtime.InteropServices; + +namespace ImGuiNET +{ + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public unsafe delegate int ImGuiInputTextCallback(ImGuiInputTextCallbackData* data); +} diff --git a/lib/ImGui.NET/ImVector.cs b/lib/ImGui.NET/ImVector.cs new file mode 100644 index 0000000..22a51a6 --- /dev/null +++ b/lib/ImGui.NET/ImVector.cs @@ -0,0 +1,82 @@ +using System; +using System.Runtime.CompilerServices; + +namespace ImGuiNET +{ + public unsafe struct ImVector + { + public readonly int Size; + public readonly int Capacity; + public readonly IntPtr Data; + + public ImVector(int size, int capacity, IntPtr data) + { + Size = size; + Capacity = capacity; + Data = data; + } + + public ref T Ref(int index) + { + return ref Unsafe.AsRef((byte*)Data + index * Unsafe.SizeOf()); + } + + public IntPtr Address(int index) + { + return (IntPtr)((byte*)Data + index * Unsafe.SizeOf()); + } + } + + public unsafe struct ImVector + { + public readonly int Size; + public readonly int Capacity; + public readonly IntPtr Data; + + public ImVector(ImVector vector) + { + Size = vector.Size; + Capacity = vector.Capacity; + Data = vector.Data; + } + + public ImVector(int size, int capacity, IntPtr data) + { + Size = size; + Capacity = capacity; + Data = data; + } + + public ref T this[int index] => ref Unsafe.AsRef((byte*)Data + index * Unsafe.SizeOf()); + } + + public unsafe struct ImPtrVector + { + public readonly int Size; + public readonly int Capacity; + public readonly IntPtr Data; + private readonly int _stride; + + public ImPtrVector(ImVector vector, int stride) + : this(vector.Size, vector.Capacity, vector.Data, stride) + { } + + public ImPtrVector(int size, int capacity, IntPtr data, int stride) + { + Size = size; + Capacity = capacity; + Data = data; + _stride = stride; + } + + public T this[int index] + { + get + { + byte* address = (byte*)Data + index * _stride; + T ret = Unsafe.Read(&address); + return ret; + } + } + } +} diff --git a/lib/ImGui.NET/NullTerminatedString.cs b/lib/ImGui.NET/NullTerminatedString.cs new file mode 100644 index 0000000..d54bae2 --- /dev/null +++ b/lib/ImGui.NET/NullTerminatedString.cs @@ -0,0 +1,29 @@ +using System.Text; + +namespace ImGuiNET +{ + public unsafe struct NullTerminatedString + { + public readonly byte* Data; + + public NullTerminatedString(byte* data) + { + Data = data; + } + + public override string ToString() + { + int length = 0; + byte* ptr = Data; + while (*ptr != 0) + { + length += 1; + ptr += 1; + } + + return Encoding.ASCII.GetString(Data, length); + } + + public static implicit operator string(NullTerminatedString nts) => nts.ToString(); + } +} diff --git a/lib/ImGui.NET/Pair.cs b/lib/ImGui.NET/Pair.cs new file mode 100644 index 0000000..904cde3 --- /dev/null +++ b/lib/ImGui.NET/Pair.cs @@ -0,0 +1,32 @@ +using System; +using System.Runtime.InteropServices; + +namespace ImGuiNET +{ + public struct ImGuiStoragePair + { + public uint Key; + public UnionValue Value; + } + + public unsafe struct ImGuiStoragePairPtr + { + public ImGuiStoragePair* NativePtr { get; } + public ImGuiStoragePairPtr(ImGuiStoragePair* nativePtr) => NativePtr = nativePtr; + public ImGuiStoragePairPtr(IntPtr nativePtr) => NativePtr = (ImGuiStoragePair*)nativePtr; + public static implicit operator ImGuiStoragePairPtr(ImGuiStoragePair* nativePtr) => new ImGuiStoragePairPtr(nativePtr); + public static implicit operator ImGuiStoragePair*(ImGuiStoragePairPtr wrappedPtr) => wrappedPtr.NativePtr; + public static implicit operator ImGuiStoragePairPtr(IntPtr nativePtr) => new ImGuiStoragePairPtr(nativePtr); + } + + [StructLayout(LayoutKind.Explicit)] + public struct UnionValue + { + [FieldOffset(0)] + public int ValueI32; + [FieldOffset(0)] + public float ValueF32; + [FieldOffset(0)] + public IntPtr ValuePtr; + } +} diff --git a/lib/ImGui.NET/RangeAccessor.cs b/lib/ImGui.NET/RangeAccessor.cs new file mode 100644 index 0000000..cf766c7 --- /dev/null +++ b/lib/ImGui.NET/RangeAccessor.cs @@ -0,0 +1,68 @@ +using System; +using System.Runtime.CompilerServices; +using System.Text; + +namespace ImGuiNET +{ + public unsafe struct RangeAccessor where T : struct + { + private static readonly int s_sizeOfT = Unsafe.SizeOf(); + + public readonly void* Data; + public readonly int Count; + + public RangeAccessor(IntPtr data, int count) : this(data.ToPointer(), count) { } + public RangeAccessor(void* data, int count) + { + Data = data; + Count = count; + } + + public ref T this[int index] + { + get + { + if (index < 0 || index >= Count) + { + throw new IndexOutOfRangeException(); + } + + return ref Unsafe.AsRef((byte*)Data + s_sizeOfT * index); + } + } + } + + public unsafe struct RangePtrAccessor where T : struct + { + public readonly void* Data; + public readonly int Count; + + public RangePtrAccessor(IntPtr data, int count) : this(data.ToPointer(), count) { } + public RangePtrAccessor(void* data, int count) + { + Data = data; + Count = count; + } + + public T this[int index] + { + get + { + if (index < 0 || index >= Count) + { + throw new IndexOutOfRangeException(); + } + + return Unsafe.Read((byte*)Data + sizeof(void*) * index); + } + } + } + + public static class RangeAccessorExtensions + { + public static unsafe string GetStringASCII(this RangeAccessor stringAccessor) + { + return Encoding.ASCII.GetString((byte*)stringAccessor.Data, stringAccessor.Count); + } + } +} diff --git a/lib/ImGui.NET/Util.cs b/lib/ImGui.NET/Util.cs new file mode 100644 index 0000000..438948c --- /dev/null +++ b/lib/ImGui.NET/Util.cs @@ -0,0 +1,97 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; + +namespace ImGuiNET +{ + internal static unsafe class Util + { + internal const int StackAllocationSizeLimit = 2048; + + public static string StringFromPtr(byte* ptr) + { + int characters = 0; + while (ptr[characters] != 0) + { + characters++; + } + + return Encoding.UTF8.GetString(ptr, characters); + } + + internal static bool AreStringsEqual(byte* a, int aLength, byte* b) + { + for (int i = 0; i < aLength; i++) + { + if (a[i] != b[i]) { return false; } + } + + if (b[aLength] != 0) { return false; } + + return true; + } + + internal static byte* Allocate(int byteCount) => (byte*)Marshal.AllocHGlobal(byteCount); + + internal static void Free(byte* ptr) => Marshal.FreeHGlobal((IntPtr)ptr); + +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + internal static int CalcSizeInUtf8(ReadOnlySpan s, int start, int length) +#else + internal static int CalcSizeInUtf8(string s, int start, int length) +#endif + { + if (start < 0 || length < 0 || start + length > s.Length) + { + throw new ArgumentOutOfRangeException(); + } + if(s.Length == 0) return 0; + + fixed (char* utf16Ptr = s) + { + return Encoding.UTF8.GetByteCount(utf16Ptr + start, length); + } + } + +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + internal static int GetUtf8(ReadOnlySpan s, byte* utf8Bytes, int utf8ByteCount) + { + if (s.IsEmpty) + { + return 0; + } + + fixed (char* utf16Ptr = s) + { + return Encoding.UTF8.GetBytes(utf16Ptr, s.Length, utf8Bytes, utf8ByteCount); + } + } +#endif + + internal static int GetUtf8(string s, byte* utf8Bytes, int utf8ByteCount) + { + fixed (char* utf16Ptr = s) + { + return Encoding.UTF8.GetBytes(utf16Ptr, s.Length, utf8Bytes, utf8ByteCount); + } + } + +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER + internal static int GetUtf8(ReadOnlySpan s, int start, int length, byte* utf8Bytes, int utf8ByteCount) +#else + internal static int GetUtf8(string s, int start, int length, byte* utf8Bytes, int utf8ByteCount) +#endif + { + if (start < 0 || length < 0 || start + length > s.Length) + { + throw new ArgumentOutOfRangeException(); + } + if (s.Length == 0) return 0; + + fixed (char* utf16Ptr = s) + { + return Encoding.UTF8.GetBytes(utf16Ptr + start, length, utf8Bytes, utf8ByteCount); + } + } + } +} diff --git a/lib/MoonWorks b/lib/MoonWorks new file mode 160000 index 0000000..4dbd5a2 --- /dev/null +++ b/lib/MoonWorks @@ -0,0 +1 @@ +Subproject commit 4dbd5a2cbeab38f78274644f3b44fe1fa727f304 diff --git a/moonlibs/lib64/cimgui.so b/moonlibs/lib64/cimgui.so new file mode 100644 index 0000000..dc9f2f9 --- /dev/null +++ b/moonlibs/lib64/cimgui.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c1a2f437b7de6c81dbc07562be5f9598c23d148d894a8933a207716a9e5468e +size 1447504 diff --git a/moonlibs/lib64/libFAudio.so.0 b/moonlibs/lib64/libFAudio.so.0 new file mode 100644 index 0000000..225202a --- /dev/null +++ b/moonlibs/lib64/libFAudio.so.0 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a2755573dfa9721b345b751788b4f3f3903b2c7f138b052589789601b7afb813 +size 303784 diff --git a/moonlibs/lib64/libRefresh.so.1 b/moonlibs/lib64/libRefresh.so.1 new file mode 100644 index 0000000..f2dbaf5 --- /dev/null +++ b/moonlibs/lib64/libRefresh.so.1 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:26d50c96125479f7c40105be60ef4764e63f0939925cb595e1bff21f27ff525c +size 226216 diff --git a/moonlibs/lib64/libSDL2-2.0.so.0 b/moonlibs/lib64/libSDL2-2.0.so.0 new file mode 100644 index 0000000..cd5835d --- /dev/null +++ b/moonlibs/lib64/libSDL2-2.0.so.0 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c5f4de5882de9ba13511ca5ae3725e4f5a605a5c81b28ec39b6182c4af30f8a1 +size 2515152 diff --git a/moonlibs/lib64/libWellspring.so.1 b/moonlibs/lib64/libWellspring.so.1 new file mode 100644 index 0000000..2fee350 --- /dev/null +++ b/moonlibs/lib64/libWellspring.so.1 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d05b3190ac350a30140a0b3a9ed02b356e5a39b38a8caec55dfea807c43a8eb +size 53224 diff --git a/moonlibs/lib64/libdav1dfile.so.1 b/moonlibs/lib64/libdav1dfile.so.1 new file mode 100644 index 0000000..46774d6 --- /dev/null +++ b/moonlibs/lib64/libdav1dfile.so.1 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:65461cfc9b4379b41a37cb786b4c6b6f329fb0148e3423d1f3c94283999c8867 +size 2840248 diff --git a/moonlibs/osx/MoltenVK_icd.json b/moonlibs/osx/MoltenVK_icd.json new file mode 100644 index 0000000..9b753d8 --- /dev/null +++ b/moonlibs/osx/MoltenVK_icd.json @@ -0,0 +1,8 @@ +{ + "file_format_version" : "1.0.0", + "ICD": { + "library_path": "./libMoltenVK.dylib", + "api_version" : "1.2.0", + "is_portability_driver" : true + } +} diff --git a/moonlibs/osx/cimgui.dylib b/moonlibs/osx/cimgui.dylib new file mode 100644 index 0000000..1193515 --- /dev/null +++ b/moonlibs/osx/cimgui.dylib @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:05b93dbf8f1b7d1138e17187f2e88c54aa800b00b71925c65329cac74b3433fd +size 2576937 diff --git a/moonlibs/osx/libFAudio.0.dylib b/moonlibs/osx/libFAudio.0.dylib new file mode 100644 index 0000000..e2a4904 --- /dev/null +++ b/moonlibs/osx/libFAudio.0.dylib @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1fadf97cbeefc20e80c1f54d1fc9ac06d302368a163c85f2c7801c084507f3e8 +size 270392 diff --git a/moonlibs/osx/libMoltenVK.dylib b/moonlibs/osx/libMoltenVK.dylib new file mode 100644 index 0000000..372ea66 --- /dev/null +++ b/moonlibs/osx/libMoltenVK.dylib @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e91a4904fb4d4f1edcc4b355048e7d04f3894e150a2fcf8eb3a1080304357e9d +size 14522286 diff --git a/moonlibs/osx/libRefresh.1.dylib b/moonlibs/osx/libRefresh.1.dylib new file mode 100644 index 0000000..ba2db45 --- /dev/null +++ b/moonlibs/osx/libRefresh.1.dylib @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b70fa42f13d916b409b0399a6e71abeb9015d516bc933b38a1e2a9799c6f5556 +size 178584 diff --git a/moonlibs/osx/libSDL2-2.0.0.dylib b/moonlibs/osx/libSDL2-2.0.0.dylib new file mode 100644 index 0000000..12ddaf6 --- /dev/null +++ b/moonlibs/osx/libSDL2-2.0.0.dylib @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e03029628897616d5c4468660b20fbbbe9d20bde98343090588969b4d4a85a6f +size 1770696 diff --git a/moonlibs/osx/libWellspring.1.dylib b/moonlibs/osx/libWellspring.1.dylib new file mode 100644 index 0000000..7d2d0d5 --- /dev/null +++ b/moonlibs/osx/libWellspring.1.dylib @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:98360db8ae779c352c86f5861144033461b325c722569e6406c8c124a589bede +size 59840 diff --git a/moonlibs/osx/libdav1dfile.1.dylib b/moonlibs/osx/libdav1dfile.1.dylib new file mode 100644 index 0000000..45bd882 --- /dev/null +++ b/moonlibs/osx/libdav1dfile.1.dylib @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:31205a3104a27ed5ea0fb98b849ce4aadee08f87cad08c1a5f475189024132f0 +size 2412632 diff --git a/moonlibs/x64/FAudio.dll b/moonlibs/x64/FAudio.dll new file mode 100644 index 0000000..d0730de --- /dev/null +++ b/moonlibs/x64/FAudio.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:58408417bd55fb9c01a0fdb1042860399659906c037a6ac0a7d35343e4b2b897 +size 306564 diff --git a/moonlibs/x64/Refresh.dll b/moonlibs/x64/Refresh.dll new file mode 100644 index 0000000..18c4da4 --- /dev/null +++ b/moonlibs/x64/Refresh.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dfd3a79a93788ce81f4d261835f46e522000aed7e03d76a5a10d270ef9c178df +size 241857 diff --git a/moonlibs/x64/SDL2.dll b/moonlibs/x64/SDL2.dll new file mode 100644 index 0000000..750ce86 --- /dev/null +++ b/moonlibs/x64/SDL2.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:76f7d265a3efaba658cbf5cf5ff078a4ad46f25160f961575041d1ca34e932c3 +size 2499584 diff --git a/moonlibs/x64/Wellspring.dll b/moonlibs/x64/Wellspring.dll new file mode 100644 index 0000000..4726fd9 --- /dev/null +++ b/moonlibs/x64/Wellspring.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f7485a43adc3cc3512f7487e5eedac57f7af77f0e44a562bcb1e8aaf69b6a4f +size 70534 diff --git a/moonlibs/x64/cimgui.dll b/moonlibs/x64/cimgui.dll new file mode 100644 index 0000000..94c3de9 --- /dev/null +++ b/moonlibs/x64/cimgui.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c1c7185401fdc2e008a4bf04ea6c667811f8f06b7fb3d33c18ef7ca983641e27 +size 1204224 diff --git a/moonlibs/x64/dav1dfile.dll b/moonlibs/x64/dav1dfile.dll new file mode 100644 index 0000000..d2f1d4c --- /dev/null +++ b/moonlibs/x64/dav1dfile.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5f21ab3ae860acb91f40e73b11320acd03c4726cad5763b82c700c1d93053a5f +size 3077607 diff --git a/src/Clipboard.cs b/src/Clipboard.cs new file mode 100644 index 0000000..ac365cb --- /dev/null +++ b/src/Clipboard.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + +namespace MoonWorksDearImGuiScaffold; + +public static unsafe class Clipboard +{ + private static IntPtr clipboard; + private static readonly Dictionary pinned = new(); + + private static unsafe void Set(void* userdata, byte* text) + { + var len = 0; while (text[len] != 0) len++; + var str = Encoding.UTF8.GetString(text, len); + SDL2.SDL.SDL_SetClipboardText(str); + } + + private static unsafe byte* Get(void* userdata) + { + if (clipboard != IntPtr.Zero) + { + NativeMemory.Free((void*) clipboard); + clipboard = IntPtr.Zero; + } + + var str = SDL2.SDL.SDL_GetClipboardText(); + var length = Encoding.UTF8.GetByteCount(str); + var bytes = (byte*)(clipboard = (nint)NativeMemory.Alloc((nuint)(length + 1))); + + Encoding.UTF8.GetBytes(str, new Span(bytes, length)); + bytes[length] = 0; + return bytes; + } + + // Stops the delegate pointer from being collected + private static IntPtr GetPointerTo(T fn) where T : Delegate + { + if (pinned.TryGetValue(fn, out var ptr)) + return ptr; + + ptr = Marshal.GetFunctionPointerForDelegate(fn); + pinned.Add(fn, ptr); + return ptr; + } + + public static readonly IntPtr GetFnPtr = GetPointerTo(Get); + public static readonly IntPtr SetFnPtr = GetPointerTo(Set); +} diff --git a/src/MoonWorksDearImGuiScaffoldGame.cs b/src/MoonWorksDearImGuiScaffoldGame.cs new file mode 100644 index 0000000..8ee9a81 --- /dev/null +++ b/src/MoonWorksDearImGuiScaffoldGame.cs @@ -0,0 +1,341 @@ +using MoonWorks.Graphics; +using MoonWorks.Input; +using MoonWorks; +using ImGuiNET; +using System.IO; +using MoonWorks.Math.Float; +using System; + +namespace MoonWorksDearImGuiScaffold; + +class MoonWorksDearImGuiScaffoldGame : Game +{ + private string ShaderContentPath = Path.Combine(System.AppContext.BaseDirectory, "Content", "Shaders"); + + private GraphicsPipeline ImGuiPipeline; + private ShaderModule ImGuiVertexShader; + private ShaderModule ImGuiFragmentShader; + private Sampler ImGuiSampler; + + private uint VertexCount = 0; + private uint IndexCount = 0; + private MoonWorks.Graphics.Buffer ImGuiVertexBuffer = null; + private MoonWorks.Graphics.Buffer ImGuiIndexBuffer = null; + + private TextureStorage TextureStorage; + + public MoonWorksDearImGuiScaffoldGame( + WindowCreateInfo windowCreateInfo, + FrameLimiterSettings frameLimiterSettings, + bool debugMode + ) : base(windowCreateInfo, frameLimiterSettings, 60, debugMode) + { + TextureStorage = new TextureStorage(); + + ImGui.CreateContext(); + + var io = ImGui.GetIO(); + io.DisplaySize = new System.Numerics.Vector2(MainWindow.Width, MainWindow.Height); + io.DisplayFramebufferScale = System.Numerics.Vector2.One; + + ImGuiVertexShader = + new ShaderModule(GraphicsDevice, Path.Combine(ShaderContentPath, "ImGui.vert.refresh")); + ImGuiFragmentShader = + new ShaderModule(GraphicsDevice, Path.Combine(ShaderContentPath, "ImGui.frag.refresh")); + + + ImGuiSampler = new Sampler(GraphicsDevice, SamplerCreateInfo.LinearClamp); + + ImGuiPipeline = new GraphicsPipeline( + GraphicsDevice, + new GraphicsPipelineCreateInfo + { + AttachmentInfo = new GraphicsPipelineAttachmentInfo( + new ColorAttachmentDescription( + MainWindow.SwapchainFormat, + ColorAttachmentBlendState.NonPremultiplied + ) + ), + DepthStencilState = DepthStencilState.Disable, + VertexShaderInfo = GraphicsShaderInfo.Create(ImGuiVertexShader, "main", 0), + FragmentShaderInfo = GraphicsShaderInfo.Create(ImGuiFragmentShader, "main", 1), + VertexInputState = VertexInputState.CreateSingleBinding(), + PrimitiveType = PrimitiveType.TriangleList, + RasterizerState = RasterizerState.CW_CullNone, + MultisampleState = MultisampleState.None + } + ); + + BuildFontAtlas(); + + MainWindow.RegisterSizeChangeCallback(HandleSizeChange); + + Inputs.TextInput += c => + { + if (c == '\t') { return; } + io.AddInputCharacter(c); + }; + + io.ConfigFlags |= ImGuiConfigFlags.NavEnableKeyboard; + + if (!OperatingSystem.IsWindows()) + { + io.SetClipboardTextFn = Clipboard.SetFnPtr; + io.GetClipboardTextFn = Clipboard.GetFnPtr; + } + } + + protected void HandleSizeChange(uint width, uint height) + { + var io = ImGui.GetIO(); + io.DisplaySize = new System.Numerics.Vector2(width, height); + } + + protected override void Update(System.TimeSpan dt) + { + var io = ImGui.GetIO(); + + io.MousePos = new System.Numerics.Vector2(Inputs.Mouse.X, Inputs.Mouse.Y); + io.MouseDown[0] = Inputs.Mouse.LeftButton.IsDown; + io.MouseDown[1] = Inputs.Mouse.RightButton.IsDown; + io.MouseDown[2] = Inputs.Mouse.MiddleButton.IsDown; + io.MouseWheel = Inputs.Mouse.Wheel; + + io.AddKeyEvent(ImGuiKey.A, Inputs.Keyboard.IsDown(KeyCode.A)); + io.AddKeyEvent(ImGuiKey.Z, Inputs.Keyboard.IsDown(KeyCode.Z)); + io.AddKeyEvent(ImGuiKey.Y, Inputs.Keyboard.IsDown(KeyCode.Y)); + io.AddKeyEvent(ImGuiKey.X, Inputs.Keyboard.IsDown(KeyCode.X)); + io.AddKeyEvent(ImGuiKey.C, Inputs.Keyboard.IsDown(KeyCode.C)); + io.AddKeyEvent(ImGuiKey.V, Inputs.Keyboard.IsDown(KeyCode.V)); + + io.AddKeyEvent(ImGuiKey.Tab, Inputs.Keyboard.IsDown(KeyCode.Tab)); + io.AddKeyEvent(ImGuiKey.LeftArrow, Inputs.Keyboard.IsDown(KeyCode.Left)); + io.AddKeyEvent(ImGuiKey.RightArrow, Inputs.Keyboard.IsDown(KeyCode.Right)); + io.AddKeyEvent(ImGuiKey.UpArrow, Inputs.Keyboard.IsDown(KeyCode.Up)); + io.AddKeyEvent(ImGuiKey.DownArrow, Inputs.Keyboard.IsDown(KeyCode.Down)); + io.AddKeyEvent(ImGuiKey.Enter, Inputs.Keyboard.IsDown(KeyCode.Return)); + io.AddKeyEvent(ImGuiKey.Escape, Inputs.Keyboard.IsDown(KeyCode.Escape)); + io.AddKeyEvent(ImGuiKey.Delete, Inputs.Keyboard.IsDown(KeyCode.Delete)); + io.AddKeyEvent(ImGuiKey.Backspace, Inputs.Keyboard.IsDown(KeyCode.Backspace)); + io.AddKeyEvent(ImGuiKey.Home, Inputs.Keyboard.IsDown(KeyCode.Home)); + io.AddKeyEvent(ImGuiKey.End, Inputs.Keyboard.IsDown(KeyCode.End)); + io.AddKeyEvent(ImGuiKey.PageDown, Inputs.Keyboard.IsDown(KeyCode.PageDown)); + io.AddKeyEvent(ImGuiKey.PageUp, Inputs.Keyboard.IsDown(KeyCode.PageUp)); + io.AddKeyEvent(ImGuiKey.Insert, Inputs.Keyboard.IsDown(KeyCode.Insert)); + + io.AddKeyEvent(ImGuiKey.ModCtrl, Inputs.Keyboard.IsDown(KeyCode.LeftControl) || Inputs.Keyboard.IsDown(KeyCode.RightControl)); + io.AddKeyEvent(ImGuiKey.ModShift, Inputs.Keyboard.IsDown(KeyCode.LeftShift) || Inputs.Keyboard.IsDown(KeyCode.RightShift)); + io.AddKeyEvent(ImGuiKey.ModAlt, Inputs.Keyboard.IsDown(KeyCode.LeftAlt) || Inputs.Keyboard.IsDown(KeyCode.RightAlt)); + io.AddKeyEvent(ImGuiKey.ModSuper, Inputs.Keyboard.IsDown(KeyCode.LeftMeta) || Inputs.Keyboard.IsDown(KeyCode.RightMeta)); + + ImGui.NewFrame(); + + ImGuiCommands(); + + ImGui.EndFrame(); + } + + protected void ImGuiCommands() + { + // Do your ImGui commands here! + ImGui.ShowDemoWindow(); + } + + protected override void Draw(double alpha) + { + ImGui.Render(); + + var io = ImGui.GetIO(); + var drawDataPtr = ImGui.GetDrawData(); + + UpdateImGuiBuffers(drawDataPtr); + + var commandBuffer = GraphicsDevice.AcquireCommandBuffer(); + var swapchainTexture = commandBuffer.AcquireSwapchainTexture(MainWindow); + + if (swapchainTexture != null) + { + RenderCommandLists(commandBuffer, swapchainTexture, drawDataPtr, io); + } + + GraphicsDevice.Submit(commandBuffer); + } + + protected override void Destroy() + { + + } + + private unsafe void UpdateImGuiBuffers(ImDrawDataPtr drawDataPtr) + { + if (drawDataPtr.TotalVtxCount == 0) { return; } + + var commandBuffer = GraphicsDevice.AcquireCommandBuffer(); + + if (drawDataPtr.TotalVtxCount > VertexCount) + { + ImGuiVertexBuffer?.Dispose(); + + VertexCount = (uint)(drawDataPtr.TotalVtxCount * 1.5f); + ImGuiVertexBuffer = MoonWorks.Graphics.Buffer.Create( + GraphicsDevice, + BufferUsageFlags.Vertex, + VertexCount + ); + } + + if (drawDataPtr.TotalIdxCount > IndexCount) + { + ImGuiIndexBuffer?.Dispose(); + + IndexCount = (uint)(drawDataPtr.TotalIdxCount * 1.5f); + ImGuiIndexBuffer = MoonWorks.Graphics.Buffer.Create( + GraphicsDevice, + BufferUsageFlags.Index, + IndexCount + ); + } + + uint vertexOffset = 0; + uint indexOffset = 0; + + for (var n = 0; n < drawDataPtr.CmdListsCount; n += 1) + { + var cmdList = drawDataPtr.CmdLists[n]; + + commandBuffer.SetBufferData( + ImGuiVertexBuffer, + cmdList.VtxBuffer.Data, + vertexOffset, + (uint)cmdList.VtxBuffer.Size + ); + + commandBuffer.SetBufferData( + ImGuiIndexBuffer, + cmdList.IdxBuffer.Data, + indexOffset, + (uint)cmdList.IdxBuffer.Size + ); + + vertexOffset += (uint)cmdList.VtxBuffer.Size; + indexOffset += (uint)cmdList.IdxBuffer.Size; + } + + GraphicsDevice.Submit(commandBuffer); + } + + private void RenderCommandLists(CommandBuffer commandBuffer, Texture renderTexture, ImDrawDataPtr drawDataPtr, ImGuiIOPtr ioPtr) + { + var view = Matrix4x4.CreateLookAt( + new Vector3(0, 0, 1), + Vector3.Zero, + Vector3.Up + ); + + var projection = Matrix4x4.CreateOrthographicOffCenter( + 0, + 480, + 270, + 0, + 0.01f, + 4000f + ); + + var viewProjectionMatrix = view * projection; + + commandBuffer.BeginRenderPass( + new ColorAttachmentInfo(renderTexture, MoonWorks.Graphics.Color.CornflowerBlue) + ); + + commandBuffer.BindGraphicsPipeline(ImGuiPipeline); + + var vertexUniformOffset = commandBuffer.PushVertexShaderUniforms( + Matrix4x4.CreateOrthographicOffCenter(0, ioPtr.DisplaySize.X, ioPtr.DisplaySize.Y, 0, -1, 1) + ); + + commandBuffer.BindVertexBuffers(ImGuiVertexBuffer); + commandBuffer.BindIndexBuffer(ImGuiIndexBuffer, IndexElementSize.Sixteen); + + uint vertexOffset = 0; + uint indexOffset = 0; + + for (int n = 0; n < drawDataPtr.CmdListsCount; n += 1) + { + var cmdList = drawDataPtr.CmdLists[n]; + + for (int cmdIndex = 0; cmdIndex < cmdList.CmdBuffer.Size; cmdIndex += 1) + { + var drawCmd = cmdList.CmdBuffer[cmdIndex]; + + commandBuffer.BindFragmentSamplers( + new TextureSamplerBinding(TextureStorage.GetTexture(drawCmd.TextureId), ImGuiSampler) + ); + + var topLeft = Vector2.Transform(new Vector2(drawCmd.ClipRect.X, drawCmd.ClipRect.Y), viewProjectionMatrix); + var bottomRight = Vector2.Transform(new Vector2(drawCmd.ClipRect.Z, drawCmd.ClipRect.W), viewProjectionMatrix); + + var width = drawCmd.ClipRect.Z - (int)drawCmd.ClipRect.X; + var height = drawCmd.ClipRect.W - (int)drawCmd.ClipRect.Y; + + if (width <= 0 || height <= 0) + { + continue; + } + + commandBuffer.SetScissor( + new Rect( + (int)drawCmd.ClipRect.X, + (int)drawCmd.ClipRect.Y, + (int)width, + (int)height + ) + ); + + commandBuffer.DrawIndexedPrimitives( + vertexOffset, + indexOffset, + drawCmd.ElemCount / 3, + vertexUniformOffset, + 0 + ); + + indexOffset += drawCmd.ElemCount; + } + + vertexOffset += (uint)cmdList.VtxBuffer.Size; + } + + commandBuffer.EndRenderPass(); + } + + private void BuildFontAtlas() + { + var commandBuffer = GraphicsDevice.AcquireCommandBuffer(); + + var io = ImGui.GetIO(); + + io.Fonts.GetTexDataAsRGBA32( + out System.IntPtr pixelData, + out int width, + out int height, + out int bytesPerPixel + ); + + var fontTexture = Texture.CreateTexture2D( + GraphicsDevice, + (uint)width, + (uint)height, + TextureFormat.R8G8B8A8, + TextureUsageFlags.Sampler + ); + + commandBuffer.SetTextureData(fontTexture, pixelData, (uint)(width * height * bytesPerPixel)); + + GraphicsDevice.Submit(commandBuffer); + + io.Fonts.SetTexID(fontTexture.Handle); + io.Fonts.ClearTexData(); + + TextureStorage.Add(fontTexture); + } +} diff --git a/src/Program.cs b/src/Program.cs new file mode 100644 index 0000000..1707335 --- /dev/null +++ b/src/Program.cs @@ -0,0 +1,33 @@ +using MoonWorks; + +namespace MoonWorksDearImGuiScaffold; + +class Program +{ + static void Main(string[] args) + { + WindowCreateInfo windowCreateInfo = new WindowCreateInfo + { + WindowWidth = 1280, + WindowHeight = 720, + WindowTitle = "MoonWorksDearImGuiScaffold", + ScreenMode = ScreenMode.Windowed, + PresentMode = PresentMode.FIFORelaxed, + SystemResizable = true + }; + + FrameLimiterSettings frameLimiterSettings = new FrameLimiterSettings + { + Mode = FrameLimiterMode.Capped, + Cap = 60 + }; + + MoonWorksDearImGuiScaffoldGame game = new MoonWorksDearImGuiScaffoldGame( + windowCreateInfo, + frameLimiterSettings, + true + ); + + game.Run(); + } +} diff --git a/src/Shaders/ImGui.frag b/src/Shaders/ImGui.frag new file mode 100644 index 0000000..597e244 --- /dev/null +++ b/src/Shaders/ImGui.frag @@ -0,0 +1,13 @@ +#version 450 + +layout(set = 1, binding = 0) uniform sampler2D tex; + +layout(location = 0) in vec2 inTexCoord; +layout(location = 1) in vec4 inColor; + +layout(location = 0) out vec4 outColor; + +void main() +{ + outColor = texture(tex, inTexCoord) * inColor; +} diff --git a/src/Shaders/ImGui.vert b/src/Shaders/ImGui.vert new file mode 100644 index 0000000..b876f58 --- /dev/null +++ b/src/Shaders/ImGui.vert @@ -0,0 +1,19 @@ +#version 450 + +layout(location = 0) in vec2 inPosition; +layout(location = 1) in vec2 inTexCoord; +layout(location = 2) in vec4 inColor; + +layout (set = 2, binding = 0) uniform UniformBlock +{ + mat4 projectionMatrix; +} Uniforms; + +layout(location = 0) out vec2 outTexCoord; +layout(location = 1) out vec4 outColor; + +void main() { + gl_Position = Uniforms.projectionMatrix * vec4(inPosition, 0.0, 1.0); + outTexCoord = inTexCoord; + outColor = inColor; +} diff --git a/src/Structs.cs b/src/Structs.cs new file mode 100644 index 0000000..ee83061 --- /dev/null +++ b/src/Structs.cs @@ -0,0 +1,29 @@ +using MoonWorks.Graphics; +using MoonWorks.Math.Float; + +namespace MoonWorksDearImGuiScaffold; + +public struct Position2DTextureColorVertex : IVertexType +{ + public Vector2 Position; + public Vector2 TexCoord; + public Color Color; + + public Position2DTextureColorVertex( + Vector2 position, + Vector2 texcoord, + Color color + ) + { + Position = position; + TexCoord = texcoord; + Color = color; + } + + public static VertexElementFormat[] Formats { get; } = new VertexElementFormat[3] + { + VertexElementFormat.Vector2, + VertexElementFormat.Vector2, + VertexElementFormat.Color + }; +} diff --git a/src/TextureStorage.cs b/src/TextureStorage.cs new file mode 100644 index 0000000..5264040 --- /dev/null +++ b/src/TextureStorage.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using MoonWorks.Graphics; + +namespace MoonWorksDearImGuiScaffold; + +public class TextureStorage +{ + Dictionary> PointerToTexture = new Dictionary>(); + + public IntPtr Add(Texture texture) + { + if (!PointerToTexture.ContainsKey(texture.Handle)) + { + PointerToTexture.Add(texture.Handle, new WeakReference(texture)); + } + return texture.Handle; + } + + public Texture GetTexture(IntPtr pointer) + { + if (!PointerToTexture.ContainsKey(pointer)) + { + return null; + } + + var result = PointerToTexture[pointer]; + + if (!result.TryGetTarget(out var texture)) + { + PointerToTexture.Remove(pointer); + return null; + } + + return texture; + } +}