Fix combobox callback impl (#2347)

* Fix combobox callback impl

* Make ImGuiBackend delegates public

* Release ImGui focus when the game window loses focus
This commit is contained in:
srkizer 2025-08-07 11:18:40 +09:00 committed by GitHub
parent 27f924f3b1
commit 1f06006cc0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 36 additions and 22 deletions

View file

@ -349,7 +349,7 @@ public static unsafe partial class ImGui
s.Item2 = s.Item1.Invoke(ref s.Item3, index);
if (s.Item2.IsNull)
return false;
*text = (byte*)Unsafe.AsPointer(ref Unsafe.AsRef(in s.Item2.Span[0]));
*text = (byte*)Unsafe.AsPointer(ref Unsafe.AsRef(in s.Item2.GetPinnableNullTerminatedReference()));
return true;
#pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type
}
@ -363,7 +363,7 @@ public static unsafe partial class ImGui
s.Item2 = s.Item1.Invoke(s.Item3, index);
if (s.Item2.IsNull)
return false;
*text = (byte*)Unsafe.AsPointer(ref Unsafe.AsRef(in s.Item2.Span[0]));
*text = (byte*)Unsafe.AsPointer(ref Unsafe.AsRef(in s.Item2.GetPinnableNullTerminatedReference()));
return true;
#pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type
}
@ -377,7 +377,7 @@ public static unsafe partial class ImGui
s.Item2 = s.Item1.Invoke(index);
if (s.Item2.IsNull)
return false;
*text = (byte*)Unsafe.AsPointer(ref Unsafe.AsRef(in s.Item2.Span[0]));
*text = (byte*)Unsafe.AsPointer(ref Unsafe.AsRef(in s.Item2.GetPinnableNullTerminatedReference()));
return true;
#pragma warning restore CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type
}