fix: feed mouse input to ImGui — sliders and buttons now clickable
- ImGui.GetIO().MousePos set from IInputState.MouseX/MouseY each frame - ImGui.GetIO().MouseDown[0-2] set from MouseLeft/Right/Middle - DisplaySize also updated each frame (was only set at init) - Done before BeginImGuiFrame() / ImGui.NewFrame()
This commit is contained in:
@@ -152,6 +152,13 @@ class Program
|
|||||||
|
|
||||||
if (hasImGui)
|
if (hasImGui)
|
||||||
{
|
{
|
||||||
|
var io = ImGui.GetIO();
|
||||||
|
io.DisplaySize = new System.Numerics.Vector2(window.Width, window.Height);
|
||||||
|
io.MousePos = new System.Numerics.Vector2(input.MouseX, input.MouseY);
|
||||||
|
io.MouseDown[0] = input.MouseLeft;
|
||||||
|
io.MouseDown[1] = input.MouseRight;
|
||||||
|
io.MouseDown[2] = input.MouseMiddle;
|
||||||
|
|
||||||
renderer.BeginImGuiFrame();
|
renderer.BeginImGuiFrame();
|
||||||
|
|
||||||
ImGui.Begin("Cortex Engine Debug");
|
ImGui.Begin("Cortex Engine Debug");
|
||||||
|
|||||||
Reference in New Issue
Block a user