Browse Source

only consider mouse-move events as "active" (for framerate purposes) if the pointer is in the window area

main
Colin McMillen 9 months ago
parent
commit
bcb2e7be7d
  1. 5
      Program.cs

5
Program.cs

@ -425,7 +425,10 @@ public class Game : GameWindow {
toast.Update(e.Time);
KeyboardState input = KeyboardState;
if (input.IsAnyKeyDown || MouseState.IsAnyButtonDown || MouseState.Delta != Vector2i.Zero) {
bool mouseInWindow = ClientRectangle.ContainsInclusive((Vector2i) MouseState.Position);
if (input.IsAnyKeyDown ||
MouseState.IsAnyButtonDown ||
(mouseInWindow && MouseState.Delta != Vector2i.Zero)) {
timeSinceEvent = 0;
} else {
timeSinceEvent += e.Time;

Loading…
Cancel
Save