Maxgui Timer Limitation

BlitzMax Forums/MaxGUI Module/Maxgui Timer Limitation

Scaremonger(Posted 2013) [#1]
Take the code below; If you increase the timer to 60 (On my laptop) the application no longer runs. I suspect this is because MAXGUI is spending all it's time processing messages rather than running the game.

Does anyone have a suggestion for calculating the best timer speed for a given PC so that this situation does not occur?




Derron(Posted 2013) [#2]
First: RedrawGadget during the timerticks does not repaint the canvas on linux/fltk (you have to move the drawing section to a custom function and call it on timertick and on gadgetpaint).

I increased the timer to 300 and it did all - except reacting on the close button. Timer-tick still got triggered.

If you want to get a "maximum" to use: just calculate avg time for each run of eventprocessing. that average is the time you have to leave for the app to stay alive and halfway responding.

bye
Ron


jsp(Posted 2013) [#3]
When using the WaitEvent loop the TimerTick cannot flood the eventqueue, but when using an addhook it can.
You have to have your own mechanism in place to avoid that, so be careful when you are using an AddHook command.


Scaremonger(Posted 2013) [#4]
@Derron: Thanks for the advice about Linux.

On @JSP's advice I moved TIMERTICK and GADGETPAINT into the while loop and it didn't seem to make much difference, so I threw in a FPS function and was surprised to see I was getting a good frame rate!

The delta timer helped me identify the problem. ANG was a float, I changed ANG to a double and it now works...

Cheers guys :)