mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 13:08:24 +01:00
first
This commit is contained in:
parent
bd62d51ec9
commit
b578433e37
1 changed files with 784842 additions and 0 deletions
47
Brutal.ImGui.Extensions/Compatibility/ImGui.Compatibility.cs
Normal file
47
Brutal.ImGui.Extensions/Compatibility/ImGui.Compatibility.cs
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
namespace Brutal.ImGuiApi.Extensions;
|
||||
|
||||
public abstract partial class ImGuiCompatibilityEx : ImGui
|
||||
{
|
||||
#region overloads / permutations
|
||||
|
||||
/// <inheritdoc cref="ImGui.PInvoke.InputText"/>
|
||||
[Obsolete("InputText(ref string) is obsolete, use the ImInputString overload instead.", error: false)]
|
||||
public static bool InputText(
|
||||
ImString label,
|
||||
ref string input,
|
||||
uint maxLength,
|
||||
ImGuiInputTextFlags flags = ImGuiInputTextFlags.None,
|
||||
ImGuiInputTextCallback? callback = null,
|
||||
IntPtr userData = 0
|
||||
)
|
||||
{
|
||||
// HACK: this allocates, remove when conversion is done
|
||||
var tmpInput = new ImInputString((int)maxLength, input);
|
||||
var changed = ImGui.InputText(label, tmpInput, flags, callback, userData);
|
||||
if (changed)
|
||||
input = tmpInput.ToString();
|
||||
return changed;
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="ImGui.PInvoke.MenuItem_0"/>
|
||||
[Obsolete("use the MenuItem(\"label\", selected: selected) syntax instead.", error: false)]
|
||||
public static bool MenuItem(ImString label, bool selected_obsolete) =>
|
||||
ImGui.MenuItem(label, selected: selected_obsolete);
|
||||
|
||||
/// <inheritdoc cref="ImGui.PInvoke.MenuItem_0"/>
|
||||
[Obsolete("use the MenuItem(\"label\", selected: selected, enabled: enabled) syntax instead.", error: false)]
|
||||
public static bool MenuItem(ImString label, bool selected_obsolete, bool enabled_obsolete) =>
|
||||
ImGui.MenuItem(label, selected: selected_obsolete, enabled: enabled_obsolete);
|
||||
|
||||
/// <inheritdoc cref="ImGui.PInvoke.BeginChild_0"/>
|
||||
[Obsolete("use the BeginChild(\"id\", childFlags: childFlags) syntax instead.", error: false)]
|
||||
public static bool BeginChild(ImString strId, ImGuiChildFlags childFlags_obsolete) =>
|
||||
ImGui.BeginChild(strId, childFlags: childFlags_obsolete);
|
||||
|
||||
/// <inheritdoc cref="ImGui.PInvoke.BeginChild_0"/>
|
||||
[Obsolete("use the BeginChild(\"id\", windowFlags: windowFlags) syntax instead.", error: false)]
|
||||
public static bool BeginChild(ImString strId, float2? size, ImGuiWindowFlags windowFlags_obsolete) =>
|
||||
ImGui.BeginChild(strId, size, windowFlags: windowFlags_obsolete);
|
||||
|
||||
#endregion
|
||||
}
|
||||
Loading…
Reference in a new issue