What's the best method in Blitz to keep the time (FPS) constant? I have used this bit of code but it just eats up all of the CPU processing power while waiting for the next loop:
Their is no problem with my game running stand-alone but if the user wants to run something else at the same time (and who doesn't with a multi-tasking OS) then the other programs suffer horribly. This wasn't a problem for me while programming in C++ because I would just set a callback timer, thereby freeing up the cpu until the next loop. But I'm not aware if something like this exists in Blitz.
While GameRunning Cls curTime=MilliSecs() While MilliSecs() < curTime + 33 Wend ;perform game functions here Flip Wend
Their is no problem with my game running stand-alone but if the user wants to run something else at the same time (and who doesn't with a multi-tasking OS) then the other programs suffer horribly. This wasn't a problem for me while programming in C++ because I would just set a callback timer, thereby freeing up the cpu until the next loop. But I'm not aware if something like this exists in Blitz.