Silk.NET icon indicating copy to clipboard operation
Silk.NET copied to clipboard

Silk.NET.OpenGL.Extensions.ImGui: ImGui inputs behave incorrectly with low FramesPerSecond and VSync off when ImGuiController.Update is put in Render loop

Open tvardero opened this issue 2 months ago • 0 comments

Summary

ImGuiController behaves incorrectly when put in Render loop of Window, when frame is not drawn due to FPS limit.

Currently noticed issue - Mouse wheel inputs missing.

Steps to reproduce

https://github.com/dotnet/Silk.NET/blob/main/examples/CSharp/OpenGL%20Demos/ImGui/Program.cs Windows 11, window options Default with disabled VSync and FramesPerSecond much lower than system can handle.

  1. Add ImGui.ShowDemoWindow(); to open demo window.
  2. Start application
  3. In demo window, find any place with scroll bar
  4. Try scrolling

Comments

https://github.com/dotnet/Silk.NET/blob/3c0313b2d69bbde12224c759a76bc2e7e064a893/src/Windowing/Silk.NET.Windowing.Common/Internals/ViewImplementationBase.cs#L174

DoRender has if ((delta >= _renderPeriod) || VSync) which completly skips Render event call. Keyboard and mouse inputs are sent with ImGuiController.Update(delta), not using IInputContext callbackes. This makes some inputs like mouse wheel scroll to not being sent, because they have been sent in the frame which was not drawn.

tvardero avatar Nov 15 '25 22:11 tvardero