IO: moved fields to put more focus on the new functions + update misc docs/references + update main.mm in Apple+Metal example (#4858)

This commit is contained in:
ocornut
2022-01-18 17:41:35 +01:00
parent 90a6961638
commit 673f5e588d
5 changed files with 46 additions and 37 deletions

View File

@ -222,7 +222,7 @@ If you are interested in using Cmake to build and links examples, see:
**About mouse cursor latency**
Dear ImGui has no particular extra lag for most behaviors,
e.g. the value of 'io.MousePos' provided at the time of NewFrame() will result in windows being moved
e.g. the last value passed to 'io.AddMousePosEvent()' before NewFrame() will result in windows being moved
to the right spot at the time of EndFrame()/Render(). At 60 FPS your experience should be pleasant.
However, consider that OS mouse cursors are typically drawn through a very specific hardware accelerated

View File

@ -114,7 +114,7 @@ void MyLowLevelMouseButtonHandler(int button, bool down)
{
// (1) ALWAYS forward mouse data to ImGui! This is automatic with default backends. With your own backend:
ImGuiIO& io = ImGui::GetIO();
io.MouseDown[button] = down;
io.AddMouseButtonEvent(button, down);
// (2) ONLY forward mouse data to your underlying app/game.
if (!io.WantCaptureMouse)