Skip to content

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

@tvardero

Description

@tvardero

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

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions