diff --git a/src/CodeGenerator/CodeGenerator.csproj b/src/CodeGenerator/CodeGenerator.csproj
index 5d22d8f..289db17 100644
--- a/src/CodeGenerator/CodeGenerator.csproj
+++ b/src/CodeGenerator/CodeGenerator.csproj
@@ -24,6 +24,6 @@
-
+
diff --git a/src/ImGui.NET.SampleProgram.XNA/ImGui.NET.SampleProgram.XNA.csproj b/src/ImGui.NET.SampleProgram.XNA/ImGui.NET.SampleProgram.XNA.csproj
index d2202c0..83e6402 100644
--- a/src/ImGui.NET.SampleProgram.XNA/ImGui.NET.SampleProgram.XNA.csproj
+++ b/src/ImGui.NET.SampleProgram.XNA/ImGui.NET.SampleProgram.XNA.csproj
@@ -20,7 +20,7 @@
-
+
diff --git a/src/ImGui.NET.SampleProgram.XNA/ImGuiRenderer.cs b/src/ImGui.NET.SampleProgram.XNA/ImGuiRenderer.cs
index 5d745c2..829b83b 100644
--- a/src/ImGui.NET.SampleProgram.XNA/ImGuiRenderer.cs
+++ b/src/ImGui.NET.SampleProgram.XNA/ImGuiRenderer.cs
@@ -158,6 +158,7 @@ namespace ImGuiNET.SampleProgram.XNA
_keys.Add(io.KeyMap[(int)ImGuiKey.Backspace] = (int)Keys.Back);
_keys.Add(io.KeyMap[(int)ImGuiKey.Enter] = (int)Keys.Enter);
_keys.Add(io.KeyMap[(int)ImGuiKey.Escape] = (int)Keys.Escape);
+ _keys.Add(io.KeyMap[(int)ImGuiKey.Space] = (int)Keys.Space);
_keys.Add(io.KeyMap[(int)ImGuiKey.A] = (int)Keys.A);
_keys.Add(io.KeyMap[(int)ImGuiKey.C] = (int)Keys.C);
_keys.Add(io.KeyMap[(int)ImGuiKey.V] = (int)Keys.V);
@@ -195,17 +196,9 @@ namespace ImGuiNET.SampleProgram.XNA
var io = ImGui.GetIO();
- // MonoGame-specific //////////////////////
- var offset = .5f;
- ///////////////////////////////////////////
-
- // FNA-specific ///////////////////////////
- //var offset = 0f;
- ///////////////////////////////////////////
-
_effect.World = Matrix.Identity;
_effect.View = Matrix.Identity;
- _effect.Projection = Matrix.CreateOrthographicOffCenter(offset, io.DisplaySize.X + offset, io.DisplaySize.Y + offset, offset, -1f, 1f);
+ _effect.Projection = Matrix.CreateOrthographicOffCenter(0f, io.DisplaySize.X, io.DisplaySize.Y, 0f, -1f, 1f);
_effect.TextureEnabled = true;
_effect.Texture = texture;
_effect.VertexColorEnabled = true;
diff --git a/src/ImGui.NET.SampleProgram/ImGui.NET.SampleProgram.csproj b/src/ImGui.NET.SampleProgram/ImGui.NET.SampleProgram.csproj
index 575cd83..6f7e984 100644
--- a/src/ImGui.NET.SampleProgram/ImGui.NET.SampleProgram.csproj
+++ b/src/ImGui.NET.SampleProgram/ImGui.NET.SampleProgram.csproj
@@ -8,8 +8,8 @@
-
-
+
+
diff --git a/src/ImGui.NET.SampleProgram/ImGuiController.cs b/src/ImGui.NET.SampleProgram/ImGuiController.cs
index 5eadc54..b9f9665 100644
--- a/src/ImGui.NET.SampleProgram/ImGuiController.cs
+++ b/src/ImGui.NET.SampleProgram/ImGuiController.cs
@@ -416,6 +416,7 @@ namespace ImGuiNET
io.KeyMap[(int)ImGuiKey.Backspace] = (int)Key.BackSpace;
io.KeyMap[(int)ImGuiKey.Enter] = (int)Key.Enter;
io.KeyMap[(int)ImGuiKey.Escape] = (int)Key.Escape;
+ io.KeyMap[(int)ImGuiKey.Space] = (int)Key.Space;
io.KeyMap[(int)ImGuiKey.A] = (int)Key.A;
io.KeyMap[(int)ImGuiKey.C] = (int)Key.C;
io.KeyMap[(int)ImGuiKey.V] = (int)Key.V;
diff --git a/src/ImGui.NET/ImGui.Manual.cs b/src/ImGui.NET/ImGui.Manual.cs
index 522c6f7..8fac3de 100644
--- a/src/ImGui.NET/ImGui.Manual.cs
+++ b/src/ImGui.NET/ImGui.Manual.cs
@@ -247,6 +247,114 @@ namespace ImGuiNET
return result != 0;
}
+ public static bool InputTextWithHint(
+ string label,
+ string hint,
+ ref string input,
+ uint maxLength) => InputTextWithHint(label, hint, ref input, maxLength, 0, null, IntPtr.Zero);
+
+ public static bool InputTextWithHint(
+ string label,
+ string hint,
+ ref string input,
+ uint maxLength,
+ ImGuiInputTextFlags flags) => InputTextWithHint(label, hint, ref input, maxLength, flags, null, IntPtr.Zero);
+
+ public static bool InputTextWithHint(
+ string label,
+ string hint,
+ ref string input,
+ uint maxLength,
+ ImGuiInputTextFlags flags,
+ ImGuiInputTextCallback callback) => InputTextWithHint(label, hint, ref input, maxLength, flags, callback, IntPtr.Zero);
+
+ public static bool InputTextWithHint(
+ string label,
+ string hint,
+ ref string input,
+ uint maxLength,
+ ImGuiInputTextFlags flags,
+ ImGuiInputTextCallback callback,
+ IntPtr user_data)
+ {
+ int utf8LabelByteCount = Encoding.UTF8.GetByteCount(label);
+ byte* utf8LabelBytes;
+ if (utf8LabelByteCount > Util.StackAllocationSizeLimit)
+ {
+ utf8LabelBytes = Util.Allocate(utf8LabelByteCount + 1);
+ }
+ else
+ {
+ byte* stackPtr = stackalloc byte[utf8LabelByteCount + 1];
+ utf8LabelBytes = stackPtr;
+ }
+ Util.GetUtf8(label, utf8LabelBytes, utf8LabelByteCount);
+
+ int utf8HintByteCount = Encoding.UTF8.GetByteCount(hint);
+ byte* utf8HintBytes;
+ if (utf8HintByteCount > Util.StackAllocationSizeLimit)
+ {
+ utf8HintBytes = Util.Allocate(utf8HintByteCount + 1);
+ }
+ else
+ {
+ byte* stackPtr = stackalloc byte[utf8HintByteCount + 1];
+ utf8HintBytes = stackPtr;
+ }
+ Util.GetUtf8(hint, utf8HintBytes, utf8HintByteCount);
+
+ int utf8InputByteCount = Encoding.UTF8.GetByteCount(input);
+ int inputBufSize = Math.Max((int)maxLength + 1, utf8InputByteCount + 1);
+
+ byte* utf8InputBytes;
+ byte* originalUtf8InputBytes;
+ if (inputBufSize > Util.StackAllocationSizeLimit)
+ {
+ utf8InputBytes = Util.Allocate(inputBufSize);
+ originalUtf8InputBytes = Util.Allocate(inputBufSize);
+ }
+ else
+ {
+ byte* inputStackBytes = stackalloc byte[inputBufSize];
+ utf8InputBytes = inputStackBytes;
+ byte* originalInputStackBytes = stackalloc byte[inputBufSize];
+ originalUtf8InputBytes = originalInputStackBytes;
+ }
+ Util.GetUtf8(input, utf8InputBytes, inputBufSize);
+ uint clearBytesCount = (uint)(inputBufSize - utf8InputByteCount);
+ Unsafe.InitBlockUnaligned(utf8InputBytes + utf8InputByteCount, 0, clearBytesCount);
+ Unsafe.CopyBlock(originalUtf8InputBytes, utf8InputBytes, (uint)inputBufSize);
+
+ byte result = ImGuiNative.igInputTextWithHint(
+ utf8LabelBytes,
+ utf8HintBytes,
+ utf8InputBytes,
+ (uint)inputBufSize,
+ flags,
+ callback,
+ user_data.ToPointer());
+ if (!Util.AreStringsEqual(originalUtf8InputBytes, inputBufSize, utf8InputBytes))
+ {
+ input = Util.StringFromPtr(utf8InputBytes);
+ }
+
+ if (utf8LabelByteCount > Util.StackAllocationSizeLimit)
+ {
+ Util.Free(utf8LabelBytes);
+ }
+ if (utf8HintByteCount > Util.StackAllocationSizeLimit)
+ {
+ Util.Free(utf8HintBytes);
+ }
+ if (inputBufSize > Util.StackAllocationSizeLimit)
+ {
+ Util.Free(utf8InputBytes);
+ Util.Free(originalUtf8InputBytes);
+ }
+
+ return result != 0;
+ }
+
public static bool InputText(
string label,
IntPtr buf,