Let's say you have a real-time 3D program running with a standard windows interface. Your loop looks like this:
This loop will respond to all events immediately, but it will never pause the program to wait for an event.
The program uses delta timing, calculating the time elapsed each loop. Now if the user selects a menu, the program will be paused for a long period of time. I have a function that will pause the game timing. However, BlitzMax doesn't give me any indication that the user has been selecting a menu, moving a window, selecting a gadget, or doing any of the other things that can pause the program for a long period of time. If these actions generated an APPSUSPENDED event, I could just pause the game timing, but they don't.
This is a serious issue. If I want real-time physics and/or rendering in a windowed application, user input will create enormous delta timing values, which will most certainly result in problems. Capping the elapsed time value is not a good solution, because I want the application to pick up from right when the user paused the application.
Repeat While PeekEvent() Select WaitEvent() < Evaluate events here > EndSelect Wend RenderWorld() Flip Forever
This loop will respond to all events immediately, but it will never pause the program to wait for an event.
The program uses delta timing, calculating the time elapsed each loop. Now if the user selects a menu, the program will be paused for a long period of time. I have a function that will pause the game timing. However, BlitzMax doesn't give me any indication that the user has been selecting a menu, moving a window, selecting a gadget, or doing any of the other things that can pause the program for a long period of time. If these actions generated an APPSUSPENDED event, I could just pause the game timing, but they don't.
This is a serious issue. If I want real-time physics and/or rendering in a windowed application, user input will create enormous delta timing values, which will most certainly result in problems. Capping the elapsed time value is not a good solution, because I want the application to pick up from right when the user paused the application.