mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 21:18:24 +01:00
SOURCE DUMP v1
This commit is contained in:
parent
bd62d51ec9
commit
fb20299e9d
3 changed files with 768360 additions and 0 deletions
|
|
@ -0,0 +1,9 @@
|
|||
using Brutal.ImGuiApi.Internal;
|
||||
|
||||
namespace Brutal.ImGuiApi.Extensions;
|
||||
|
||||
public partial class ImGuiCompatibilityEx
|
||||
{
|
||||
[Obsolete("Use Brutal.ImGuiApi.Internal.ImGui.GetCurrentWindow()", error: false)]
|
||||
public static ImGuiWindowPtr GetCurrentWindow() => Internal.GetCurrentWindow();
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
namespace Brutal.ImGuiApi.Extensions;
|
||||
|
||||
public partial class ImGuiCompatibilityEx
|
||||
{
|
||||
[Obsolete("use ImGui.Text() instead.", error: false)]
|
||||
public static void TextUnformatted(ImString text) => ImGui.Text(text);
|
||||
|
||||
/// <inheritdoc cref="ImGui.Image"/>
|
||||
[Obsolete("use ImageWithBg(ImTextureRef, tintColor: color)", error: false)]
|
||||
public static void Image(ImTextureID user_texture_id, float2 image_size, float4? tint_col = default) =>
|
||||
ImGui.ImageWithBg(new ImTextureRef { _TexID = user_texture_id }, image_size, tintCol: tint_col);
|
||||
|
||||
/// <inheritdoc cref="ImGui.Image"/>
|
||||
[Obsolete("use ImTextureRef overload", error: false)]
|
||||
public static void Image(ImTextureID user_texture_id, float2 image_size, float2 uv0, float2 uv1) =>
|
||||
ImGui.Image(new ImTextureRef { _TexID = user_texture_id }, image_size, uv0, uv1);
|
||||
|
||||
/// <inheritdoc cref="ImGui.PushFont"/>
|
||||
[Obsolete(
|
||||
"PushFont() API now has a REQUIRED size parameter",
|
||||
error: false,
|
||||
UrlFormat = "https://github.com/ocornut/imgui/releases/tag/v1.92.0#:~:text=PushFont()%20API%20now%20has%20a%20REQUIRED%20size%20parameter"
|
||||
)]
|
||||
public static void PushFont(ImFontPtr font) => ImGui.PushFont(font, font.LegacySize);
|
||||
|
||||
[Obsolete(
|
||||
"Prefer using PushFont(null, style.FontSizeBase * factor) or use style.FontScaleMain to scale all windows.",
|
||||
error: false,
|
||||
UrlFormat = "https://github.com/ocornut/imgui/blob/v1.92.2-docking/imgui.h#L4233"
|
||||
)]
|
||||
public static void SetWindowFontScale(float scale) => throw new NotImplementedException();
|
||||
}
|
||||
|
|
@ -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