Add ClearWindowFocus

This commit is contained in:
Soreepeong 2025-08-07 07:52:46 +09:00
parent 12f099a57e
commit 4a2f890aa9

View file

@ -564,8 +564,12 @@ public static unsafe partial class ImGui
name.Dispose(); name.Dispose();
} }
/// <summary>Sets the current window to be focused / top-most.</summary>
/// <remarks>Prefer using <see cref="SetNextWindowFocus"/>.</remarks>
public static void SetWindowFocus() => ImGuiNative.SetWindowFocus(); public static void SetWindowFocus() => ImGuiNative.SetWindowFocus();
/// <summary>Sets a named window to be focused / top-most.</summary>
/// <param name="name">Name of the window to focus. Use <c>default</c> to remove focus.</param>
public static void SetWindowFocus(ImU8String name) public static void SetWindowFocus(ImU8String name)
{ {
fixed (byte* namePtr = &name.GetPinnableNullTerminatedReference()) fixed (byte* namePtr = &name.GetPinnableNullTerminatedReference())
@ -573,6 +577,9 @@ public static unsafe partial class ImGui
name.Dispose(); name.Dispose();
} }
/// <summary>Removes focus from any window.</summary>
public static void ClearWindowFocus() => ImGuiNative.SetWindowFocus(null);
public static void SetWindowPos(Vector2 pos, ImGuiCond cond = ImGuiCond.None) => public static void SetWindowPos(Vector2 pos, ImGuiCond cond = ImGuiCond.None) =>
ImGuiNative.SetWindowPos(pos, cond); ImGuiNative.SetWindowPos(pos, cond);