mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-03 14:23:40 +01:00
Work on manual bindings
This commit is contained in:
parent
f391ac57d3
commit
3381ac1c7d
37 changed files with 2596 additions and 48072 deletions
60
imgui/Dalamud.Bindings.ImGui/Custom/ImGuiStorage.Custom.cs
Normal file
60
imgui/Dalamud.Bindings.ImGui/Custom/ImGuiStorage.Custom.cs
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
namespace Dalamud.Bindings.ImGui;
|
||||
|
||||
public unsafe partial struct ImGuiStorage
|
||||
{
|
||||
public readonly ref bool GetBoolRef(uint key, bool defaultValue = false)
|
||||
{
|
||||
fixed (ImGuiStorage* thisPtr = &this)
|
||||
return ref ImGui.GetBoolRef(thisPtr, key, defaultValue);
|
||||
}
|
||||
|
||||
public readonly ref float GetFloatRef(uint key, float defaultValue = 0.0f)
|
||||
{
|
||||
fixed (ImGuiStorage* thisPtr = &this)
|
||||
return ref ImGui.GetFloatRef(thisPtr, key, defaultValue);
|
||||
}
|
||||
|
||||
public readonly ref int GetIntRef(uint key, int defaultValue = 0)
|
||||
{
|
||||
fixed (ImGuiStorage* thisPtr = &this)
|
||||
return ref ImGui.GetIntRef(thisPtr, key, defaultValue);
|
||||
}
|
||||
|
||||
public readonly ref void* GetVoidPtrRef(uint key, void* defaultValue = null)
|
||||
{
|
||||
fixed (ImGuiStorage* thisPtr = &this)
|
||||
return ref ImGui.GetVoidPtrRef(thisPtr, key, defaultValue);
|
||||
}
|
||||
|
||||
public readonly ref T* GetPtrRef<T>(uint key, T* defaultValue = null) where T : unmanaged
|
||||
{
|
||||
fixed (ImGuiStorage* thisPtr = &this)
|
||||
return ref ImGui.GetPtrRef(thisPtr, key, defaultValue);
|
||||
}
|
||||
|
||||
public readonly ref T GetRef<T>(uint key, T defaultValue = default) where T : unmanaged
|
||||
{
|
||||
fixed (ImGuiStorage* thisPtr = &this)
|
||||
return ref ImGui.GetRef(thisPtr, key, defaultValue);
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe partial struct ImGuiStoragePtr
|
||||
{
|
||||
public readonly ref bool GetBoolRef(uint key, bool defaultValue = false) =>
|
||||
ref ImGui.GetBoolRef(this, key, defaultValue);
|
||||
|
||||
public readonly ref float GetFloatRef(uint key, float defaultValue = 0.0f) =>
|
||||
ref ImGui.GetFloatRef(this, key, defaultValue);
|
||||
|
||||
public readonly ref int GetIntRef(uint key, int defaultValue = 0) => ref ImGui.GetIntRef(this, key, defaultValue);
|
||||
|
||||
public readonly ref void* GetVoidPtrRef(uint key, void* defaultValue = null) =>
|
||||
ref ImGui.GetVoidPtrRef(this, key, defaultValue);
|
||||
|
||||
public readonly ref T* GetPtrRef<T>(uint key, T* defaultValue = null) where T : unmanaged =>
|
||||
ref ImGui.GetPtrRef(this, key, defaultValue);
|
||||
|
||||
public readonly ref T GetRef<T>(uint key, T defaultValue = default) where T : unmanaged =>
|
||||
ref ImGui.GetRef(this, key, defaultValue);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue