initial commit
commit
c398732ecd
|
@ -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
|
||||
|
||||
moonlibs/
|
||||
|
||||
# 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/
|
|
@ -0,0 +1,3 @@
|
|||
[submodule "lib/MoonWorks"]
|
||||
path = lib/MoonWorks
|
||||
url = https://gitea.moonside.games/MoonsideGames/MoonWorks.git
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Attach to .NET 6 Debugger",
|
||||
"type": "coreclr",
|
||||
"request": "launch",
|
||||
"preLaunchTask": "Build: .NET 6 Debug",
|
||||
"program": "${workspaceFolder}/bin/x64/Debug/net6.0/MoonWorksImguiExample.dll",
|
||||
"args": [],
|
||||
"cwd": "${workspaceFolder}/bin/x64/Debug/net6.0",
|
||||
"console": "integratedTerminal",
|
||||
"internalConsoleOptions": "neverOpen"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,118 @@
|
|||
{
|
||||
"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: .NET 6 Debug",
|
||||
"type": "shell",
|
||||
"dependsOrder": "sequence",
|
||||
"dependsOn": [
|
||||
"Build: .NET 6 Debug",
|
||||
"Run: .NET 6 Debug"
|
||||
],
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "Build: .NET 6 Debug",
|
||||
"command": "dotnet",
|
||||
"args": [
|
||||
"build",
|
||||
"./MoonWorksImguiExample.csproj",
|
||||
"-p:SolutionDir=${workspaceFolder}/",
|
||||
"-p:Platform=x64"
|
||||
],
|
||||
"type": "shell",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "Run: .NET 6 Debug",
|
||||
"command": "dotnet",
|
||||
"args": [
|
||||
"./MoonWorksImguiExample.dll"
|
||||
],
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}/bin/x64/Debug/net6.0"
|
||||
},
|
||||
"type": "process",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "Build: .NET 6 Release",
|
||||
"command": "dotnet",
|
||||
"args": [
|
||||
"build",
|
||||
"./MoonWorksImguiExample.csproj",
|
||||
"--configuration",
|
||||
"Release",
|
||||
"-p:SolutionDir=${workspaceFolder}/",
|
||||
"-p:Platform=x64"
|
||||
],
|
||||
"type": "shell",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "Run: .NET 5 Release",
|
||||
"command": "dotnet",
|
||||
"args": [
|
||||
"./MoonWorksImguiExample.dll"
|
||||
],
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}/bin/x64/Release/net6.0"
|
||||
},
|
||||
"type": "process",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "Build & Run: .NET 6 Release",
|
||||
"dependsOrder": "sequence",
|
||||
"dependsOn": [
|
||||
"Build: .NET 6 Release",
|
||||
"Run: .NET 6 Release"
|
||||
],
|
||||
"type": "shell",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"problemMatcher": []
|
||||
}
|
||||
]
|
||||
}
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
Insert your content files here (sprites, sound, etc)
|
|
@ -0,0 +1,51 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
|
||||
<Target Name="Runtime ID" AfterTargets="Build">
|
||||
<Message Text="Runtime ID: $(RuntimeIdentifier)" Importance="high"/>
|
||||
</Target>
|
||||
|
||||
<ItemGroup Condition="$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))">
|
||||
<Content Include=".\moonlibs\windows\FAudio.dll">
|
||||
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include=".\moonlibs\windows\Refresh.dll">
|
||||
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include=".\moonlibs\windows\SDL2.dll">
|
||||
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include=".\moonlibs\windows\cimgui.dll">
|
||||
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))">
|
||||
<Content Include=".\moonlibs\lib64\libFAudio.*">
|
||||
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include=".\moonlibs\lib64\libRefresh.*">
|
||||
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include=".\moonlibs\lib64\libSDL2-2.0.*">
|
||||
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include=".\moonlibs\lib64\cimgui.*">
|
||||
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))">
|
||||
<Content Include=".\moonlibs\osx\**\*.*" >
|
||||
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,33 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetName>MoonWorksImguiExample</TargetName>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
|
||||
<LangVersion>8.0</LangVersion>
|
||||
<StartupObject>MoonWorksImguiExample.Program</StartupObject>
|
||||
<AssemblyName>MoonWorksImguiExample</AssemblyName>
|
||||
<RootNamespace>MoonWorksImguiExample</RootNamespace>
|
||||
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<ApplicationIcon />
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="Content\**\*.*">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);lib\**\*</DefaultItemExcludes>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="lib\MoonWorks\MoonWorks.csproj" />
|
||||
<ProjectReference Include="lib\ImGui.NET\ImGui.NET.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project=".\CopyMoonlibs.targets" />
|
||||
</Project>
|
|
@ -0,0 +1,49 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.30717.126
|
||||
MinimumVisualStudioVersion = 15.0.26124.0
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MoonWorksImguiExample.Core", "MoonWorksImguiExample\MoonWorksImguiExample.Core.csproj", "{4589302C-174A-4173-9654-CAA6CA1B5220}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MoonWorksImguiExample", "MoonWorksImguiExample.csproj", "{2E898605-87C3-449C-AB79-A4623C2494E8}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "lib", "lib", "{93E44B4D-AF02-4085-ADD3-F8BE21F0BE66}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MoonWorks", "lib\MoonWorks\MoonWorks.csproj", "{EE7FCB89-3297-4C18-8396-2A4C8FE03546}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImGui.NET", "lib\ImGui.NET\ImGui.NET.csproj", "{321FB044-6597-43CA-942F-3FC5FF60D7BC}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{4589302C-174A-4173-9654-CAA6CA1B5220}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{4589302C-174A-4173-9654-CAA6CA1B5220}.Debug|x64.Build.0 = Debug|x64
|
||||
{4589302C-174A-4173-9654-CAA6CA1B5220}.Release|x64.ActiveCfg = Release|x64
|
||||
{4589302C-174A-4173-9654-CAA6CA1B5220}.Release|x64.Build.0 = Release|x64
|
||||
{2E898605-87C3-449C-AB79-A4623C2494E8}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{2E898605-87C3-449C-AB79-A4623C2494E8}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{2E898605-87C3-449C-AB79-A4623C2494E8}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{2E898605-87C3-449C-AB79-A4623C2494E8}.Release|x64.Build.0 = Release|Any CPU
|
||||
{EE7FCB89-3297-4C18-8396-2A4C8FE03546}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{EE7FCB89-3297-4C18-8396-2A4C8FE03546}.Debug|x64.Build.0 = Debug|x64
|
||||
{EE7FCB89-3297-4C18-8396-2A4C8FE03546}.Release|x64.ActiveCfg = Release|x64
|
||||
{EE7FCB89-3297-4C18-8396-2A4C8FE03546}.Release|x64.Build.0 = Release|x64
|
||||
{321FB044-6597-43CA-942F-3FC5FF60D7BC}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{321FB044-6597-43CA-942F-3FC5FF60D7BC}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{321FB044-6597-43CA-942F-3FC5FF60D7BC}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{321FB044-6597-43CA-942F-3FC5FF60D7BC}.Release|x64.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {70247DA8-9C19-4FC5-B4BC-68E1262B9F4B}
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{EE7FCB89-3297-4C18-8396-2A4C8FE03546} = {93E44B4D-AF02-4085-ADD3-F8BE21F0BE66}
|
||||
{321FB044-6597-43CA-942F-3FC5FF60D7BC} = {93E44B4D-AF02-4085-ADD3-F8BE21F0BE66}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,40 @@
|
|||
# MoonWorksTemplate
|
||||
|
||||
Template and build tasks for developing a cross-platform multi-target .NET 6 MoonWorks project in VSCode.
|
||||
|
||||
The generated solution file will also work in regular Visual Studio.
|
||||
|
||||
NOTE: OSX is broken right now because I need to set up MoltenVK.
|
||||
|
||||
## Features
|
||||
|
||||
- Project boilerplate code
|
||||
- VSCode build tasks
|
||||
- VSCode debugger integration
|
||||
|
||||
## Requirements
|
||||
|
||||
- [Git](https://git-scm.com/) or [Git for Windows](https://gitforwindows.org/) on Windows
|
||||
- [.NET 6 SDK](https://dotnet.microsoft.com/download/dotnet/6.0)
|
||||
- [Build Tools for Visual Studio 2019](https://visualstudio.microsoft.com/downloads/) on Windows
|
||||
- [Visual Studio Code](https://code.visualstudio.com/)
|
||||
- [VSCode C# Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.csharp)
|
||||
|
||||
## Installation
|
||||
|
||||
- Make sure you have Git Bash from Git for Windows if you are on Windows
|
||||
- Download this repository
|
||||
- Run `install.sh`
|
||||
- Move the newly created project directory wherever you want
|
||||
- On Windows, add `C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin` to your system environment PATH variable after installing Build Tools for VS 2019
|
||||
|
||||
## Usage
|
||||
|
||||
- Open the project directory in VSCode
|
||||
- Press Ctrl-Shift-B to open the build tasks menu
|
||||
- Tasks use .NET 6.0 to build and run
|
||||
- Press F5 to build and debug
|
||||
|
||||
## Acknowledgments
|
||||
|
||||
Thanks to Andrew Russell and Caleb Cornett's FNA templates for a starting point for this template.
|
|
@ -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<Vector4>(&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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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<ImDrawCmdPtr> _CmdBuffer => new ImPtrVector<ImDrawCmdPtr>(NativePtr->_CmdBuffer, Unsafe.SizeOf<ImDrawCmd>());
|
||||
public ImVector<ushort> _IdxBuffer => new ImVector<ushort>(NativePtr->_IdxBuffer);
|
||||
}
|
||||
}
|
|
@ -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<Vector4>(&NativePtr->ClipRect);
|
||||
public ref IntPtr TextureId => ref Unsafe.AsRef<IntPtr>(&NativePtr->TextureId);
|
||||
public ref uint VtxOffset => ref Unsafe.AsRef<uint>(&NativePtr->VtxOffset);
|
||||
public ref uint IdxOffset => ref Unsafe.AsRef<uint>(&NativePtr->IdxOffset);
|
||||
public ref uint ElemCount => ref Unsafe.AsRef<uint>(&NativePtr->ElemCount);
|
||||
public ref IntPtr UserCallback => ref Unsafe.AsRef<IntPtr>(&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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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<Vector4>(&NativePtr->ClipRect);
|
||||
public ref IntPtr TextureId => ref Unsafe.AsRef<IntPtr>(&NativePtr->TextureId);
|
||||
public ref uint VtxOffset => ref Unsafe.AsRef<uint>(&NativePtr->VtxOffset);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
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 ImDrawList** 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<bool>(&NativePtr->Valid);
|
||||
public ref int CmdListsCount => ref Unsafe.AsRef<int>(&NativePtr->CmdListsCount);
|
||||
public ref int TotalIdxCount => ref Unsafe.AsRef<int>(&NativePtr->TotalIdxCount);
|
||||
public ref int TotalVtxCount => ref Unsafe.AsRef<int>(&NativePtr->TotalVtxCount);
|
||||
public IntPtr CmdLists { get => (IntPtr)NativePtr->CmdLists; set => NativePtr->CmdLists = (ImDrawList**)value; }
|
||||
public ref Vector2 DisplayPos => ref Unsafe.AsRef<Vector2>(&NativePtr->DisplayPos);
|
||||
public ref Vector2 DisplaySize => ref Unsafe.AsRef<Vector2>(&NativePtr->DisplaySize);
|
||||
public ref Vector2 FramebufferScale => ref Unsafe.AsRef<Vector2>(&NativePtr->FramebufferScale);
|
||||
public ImGuiViewportPtr OwnerViewport => new ImGuiViewportPtr(NativePtr->OwnerViewport);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,483 @@
|
|||
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<ImDrawCmdPtr> CmdBuffer => new ImPtrVector<ImDrawCmdPtr>(NativePtr->CmdBuffer, Unsafe.SizeOf<ImDrawCmd>());
|
||||
public ImVector<ushort> IdxBuffer => new ImVector<ushort>(NativePtr->IdxBuffer);
|
||||
public ImPtrVector<ImDrawVertPtr> VtxBuffer => new ImPtrVector<ImDrawVertPtr>(NativePtr->VtxBuffer, Unsafe.SizeOf<ImDrawVert>());
|
||||
public ref ImDrawListFlags Flags => ref Unsafe.AsRef<ImDrawListFlags>(&NativePtr->Flags);
|
||||
public ref uint _VtxCurrentIdx => ref Unsafe.AsRef<uint>(&NativePtr->_VtxCurrentIdx);
|
||||
public ref IntPtr _Data => ref Unsafe.AsRef<IntPtr>(&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<Vector4> _ClipRectStack => new ImVector<Vector4>(NativePtr->_ClipRectStack);
|
||||
public ImVector<IntPtr> _TextureIdStack => new ImVector<IntPtr>(NativePtr->_TextureIdStack);
|
||||
public ImVector<Vector2> _Path => new ImVector<Vector2>(NativePtr->_Path);
|
||||
public ref ImDrawCmdHeader _CmdHeader => ref Unsafe.AsRef<ImDrawCmdHeader>(&NativePtr->_CmdHeader);
|
||||
public ref ImDrawListSplitter _Splitter => ref Unsafe.AsRef<ImDrawListSplitter>(&NativePtr->_Splitter);
|
||||
public ref float _FringeScale => ref Unsafe.AsRef<float>(&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 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);
|
||||
}
|
||||
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 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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
namespace ImGuiNET
|
||||
{
|
||||
[System.Flags]
|
||||
public enum ImDrawListFlags
|
||||
{
|
||||
None = 0,
|
||||
AntiAliasedLines = 1,
|
||||
AntiAliasedLinesUseTex = 2,
|
||||
AntiAliasedFill = 4,
|
||||
AllowVtxOffset = 8,
|
||||
}
|
||||
}
|
|
@ -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<int>(&NativePtr->_Current);
|
||||
public ref int _Count => ref Unsafe.AsRef<int>(&NativePtr->_Count);
|
||||
public ImPtrVector<ImDrawChannelPtr> _Channels => new ImPtrVector<ImDrawChannelPtr>(NativePtr->_Channels, Unsafe.SizeOf<ImDrawChannel>());
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
using System;
|
||||
using System.Numerics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
|
||||
namespace ImGuiNET
|
||||
{
|
||||
public unsafe partial struct ImDrawVert
|
||||
{
|
||||
public Vector2 pos;
|
||||
public Vector2 uv;
|
||||
public uint col;
|
||||
}
|
||||
public unsafe partial struct ImDrawVertPtr
|
||||
{
|
||||
public ImDrawVert* NativePtr { get; }
|
||||
public ImDrawVertPtr(ImDrawVert* nativePtr) => NativePtr = nativePtr;
|
||||
public ImDrawVertPtr(IntPtr nativePtr) => NativePtr = (ImDrawVert*)nativePtr;
|
||||
public static implicit operator ImDrawVertPtr(ImDrawVert* nativePtr) => new ImDrawVertPtr(nativePtr);
|
||||
public static implicit operator ImDrawVert* (ImDrawVertPtr wrappedPtr) => wrappedPtr.NativePtr;
|
||||
public static implicit operator ImDrawVertPtr(IntPtr nativePtr) => new ImDrawVertPtr(nativePtr);
|
||||
public ref Vector2 pos => ref Unsafe.AsRef<Vector2>(&NativePtr->pos);
|
||||
public ref Vector2 uv => ref Unsafe.AsRef<Vector2>(&NativePtr->uv);
|
||||
public ref uint col => ref Unsafe.AsRef<uint>(&NativePtr->col);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,122 @@
|
|||
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 ushort DotChar;
|
||||
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<float> IndexAdvanceX => new ImVector<float>(NativePtr->IndexAdvanceX);
|
||||
public ref float FallbackAdvanceX => ref Unsafe.AsRef<float>(&NativePtr->FallbackAdvanceX);
|
||||
public ref float FontSize => ref Unsafe.AsRef<float>(&NativePtr->FontSize);
|
||||
public ImVector<ushort> IndexLookup => new ImVector<ushort>(NativePtr->IndexLookup);
|
||||
public ImPtrVector<ImFontGlyphPtr> Glyphs => new ImPtrVector<ImFontGlyphPtr>(NativePtr->Glyphs, Unsafe.SizeOf<ImFontGlyph>());
|
||||
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<short>(&NativePtr->ConfigDataCount);
|
||||
public ref ushort FallbackChar => ref Unsafe.AsRef<ushort>(&NativePtr->FallbackChar);
|
||||
public ref ushort EllipsisChar => ref Unsafe.AsRef<ushort>(&NativePtr->EllipsisChar);
|
||||
public ref ushort DotChar => ref Unsafe.AsRef<ushort>(&NativePtr->DotChar);
|
||||
public ref bool DirtyLookupTables => ref Unsafe.AsRef<bool>(&NativePtr->DirtyLookupTables);
|
||||
public ref float Scale => ref Unsafe.AsRef<float>(&NativePtr->Scale);
|
||||
public ref float Ascent => ref Unsafe.AsRef<float>(&NativePtr->Ascent);
|
||||
public ref float Descent => ref Unsafe.AsRef<float>(&NativePtr->Descent);
|
||||
public ref int MetricsTotalSurface => ref Unsafe.AsRef<int>(&NativePtr->MetricsTotalSurface);
|
||||
public RangeAccessor<byte> Used4kPagesMap => new RangeAccessor<byte>(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));
|
||||
}
|
||||
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);
|
||||
}
|
||||
public void SetGlyphVisible(ushort c, bool visible)
|
||||
{
|
||||
byte native_visible = visible ? (byte)1 : (byte)0;
|
||||
ImGuiNative.ImFont_SetGlyphVisible((ImFont*)(NativePtr), c, native_visible);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,610 @@
|
|||
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 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<ImFontAtlasFlags>(&NativePtr->Flags);
|
||||
public ref IntPtr TexID => ref Unsafe.AsRef<IntPtr>(&NativePtr->TexID);
|
||||
public ref int TexDesiredWidth => ref Unsafe.AsRef<int>(&NativePtr->TexDesiredWidth);
|
||||
public ref int TexGlyphPadding => ref Unsafe.AsRef<int>(&NativePtr->TexGlyphPadding);
|
||||
public ref bool Locked => ref Unsafe.AsRef<bool>(&NativePtr->Locked);
|
||||
public ref bool TexReady => ref Unsafe.AsRef<bool>(&NativePtr->TexReady);
|
||||
public ref bool TexPixelsUseColors => ref Unsafe.AsRef<bool>(&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<int>(&NativePtr->TexWidth);
|
||||
public ref int TexHeight => ref Unsafe.AsRef<int>(&NativePtr->TexHeight);
|
||||
public ref Vector2 TexUvScale => ref Unsafe.AsRef<Vector2>(&NativePtr->TexUvScale);
|
||||
public ref Vector2 TexUvWhitePixel => ref Unsafe.AsRef<Vector2>(&NativePtr->TexUvWhitePixel);
|
||||
public ImVector<ImFontPtr> Fonts => new ImVector<ImFontPtr>(NativePtr->Fonts);
|
||||
public ImPtrVector<ImFontAtlasCustomRectPtr> CustomRects => new ImPtrVector<ImFontAtlasCustomRectPtr>(NativePtr->CustomRects, Unsafe.SizeOf<ImFontAtlasCustomRect>());
|
||||
public ImPtrVector<ImFontConfigPtr> ConfigData => new ImPtrVector<ImFontConfigPtr>(NativePtr->ConfigData, Unsafe.SizeOf<ImFontConfig>());
|
||||
public RangeAccessor<Vector4> TexUvLines => new RangeAccessor<Vector4>(&NativePtr->TexUvLines_0, 64);
|
||||
public IntPtr FontBuilderIO { get => (IntPtr)NativePtr->FontBuilderIO; set => NativePtr->FontBuilderIO = (IntPtr*)value; }
|
||||
public ref uint FontBuilderFlags => ref Unsafe.AsRef<uint>(&NativePtr->FontBuilderFlags);
|
||||
public ref int PackIdMouseCursors => ref Unsafe.AsRef<int>(&NativePtr->PackIdMouseCursors);
|
||||
public ref int PackIdLines => ref Unsafe.AsRef<int>(&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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
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_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_size, size_pixels, font_cfg, glyph_ranges);
|
||||
return new ImFontPtr(ret);
|
||||
}
|
||||
public ImFontPtr AddFontFromMemoryCompressedTTF(IntPtr compressed_font_data, int compressed_font_size, float size_pixels, ImFontConfigPtr font_cfg)
|
||||
{
|
||||
void* native_compressed_font_data = (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_size, size_pixels, native_font_cfg, glyph_ranges);
|
||||
return new ImFontPtr(ret);
|
||||
}
|
||||
public ImFontPtr AddFontFromMemoryCompressedTTF(IntPtr compressed_font_data, int compressed_font_size, float size_pixels, ImFontConfigPtr font_cfg, 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_size, size_pixels, native_font_cfg, native_glyph_ranges);
|
||||
return new ImFontPtr(ret);
|
||||
}
|
||||
public ImFontPtr AddFontFromMemoryTTF(IntPtr font_data, int font_size, float size_pixels)
|
||||
{
|
||||
void* native_font_data = (void*)font_data.ToPointer();
|
||||
ImFontConfig* font_cfg = null;
|
||||
ushort* glyph_ranges = null;
|
||||
ImFont* ret = ImGuiNative.ImFontAtlas_AddFontFromMemoryTTF((ImFontAtlas*)(NativePtr), native_font_data, font_size, size_pixels, font_cfg, glyph_ranges);
|
||||
return new ImFontPtr(ret);
|
||||
}
|
||||
public ImFontPtr AddFontFromMemoryTTF(IntPtr font_data, int font_size, float size_pixels, ImFontConfigPtr font_cfg)
|
||||
{
|
||||
void* native_font_data = (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_size, size_pixels, native_font_cfg, glyph_ranges);
|
||||
return new ImFontPtr(ret);
|
||||
}
|
||||
public ImFontPtr AddFontFromMemoryTTF(IntPtr font_data, int font_size, float size_pixels, ImFontConfigPtr font_cfg, 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_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 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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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<ushort>(&NativePtr->Width);
|
||||
public ref ushort Height => ref Unsafe.AsRef<ushort>(&NativePtr->Height);
|
||||
public ref ushort X => ref Unsafe.AsRef<ushort>(&NativePtr->X);
|
||||
public ref ushort Y => ref Unsafe.AsRef<ushort>(&NativePtr->Y);
|
||||
public ref uint GlyphID => ref Unsafe.AsRef<uint>(&NativePtr->GlyphID);
|
||||
public ref float GlyphAdvanceX => ref Unsafe.AsRef<float>(&NativePtr->GlyphAdvanceX);
|
||||
public ref Vector2 GlyphOffset => ref Unsafe.AsRef<Vector2>(&NativePtr->GlyphOffset);
|
||||
public ImFontPtr Font => new ImFontPtr(NativePtr->Font);
|
||||
public void Destroy()
|
||||
{
|
||||
ImGuiNative.ImFontAtlasCustomRect_destroy((ImFontAtlasCustomRect*)(NativePtr));
|
||||
}
|
||||
public bool IsPacked()
|
||||
{
|
||||
byte ret = ImGuiNative.ImFontAtlasCustomRect_IsPacked((ImFontAtlasCustomRect*)(NativePtr));
|
||||
return ret != 0;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
namespace ImGuiNET
|
||||
{
|
||||
[System.Flags]
|
||||
public enum ImFontAtlasFlags
|
||||
{
|
||||
None = 0,
|
||||
NoPowerOfTwoHeight = 1,
|
||||
NoMouseCursors = 2,
|
||||
NoBakedLines = 4,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
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 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<int>(&NativePtr->FontDataSize);
|
||||
public ref bool FontDataOwnedByAtlas => ref Unsafe.AsRef<bool>(&NativePtr->FontDataOwnedByAtlas);
|
||||
public ref int FontNo => ref Unsafe.AsRef<int>(&NativePtr->FontNo);
|
||||
public ref float SizePixels => ref Unsafe.AsRef<float>(&NativePtr->SizePixels);
|
||||
public ref int OversampleH => ref Unsafe.AsRef<int>(&NativePtr->OversampleH);
|
||||
public ref int OversampleV => ref Unsafe.AsRef<int>(&NativePtr->OversampleV);
|
||||
public ref bool PixelSnapH => ref Unsafe.AsRef<bool>(&NativePtr->PixelSnapH);
|
||||
public ref Vector2 GlyphExtraSpacing => ref Unsafe.AsRef<Vector2>(&NativePtr->GlyphExtraSpacing);
|
||||
public ref Vector2 GlyphOffset => ref Unsafe.AsRef<Vector2>(&NativePtr->GlyphOffset);
|
||||
public IntPtr GlyphRanges { get => (IntPtr)NativePtr->GlyphRanges; set => NativePtr->GlyphRanges = (ushort*)value; }
|
||||
public ref float GlyphMinAdvanceX => ref Unsafe.AsRef<float>(&NativePtr->GlyphMinAdvanceX);
|
||||
public ref float GlyphMaxAdvanceX => ref Unsafe.AsRef<float>(&NativePtr->GlyphMaxAdvanceX);
|
||||
public ref bool MergeMode => ref Unsafe.AsRef<bool>(&NativePtr->MergeMode);
|
||||
public ref uint FontBuilderFlags => ref Unsafe.AsRef<uint>(&NativePtr->FontBuilderFlags);
|
||||
public ref float RasterizerMultiply => ref Unsafe.AsRef<float>(&NativePtr->RasterizerMultiply);
|
||||
public ref ushort EllipsisChar => ref Unsafe.AsRef<ushort>(&NativePtr->EllipsisChar);
|
||||
public RangeAccessor<byte> Name => new RangeAccessor<byte>(NativePtr->Name, 40);
|
||||
public ImFontPtr DstFont => new ImFontPtr(NativePtr->DstFont);
|
||||
public void Destroy()
|
||||
{
|
||||
ImGuiNative.ImFontConfig_destroy((ImFontConfig*)(NativePtr));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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<uint>(&NativePtr->Colored);
|
||||
public ref uint Visible => ref Unsafe.AsRef<uint>(&NativePtr->Visible);
|
||||
public ref uint Codepoint => ref Unsafe.AsRef<uint>(&NativePtr->Codepoint);
|
||||
public ref float AdvanceX => ref Unsafe.AsRef<float>(&NativePtr->AdvanceX);
|
||||
public ref float X0 => ref Unsafe.AsRef<float>(&NativePtr->X0);
|
||||
public ref float Y0 => ref Unsafe.AsRef<float>(&NativePtr->Y0);
|
||||
public ref float X1 => ref Unsafe.AsRef<float>(&NativePtr->X1);
|
||||
public ref float Y1 => ref Unsafe.AsRef<float>(&NativePtr->Y1);
|
||||
public ref float U0 => ref Unsafe.AsRef<float>(&NativePtr->U0);
|
||||
public ref float V0 => ref Unsafe.AsRef<float>(&NativePtr->V0);
|
||||
public ref float U1 => ref Unsafe.AsRef<float>(&NativePtr->U1);
|
||||
public ref float V1 => ref Unsafe.AsRef<float>(&NativePtr->V1);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,82 @@
|
|||
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<uint> UsedChars => new ImVector<uint>(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);
|
||||
}
|
||||
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; }
|
||||
byte* native_text_end = null;
|
||||
ImGuiNative.ImFontGlyphRangesBuilder_AddText((ImFontGlyphRangesBuilder*)(NativePtr), native_text, native_text_end);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -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,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
namespace ImGuiNET
|
||||
{
|
||||
[System.Flags]
|
||||
public enum ImGuiButtonFlags
|
||||
{
|
||||
None = 0,
|
||||
MouseButtonLeft = 1,
|
||||
MouseButtonRight = 2,
|
||||
MouseButtonMiddle = 4,
|
||||
MouseButtonMask = 7,
|
||||
MouseButtonDefault = 1,
|
||||
}
|
||||
}
|
|
@ -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,
|
||||
}
|
||||
}
|
|
@ -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,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
namespace ImGuiNET
|
||||
{
|
||||
[System.Flags]
|
||||
public enum ImGuiComboFlags
|
||||
{
|
||||
None = 0,
|
||||
PopupAlignLeft = 1,
|
||||
HeightSmall = 2,
|
||||
HeightRegular = 4,
|
||||
HeightLarge = 8,
|
||||
HeightLargest = 16,
|
||||
NoArrowButton = 32,
|
||||
NoPreview = 64,
|
||||
HeightMask = 30,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
namespace ImGuiNET
|
||||
{
|
||||
public enum ImGuiCond
|
||||
{
|
||||
None = 0,
|
||||
Always = 1,
|
||||
Once = 2,
|
||||
FirstUseEver = 4,
|
||||
Appearing = 8,
|
||||
}
|
||||
}
|
|
@ -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,
|
||||
}
|
||||
}
|
|
@ -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,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
namespace ImGuiNET
|
||||
{
|
||||
public enum ImGuiDir
|
||||
{
|
||||
None = -1,
|
||||
Left = 0,
|
||||
Right = 1,
|
||||
Up = 2,
|
||||
Down = 3,
|
||||
COUNT = 4,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
namespace ImGuiNET
|
||||
{
|
||||
[System.Flags]
|
||||
public enum ImGuiDockNodeFlags
|
||||
{
|
||||
None = 0,
|
||||
KeepAliveOnly = 1,
|
||||
NoDockingInCentralNode = 4,
|
||||
PassthruCentralNode = 8,
|
||||
NoSplit = 16,
|
||||
NoResize = 32,
|
||||
AutoHideTabBar = 64,
|
||||
}
|
||||
}
|
|
@ -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,
|
||||
}
|
||||
}
|
|
@ -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,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
namespace ImGuiNET
|
||||
{
|
||||
[System.Flags]
|
||||
public enum ImGuiHoveredFlags
|
||||
{
|
||||
None = 0,
|
||||
ChildWindows = 1,
|
||||
RootWindow = 2,
|
||||
AnyWindow = 4,
|
||||
NoPopupHierarchy = 8,
|
||||
DockHierarchy = 16,
|
||||
AllowWhenBlockedByPopup = 32,
|
||||
AllowWhenBlockedByActiveItem = 128,
|
||||
AllowWhenOverlapped = 256,
|
||||
AllowWhenDisabled = 512,
|
||||
RectOnly = 416,
|
||||
RootAndChildWindows = 3,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,951 @@
|
|||
using System;
|
||||
using System.Numerics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
|
||||
namespace ImGuiNET
|
||||
{
|
||||
public unsafe partial struct ImGuiIO
|
||||
{
|
||||
public ImGuiConfigFlags ConfigFlags;
|
||||
public ImGuiBackendFlags BackendFlags;
|
||||
public Vector2 DisplaySize;
|
||||
public float DeltaTime;
|
||||
public float IniSavingRate;
|
||||
public byte* IniFilename;
|
||||
public byte* LogFilename;
|
||||
public float MouseDoubleClickTime;
|
||||
public float MouseDoubleClickMaxDist;
|
||||
public float MouseDragThreshold;
|
||||
public float KeyRepeatDelay;
|
||||
public float KeyRepeatRate;
|
||||
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 ConfigDragClickToInputText;
|
||||
public byte ConfigWindowsResizeFromEdges;
|
||||
public byte ConfigWindowsMoveFromTitleBarOnly;
|
||||
public float ConfigMemoryCompactTimer;
|
||||
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 void* _UnusedPadding;
|
||||
public byte WantCaptureMouse;
|
||||
public byte WantCaptureKeyboard;
|
||||
public byte WantTextInput;
|
||||
public byte WantSetMousePos;
|
||||
public byte WantSaveIniSettings;
|
||||
public byte NavActive;
|
||||
public byte NavVisible;
|
||||
public float Framerate;
|
||||
public int MetricsRenderVertices;
|
||||
public int MetricsRenderIndices;
|
||||
public int MetricsRenderWindows;
|
||||
public int MetricsActiveWindows;
|
||||
public int MetricsActiveAllocations;
|
||||
public Vector2 MouseDelta;
|
||||
public fixed int KeyMap[645];
|
||||
public fixed byte KeysDown[512];
|
||||
public Vector2 MousePos;
|
||||
public fixed byte MouseDown[5];
|
||||
public float MouseWheel;
|
||||
public float MouseWheelH;
|
||||
public uint MouseHoveredViewport;
|
||||
public byte KeyCtrl;
|
||||
public byte KeyShift;
|
||||
public byte KeyAlt;
|
||||
public byte KeySuper;
|
||||
public fixed float NavInputs[20];
|
||||
public ImGuiKeyModFlags KeyMods;
|
||||
public ImGuiKeyModFlags KeyModsPrev;
|
||||
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 ImGuiKeyData KeysData_154;
|
||||
public ImGuiKeyData KeysData_155;
|
||||
public ImGuiKeyData KeysData_156;
|
||||
public ImGuiKeyData KeysData_157;
|
||||
public ImGuiKeyData KeysData_158;
|
||||
public ImGuiKeyData KeysData_159;
|
||||
public ImGuiKeyData KeysData_160;
|
||||
public ImGuiKeyData KeysData_161;
|
||||
public ImGuiKeyData KeysData_162;
|
||||
public ImGuiKeyData KeysData_163;
|
||||
public ImGuiKeyData KeysData_164;
|
||||
public ImGuiKeyData KeysData_165;
|
||||
public ImGuiKeyData KeysData_166;
|
||||
public ImGuiKeyData KeysData_167;
|
||||
public ImGuiKeyData KeysData_168;
|
||||
public ImGuiKeyData KeysData_169;
|
||||
public ImGuiKeyData KeysData_170;
|
||||
public ImGuiKeyData KeysData_171;
|
||||
public ImGuiKeyData KeysData_172;
|
||||
public ImGuiKeyData KeysData_173;
|
||||
public ImGuiKeyData KeysData_174;
|
||||
public ImGuiKeyData KeysData_175;
|
||||
public ImGuiKeyData KeysData_176;
|
||||
public ImGuiKeyData KeysData_177;
|
||||
public ImGuiKeyData KeysData_178;
|
||||
public ImGuiKeyData KeysData_179;
|
||||
public ImGuiKeyData KeysData_180;
|
||||
public ImGuiKeyData KeysData_181;
|
||||
public ImGuiKeyData KeysData_182;
|
||||
public ImGuiKeyData KeysData_183;
|
||||
public ImGuiKeyData KeysData_184;
|
||||
public ImGuiKeyData KeysData_185;
|
||||
public ImGuiKeyData KeysData_186;
|
||||
public ImGuiKeyData KeysData_187;
|
||||
public ImGuiKeyData KeysData_188;
|
||||
public ImGuiKeyData KeysData_189;
|
||||
public ImGuiKeyData KeysData_190;
|
||||
public ImGuiKeyData KeysData_191;
|
||||
public ImGuiKeyData KeysData_192;
|
||||
public ImGuiKeyData KeysData_193;
|
||||
public ImGuiKeyData KeysData_194;
|
||||
public ImGuiKeyData KeysData_195;
|
||||
public ImGuiKeyData KeysData_196;
|
||||
public ImGuiKeyData KeysData_197;
|
||||
public ImGuiKeyData KeysData_198;
|
||||
public ImGuiKeyData KeysData_199;
|
||||
public ImGuiKeyData KeysData_200;
|
||||
public ImGuiKeyData KeysData_201;
|
||||
public ImGuiKeyData KeysData_202;
|
||||
public ImGuiKeyData KeysData_203;
|
||||
public ImGuiKeyData KeysData_204;
|
||||
public ImGuiKeyData KeysData_205;
|
||||
public ImGuiKeyData KeysData_206;
|
||||
public ImGuiKeyData KeysData_207;
|
||||
public ImGuiKeyData KeysData_208;
|
||||
public ImGuiKeyData KeysData_209;
|
||||
public ImGuiKeyData KeysData_210;
|
||||
public ImGuiKeyData KeysData_211;
|
||||
public ImGuiKeyData KeysData_212;
|
||||
public ImGuiKeyData KeysData_213;
|
||||
public ImGuiKeyData KeysData_214;
|
||||
public ImGuiKeyData KeysData_215;
|
||||
public ImGuiKeyData KeysData_216;
|
||||
public ImGuiKeyData KeysData_217;
|
||||
public ImGuiKeyData KeysData_218;
|
||||
public ImGuiKeyData KeysData_219;
|
||||
public ImGuiKeyData KeysData_220;
|
||||
public ImGuiKeyData KeysData_221;
|
||||
public ImGuiKeyData KeysData_222;
|
||||
public ImGuiKeyData KeysData_223;
|
||||
public ImGuiKeyData KeysData_224;
|
||||
public ImGuiKeyData KeysData_225;
|
||||
public ImGuiKeyData KeysData_226;
|
||||
public ImGuiKeyData KeysData_227;
|
||||
public ImGuiKeyData KeysData_228;
|
||||
public ImGuiKeyData KeysData_229;
|
||||
public ImGuiKeyData KeysData_230;
|
||||
public ImGuiKeyData KeysData_231;
|
||||
public ImGuiKeyData KeysData_232;
|
||||
public ImGuiKeyData KeysData_233;
|
||||
public ImGuiKeyData KeysData_234;
|
||||
public ImGuiKeyData KeysData_235;
|
||||
public ImGuiKeyData KeysData_236;
|
||||
public ImGuiKeyData KeysData_237;
|
||||
public ImGuiKeyData KeysData_238;
|
||||
public ImGuiKeyData KeysData_239;
|
||||
public ImGuiKeyData KeysData_240;
|
||||
public ImGuiKeyData KeysData_241;
|
||||
public ImGuiKeyData KeysData_242;
|
||||
public ImGuiKeyData KeysData_243;
|
||||
public ImGuiKeyData KeysData_244;
|
||||
public ImGuiKeyData KeysData_245;
|
||||
public ImGuiKeyData KeysData_246;
|
||||
public ImGuiKeyData KeysData_247;
|
||||
public ImGuiKeyData KeysData_248;
|
||||
public ImGuiKeyData KeysData_249;
|
||||
public ImGuiKeyData KeysData_250;
|
||||
public ImGuiKeyData KeysData_251;
|
||||
public ImGuiKeyData KeysData_252;
|
||||
public ImGuiKeyData KeysData_253;
|
||||
public ImGuiKeyData KeysData_254;
|
||||
public ImGuiKeyData KeysData_255;
|
||||
public ImGuiKeyData KeysData_256;
|
||||
public ImGuiKeyData KeysData_257;
|
||||
public ImGuiKeyData KeysData_258;
|
||||
public ImGuiKeyData KeysData_259;
|
||||
public ImGuiKeyData KeysData_260;
|
||||
public ImGuiKeyData KeysData_261;
|
||||
public ImGuiKeyData KeysData_262;
|
||||
public ImGuiKeyData KeysData_263;
|
||||
public ImGuiKeyData KeysData_264;
|
||||
public ImGuiKeyData KeysData_265;
|
||||
public ImGuiKeyData KeysData_266;
|
||||
public ImGuiKeyData KeysData_267;
|
||||
public ImGuiKeyData KeysData_268;
|
||||
public ImGuiKeyData KeysData_269;
|
||||
public ImGuiKeyData KeysData_270;
|
||||
public ImGuiKeyData KeysData_271;
|
||||
public ImGuiKeyData KeysData_272;
|
||||
public ImGuiKeyData KeysData_273;
|
||||
public ImGuiKeyData KeysData_274;
|
||||
public ImGuiKeyData KeysData_275;
|
||||
public ImGuiKeyData KeysData_276;
|
||||
public ImGuiKeyData KeysData_277;
|
||||
public ImGuiKeyData KeysData_278;
|
||||
public ImGuiKeyData KeysData_279;
|
||||
public ImGuiKeyData KeysData_280;
|
||||
public ImGuiKeyData KeysData_281;
|
||||
public ImGuiKeyData KeysData_282;
|
||||
public ImGuiKeyData KeysData_283;
|
||||
public ImGuiKeyData KeysData_284;
|
||||
public ImGuiKeyData KeysData_285;
|
||||
public ImGuiKeyData KeysData_286;
|
||||
public ImGuiKeyData KeysData_287;
|
||||
public ImGuiKeyData KeysData_288;
|
||||
public ImGuiKeyData KeysData_289;
|
||||
public ImGuiKeyData KeysData_290;
|
||||
public ImGuiKeyData KeysData_291;
|
||||
public ImGuiKeyData KeysData_292;
|
||||
public ImGuiKeyData KeysData_293;
|
||||
public ImGuiKeyData KeysData_294;
|
||||
public ImGuiKeyData KeysData_295;
|
||||
public ImGuiKeyData KeysData_296;
|
||||
public ImGuiKeyData KeysData_297;
|
||||
public ImGuiKeyData KeysData_298;
|
||||
public ImGuiKeyData KeysData_299;
|
||||
public ImGuiKeyData KeysData_300;
|
||||
public ImGuiKeyData KeysData_301;
|
||||
public ImGuiKeyData KeysData_302;
|
||||
public ImGuiKeyData KeysData_303;
|
||||
public ImGuiKeyData KeysData_304;
|
||||
public ImGuiKeyData KeysData_305;
|
||||
public ImGuiKeyData KeysData_306;
|
||||
public ImGuiKeyData KeysData_307;
|
||||
public ImGuiKeyData KeysData_308;
|
||||
public ImGuiKeyData KeysData_309;
|
||||
public ImGuiKeyData KeysData_310;
|
||||
public ImGuiKeyData KeysData_311;
|
||||
public ImGuiKeyData KeysData_312;
|
||||
public ImGuiKeyData KeysData_313;
|
||||
public ImGuiKeyData KeysData_314;
|
||||
public ImGuiKeyData KeysData_315;
|
||||
public ImGuiKeyData KeysData_316;
|
||||
public ImGuiKeyData KeysData_317;
|
||||
public ImGuiKeyData KeysData_318;
|
||||
public ImGuiKeyData KeysData_319;
|
||||
public ImGuiKeyData KeysData_320;
|
||||
public ImGuiKeyData KeysData_321;
|
||||
public ImGuiKeyData KeysData_322;
|
||||
public ImGuiKeyData KeysData_323;
|
||||
public ImGuiKeyData KeysData_324;
|
||||
public ImGuiKeyData KeysData_325;
|
||||
public ImGuiKeyData KeysData_326;
|
||||
public ImGuiKeyData KeysData_327;
|
||||
public ImGuiKeyData KeysData_328;
|
||||
public ImGuiKeyData KeysData_329;
|
||||
public ImGuiKeyData KeysData_330;
|
||||
public ImGuiKeyData KeysData_331;
|
||||
public ImGuiKeyData KeysData_332;
|
||||
public ImGuiKeyData KeysData_333;
|
||||
public ImGuiKeyData KeysData_334;
|
||||
public ImGuiKeyData KeysData_335;
|
||||
public ImGuiKeyData KeysData_336;
|
||||
public ImGuiKeyData KeysData_337;
|
||||
public ImGuiKeyData KeysData_338;
|
||||
public ImGuiKeyData KeysData_339;
|
||||
public ImGuiKeyData KeysData_340;
|
||||
public ImGuiKeyData KeysData_341;
|
||||
public ImGuiKeyData KeysData_342;
|
||||
public ImGuiKeyData KeysData_343;
|
||||
public ImGuiKeyData KeysData_344;
|
||||
public ImGuiKeyData KeysData_345;
|
||||
public ImGuiKeyData KeysData_346;
|
||||
public ImGuiKeyData KeysData_347;
|
||||
public ImGuiKeyData KeysData_348;
|
||||
public ImGuiKeyData KeysData_349;
|
||||
public ImGuiKeyData KeysData_350;
|
||||
public ImGuiKeyData KeysData_351;
|
||||
public ImGuiKeyData KeysData_352;
|
||||
public ImGuiKeyData KeysData_353;
|
||||
public ImGuiKeyData KeysData_354;
|
||||
public ImGuiKeyData KeysData_355;
|
||||
public ImGuiKeyData KeysData_356;
|
||||
public ImGuiKeyData KeysData_357;
|
||||
public ImGuiKeyData KeysData_358;
|
||||
public ImGuiKeyData KeysData_359;
|
||||
public ImGuiKeyData KeysData_360;
|
||||
public ImGuiKeyData KeysData_361;
|
||||
public ImGuiKeyData KeysData_362;
|
||||
public ImGuiKeyData KeysData_363;
|
||||
public ImGuiKeyData KeysData_364;
|
||||
public ImGuiKeyData KeysData_365;
|
||||
public ImGuiKeyData KeysData_366;
|
||||
public ImGuiKeyData KeysData_367;
|
||||
public ImGuiKeyData KeysData_368;
|
||||
public ImGuiKeyData KeysData_369;
|
||||
public ImGuiKeyData KeysData_370;
|
||||
public ImGuiKeyData KeysData_371;
|
||||
public ImGuiKeyData KeysData_372;
|
||||
public ImGuiKeyData KeysData_373;
|
||||
public ImGuiKeyData KeysData_374;
|
||||
public ImGuiKeyData KeysData_375;
|
||||
public ImGuiKeyData KeysData_376;
|
||||
public ImGuiKeyData KeysData_377;
|
||||
public ImGuiKeyData KeysData_378;
|
||||
public ImGuiKeyData KeysData_379;
|
||||
public ImGuiKeyData KeysData_380;
|
||||
public ImGuiKeyData KeysData_381;
|
||||
public ImGuiKeyData KeysData_382;
|
||||
public ImGuiKeyData KeysData_383;
|
||||
public ImGuiKeyData KeysData_384;
|
||||
public ImGuiKeyData KeysData_385;
|
||||
public ImGuiKeyData KeysData_386;
|
||||
public ImGuiKeyData KeysData_387;
|
||||
public ImGuiKeyData KeysData_388;
|
||||
public ImGuiKeyData KeysData_389;
|
||||
public ImGuiKeyData KeysData_390;
|
||||
public ImGuiKeyData KeysData_391;
|
||||
public ImGuiKeyData KeysData_392;
|
||||
public ImGuiKeyData KeysData_393;
|
||||
public ImGuiKeyData KeysData_394;
|
||||
public ImGuiKeyData KeysData_395;
|
||||
public ImGuiKeyData KeysData_396;
|
||||
public ImGuiKeyData KeysData_397;
|
||||
public ImGuiKeyData KeysData_398;
|
||||
public ImGuiKeyData KeysData_399;
|
||||
public ImGuiKeyData KeysData_400;
|
||||
public ImGuiKeyData KeysData_401;
|
||||
public ImGuiKeyData KeysData_402;
|
||||
public ImGuiKeyData KeysData_403;
|
||||
public ImGuiKeyData KeysData_404;
|
||||
public ImGuiKeyData KeysData_405;
|
||||
public ImGuiKeyData KeysData_406;
|
||||
public ImGuiKeyData KeysData_407;
|
||||
public ImGuiKeyData KeysData_408;
|
||||
public ImGuiKeyData KeysData_409;
|
||||
public ImGuiKeyData KeysData_410;
|
||||
public ImGuiKeyData KeysData_411;
|
||||
public ImGuiKeyData KeysData_412;
|
||||
public ImGuiKeyData KeysData_413;
|
||||
public ImGuiKeyData KeysData_414;
|
||||
public ImGuiKeyData KeysData_415;
|
||||
public ImGuiKeyData KeysData_416;
|
||||
public ImGuiKeyData KeysData_417;
|
||||
public ImGuiKeyData KeysData_418;
|
||||
public ImGuiKeyData KeysData_419;
|
||||
public ImGuiKeyData KeysData_420;
|
||||
public ImGuiKeyData KeysData_421;
|
||||
public ImGuiKeyData KeysData_422;
|
||||
public ImGuiKeyData KeysData_423;
|
||||
public ImGuiKeyData KeysData_424;
|
||||
public ImGuiKeyData KeysData_425;
|
||||
public ImGuiKeyData KeysData_426;
|
||||
public ImGuiKeyData KeysData_427;
|
||||
public ImGuiKeyData KeysData_428;
|
||||
public ImGuiKeyData KeysData_429;
|
||||
public ImGuiKeyData KeysData_430;
|
||||
public ImGuiKeyData KeysData_431;
|
||||
public ImGuiKeyData KeysData_432;
|
||||
public ImGuiKeyData KeysData_433;
|
||||
public ImGuiKeyData KeysData_434;
|
||||
public ImGuiKeyData KeysData_435;
|
||||
public ImGuiKeyData KeysData_436;
|
||||
public ImGuiKeyData KeysData_437;
|
||||
public ImGuiKeyData KeysData_438;
|
||||
public ImGuiKeyData KeysData_439;
|
||||
public ImGuiKeyData KeysData_440;
|
||||
public ImGuiKeyData KeysData_441;
|
||||
public ImGuiKeyData KeysData_442;
|
||||
public ImGuiKeyData KeysData_443;
|
||||
public ImGuiKeyData KeysData_444;
|
||||
public ImGuiKeyData KeysData_445;
|
||||
public ImGuiKeyData KeysData_446;
|
||||
public ImGuiKeyData KeysData_447;
|
||||
public ImGuiKeyData KeysData_448;
|
||||
public ImGuiKeyData KeysData_449;
|
||||
public ImGuiKeyData KeysData_450;
|
||||
public ImGuiKeyData KeysData_451;
|
||||
public ImGuiKeyData KeysData_452;
|
||||
public ImGuiKeyData KeysData_453;
|
||||
public ImGuiKeyData KeysData_454;
|
||||
public ImGuiKeyData KeysData_455;
|
||||
public ImGuiKeyData KeysData_456;
|
||||
public ImGuiKeyData KeysData_457;
|
||||
public ImGuiKeyData KeysData_458;
|
||||
public ImGuiKeyData KeysData_459;
|
||||
public ImGuiKeyData KeysData_460;
|
||||
public ImGuiKeyData KeysData_461;
|
||||
public ImGuiKeyData KeysData_462;
|
||||
public ImGuiKeyData KeysData_463;
|
||||
public ImGuiKeyData KeysData_464;
|
||||
public ImGuiKeyData KeysData_465;
|
||||
public ImGuiKeyData KeysData_466;
|
||||
public ImGuiKeyData KeysData_467;
|
||||
public ImGuiKeyData KeysData_468;
|
||||
public ImGuiKeyData KeysData_469;
|
||||
public ImGuiKeyData KeysData_470;
|
||||
public ImGuiKeyData KeysData_471;
|
||||
public ImGuiKeyData KeysData_472;
|
||||
public ImGuiKeyData KeysData_473;
|
||||
public ImGuiKeyData KeysData_474;
|
||||
public ImGuiKeyData KeysData_475;
|
||||
public ImGuiKeyData KeysData_476;
|
||||
public ImGuiKeyData KeysData_477;
|
||||
public ImGuiKeyData KeysData_478;
|
||||
public ImGuiKeyData KeysData_479;
|
||||
public ImGuiKeyData KeysData_480;
|
||||
public ImGuiKeyData KeysData_481;
|
||||
public ImGuiKeyData KeysData_482;
|
||||
public ImGuiKeyData KeysData_483;
|
||||
public ImGuiKeyData KeysData_484;
|
||||
public ImGuiKeyData KeysData_485;
|
||||
public ImGuiKeyData KeysData_486;
|
||||
public ImGuiKeyData KeysData_487;
|
||||
public ImGuiKeyData KeysData_488;
|
||||
public ImGuiKeyData KeysData_489;
|
||||
public ImGuiKeyData KeysData_490;
|
||||
public ImGuiKeyData KeysData_491;
|
||||
public ImGuiKeyData KeysData_492;
|
||||
public ImGuiKeyData KeysData_493;
|
||||
public ImGuiKeyData KeysData_494;
|
||||
public ImGuiKeyData KeysData_495;
|
||||
public ImGuiKeyData KeysData_496;
|
||||
public ImGuiKeyData KeysData_497;
|
||||
public ImGuiKeyData KeysData_498;
|
||||
public ImGuiKeyData KeysData_499;
|
||||
public ImGuiKeyData KeysData_500;
|
||||
public ImGuiKeyData KeysData_501;
|
||||
public ImGuiKeyData KeysData_502;
|
||||
public ImGuiKeyData KeysData_503;
|
||||
public ImGuiKeyData KeysData_504;
|
||||
public ImGuiKeyData KeysData_505;
|
||||
public ImGuiKeyData KeysData_506;
|
||||
public ImGuiKeyData KeysData_507;
|
||||
public ImGuiKeyData KeysData_508;
|
||||
public ImGuiKeyData KeysData_509;
|
||||
public ImGuiKeyData KeysData_510;
|
||||
public ImGuiKeyData KeysData_511;
|
||||
public ImGuiKeyData KeysData_512;
|
||||
public ImGuiKeyData KeysData_513;
|
||||
public ImGuiKeyData KeysData_514;
|
||||
public ImGuiKeyData KeysData_515;
|
||||
public ImGuiKeyData KeysData_516;
|
||||
public ImGuiKeyData KeysData_517;
|
||||
public ImGuiKeyData KeysData_518;
|
||||
public ImGuiKeyData KeysData_519;
|
||||
public ImGuiKeyData KeysData_520;
|
||||
public ImGuiKeyData KeysData_521;
|
||||
public ImGuiKeyData KeysData_522;
|
||||
public ImGuiKeyData KeysData_523;
|
||||
public ImGuiKeyData KeysData_524;
|
||||
public ImGuiKeyData KeysData_525;
|
||||
public ImGuiKeyData KeysData_526;
|
||||
public ImGuiKeyData KeysData_527;
|
||||
public ImGuiKeyData KeysData_528;
|
||||
public ImGuiKeyData KeysData_529;
|
||||
public ImGuiKeyData KeysData_530;
|
||||
public ImGuiKeyData KeysData_531;
|
||||
public ImGuiKeyData KeysData_532;
|
||||
public ImGuiKeyData KeysData_533;
|
||||
public ImGuiKeyData KeysData_534;
|
||||
public ImGuiKeyData KeysData_535;
|
||||
public ImGuiKeyData KeysData_536;
|
||||
public ImGuiKeyData KeysData_537;
|
||||
public ImGuiKeyData KeysData_538;
|
||||
public ImGuiKeyData KeysData_539;
|
||||
public ImGuiKeyData KeysData_540;
|
||||
public ImGuiKeyData KeysData_541;
|
||||
public ImGuiKeyData KeysData_542;
|
||||
public ImGuiKeyData KeysData_543;
|
||||
public ImGuiKeyData KeysData_544;
|
||||
public ImGuiKeyData KeysData_545;
|
||||
public ImGuiKeyData KeysData_546;
|
||||
public ImGuiKeyData KeysData_547;
|
||||
public ImGuiKeyData KeysData_548;
|
||||
public ImGuiKeyData KeysData_549;
|
||||
public ImGuiKeyData KeysData_550;
|
||||
public ImGuiKeyData KeysData_551;
|
||||
public ImGuiKeyData KeysData_552;
|
||||
public ImGuiKeyData KeysData_553;
|
||||
public ImGuiKeyData KeysData_554;
|
||||
public ImGuiKeyData KeysData_555;
|
||||
public ImGuiKeyData KeysData_556;
|
||||
public ImGuiKeyData KeysData_557;
|
||||
public ImGuiKeyData KeysData_558;
|
||||
public ImGuiKeyData KeysData_559;
|
||||
public ImGuiKeyData KeysData_560;
|
||||
public ImGuiKeyData KeysData_561;
|
||||
public ImGuiKeyData KeysData_562;
|
||||
public ImGuiKeyData KeysData_563;
|
||||
public ImGuiKeyData KeysData_564;
|
||||
public ImGuiKeyData KeysData_565;
|
||||
public ImGuiKeyData KeysData_566;
|
||||
public ImGuiKeyData KeysData_567;
|
||||
public ImGuiKeyData KeysData_568;
|
||||
public ImGuiKeyData KeysData_569;
|
||||
public ImGuiKeyData KeysData_570;
|
||||
public ImGuiKeyData KeysData_571;
|
||||
public ImGuiKeyData KeysData_572;
|
||||
public ImGuiKeyData KeysData_573;
|
||||
public ImGuiKeyData KeysData_574;
|
||||
public ImGuiKeyData KeysData_575;
|
||||
public ImGuiKeyData KeysData_576;
|
||||
public ImGuiKeyData KeysData_577;
|
||||
public ImGuiKeyData KeysData_578;
|
||||
public ImGuiKeyData KeysData_579;
|
||||
public ImGuiKeyData KeysData_580;
|
||||
public ImGuiKeyData KeysData_581;
|
||||
public ImGuiKeyData KeysData_582;
|
||||
public ImGuiKeyData KeysData_583;
|
||||
public ImGuiKeyData KeysData_584;
|
||||
public ImGuiKeyData KeysData_585;
|
||||
public ImGuiKeyData KeysData_586;
|
||||
public ImGuiKeyData KeysData_587;
|
||||
public ImGuiKeyData KeysData_588;
|
||||
public ImGuiKeyData KeysData_589;
|
||||
public ImGuiKeyData KeysData_590;
|
||||
public ImGuiKeyData KeysData_591;
|
||||
public ImGuiKeyData KeysData_592;
|
||||
public ImGuiKeyData KeysData_593;
|
||||
public ImGuiKeyData KeysData_594;
|
||||
public ImGuiKeyData KeysData_595;
|
||||
public ImGuiKeyData KeysData_596;
|
||||
public ImGuiKeyData KeysData_597;
|
||||
public ImGuiKeyData KeysData_598;
|
||||
public ImGuiKeyData KeysData_599;
|
||||
public ImGuiKeyData KeysData_600;
|
||||
public ImGuiKeyData KeysData_601;
|
||||
public ImGuiKeyData KeysData_602;
|
||||
public ImGuiKeyData KeysData_603;
|
||||
public ImGuiKeyData KeysData_604;
|
||||
public ImGuiKeyData KeysData_605;
|
||||
public ImGuiKeyData KeysData_606;
|
||||
public ImGuiKeyData KeysData_607;
|
||||
public ImGuiKeyData KeysData_608;
|
||||
public ImGuiKeyData KeysData_609;
|
||||
public ImGuiKeyData KeysData_610;
|
||||
public ImGuiKeyData KeysData_611;
|
||||
public ImGuiKeyData KeysData_612;
|
||||
public ImGuiKeyData KeysData_613;
|
||||
public ImGuiKeyData KeysData_614;
|
||||
public ImGuiKeyData KeysData_615;
|
||||
public ImGuiKeyData KeysData_616;
|
||||
public ImGuiKeyData KeysData_617;
|
||||
public ImGuiKeyData KeysData_618;
|
||||
public ImGuiKeyData KeysData_619;
|
||||
public ImGuiKeyData KeysData_620;
|
||||
public ImGuiKeyData KeysData_621;
|
||||
public ImGuiKeyData KeysData_622;
|
||||
public ImGuiKeyData KeysData_623;
|
||||
public ImGuiKeyData KeysData_624;
|
||||
public ImGuiKeyData KeysData_625;
|
||||
public ImGuiKeyData KeysData_626;
|
||||
public ImGuiKeyData KeysData_627;
|
||||
public ImGuiKeyData KeysData_628;
|
||||
public ImGuiKeyData KeysData_629;
|
||||
public ImGuiKeyData KeysData_630;
|
||||
public ImGuiKeyData KeysData_631;
|
||||
public ImGuiKeyData KeysData_632;
|
||||
public ImGuiKeyData KeysData_633;
|
||||
public ImGuiKeyData KeysData_634;
|
||||
public ImGuiKeyData KeysData_635;
|
||||
public ImGuiKeyData KeysData_636;
|
||||
public ImGuiKeyData KeysData_637;
|
||||
public ImGuiKeyData KeysData_638;
|
||||
public ImGuiKeyData KeysData_639;
|
||||
public ImGuiKeyData KeysData_640;
|
||||
public ImGuiKeyData KeysData_641;
|
||||
public ImGuiKeyData KeysData_642;
|
||||
public ImGuiKeyData KeysData_643;
|
||||
public ImGuiKeyData KeysData_644;
|
||||
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 fixed float MouseDownDuration[5];
|
||||
public fixed float MouseDownDurationPrev[5];
|
||||
public Vector2 MouseDragMaxDistanceAbs_0;
|
||||
public Vector2 MouseDragMaxDistanceAbs_1;
|
||||
public Vector2 MouseDragMaxDistanceAbs_2;
|
||||
public Vector2 MouseDragMaxDistanceAbs_3;
|
||||
public Vector2 MouseDragMaxDistanceAbs_4;
|
||||
public fixed float MouseDragMaxDistanceSqr[5];
|
||||
public fixed float NavInputsDownDuration[20];
|
||||
public fixed float NavInputsDownDurationPrev[20];
|
||||
public float PenPressure;
|
||||
public byte AppFocusLost;
|
||||
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<ImGuiConfigFlags>(&NativePtr->ConfigFlags);
|
||||
public ref ImGuiBackendFlags BackendFlags => ref Unsafe.AsRef<ImGuiBackendFlags>(&NativePtr->BackendFlags);
|
||||
public ref Vector2 DisplaySize => ref Unsafe.AsRef<Vector2>(&NativePtr->DisplaySize);
|
||||
public ref float DeltaTime => ref Unsafe.AsRef<float>(&NativePtr->DeltaTime);
|
||||
public ref float IniSavingRate => ref Unsafe.AsRef<float>(&NativePtr->IniSavingRate);
|
||||
public NullTerminatedString IniFilename => new NullTerminatedString(NativePtr->IniFilename);
|
||||
public NullTerminatedString LogFilename => new NullTerminatedString(NativePtr->LogFilename);
|
||||
public ref float MouseDoubleClickTime => ref Unsafe.AsRef<float>(&NativePtr->MouseDoubleClickTime);
|
||||
public ref float MouseDoubleClickMaxDist => ref Unsafe.AsRef<float>(&NativePtr->MouseDoubleClickMaxDist);
|
||||
public ref float MouseDragThreshold => ref Unsafe.AsRef<float>(&NativePtr->MouseDragThreshold);
|
||||
public ref float KeyRepeatDelay => ref Unsafe.AsRef<float>(&NativePtr->KeyRepeatDelay);
|
||||
public ref float KeyRepeatRate => ref Unsafe.AsRef<float>(&NativePtr->KeyRepeatRate);
|
||||
public IntPtr UserData { get => (IntPtr)NativePtr->UserData; set => NativePtr->UserData = (void*)value; }
|
||||
public ImFontAtlasPtr Fonts => new ImFontAtlasPtr(NativePtr->Fonts);
|
||||
public ref float FontGlobalScale => ref Unsafe.AsRef<float>(&NativePtr->FontGlobalScale);
|
||||
public ref bool FontAllowUserScaling => ref Unsafe.AsRef<bool>(&NativePtr->FontAllowUserScaling);
|
||||
public ImFontPtr FontDefault => new ImFontPtr(NativePtr->FontDefault);
|
||||
public ref Vector2 DisplayFramebufferScale => ref Unsafe.AsRef<Vector2>(&NativePtr->DisplayFramebufferScale);
|
||||
public ref bool ConfigDockingNoSplit => ref Unsafe.AsRef<bool>(&NativePtr->ConfigDockingNoSplit);
|
||||
public ref bool ConfigDockingWithShift => ref Unsafe.AsRef<bool>(&NativePtr->ConfigDockingWithShift);
|
||||
public ref bool ConfigDockingAlwaysTabBar => ref Unsafe.AsRef<bool>(&NativePtr->ConfigDockingAlwaysTabBar);
|
||||
public ref bool ConfigDockingTransparentPayload => ref Unsafe.AsRef<bool>(&NativePtr->ConfigDockingTransparentPayload);
|
||||
public ref bool ConfigViewportsNoAutoMerge => ref Unsafe.AsRef<bool>(&NativePtr->ConfigViewportsNoAutoMerge);
|
||||
public ref bool ConfigViewportsNoTaskBarIcon => ref Unsafe.AsRef<bool>(&NativePtr->ConfigViewportsNoTaskBarIcon);
|
||||
public ref bool ConfigViewportsNoDecoration => ref Unsafe.AsRef<bool>(&NativePtr->ConfigViewportsNoDecoration);
|
||||
public ref bool ConfigViewportsNoDefaultParent => ref Unsafe.AsRef<bool>(&NativePtr->ConfigViewportsNoDefaultParent);
|
||||
public ref bool MouseDrawCursor => ref Unsafe.AsRef<bool>(&NativePtr->MouseDrawCursor);
|
||||
public ref bool ConfigMacOSXBehaviors => ref Unsafe.AsRef<bool>(&NativePtr->ConfigMacOSXBehaviors);
|
||||
public ref bool ConfigInputTrickleEventQueue => ref Unsafe.AsRef<bool>(&NativePtr->ConfigInputTrickleEventQueue);
|
||||
public ref bool ConfigInputTextCursorBlink => ref Unsafe.AsRef<bool>(&NativePtr->ConfigInputTextCursorBlink);
|
||||
public ref bool ConfigDragClickToInputText => ref Unsafe.AsRef<bool>(&NativePtr->ConfigDragClickToInputText);
|
||||
public ref bool ConfigWindowsResizeFromEdges => ref Unsafe.AsRef<bool>(&NativePtr->ConfigWindowsResizeFromEdges);
|
||||
public ref bool ConfigWindowsMoveFromTitleBarOnly => ref Unsafe.AsRef<bool>(&NativePtr->ConfigWindowsMoveFromTitleBarOnly);
|
||||
public ref float ConfigMemoryCompactTimer => ref Unsafe.AsRef<float>(&NativePtr->ConfigMemoryCompactTimer);
|
||||
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<IntPtr>(&NativePtr->GetClipboardTextFn);
|
||||
public ref IntPtr SetClipboardTextFn => ref Unsafe.AsRef<IntPtr>(&NativePtr->SetClipboardTextFn);
|
||||
public IntPtr ClipboardUserData { get => (IntPtr)NativePtr->ClipboardUserData; set => NativePtr->ClipboardUserData = (void*)value; }
|
||||
public ref IntPtr SetPlatformImeDataFn => ref Unsafe.AsRef<IntPtr>(&NativePtr->SetPlatformImeDataFn);
|
||||
public IntPtr _UnusedPadding { get => (IntPtr)NativePtr->_UnusedPadding; set => NativePtr->_UnusedPadding = (void*)value; }
|
||||
public ref bool WantCaptureMouse => ref Unsafe.AsRef<bool>(&NativePtr->WantCaptureMouse);
|
||||
public ref bool WantCaptureKeyboard => ref Unsafe.AsRef<bool>(&NativePtr->WantCaptureKeyboard);
|
||||
public ref bool WantTextInput => ref Unsafe.AsRef<bool>(&NativePtr->WantTextInput);
|
||||
public ref bool WantSetMousePos => ref Unsafe.AsRef<bool>(&NativePtr->WantSetMousePos);
|
||||
public ref bool WantSaveIniSettings => ref Unsafe.AsRef<bool>(&NativePtr->WantSaveIniSettings);
|
||||
public ref bool NavActive => ref Unsafe.AsRef<bool>(&NativePtr->NavActive);
|
||||
public ref bool NavVisible => ref Unsafe.AsRef<bool>(&NativePtr->NavVisible);
|
||||
public ref float Framerate => ref Unsafe.AsRef<float>(&NativePtr->Framerate);
|
||||
public ref int MetricsRenderVertices => ref Unsafe.AsRef<int>(&NativePtr->MetricsRenderVertices);
|
||||
public ref int MetricsRenderIndices => ref Unsafe.AsRef<int>(&NativePtr->MetricsRenderIndices);
|
||||
public ref int MetricsRenderWindows => ref Unsafe.AsRef<int>(&NativePtr->MetricsRenderWindows);
|
||||
public ref int MetricsActiveWindows => ref Unsafe.AsRef<int>(&NativePtr->MetricsActiveWindows);
|
||||
public ref int MetricsActiveAllocations => ref Unsafe.AsRef<int>(&NativePtr->MetricsActiveAllocations);
|
||||
public ref Vector2 MouseDelta => ref Unsafe.AsRef<Vector2>(&NativePtr->MouseDelta);
|
||||
public RangeAccessor<int> KeyMap => new RangeAccessor<int>(NativePtr->KeyMap, 645);
|
||||
public RangeAccessor<bool> KeysDown => new RangeAccessor<bool>(NativePtr->KeysDown, 512);
|
||||
public ref Vector2 MousePos => ref Unsafe.AsRef<Vector2>(&NativePtr->MousePos);
|
||||
public RangeAccessor<bool> MouseDown => new RangeAccessor<bool>(NativePtr->MouseDown, 5);
|
||||
public ref float MouseWheel => ref Unsafe.AsRef<float>(&NativePtr->MouseWheel);
|
||||
public ref float MouseWheelH => ref Unsafe.AsRef<float>(&NativePtr->MouseWheelH);
|
||||
public ref uint MouseHoveredViewport => ref Unsafe.AsRef<uint>(&NativePtr->MouseHoveredViewport);
|
||||
public ref bool KeyCtrl => ref Unsafe.AsRef<bool>(&NativePtr->KeyCtrl);
|
||||
public ref bool KeyShift => ref Unsafe.AsRef<bool>(&NativePtr->KeyShift);
|
||||
public ref bool KeyAlt => ref Unsafe.AsRef<bool>(&NativePtr->KeyAlt);
|
||||
public ref bool KeySuper => ref Unsafe.AsRef<bool>(&NativePtr->KeySuper);
|
||||
public RangeAccessor<float> NavInputs => new RangeAccessor<float>(NativePtr->NavInputs, 20);
|
||||
public ref ImGuiKeyModFlags KeyMods => ref Unsafe.AsRef<ImGuiKeyModFlags>(&NativePtr->KeyMods);
|
||||
public ref ImGuiKeyModFlags KeyModsPrev => ref Unsafe.AsRef<ImGuiKeyModFlags>(&NativePtr->KeyModsPrev);
|
||||
public RangeAccessor<ImGuiKeyData> KeysData => new RangeAccessor<ImGuiKeyData>(&NativePtr->KeysData_0, 645);
|
||||
public ref bool WantCaptureMouseUnlessPopupClose => ref Unsafe.AsRef<bool>(&NativePtr->WantCaptureMouseUnlessPopupClose);
|
||||
public ref Vector2 MousePosPrev => ref Unsafe.AsRef<Vector2>(&NativePtr->MousePosPrev);
|
||||
public RangeAccessor<Vector2> MouseClickedPos => new RangeAccessor<Vector2>(&NativePtr->MouseClickedPos_0, 5);
|
||||
public RangeAccessor<double> MouseClickedTime => new RangeAccessor<double>(NativePtr->MouseClickedTime, 5);
|
||||
public RangeAccessor<bool> MouseClicked => new RangeAccessor<bool>(NativePtr->MouseClicked, 5);
|
||||
public RangeAccessor<bool> MouseDoubleClicked => new RangeAccessor<bool>(NativePtr->MouseDoubleClicked, 5);
|
||||
public RangeAccessor<ushort> MouseClickedCount => new RangeAccessor<ushort>(NativePtr->MouseClickedCount, 5);
|
||||
public RangeAccessor<ushort> MouseClickedLastCount => new RangeAccessor<ushort>(NativePtr->MouseClickedLastCount, 5);
|
||||
public RangeAccessor<bool> MouseReleased => new RangeAccessor<bool>(NativePtr->MouseReleased, 5);
|
||||
public RangeAccessor<bool> MouseDownOwned => new RangeAccessor<bool>(NativePtr->MouseDownOwned, 5);
|
||||
public RangeAccessor<bool> MouseDownOwnedUnlessPopupClose => new RangeAccessor<bool>(NativePtr->MouseDownOwnedUnlessPopupClose, 5);
|
||||
public RangeAccessor<float> MouseDownDuration => new RangeAccessor<float>(NativePtr->MouseDownDuration, 5);
|
||||
public RangeAccessor<float> MouseDownDurationPrev => new RangeAccessor<float>(NativePtr->MouseDownDurationPrev, 5);
|
||||
public RangeAccessor<Vector2> MouseDragMaxDistanceAbs => new RangeAccessor<Vector2>(&NativePtr->MouseDragMaxDistanceAbs_0, 5);
|
||||
public RangeAccessor<float> MouseDragMaxDistanceSqr => new RangeAccessor<float>(NativePtr->MouseDragMaxDistanceSqr, 5);
|
||||
public RangeAccessor<float> NavInputsDownDuration => new RangeAccessor<float>(NativePtr->NavInputsDownDuration, 20);
|
||||
public RangeAccessor<float> NavInputsDownDurationPrev => new RangeAccessor<float>(NativePtr->NavInputsDownDurationPrev, 20);
|
||||
public ref float PenPressure => ref Unsafe.AsRef<float>(&NativePtr->PenPressure);
|
||||
public ref bool AppFocusLost => ref Unsafe.AsRef<bool>(&NativePtr->AppFocusLost);
|
||||
public ref sbyte BackendUsingLegacyKeyArrays => ref Unsafe.AsRef<sbyte>(&NativePtr->BackendUsingLegacyKeyArrays);
|
||||
public ref bool BackendUsingLegacyNavInputArray => ref Unsafe.AsRef<bool>(&NativePtr->BackendUsingLegacyNavInputArray);
|
||||
public ref ushort InputQueueSurrogate => ref Unsafe.AsRef<ushort>(&NativePtr->InputQueueSurrogate);
|
||||
public ImVector<ushort> InputQueueCharacters => new ImVector<ushort>(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);
|
||||
}
|
||||
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 AddMouseViewportEvent(uint id)
|
||||
{
|
||||
ImGuiNative.ImGuiIO_AddMouseViewportEvent((ImGuiIO*)(NativePtr), id);
|
||||
}
|
||||
public void AddMouseWheelEvent(float wh_x, float wh_y)
|
||||
{
|
||||
ImGuiNative.ImGuiIO_AddMouseWheelEvent((ImGuiIO*)(NativePtr), wh_x, wh_y);
|
||||
}
|
||||
public void ClearInputCharacters()
|
||||
{
|
||||
ImGuiNative.ImGuiIO_ClearInputCharacters((ImGuiIO*)(NativePtr));
|
||||
}
|
||||
public void ClearInputKeys()
|
||||
{
|
||||
ImGuiNative.ImGuiIO_ClearInputKeys((ImGuiIO*)(NativePtr));
|
||||
}
|
||||
public void Destroy()
|
||||
{
|
||||
ImGuiNative.ImGuiIO_destroy((ImGuiIO*)(NativePtr));
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,92 @@
|
|||
using System;
|
||||
using System.Numerics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
|
||||
namespace ImGuiNET
|
||||
{
|
||||
public unsafe partial struct ImGuiInputTextCallbackData
|
||||
{
|
||||
public ImGuiInputTextFlags EventFlag;
|
||||
public ImGuiInputTextFlags Flags;
|
||||
public void* UserData;
|
||||
public ushort EventChar;
|
||||
public ImGuiKey EventKey;
|
||||
public byte* Buf;
|
||||
public int BufTextLen;
|
||||
public int BufSize;
|
||||
public byte BufDirty;
|
||||
public int CursorPos;
|
||||
public int SelectionStart;
|
||||
public int SelectionEnd;
|
||||
}
|
||||
public unsafe partial struct ImGuiInputTextCallbackDataPtr
|
||||
{
|
||||
public ImGuiInputTextCallbackData* NativePtr { get; }
|
||||
public ImGuiInputTextCallbackDataPtr(ImGuiInputTextCallbackData* nativePtr) => NativePtr = nativePtr;
|
||||
public ImGuiInputTextCallbackDataPtr(IntPtr nativePtr) => NativePtr = (ImGuiInputTextCallbackData*)nativePtr;
|
||||
public static implicit operator ImGuiInputTextCallbackDataPtr(ImGuiInputTextCallbackData* nativePtr) => new ImGuiInputTextCallbackDataPtr(nativePtr);
|
||||
public static implicit operator ImGuiInputTextCallbackData* (ImGuiInputTextCallbackDataPtr wrappedPtr) => wrappedPtr.NativePtr;
|
||||
public static implicit operator ImGuiInputTextCallbackDataPtr(IntPtr nativePtr) => new ImGuiInputTextCallbackDataPtr(nativePtr);
|
||||
public ref ImGuiInputTextFlags EventFlag => ref Unsafe.AsRef<ImGuiInputTextFlags>(&NativePtr->EventFlag);
|
||||
public ref ImGuiInputTextFlags Flags => ref Unsafe.AsRef<ImGuiInputTextFlags>(&NativePtr->Flags);
|
||||
public IntPtr UserData { get => (IntPtr)NativePtr->UserData; set => NativePtr->UserData = (void*)value; }
|
||||
public ref ushort EventChar => ref Unsafe.AsRef<ushort>(&NativePtr->EventChar);
|
||||
public ref ImGuiKey EventKey => ref Unsafe.AsRef<ImGuiKey>(&NativePtr->EventKey);
|
||||
public IntPtr Buf { get => (IntPtr)NativePtr->Buf; set => NativePtr->Buf = (byte*)value; }
|
||||
public ref int BufTextLen => ref Unsafe.AsRef<int>(&NativePtr->BufTextLen);
|
||||
public ref int BufSize => ref Unsafe.AsRef<int>(&NativePtr->BufSize);
|
||||
public ref bool BufDirty => ref Unsafe.AsRef<bool>(&NativePtr->BufDirty);
|
||||
public ref int CursorPos => ref Unsafe.AsRef<int>(&NativePtr->CursorPos);
|
||||
public ref int SelectionStart => ref Unsafe.AsRef<int>(&NativePtr->SelectionStart);
|
||||
public ref int SelectionEnd => ref Unsafe.AsRef<int>(&NativePtr->SelectionEnd);
|
||||
public void 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;
|
||||
}
|
||||
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; }
|
||||
byte* native_text_end = null;
|
||||
ImGuiNative.ImGuiInputTextCallbackData_InsertChars((ImGuiInputTextCallbackData*)(NativePtr), pos, native_text, native_text_end);
|
||||
if (text_byteCount > Util.StackAllocationSizeLimit)
|
||||
{
|
||||
Util.Free(native_text);
|
||||
}
|
||||
}
|
||||
public void SelectAll()
|
||||
{
|
||||
ImGuiNative.ImGuiInputTextCallbackData_SelectAll((ImGuiInputTextCallbackData*)(NativePtr));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
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,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,146 @@
|
|||
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,
|
||||
Apostrophe = 584,
|
||||
Comma = 585,
|
||||
Minus = 586,
|
||||
Period = 587,
|
||||
Slash = 588,
|
||||
Semicolon = 589,
|
||||
Equal = 590,
|
||||
LeftBracket = 591,
|
||||
Backslash = 592,
|
||||
RightBracket = 593,
|
||||
GraveAccent = 594,
|
||||
CapsLock = 595,
|
||||
ScrollLock = 596,
|
||||
NumLock = 597,
|
||||
PrintScreen = 598,
|
||||
Pause = 599,
|
||||
Keypad0 = 600,
|
||||
Keypad1 = 601,
|
||||
Keypad2 = 602,
|
||||
Keypad3 = 603,
|
||||
Keypad4 = 604,
|
||||
Keypad5 = 605,
|
||||
Keypad6 = 606,
|
||||
Keypad7 = 607,
|
||||
Keypad8 = 608,
|
||||
Keypad9 = 609,
|
||||
KeypadDecimal = 610,
|
||||
KeypadDivide = 611,
|
||||
KeypadMultiply = 612,
|
||||
KeypadSubtract = 613,
|
||||
KeypadAdd = 614,
|
||||
KeypadEnter = 615,
|
||||
KeypadEqual = 616,
|
||||
GamepadStart = 617,
|
||||
GamepadBack = 618,
|
||||
GamepadFaceUp = 619,
|
||||
GamepadFaceDown = 620,
|
||||
GamepadFaceLeft = 621,
|
||||
GamepadFaceRight = 622,
|
||||
GamepadDpadUp = 623,
|
||||
GamepadDpadDown = 624,
|
||||
GamepadDpadLeft = 625,
|
||||
GamepadDpadRight = 626,
|
||||
GamepadL1 = 627,
|
||||
GamepadR1 = 628,
|
||||
GamepadL2 = 629,
|
||||
GamepadR2 = 630,
|
||||
GamepadL3 = 631,
|
||||
GamepadR3 = 632,
|
||||
GamepadLStickUp = 633,
|
||||
GamepadLStickDown = 634,
|
||||
GamepadLStickLeft = 635,
|
||||
GamepadLStickRight = 636,
|
||||
GamepadRStickUp = 637,
|
||||
GamepadRStickDown = 638,
|
||||
GamepadRStickLeft = 639,
|
||||
GamepadRStickRight = 640,
|
||||
ModCtrl = 641,
|
||||
ModShift = 642,
|
||||
ModAlt = 643,
|
||||
ModSuper = 644,
|
||||
COUNT = 645,
|
||||
NamedKey_BEGIN = 512,
|
||||
NamedKey_END = 645,
|
||||
NamedKey_COUNT = 133,
|
||||
KeysData_SIZE = 645,
|
||||
KeysData_OFFSET = 0,
|
||||
}
|
||||
}
|
|
@ -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<bool>(&NativePtr->Down);
|
||||
public ref float DownDuration => ref Unsafe.AsRef<float>(&NativePtr->DownDuration);
|
||||
public ref float DownDurationPrev => ref Unsafe.AsRef<float>(&NativePtr->DownDurationPrev);
|
||||
public ref float AnalogValue => ref Unsafe.AsRef<float>(&NativePtr->AnalogValue);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
namespace ImGuiNET
|
||||
{
|
||||
[System.Flags]
|
||||
public enum ImGuiKeyModFlags
|
||||
{
|
||||
None = 0,
|
||||
Ctrl = 1,
|
||||
Shift = 2,
|
||||
Alt = 4,
|
||||
Super = 8,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
using System;
|
||||
using System.Numerics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
|
||||
namespace ImGuiNET
|
||||
{
|
||||
public unsafe partial struct ImGuiListClipper
|
||||
{
|
||||
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 int DisplayStart => ref Unsafe.AsRef<int>(&NativePtr->DisplayStart);
|
||||
public ref int DisplayEnd => ref Unsafe.AsRef<int>(&NativePtr->DisplayEnd);
|
||||
public ref int ItemsCount => ref Unsafe.AsRef<int>(&NativePtr->ItemsCount);
|
||||
public ref float ItemsHeight => ref Unsafe.AsRef<float>(&NativePtr->ItemsHeight);
|
||||
public ref float StartPosY => ref Unsafe.AsRef<float>(&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 ForceDisplayRangeByIndices(int item_min, int item_max)
|
||||
{
|
||||
ImGuiNative.ImGuiListClipper_ForceDisplayRangeByIndices((ImGuiListClipper*)(NativePtr), item_min, item_max);
|
||||
}
|
||||
public bool Step()
|
||||
{
|
||||
byte ret = ImGuiNative.ImGuiListClipper_Step((ImGuiListClipper*)(NativePtr));
|
||||
return ret != 0;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
namespace ImGuiNET
|
||||
{
|
||||
public enum ImGuiMouseButton
|
||||
{
|
||||
Left = 0,
|
||||
Right = 1,
|
||||
Middle = 2,
|
||||
COUNT = 5,
|
||||
}
|
||||
}
|
|
@ -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,
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,27 @@
|
|||
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,
|
||||
KeyLeft = 16,
|
||||
KeyRight = 17,
|
||||
KeyUp = 18,
|
||||
KeyDown = 19,
|
||||
COUNT = 20,
|
||||
}
|
||||
}
|
|
@ -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<int>(&NativePtr->RefFrame);
|
||||
public void Destroy()
|
||||
{
|
||||
ImGuiNative.ImGuiOnceUponAFrame_destroy((ImGuiOnceUponAFrame*)(NativePtr));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
using System;
|
||||
using System.Numerics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
|
||||
namespace ImGuiNET
|
||||
{
|
||||
public unsafe partial struct ImGuiPayload
|
||||
{
|
||||
public void* Data;
|
||||
public int DataSize;
|
||||
public uint SourceId;
|
||||
public uint SourceParentId;
|
||||
public int DataFrameCount;
|
||||
public fixed byte DataType[33];
|
||||
public byte Preview;
|
||||
public byte Delivery;
|
||||
}
|
||||
public unsafe partial struct ImGuiPayloadPtr
|
||||
{
|
||||
public ImGuiPayload* NativePtr { get; }
|
||||
public ImGuiPayloadPtr(ImGuiPayload* nativePtr) => NativePtr = nativePtr;
|
||||
public ImGuiPayloadPtr(IntPtr nativePtr) => NativePtr = (ImGuiPayload*)nativePtr;
|
||||
public static implicit operator ImGuiPayloadPtr(ImGuiPayload* nativePtr) => new ImGuiPayloadPtr(nativePtr);
|
||||
public static implicit operator ImGuiPayload* (ImGuiPayloadPtr wrappedPtr) => wrappedPtr.NativePtr;
|
||||
public static implicit operator ImGuiPayloadPtr(IntPtr nativePtr) => new ImGuiPayloadPtr(nativePtr);
|
||||
public IntPtr Data { get => (IntPtr)NativePtr->Data; set => NativePtr->Data = (void*)value; }
|
||||
public ref int DataSize => ref Unsafe.AsRef<int>(&NativePtr->DataSize);
|
||||
public ref uint SourceId => ref Unsafe.AsRef<uint>(&NativePtr->SourceId);
|
||||
public ref uint SourceParentId => ref Unsafe.AsRef<uint>(&NativePtr->SourceParentId);
|
||||
public ref int DataFrameCount => ref Unsafe.AsRef<int>(&NativePtr->DataFrameCount);
|
||||
public RangeAccessor<byte> DataType => new RangeAccessor<byte>(NativePtr->DataType, 33);
|
||||
public ref bool Preview => ref Unsafe.AsRef<bool>(&NativePtr->Preview);
|
||||
public ref bool Delivery => ref Unsafe.AsRef<bool>(&NativePtr->Delivery);
|
||||
public void Clear()
|
||||
{
|
||||
ImGuiNative.ImGuiPayload_Clear((ImGuiPayload*)(NativePtr));
|
||||
}
|
||||
public void Destroy()
|
||||
{
|
||||
ImGuiNative.ImGuiPayload_destroy((ImGuiPayload*)(NativePtr));
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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<IntPtr>(&NativePtr->Platform_CreateWindow);
|
||||
public ref IntPtr Platform_DestroyWindow => ref Unsafe.AsRef<IntPtr>(&NativePtr->Platform_DestroyWindow);
|
||||
public ref IntPtr Platform_ShowWindow => ref Unsafe.AsRef<IntPtr>(&NativePtr->Platform_ShowWindow);
|
||||
public ref IntPtr Platform_SetWindowPos => ref Unsafe.AsRef<IntPtr>(&NativePtr->Platform_SetWindowPos);
|
||||
public ref IntPtr Platform_GetWindowPos => ref Unsafe.AsRef<IntPtr>(&NativePtr->Platform_GetWindowPos);
|
||||
public ref IntPtr Platform_SetWindowSize => ref Unsafe.AsRef<IntPtr>(&NativePtr->Platform_SetWindowSize);
|
||||
public ref IntPtr Platform_GetWindowSize => ref Unsafe.AsRef<IntPtr>(&NativePtr->Platform_GetWindowSize);
|
||||
public ref IntPtr Platform_SetWindowFocus => ref Unsafe.AsRef<IntPtr>(&NativePtr->Platform_SetWindowFocus);
|
||||
public ref IntPtr Platform_GetWindowFocus => ref Unsafe.AsRef<IntPtr>(&NativePtr->Platform_GetWindowFocus);
|
||||
public ref IntPtr Platform_GetWindowMinimized => ref Unsafe.AsRef<IntPtr>(&NativePtr->Platform_GetWindowMinimized);
|
||||
public ref IntPtr Platform_SetWindowTitle => ref Unsafe.AsRef<IntPtr>(&NativePtr->Platform_SetWindowTitle);
|
||||
public ref IntPtr Platform_SetWindowAlpha => ref Unsafe.AsRef<IntPtr>(&NativePtr->Platform_SetWindowAlpha);
|
||||
public ref IntPtr Platform_UpdateWindow => ref Unsafe.AsRef<IntPtr>(&NativePtr->Platform_UpdateWindow);
|
||||
public ref IntPtr Platform_RenderWindow => ref Unsafe.AsRef<IntPtr>(&NativePtr->Platform_RenderWindow);
|
||||
public ref IntPtr Platform_SwapBuffers => ref Unsafe.AsRef<IntPtr>(&NativePtr->Platform_SwapBuffers);
|
||||
public ref IntPtr Platform_GetWindowDpiScale => ref Unsafe.AsRef<IntPtr>(&NativePtr->Platform_GetWindowDpiScale);
|
||||
public ref IntPtr Platform_OnChangedViewport => ref Unsafe.AsRef<IntPtr>(&NativePtr->Platform_OnChangedViewport);
|
||||
public ref IntPtr Platform_CreateVkSurface => ref Unsafe.AsRef<IntPtr>(&NativePtr->Platform_CreateVkSurface);
|
||||
public ref IntPtr Renderer_CreateWindow => ref Unsafe.AsRef<IntPtr>(&NativePtr->Renderer_CreateWindow);
|
||||
public ref IntPtr Renderer_DestroyWindow => ref Unsafe.AsRef<IntPtr>(&NativePtr->Renderer_DestroyWindow);
|
||||
public ref IntPtr Renderer_SetWindowSize => ref Unsafe.AsRef<IntPtr>(&NativePtr->Renderer_SetWindowSize);
|
||||
public ref IntPtr Renderer_RenderWindow => ref Unsafe.AsRef<IntPtr>(&NativePtr->Renderer_RenderWindow);
|
||||
public ref IntPtr Renderer_SwapBuffers => ref Unsafe.AsRef<IntPtr>(&NativePtr->Renderer_SwapBuffers);
|
||||
public ImPtrVector<ImGuiPlatformMonitorPtr> Monitors => new ImPtrVector<ImGuiPlatformMonitorPtr>(NativePtr->Monitors, Unsafe.SizeOf<ImGuiPlatformMonitor>());
|
||||
public ImVector<ImGuiViewportPtr> Viewports => new ImVector<ImGuiViewportPtr>(NativePtr->Viewports);
|
||||
public void Destroy()
|
||||
{
|
||||
ImGuiNative.ImGuiPlatformIO_destroy((ImGuiPlatformIO*)(NativePtr));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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<bool>(&NativePtr->WantVisible);
|
||||
public ref Vector2 InputPos => ref Unsafe.AsRef<Vector2>(&NativePtr->InputPos);
|
||||
public ref float InputLineHeight => ref Unsafe.AsRef<float>(&NativePtr->InputLineHeight);
|
||||
public void Destroy()
|
||||
{
|
||||
ImGuiNative.ImGuiPlatformImeData_destroy((ImGuiPlatformImeData*)(NativePtr));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
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 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<Vector2>(&NativePtr->MainPos);
|
||||
public ref Vector2 MainSize => ref Unsafe.AsRef<Vector2>(&NativePtr->MainSize);
|
||||
public ref Vector2 WorkPos => ref Unsafe.AsRef<Vector2>(&NativePtr->WorkPos);
|
||||
public ref Vector2 WorkSize => ref Unsafe.AsRef<Vector2>(&NativePtr->WorkSize);
|
||||
public ref float DpiScale => ref Unsafe.AsRef<float>(&NativePtr->DpiScale);
|
||||
public void Destroy()
|
||||
{
|
||||
ImGuiNative.ImGuiPlatformMonitor_destroy((ImGuiPlatformMonitor*)(NativePtr));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
namespace ImGuiNET
|
||||
{
|
||||
[System.Flags]
|
||||
public enum ImGuiSelectableFlags
|
||||
{
|
||||
None = 0,
|
||||
DontClosePopups = 1,
|
||||
SpanAllColumns = 2,
|
||||
AllowDoubleClick = 4,
|
||||
Disabled = 8,
|
||||
AllowItemOverlap = 16,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
using System;
|
||||
using System.Numerics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
|
||||
namespace ImGuiNET
|
||||
{
|
||||
public unsafe partial struct ImGuiSizeCallbackData
|
||||
{
|
||||
public void* UserData;
|
||||
public Vector2 Pos;
|
||||
public Vector2 CurrentSize;
|
||||
public Vector2 DesiredSize;
|
||||
}
|
||||
public unsafe partial struct ImGuiSizeCallbackDataPtr
|
||||
{
|
||||
public ImGuiSizeCallbackData* NativePtr { get; }
|
||||
public ImGuiSizeCallbackDataPtr(ImGuiSizeCallbackData* nativePtr) => NativePtr = nativePtr;
|
||||
public ImGuiSizeCallbackDataPtr(IntPtr nativePtr) => NativePtr = (ImGuiSizeCallbackData*)nativePtr;
|
||||
public static implicit operator ImGuiSizeCallbackDataPtr(ImGuiSizeCallbackData* nativePtr) => new ImGuiSizeCallbackDataPtr(nativePtr);
|
||||
public static implicit operator ImGuiSizeCallbackData* (ImGuiSizeCallbackDataPtr wrappedPtr) => wrappedPtr.NativePtr;
|
||||
public static implicit operator ImGuiSizeCallbackDataPtr(IntPtr nativePtr) => new ImGuiSizeCallbackDataPtr(nativePtr);
|
||||
public IntPtr UserData { get => (IntPtr)NativePtr->UserData; set => NativePtr->UserData = (void*)value; }
|
||||
public ref Vector2 Pos => ref Unsafe.AsRef<Vector2>(&NativePtr->Pos);
|
||||
public ref Vector2 CurrentSize => ref Unsafe.AsRef<Vector2>(&NativePtr->CurrentSize);
|
||||
public ref Vector2 DesiredSize => ref Unsafe.AsRef<Vector2>(&NativePtr->DesiredSize);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
namespace ImGuiNET
|
||||
{
|
||||
[System.Flags]
|
||||
public enum ImGuiSliderFlags
|
||||
{
|
||||
None = 0,
|
||||
AlwaysClamp = 16,
|
||||
Logarithmic = 32,
|
||||
NoRoundToFormat = 64,
|
||||
NoInput = 128,
|
||||
InvalidMask = 1879048207,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
namespace ImGuiNET
|
||||
{
|
||||
public enum ImGuiSortDirection
|
||||
{
|
||||
None = 0,
|
||||
Ascending = 1,
|
||||
Descending = 2,
|
||||
}
|
||||
}
|
|
@ -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<ImGuiStoragePairPtr> Data => new ImPtrVector<ImGuiStoragePairPtr>(NativePtr->Data, Unsafe.SizeOf<ImGuiStoragePair>());
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,164 @@
|
|||
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 ImGuiDir ColorButtonPosition;
|
||||
public Vector2 ButtonTextAlign;
|
||||
public Vector2 SelectableTextAlign;
|
||||
public Vector2 DisplayWindowPadding;
|
||||
public Vector2 DisplaySafeAreaPadding;
|
||||
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 unsafe partial struct ImGuiStylePtr
|
||||
{
|
||||
public ImGuiStyle* NativePtr { get; }
|
||||
public ImGuiStylePtr(ImGuiStyle* nativePtr) => NativePtr = nativePtr;
|
||||
public ImGuiStylePtr(IntPtr nativePtr) => NativePtr = (ImGuiStyle*)nativePtr;
|
||||
public static implicit operator ImGuiStylePtr(ImGuiStyle* nativePtr) => new ImGuiStylePtr(nativePtr);
|
||||
public static implicit operator ImGuiStyle* (ImGuiStylePtr wrappedPtr) => wrappedPtr.NativePtr;
|
||||
public static implicit operator ImGuiStylePtr(IntPtr nativePtr) => new ImGuiStylePtr(nativePtr);
|
||||
public ref float Alpha => ref Unsafe.AsRef<float>(&NativePtr->Alpha);
|
||||
public ref float DisabledAlpha => ref Unsafe.AsRef<float>(&NativePtr->DisabledAlpha);
|
||||
public ref Vector2 WindowPadding => ref Unsafe.AsRef<Vector2>(&NativePtr->WindowPadding);
|
||||
public ref float WindowRounding => ref Unsafe.AsRef<float>(&NativePtr->WindowRounding);
|
||||
public ref float WindowBorderSize => ref Unsafe.AsRef<float>(&NativePtr->WindowBorderSize);
|
||||
public ref Vector2 WindowMinSize => ref Unsafe.AsRef<Vector2>(&NativePtr->WindowMinSize);
|
||||
public ref Vector2 WindowTitleAlign => ref Unsafe.AsRef<Vector2>(&NativePtr->WindowTitleAlign);
|
||||
public ref ImGuiDir WindowMenuButtonPosition => ref Unsafe.AsRef<ImGuiDir>(&NativePtr->WindowMenuButtonPosition);
|
||||
public ref float ChildRounding => ref Unsafe.AsRef<float>(&NativePtr->ChildRounding);
|
||||
public ref float ChildBorderSize => ref Unsafe.AsRef<float>(&NativePtr->ChildBorderSize);
|
||||
public ref float PopupRounding => ref Unsafe.AsRef<float>(&NativePtr->PopupRounding);
|
||||
public ref float PopupBorderSize => ref Unsafe.AsRef<float>(&NativePtr->PopupBorderSize);
|
||||
public ref Vector2 FramePadding => ref Unsafe.AsRef<Vector2>(&NativePtr->FramePadding);
|
||||
public ref float FrameRounding => ref Unsafe.AsRef<float>(&NativePtr->FrameRounding);
|
||||
public ref float FrameBorderSize => ref Unsafe.AsRef<float>(&NativePtr->FrameBorderSize);
|
||||
public ref Vector2 ItemSpacing => ref Unsafe.AsRef<Vector2>(&NativePtr->ItemSpacing);
|
||||
public ref Vector2 ItemInnerSpacing => ref Unsafe.AsRef<Vector2>(&NativePtr->ItemInnerSpacing);
|
||||
public ref Vector2 CellPadding => ref Unsafe.AsRef<Vector2>(&NativePtr->CellPadding);
|
||||
public ref Vector2 TouchExtraPadding => ref Unsafe.AsRef<Vector2>(&NativePtr->TouchExtraPadding);
|
||||
public ref float IndentSpacing => ref Unsafe.AsRef<float>(&NativePtr->IndentSpacing);
|
||||
public ref float ColumnsMinSpacing => ref Unsafe.AsRef<float>(&NativePtr->ColumnsMinSpacing);
|
||||
public ref float ScrollbarSize => ref Unsafe.AsRef<float>(&NativePtr->ScrollbarSize);
|
||||
public ref float ScrollbarRounding => ref Unsafe.AsRef<float>(&NativePtr->ScrollbarRounding);
|
||||
public ref float GrabMinSize => ref Unsafe.AsRef<float>(&NativePtr->GrabMinSize);
|
||||
public ref float GrabRounding => ref Unsafe.AsRef<float>(&NativePtr->GrabRounding);
|
||||
public ref float LogSliderDeadzone => ref Unsafe.AsRef<float>(&NativePtr->LogSliderDeadzone);
|
||||
public ref float TabRounding => ref Unsafe.AsRef<float>(&NativePtr->TabRounding);
|
||||
public ref float TabBorderSize => ref Unsafe.AsRef<float>(&NativePtr->TabBorderSize);
|
||||
public ref float TabMinWidthForCloseButton => ref Unsafe.AsRef<float>(&NativePtr->TabMinWidthForCloseButton);
|
||||
public ref ImGuiDir ColorButtonPosition => ref Unsafe.AsRef<ImGuiDir>(&NativePtr->ColorButtonPosition);
|
||||
public ref Vector2 ButtonTextAlign => ref Unsafe.AsRef<Vector2>(&NativePtr->ButtonTextAlign);
|
||||
public ref Vector2 SelectableTextAlign => ref Unsafe.AsRef<Vector2>(&NativePtr->SelectableTextAlign);
|
||||
public ref Vector2 DisplayWindowPadding => ref Unsafe.AsRef<Vector2>(&NativePtr->DisplayWindowPadding);
|
||||
public ref Vector2 DisplaySafeAreaPadding => ref Unsafe.AsRef<Vector2>(&NativePtr->DisplaySafeAreaPadding);
|
||||
public ref float MouseCursorScale => ref Unsafe.AsRef<float>(&NativePtr->MouseCursorScale);
|
||||
public ref bool AntiAliasedLines => ref Unsafe.AsRef<bool>(&NativePtr->AntiAliasedLines);
|
||||
public ref bool AntiAliasedLinesUseTex => ref Unsafe.AsRef<bool>(&NativePtr->AntiAliasedLinesUseTex);
|
||||
public ref bool AntiAliasedFill => ref Unsafe.AsRef<bool>(&NativePtr->AntiAliasedFill);
|
||||
public ref float CurveTessellationTol => ref Unsafe.AsRef<float>(&NativePtr->CurveTessellationTol);
|
||||
public ref float CircleTessellationMaxError => ref Unsafe.AsRef<float>(&NativePtr->CircleTessellationMaxError);
|
||||
public RangeAccessor<Vector4> Colors => new RangeAccessor<Vector4>(&NativePtr->Colors_0, 55);
|
||||
public void Destroy()
|
||||
{
|
||||
ImGuiNative.ImGuiStyle_destroy((ImGuiStyle*)(NativePtr));
|
||||
}
|
||||
public void ScaleAllSizes(float scale_factor)
|
||||
{
|
||||
ImGuiNative.ImGuiStyle_ScaleAllSizes((ImGuiStyle*)(NativePtr), scale_factor);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
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,
|
||||
ButtonTextAlign = 23,
|
||||
SelectableTextAlign = 24,
|
||||
COUNT = 25,
|
||||
}
|
||||
}
|
|
@ -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,
|
||||
}
|
||||
}
|
|
@ -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,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
namespace ImGuiNET
|
||||
{
|
||||
public enum ImGuiTableBgTarget
|
||||
{
|
||||
None = 0,
|
||||
RowBg0 = 1,
|
||||
RowBg1 = 2,
|
||||
CellBg = 3,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
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,
|
||||
IsEnabled = 16777216,
|
||||
IsVisible = 33554432,
|
||||
IsSorted = 67108864,
|
||||
IsHovered = 134217728,
|
||||
WidthMask = 24,
|
||||
IndentMask = 196608,
|
||||
StatusMask = 251658240,
|
||||
NoDirectResize = 1073741824,
|
||||
}
|
||||
}
|
|
@ -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<uint>(&NativePtr->ColumnUserID);
|
||||
public ref short ColumnIndex => ref Unsafe.AsRef<short>(&NativePtr->ColumnIndex);
|
||||
public ref short SortOrder => ref Unsafe.AsRef<short>(&NativePtr->SortOrder);
|
||||
public ref ImGuiSortDirection SortDirection => ref Unsafe.AsRef<ImGuiSortDirection>(&NativePtr->SortDirection);
|
||||
public void Destroy()
|
||||
{
|
||||
ImGuiNative.ImGuiTableColumnSortSpecs_destroy((ImGuiTableColumnSortSpecs*)(NativePtr));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
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,
|
||||
SizingMask = 57344,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
namespace ImGuiNET
|
||||
{
|
||||
[System.Flags]
|
||||
public enum ImGuiTableRowFlags
|
||||
{
|
||||
None = 0,
|
||||
Headers = 1,
|
||||
}
|
||||
}
|
|
@ -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<int>(&NativePtr->SpecsCount);
|
||||
public ref bool SpecsDirty => ref Unsafe.AsRef<bool>(&NativePtr->SpecsDirty);
|
||||
public void Destroy()
|
||||
{
|
||||
ImGuiNative.ImGuiTableSortSpecs_destroy((ImGuiTableSortSpecs*)(NativePtr));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,112 @@
|
|||
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<byte> Buf => new ImVector<byte>(NativePtr->Buf);
|
||||
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; }
|
||||
byte* native_str_end = null;
|
||||
ImGuiNative.ImGuiTextBuffer_append((ImGuiTextBuffer*)(NativePtr), native_str, native_str_end);
|
||||
if (str_byteCount > Util.StackAllocationSizeLimit)
|
||||
{
|
||||
Util.Free(native_str);
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,150 @@
|
|||
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<byte> InputBuf => new RangeAccessor<byte>(NativePtr->InputBuf, 256);
|
||||
public ImPtrVector<ImGuiTextRangePtr> Filters => new ImPtrVector<ImGuiTextRangePtr>(NativePtr->Filters, Unsafe.SizeOf<ImGuiTextRange>());
|
||||
public ref int CountGrep => ref Unsafe.AsRef<int>(&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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
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* native_text_end = null;
|
||||
byte ret = ImGuiNative.ImGuiTextFilter_PassFilter((ImGuiTextFilter*)(NativePtr), native_text, native_text_end);
|
||||
if (text_byteCount > Util.StackAllocationSizeLimit)
|
||||
{
|
||||
Util.Free(native_text);
|
||||
}
|
||||
return ret != 0;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
namespace ImGuiNET
|
||||
{
|
||||
[System.Flags]
|
||||
public enum ImGuiTreeNodeFlags
|
||||
{
|
||||
None = 0,
|
||||
Selected = 1,
|
||||
Framed = 2,
|
||||
AllowItemOverlap = 4,
|
||||
NoTreePushOnOpen = 8,
|
||||
NoAutoOpenOnLog = 16,
|
||||
DefaultOpen = 32,
|
||||
OpenOnDoubleClick = 64,
|
||||
OpenOnArrow = 128,
|
||||
Leaf = 256,
|
||||
Bullet = 512,
|
||||
FramePadding = 1024,
|
||||
SpanAvailWidth = 2048,
|
||||
SpanFullWidth = 4096,
|
||||
NavLeftJumpsBackHere = 8192,
|
||||
CollapsingHeader = 26,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
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 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<uint>(&NativePtr->ID);
|
||||
public ref ImGuiViewportFlags Flags => ref Unsafe.AsRef<ImGuiViewportFlags>(&NativePtr->Flags);
|
||||
public ref Vector2 Pos => ref Unsafe.AsRef<Vector2>(&NativePtr->Pos);
|
||||
public ref Vector2 Size => ref Unsafe.AsRef<Vector2>(&NativePtr->Size);
|
||||
public ref Vector2 WorkPos => ref Unsafe.AsRef<Vector2>(&NativePtr->WorkPos);
|
||||
public ref Vector2 WorkSize => ref Unsafe.AsRef<Vector2>(&NativePtr->WorkSize);
|
||||
public ref float DpiScale => ref Unsafe.AsRef<float>(&NativePtr->DpiScale);
|
||||
public ref uint ParentViewportId => ref Unsafe.AsRef<uint>(&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 PlatformRequestMove => ref Unsafe.AsRef<bool>(&NativePtr->PlatformRequestMove);
|
||||
public ref bool PlatformRequestResize => ref Unsafe.AsRef<bool>(&NativePtr->PlatformRequestResize);
|
||||
public ref bool PlatformRequestClose => ref Unsafe.AsRef<bool>(&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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
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,
|
||||
TopMost = 512,
|
||||
Minimized = 1024,
|
||||
NoAutoMerge = 2048,
|
||||
CanHostOtherWindows = 4096,
|
||||
}
|
||||
}
|
|
@ -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<uint>(&NativePtr->ClassId);
|
||||
public ref uint ParentViewportId => ref Unsafe.AsRef<uint>(&NativePtr->ParentViewportId);
|
||||
public ref ImGuiViewportFlags ViewportFlagsOverrideSet => ref Unsafe.AsRef<ImGuiViewportFlags>(&NativePtr->ViewportFlagsOverrideSet);
|
||||
public ref ImGuiViewportFlags ViewportFlagsOverrideClear => ref Unsafe.AsRef<ImGuiViewportFlags>(&NativePtr->ViewportFlagsOverrideClear);
|
||||
public ref ImGuiTabItemFlags TabItemFlagsOverrideSet => ref Unsafe.AsRef<ImGuiTabItemFlags>(&NativePtr->TabItemFlagsOverrideSet);
|
||||
public ref ImGuiDockNodeFlags DockNodeFlagsOverrideSet => ref Unsafe.AsRef<ImGuiDockNodeFlags>(&NativePtr->DockNodeFlagsOverrideSet);
|
||||
public ref bool DockingAlwaysTabBar => ref Unsafe.AsRef<bool>(&NativePtr->DockingAlwaysTabBar);
|
||||
public ref bool DockingAllowUnclassed => ref Unsafe.AsRef<bool>(&NativePtr->DockingAllowUnclassed);
|
||||
public void Destroy()
|
||||
{
|
||||
ImGuiNative.ImGuiWindowClass_destroy((ImGuiWindowClass*)(NativePtr));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
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,
|
||||
AlwaysUseWindowPadding = 65536,
|
||||
NoNavInputs = 262144,
|
||||
NoNavFocus = 524288,
|
||||
UnsavedDocument = 1048576,
|
||||
NoDocking = 2097152,
|
||||
NoNav = 786432,
|
||||
NoDecoration = 43,
|
||||
NoInputs = 786944,
|
||||
NavFlattened = 8388608,
|
||||
ChildWindow = 16777216,
|
||||
Tooltip = 33554432,
|
||||
Popup = 67108864,
|
||||
Modal = 134217728,
|
||||
ChildMenu = 268435456,
|
||||
DockNodeHost = 536870912,
|
||||
}
|
||||
}
|
|
@ -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<int>(&NativePtr->cursor);
|
||||
public ref int select_start => ref Unsafe.AsRef<int>(&NativePtr->select_start);
|
||||
public ref int select_end => ref Unsafe.AsRef<int>(&NativePtr->select_end);
|
||||
public ref byte insert_mode => ref Unsafe.AsRef<byte>(&NativePtr->insert_mode);
|
||||
public ref int row_count_per_page => ref Unsafe.AsRef<int>(&NativePtr->row_count_per_page);
|
||||
public ref byte cursor_at_end_of_line => ref Unsafe.AsRef<byte>(&NativePtr->cursor_at_end_of_line);
|
||||
public ref byte initialized => ref Unsafe.AsRef<byte>(&NativePtr->initialized);
|
||||
public ref byte has_preferred_x => ref Unsafe.AsRef<byte>(&NativePtr->has_preferred_x);
|
||||
public ref byte single_line => ref Unsafe.AsRef<byte>(&NativePtr->single_line);
|
||||
public ref byte padding1 => ref Unsafe.AsRef<byte>(&NativePtr->padding1);
|
||||
public ref byte padding2 => ref Unsafe.AsRef<byte>(&NativePtr->padding2);
|
||||
public ref byte padding3 => ref Unsafe.AsRef<byte>(&NativePtr->padding3);
|
||||
public ref float preferred_x => ref Unsafe.AsRef<float>(&NativePtr->preferred_x);
|
||||
public ref StbUndoState undostate => ref Unsafe.AsRef<StbUndoState>(&NativePtr->undostate);
|
||||
}
|
||||
}
|
|
@ -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<float>(&NativePtr->x0);
|
||||
public ref float x1 => ref Unsafe.AsRef<float>(&NativePtr->x1);
|
||||
public ref float baseline_y_delta => ref Unsafe.AsRef<float>(&NativePtr->baseline_y_delta);
|
||||
public ref float ymin => ref Unsafe.AsRef<float>(&NativePtr->ymin);
|
||||
public ref float ymax => ref Unsafe.AsRef<float>(&NativePtr->ymax);
|
||||
public ref int num_chars => ref Unsafe.AsRef<int>(&NativePtr->num_chars);
|
||||
}
|
||||
}
|
|
@ -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<int>(&NativePtr->where);
|
||||
public ref int insert_length => ref Unsafe.AsRef<int>(&NativePtr->insert_length);
|
||||
public ref int delete_length => ref Unsafe.AsRef<int>(&NativePtr->delete_length);
|
||||
public ref int char_storage => ref Unsafe.AsRef<int>(&NativePtr->char_storage);
|
||||
}
|
||||
}
|
|
@ -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<StbUndoRecord> undo_rec => new RangeAccessor<StbUndoRecord>(&NativePtr->undo_rec_0, 99);
|
||||
public RangeAccessor<ushort> undo_char => new RangeAccessor<ushort>(NativePtr->undo_char, 999);
|
||||
public ref short undo_point => ref Unsafe.AsRef<short>(&NativePtr->undo_point);
|
||||
public ref short redo_point => ref Unsafe.AsRef<short>(&NativePtr->redo_point);
|
||||
public ref int undo_char_point => ref Unsafe.AsRef<int>(&NativePtr->undo_char_point);
|
||||
public ref int redo_char_point => ref Unsafe.AsRef<int>(&NativePtr->redo_char_point);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
namespace ImGuiNET
|
||||
{
|
||||
public unsafe partial struct ImDrawDataPtr
|
||||
{
|
||||
public RangePtrAccessor<ImDrawListPtr> CmdListsRange => new RangePtrAccessor<ImDrawListPtr>(CmdLists.ToPointer(), CmdListsCount);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
using System.Numerics;
|
||||
using System.Text;
|
||||
|
||||
namespace ImGuiNET
|
||||
{
|
||||
public unsafe partial struct ImDrawListPtr
|
||||
{
|
||||
public void AddText(Vector2 pos, uint col, string text_begin)
|
||||
{
|
||||
int text_begin_byteCount = Encoding.UTF8.GetByteCount(text_begin);
|
||||
byte* native_text_begin = stackalloc byte[text_begin_byteCount + 1];
|
||||
fixed (char* text_begin_ptr = text_begin)
|
||||
{
|
||||
int native_text_begin_offset = Encoding.UTF8.GetBytes(text_begin_ptr, text_begin.Length, native_text_begin, text_begin_byteCount);
|
||||
native_text_begin[native_text_begin_offset] = 0;
|
||||
}
|
||||
byte* native_text_end = null;
|
||||
ImGuiNative.ImDrawList_AddText_Vec2(NativePtr, pos, col, native_text_begin, native_text_end);
|
||||
}
|
||||
|
||||
public void AddText(ImFontPtr font, float font_size, Vector2 pos, uint col, string text_begin)
|
||||
{
|
||||
ImFont* native_font = font.NativePtr;
|
||||
int text_begin_byteCount = Encoding.UTF8.GetByteCount(text_begin);
|
||||
byte* native_text_begin = stackalloc byte[text_begin_byteCount + 1];
|
||||
fixed (char* text_begin_ptr = text_begin)
|
||||
{
|
||||
int native_text_begin_offset = Encoding.UTF8.GetBytes(text_begin_ptr, text_begin.Length, native_text_begin, text_begin_byteCount);
|
||||
native_text_begin[native_text_begin_offset] = 0;
|
||||
}
|
||||
byte* native_text_end = null;
|
||||
float wrap_width = 0.0f;
|
||||
Vector4* cpu_fine_clip_rect = null;
|
||||
ImGuiNative.ImDrawList_AddText_FontPtr(NativePtr, native_font, font_size, pos, col, native_text_begin, native_text_end, wrap_width, cpu_fine_clip_rect);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,520 @@
|
|||
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)
|
||||
=> CalcTextSizeImpl(text);
|
||||
|
||||
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, bool hideTextAfterDoubleHash)
|
||||
=> CalcTextSizeImpl(text, hideTextAfterDoubleHash: hideTextAfterDoubleHash);
|
||||
|
||||
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, bool hideTextAfterDoubleHash, float wrapWidth)
|
||||
=> CalcTextSizeImpl(text, hideTextAfterDoubleHash: hideTextAfterDoubleHash, 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)
|
||||
{
|
||||
Vector2 ret;
|
||||
byte* nativeTextStart = null;
|
||||
byte* nativeTextEnd = null;
|
||||
int textByteCount = 0;
|
||||
if (text != null)
|
||||
{
|
||||
|
||||
int textToCopyLen = length.HasValue ? length.Value : text.Length;
|
||||
textByteCount = Util.CalcSizeInUtf8(text, start, textToCopyLen);
|
||||
if (textByteCount > Util.StackAllocationSizeLimit)
|
||||
{
|
||||
nativeTextStart = Util.Allocate(textByteCount + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
byte* nativeTextStackBytes = stackalloc byte[textByteCount + 1];
|
||||
nativeTextStart = nativeTextStackBytes;
|
||||
}
|
||||
|
||||
int nativeTextOffset = Util.GetUtf8(text, start, textToCopyLen, nativeTextStart, textByteCount);
|
||||
nativeTextStart[nativeTextOffset] = 0;
|
||||
nativeTextEnd = nativeTextStart + nativeTextOffset;
|
||||
}
|
||||
|
||||
ImGuiNative.igCalcTextSize(&ret, nativeTextStart, nativeTextEnd, *((byte*)(&hideTextAfterDoubleHash)), wrapWidth);
|
||||
if (textByteCount > Util.StackAllocationSizeLimit)
|
||||
{
|
||||
Util.Free(nativeTextStart);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<Description>A .NET wrapper for the Dear ImGui library.</Description>
|
||||
<AssemblyVersion>1.87.2</AssemblyVersion>
|
||||
<Authors>Eric Mellino</Authors>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<DebugType>portable</DebugType>
|
||||
<AssemblyName>ImGui.NET</AssemblyName>
|
||||
<PackageId>ImGui.NET</PackageId>
|
||||
<PackagePrereleaseIdentifier></PackagePrereleaseIdentifier>
|
||||
<PackageVersion>$(AssemblyVersion)$(PackagePrereleaseIdentifier)</PackageVersion>
|
||||
<PackageTags>ImGui ImGui.NET Immediate Mode GUI</PackageTags>
|
||||
<PackageProjectUrl>https://github.com/mellinoe/imgui.net</PackageProjectUrl>
|
||||
<DocumentationFile Condition="'$(Configuration)' == 'Release'">$(OutputPath)\ImGui.NET.xml</DocumentationFile>
|
||||
<RootNamespace>ImGuiNET</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.Numerics.Vectors" Version="4.4.0" />
|
||||
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="4.4.0" />
|
||||
<PackageReference Include="System.Buffers" Version="4.4.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
|
||||
<_Parameter1>ImPlot.NET</_Parameter1>
|
||||
</AssemblyAttribute>
|
||||
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
|
||||
<_Parameter1>ImNodes.NET</_Parameter1>
|
||||
</AssemblyAttribute>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="..\..\deps\cimgui\win-x86\cimgui.dll">
|
||||
<PackagePath>runtimes/win-x86/native</PackagePath>
|
||||
<Pack>true</Pack>
|
||||
</Content>
|
||||
<Content Include="..\..\deps\cimgui\win-x64\cimgui.dll">
|
||||
<PackagePath>runtimes/win-x64/native</PackagePath>
|
||||
<Pack>true</Pack>
|
||||
</Content>
|
||||
<Content Include="..\..\deps\cimgui\linux-x64\cimgui.so">
|
||||
<PackagePath>runtimes/linux-x64/native/libcimgui.so</PackagePath>
|
||||
<Pack>true</Pack>
|
||||
</Content>
|
||||
<Content Include="..\..\deps\cimgui\osx-universal\cimgui.dylib">
|
||||
<PackagePath>runtimes/osx-universal/native/libcimgui.dylib</PackagePath>
|
||||
<Pack>true</Pack>
|
||||
</Content>
|
||||
<Content Include="build\net40\ImGui.NET.targets">
|
||||
<PackagePath>build/net40/ImGui.NET.targets</PackagePath>
|
||||
<Pack>true</Pack>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Generated\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,4 @@
|
|||
namespace ImGuiNET
|
||||
{
|
||||
public unsafe delegate void ImGuiSizeCallback(ImGuiSizeCallbackData* data);
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
namespace ImGuiNET
|
||||
{
|
||||
public unsafe delegate int ImGuiInputTextCallback(ImGuiInputTextCallbackData* data);
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
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 ref T Ref<T>(int index)
|
||||
{
|
||||
return ref Unsafe.AsRef<T>((byte*)Data + index * Unsafe.SizeOf<T>());
|
||||
}
|
||||
|
||||
public IntPtr Address<T>(int index)
|
||||
{
|
||||
return (IntPtr)((byte*)Data + index * Unsafe.SizeOf<T>());
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe struct ImVector<T>
|
||||
{
|
||||
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<T>((byte*)Data + index * Unsafe.SizeOf<T>());
|
||||
}
|
||||
|
||||
public unsafe struct ImPtrVector<T>
|
||||
{
|
||||
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<T>(&address);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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();
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
|
||||
namespace ImGuiNET
|
||||
{
|
||||
public unsafe struct RangeAccessor<T> where T : struct
|
||||
{
|
||||
private static readonly int s_sizeOfT = Unsafe.SizeOf<T>();
|
||||
|
||||
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<T>((byte*)Data + s_sizeOfT * index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe struct RangePtrAccessor<T> 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<T>((byte*)Data + sizeof(void*) * index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class RangeAccessorExtensions
|
||||
{
|
||||
public static unsafe string GetStringASCII(this RangeAccessor<byte> stringAccessor)
|
||||
{
|
||||
return Encoding.ASCII.GetString((byte*)stringAccessor.Data, stringAccessor.Count);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
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);
|
||||
|
||||
internal static int CalcSizeInUtf8(string s, int start, int length)
|
||||
{
|
||||
if (start < 0 || length < 0 || start + length > s.Length)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
|
||||
fixed (char* utf16Ptr = s)
|
||||
{
|
||||
return Encoding.UTF8.GetByteCount(utf16Ptr + start, length);
|
||||
}
|
||||
}
|
||||
|
||||
internal static int GetUtf8(string s, byte* utf8Bytes, int utf8ByteCount)
|
||||
{
|
||||
fixed (char* utf16Ptr = s)
|
||||
{
|
||||
return Encoding.UTF8.GetBytes(utf16Ptr, s.Length, utf8Bytes, utf8ByteCount);
|
||||
}
|
||||
}
|
||||
|
||||
internal static int GetUtf8(string s, int start, int length, byte* utf8Bytes, int utf8ByteCount)
|
||||
{
|
||||
if (start < 0 || length < 0 || start + length > s.Length)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
|
||||
fixed (char* utf16Ptr = s)
|
||||
{
|
||||
return Encoding.UTF8.GetBytes(utf16Ptr + start, length, utf8Bytes, utf8ByteCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<_IsWindows Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true'">true</_IsWindows>
|
||||
<_IsMacOS Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'">true</_IsMacOS>
|
||||
<_IsLinux Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true'">true</_IsLinux>
|
||||
|
||||
<_NativeRuntime Condition=" '$(_NativeRuntime)' == '' And '$(_IsMacOS)' == 'true' And '$(PlatformTarget)' == 'x64'">osx-x64</_NativeRuntime>
|
||||
<_NativeRuntime Condition=" '$(_NativeRuntime)' == '' And '$(_IsMacOS)' == 'true' And '$(PlatformTarget)' == 'ARM64'">osx-arm64</_NativeRuntime>
|
||||
<_NativeRuntime Condition=" '$(_NativeRuntime)' == '' And '$(_IsLinux)' == 'true' And ('$(Prefer32Bit)' == 'false' Or '$(PlatformTarget)' == 'x64')">linux-x64</_NativeRuntime>
|
||||
<_NativeRuntime Condition=" '$(_NativeRuntime)' == '' And '$(_IsWindows)' == 'true' And ('$(Prefer32Bit)' == 'true' Or '$(PlatformTarget)' == 'x86')">win-x86</_NativeRuntime>
|
||||
<_NativeRuntime Condition=" '$(_NativeRuntime)' == '' And '$(_IsWindows)' == 'true' And ('$(Prefer32Bit)' == 'false' Or '$(PlatformTarget)' == 'x64')">win-x64</_NativeRuntime>
|
||||
|
||||
<_NativeLibName Condition="'$(_NativeRuntime)' == 'win-x86' Or '$(_NativeRuntime)' == 'win-x64'">cimgui.dll</_NativeLibName>
|
||||
<_NativeLibName Condition="'$(_NativeRuntime)' == 'osx-x64' Or '$(_NativeRuntime)' == 'osx-arm64'">libcimgui.dylib</_NativeLibName>
|
||||
<_NativeLibName Condition="'$(_NativeRuntime)' == 'linux-x64'">libcimgui.so</_NativeLibName>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Content Condition="'$(_NativeRuntime)' != ''" Include="$(MSBuildThisFileDirectory)..\..\runtimes\$(_NativeRuntime)\native\$(_NativeLibName)">
|
||||
<Link>%(Filename)%(Extension)</Link>
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<Visible>False</Visible>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1 @@
|
|||
Subproject commit a413863cf94827148dc36580a0313a2013c235ee
|
|
@ -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;
|
||||
}
|
|
@ -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;
|
||||
}
|
|
@ -0,0 +1,310 @@
|
|||
using MoonWorks.Graphics;
|
||||
using MoonWorks;
|
||||
using ImGuiNET;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.IO;
|
||||
using MoonWorks.Input;
|
||||
using MoonWorks.Math;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MoonWorksImguiExample
|
||||
{
|
||||
class MoonWorksImguiExampleGame : Game
|
||||
{
|
||||
private string ContentPath = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "Content");
|
||||
|
||||
private ImFontPtr DefaultFontPtr;
|
||||
private int TextureID;
|
||||
private System.IntPtr? FontTexturePtr;
|
||||
private Dictionary<System.IntPtr, Texture> LoadedTextures = new Dictionary<System.IntPtr, Texture>();
|
||||
private Dictionary<Texture, System.IntPtr> TextureHandles = new Dictionary<Texture, System.IntPtr>();
|
||||
|
||||
private uint VertexCount = 0;
|
||||
private uint IndexCount = 0;
|
||||
private Buffer ImGuiVertexBuffer = null;
|
||||
private Buffer ImGuiIndexBuffer = null;
|
||||
private GraphicsPipeline ImGuiPipeline;
|
||||
private ShaderModule ImGuiVertexShader;
|
||||
private ShaderModule ImGuiFragmentShader;
|
||||
private Sampler ImGuiSampler;
|
||||
|
||||
public MoonWorksImguiExampleGame(
|
||||
WindowCreateInfo windowCreateInfo,
|
||||
PresentMode presentMode,
|
||||
bool debugMode
|
||||
) : base(windowCreateInfo, presentMode, 60, debugMode)
|
||||
{
|
||||
var context = ImGui.CreateContext();
|
||||
ImGui.SetCurrentContext(context);
|
||||
|
||||
var io = ImGui.GetIO();
|
||||
|
||||
io.Fonts.AddFontDefault();
|
||||
|
||||
RebuildFontAtlas();
|
||||
|
||||
io.DisplaySize = new System.Numerics.Vector2(
|
||||
windowCreateInfo.WindowWidth,
|
||||
windowCreateInfo.WindowHeight
|
||||
);
|
||||
io.DisplayFramebufferScale = System.Numerics.Vector2.One;
|
||||
|
||||
ImGuiVertexShader = new ShaderModule(GraphicsDevice, Path.Combine(ContentPath, "ImGuiVert.spv"));
|
||||
ImGuiFragmentShader = new ShaderModule(GraphicsDevice, Path.Combine(ContentPath, "ImGuiFrag.spv"));
|
||||
ImGuiSampler = new Sampler(GraphicsDevice, SamplerCreateInfo.PointClamp);
|
||||
|
||||
ImGuiPipeline = new GraphicsPipeline(
|
||||
GraphicsDevice,
|
||||
new GraphicsPipelineCreateInfo
|
||||
{
|
||||
AttachmentInfo = new GraphicsPipelineAttachmentInfo(
|
||||
new ColorAttachmentDescription(
|
||||
GraphicsDevice.GetSwapchainFormat(Window),
|
||||
ColorAttachmentBlendState.NonPremultiplied
|
||||
)
|
||||
),
|
||||
DepthStencilState = DepthStencilState.Disable,
|
||||
VertexShaderInfo = GraphicsShaderInfo.Create<Matrix4x4>(ImGuiVertexShader, "main", 0),
|
||||
FragmentShaderInfo = GraphicsShaderInfo.Create(ImGuiFragmentShader, "main", 1),
|
||||
VertexInputState = new VertexInputState(
|
||||
VertexBinding.Create<VertexPositionTextureColor>(),
|
||||
VertexAttribute.Create<VertexPositionTextureColor>("Position", 0),
|
||||
VertexAttribute.Create<VertexPositionTextureColor>("Texture", 1),
|
||||
VertexAttribute.Create<VertexPositionTextureColor>("Color", 2)
|
||||
),
|
||||
PrimitiveType = PrimitiveType.TriangleList,
|
||||
RasterizerState = RasterizerState.CW_CullNone,
|
||||
ViewportState = new ViewportState((int) windowCreateInfo.WindowWidth, (int) windowCreateInfo.WindowHeight),
|
||||
MultisampleState = MultisampleState.None
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
protected override void Update(System.TimeSpan dt)
|
||||
{
|
||||
// Insert your game update logic here.
|
||||
}
|
||||
|
||||
private System.IntPtr BindTexture(Texture texture)
|
||||
{
|
||||
var id = new System.IntPtr(TextureID);
|
||||
LoadedTextures.Add(id, texture);
|
||||
TextureHandles.Add(texture, id);
|
||||
return id;
|
||||
}
|
||||
|
||||
private void UnbindTexture(System.IntPtr textureID)
|
||||
{
|
||||
var texture = LoadedTextures[textureID];
|
||||
LoadedTextures.Remove(textureID);
|
||||
TextureHandles.Remove(texture);
|
||||
}
|
||||
|
||||
private void RebuildFontAtlas()
|
||||
{
|
||||
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 texture = Texture.CreateTexture2D(
|
||||
GraphicsDevice,
|
||||
(uint) width,
|
||||
(uint) height,
|
||||
TextureFormat.R8G8B8A8,
|
||||
TextureUsageFlags.Sampler
|
||||
);
|
||||
|
||||
commandBuffer.SetTextureData(texture, pixelData, (uint) (width * height * bytesPerPixel));
|
||||
|
||||
GraphicsDevice.Submit(commandBuffer);
|
||||
|
||||
if (FontTexturePtr.HasValue)
|
||||
{
|
||||
UnbindTexture(FontTexturePtr.Value);
|
||||
}
|
||||
|
||||
FontTexturePtr = BindTexture(texture);
|
||||
|
||||
io.Fonts.SetTexID(FontTexturePtr.Value);
|
||||
io.Fonts.ClearTexData();
|
||||
}
|
||||
|
||||
private void UpdateImGuiBuffers(ImDrawDataPtr drawDataPtr)
|
||||
{
|
||||
if (drawDataPtr.TotalVtxCount == 0) { return; }
|
||||
|
||||
var commandBuffer = GraphicsDevice.AcquireCommandBuffer();
|
||||
|
||||
var vertexSize = Marshal.SizeOf<VertexPositionTextureColor>();
|
||||
|
||||
if (drawDataPtr.TotalVtxCount > VertexCount)
|
||||
{
|
||||
ImGuiVertexBuffer?.Dispose();
|
||||
|
||||
VertexCount = (uint) (drawDataPtr.TotalVtxCount * 1.5f);
|
||||
ImGuiVertexBuffer = Buffer.Create<VertexPositionTextureColor>(
|
||||
GraphicsDevice,
|
||||
BufferUsageFlags.Vertex,
|
||||
VertexCount
|
||||
);
|
||||
}
|
||||
|
||||
if (drawDataPtr.TotalIdxCount > IndexCount)
|
||||
{
|
||||
ImGuiIndexBuffer?.Dispose();
|
||||
|
||||
IndexCount = (uint) (drawDataPtr.TotalIdxCount * 1.5f);
|
||||
ImGuiIndexBuffer = Buffer.Create<ushort>(
|
||||
GraphicsDevice,
|
||||
BufferUsageFlags.Index,
|
||||
IndexCount
|
||||
);
|
||||
}
|
||||
|
||||
uint vertexOffset = 0;
|
||||
uint indexOffset = 0;
|
||||
|
||||
for (var n = 0; n < drawDataPtr.CmdListsCount; n += 1)
|
||||
{
|
||||
var cmdList = drawDataPtr.CmdListsRange[n];
|
||||
|
||||
commandBuffer.SetBufferData(
|
||||
ImGuiVertexBuffer,
|
||||
cmdList.VtxBuffer.Data,
|
||||
vertexOffset,
|
||||
(uint) (cmdList.VtxBuffer.Size * vertexSize)
|
||||
);
|
||||
|
||||
commandBuffer.SetBufferData(
|
||||
ImGuiIndexBuffer,
|
||||
cmdList.IdxBuffer.Data,
|
||||
indexOffset,
|
||||
(uint) cmdList.IdxBuffer.Size * sizeof(ushort)
|
||||
);
|
||||
|
||||
vertexOffset += (uint) cmdList.VtxBuffer.Size;
|
||||
indexOffset += (uint) cmdList.IdxBuffer.Size;
|
||||
}
|
||||
|
||||
GraphicsDevice.Submit(commandBuffer);
|
||||
}
|
||||
|
||||
protected override void Draw(System.TimeSpan dt, double alpha)
|
||||
{
|
||||
// Replace this with your own drawing code.
|
||||
|
||||
var io = ImGui.GetIO();
|
||||
|
||||
io.KeyShift = Inputs.Keyboard.IsDown(Keycode.LeftShift) || Inputs.Keyboard.IsDown(Keycode.RightShift);
|
||||
io.KeyCtrl = Inputs.Keyboard.IsDown(Keycode.LeftControl) || Inputs.Keyboard.IsDown(Keycode.RightControl);
|
||||
io.KeyAlt = Inputs.Keyboard.IsDown(Keycode.LeftAlt) || Inputs.Keyboard.IsDown(Keycode.RightAlt);
|
||||
io.KeySuper = Inputs.Keyboard.IsDown(Keycode.LeftMeta) || Inputs.Keyboard.IsDown(Keycode.RightMeta);
|
||||
io.KeyMap[(int)ImGuiKey.Backspace] = (int)Keycode.Backspace;
|
||||
|
||||
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 > 0 ? 1 : Inputs.Mouse.Wheel < 0 ? -1 : 0;
|
||||
|
||||
ImGui.NewFrame();
|
||||
|
||||
ImGui.SetNextWindowSize(new System.Numerics.Vector2(400, 200));
|
||||
ImGui.Begin("Help");
|
||||
ImGui.Columns(2);
|
||||
|
||||
ImGui.Text("F7");
|
||||
ImGui.NextColumn();
|
||||
ImGui.Text("Pause Action");
|
||||
ImGui.NextColumn();
|
||||
|
||||
ImGui.Text("Ctrl-E");
|
||||
ImGui.NextColumn();
|
||||
ImGui.Text("Entity Search");
|
||||
ImGui.NextColumn();
|
||||
|
||||
ImGui.Text("Left Click");
|
||||
ImGui.NextColumn();
|
||||
ImGui.Text("Inspect Entity");
|
||||
ImGui.NextColumn();
|
||||
|
||||
ImGui.Text("Ctrl-H");
|
||||
ImGui.NextColumn();
|
||||
ImGui.Text("Help");
|
||||
ImGui.NextColumn();
|
||||
|
||||
ImGui.End();
|
||||
|
||||
ImGui.Render();
|
||||
|
||||
var drawDataPtr = ImGui.GetDrawData();
|
||||
UpdateImGuiBuffers(drawDataPtr);
|
||||
|
||||
if (ImGuiVertexBuffer == null) { return; }
|
||||
|
||||
var commandBuffer = GraphicsDevice.AcquireCommandBuffer();
|
||||
var swapchainTexture = commandBuffer.AcquireSwapchainTexture(Window);
|
||||
|
||||
if (swapchainTexture != null)
|
||||
{
|
||||
commandBuffer.BeginRenderPass(
|
||||
new ColorAttachmentInfo(swapchainTexture, Color.Transparent)
|
||||
);
|
||||
|
||||
commandBuffer.BindGraphicsPipeline(ImGuiPipeline);
|
||||
|
||||
var vertexUniformOffset = commandBuffer.PushVertexShaderUniforms(
|
||||
Matrix4x4.CreateOrthographicOffCenter(0, io.DisplaySize.X, io.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.CmdListsRange[n];
|
||||
|
||||
for (int cmdIndex = 0; cmdIndex < cmdList.CmdBuffer.Size; cmdIndex += 1)
|
||||
{
|
||||
var drawCmd = cmdList.CmdBuffer[cmdIndex];
|
||||
|
||||
commandBuffer.BindFragmentSamplers(
|
||||
new TextureSamplerBinding(LoadedTextures[drawCmd.TextureId], ImGuiSampler)
|
||||
);
|
||||
|
||||
commandBuffer.DrawIndexedPrimitives(
|
||||
vertexOffset,
|
||||
indexOffset,
|
||||
drawCmd.ElemCount / 3,
|
||||
vertexUniformOffset,
|
||||
0
|
||||
);
|
||||
|
||||
indexOffset += drawCmd.ElemCount;
|
||||
}
|
||||
|
||||
vertexOffset += (uint) cmdList.VtxBuffer.Size;
|
||||
}
|
||||
|
||||
commandBuffer.EndRenderPass();
|
||||
}
|
||||
|
||||
GraphicsDevice.Submit(commandBuffer);
|
||||
}
|
||||
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using MoonWorks;
|
||||
|
||||
namespace MoonWorksImguiExample
|
||||
{
|
||||
class Program
|
||||
{
|
||||
[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
static extern bool SetDllDirectory(string lpPathName);
|
||||
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
WindowCreateInfo windowCreateInfo = new WindowCreateInfo
|
||||
{
|
||||
WindowWidth = 1280,
|
||||
WindowHeight = 720,
|
||||
WindowTitle = "MoonWorksImguiExample",
|
||||
ScreenMode = ScreenMode.Windowed
|
||||
};
|
||||
|
||||
MoonWorksImguiExampleGame game = new MoonWorksImguiExampleGame(
|
||||
windowCreateInfo,
|
||||
MoonWorks.Graphics.PresentMode.FIFORelaxed,
|
||||
true
|
||||
);
|
||||
|
||||
game.Run();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
using MoonWorks.Graphics;
|
||||
using MoonWorks.Math;
|
||||
|
||||
namespace MoonWorksImguiExample
|
||||
{
|
||||
public struct VertexPositionTextureColor
|
||||
{
|
||||
public Vector2 Position;
|
||||
public Vector2 Texture;
|
||||
public Color Color;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue