only consider mouse-move events as "active" (for framerate purposes) if the pointer is in the window area
This commit is contained in:
parent
6478f1ee95
commit
bcb2e7be7d
@ -425,7 +425,10 @@ public class Game : GameWindow {
|
|||||||
toast.Update(e.Time);
|
toast.Update(e.Time);
|
||||||
|
|
||||||
KeyboardState input = KeyboardState;
|
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;
|
timeSinceEvent = 0;
|
||||||
} else {
|
} else {
|
||||||
timeSinceEvent += e.Time;
|
timeSinceEvent += e.Time;
|
||||||
|
Loading…
Reference in New Issue
Block a user