My point is that the events aren't being sent with the right timings. If the engine is running at 140 FPS, and the mouse is polling at 140Hz (assumed for simplicity though obviously this is likely to be higher), this is roughly what ZScript will currently see:
Code: Select all
FRAME #1 Rendered
FRAME #2 Rendered
FRAME #3 Rendered
Mouse Event #1 Received by ZScript
Mouse Event #2 Received by ZScript
Mouse Event #3 Received by ZScript
Mouse Event #4 Received by ZScript
PLAYSIM TICK Handled
FRAME #4 Rendered
Therefore, even though ZScript sees 4 mouse events, it can't actually handle them in a proper way that leads to 140FPS menu rendering - this is especially noticeably on a 144Hz monitor but it's still a problem on 60Hz - in ZForms it ends up meaning that if the user grabs a scrollbar, it won't update as fast as the mouse is moving.
What I'd expect to see is an event order more like this:
Code: Select all
Mouse Event #1 Received by ZScript
FRAME #1 Rendered
Mouse Event #2 Received by ZScript
FRAME #2 Rendered
Mouse Event #3 Received by ZScript
FRAME #3 Rendered
Mouse Event #4 Received by ZScript
PLAYSIM TICK Handled
FRAME #4 Rendered
I think this can just be achieved by adding this to d_main.cpp:
Code: Select all
--- a/src/d_main.cpp
+++ b/src/d_main.cpp
@@ -1215,6 +1215,7 @@ void D_DoomLoop ()
}
// Update display, next frame, with current state.
I_StartTic ();
+ D_ProcessEvents();
D_Display ();
S_UpdateMusic();
if (wantToRestart)
I've had this in my own local compiled version of GZDoom for a few months now and I don't think it causes any issues.
My point is that the events aren't being sent with the right timings. If the engine is running at 140 FPS, and the mouse is polling at 140Hz (assumed for simplicity though obviously this is likely to be higher), this is roughly what ZScript will currently see:
[code]
FRAME #1 Rendered
FRAME #2 Rendered
FRAME #3 Rendered
Mouse Event #1 Received by ZScript
Mouse Event #2 Received by ZScript
Mouse Event #3 Received by ZScript
Mouse Event #4 Received by ZScript
PLAYSIM TICK Handled
FRAME #4 Rendered
[/code]
Therefore, even though ZScript sees 4 mouse events, it can't actually handle them in a proper way that leads to 140FPS menu rendering - this is especially noticeably on a 144Hz monitor but it's still a problem on 60Hz - in ZForms it ends up meaning that if the user grabs a scrollbar, it won't update as fast as the mouse is moving.
What I'd expect to see is an event order more like this:
[code]
Mouse Event #1 Received by ZScript
FRAME #1 Rendered
Mouse Event #2 Received by ZScript
FRAME #2 Rendered
Mouse Event #3 Received by ZScript
FRAME #3 Rendered
Mouse Event #4 Received by ZScript
PLAYSIM TICK Handled
FRAME #4 Rendered
[/code]
I think this can just be achieved by adding this to d_main.cpp:
[code]
--- a/src/d_main.cpp
+++ b/src/d_main.cpp
@@ -1215,6 +1215,7 @@ void D_DoomLoop ()
}
// Update display, next frame, with current state.
I_StartTic ();
+ D_ProcessEvents();
D_Display ();
S_UpdateMusic();
if (wantToRestart)
[/code]
I've had this in my own local compiled version of GZDoom for a few months now and I don't think it causes any issues.