[futurebasic] Re: [FB] Faster access to pictures with GWorld

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : April 2008 : Group Archive : Group : All Groups

From: Robert Purves <listrp@...>
Date: Sat, 26 Apr 2008 17:43:24 +1200
Markus Binder wrote:

> Ah, thanks! Now it works better. The small number shown on the top  
> left of the screen of my game indicates the frames per second drawn.  
> I get 22 fps now instead of 18 before with my MacBook, that is 20 %  
> faster. The 4 fps more sound to be not the big step, but I think the  
> feeling of the gameplay is really better with it. :-)

Markus is now using CopyBits, instead of the 'picture' command, to  
draw (most of) the PICT resources for his game.
The game loop is throttled by inkey$, which is called once each frame.
frame time = inkey$ time + calculation-and-drawing time
By default, inkey$ time is 2 ticks = 1/30 s (the same as the default  
HandleEvents time).
If my arithmetic is right, calculation-and-drawing time has dropped  
from 0.022 s per frame to 0.012 s per frame, nearly twice the speed.

Robert P.