Re: Programming a game
Re: Programming a game
- Subject: Re: Programming a game
- From: Dietrich Epp <email@hidden>
- Date: Sun, 16 Nov 2003 19:14:19 -0800
On Nov 16, 2003, at 6:44 PM, Ambroise Confetti wrote:
Le 17 nov. 03, ` 00:13, Clark Cox a icrit :
On Nov 16, 2003, at 15:14, Ambroise Confetti wrote:
About syncing your redraw with vertical retrace, you have to be
careful
with that, since it can also reduce the frame rate.
If your framerate is reduced by synching with the VBL, then that is a
*good* thing, as drawing frames faster than the VBL is a waste, as the
user will never be able to see it. For example, if the screen
refreshes at 60 Hz, but you're drawing at 120 fps, then half of your
frames will never be drawn to the screen, and any CPU time that you
spent rendering those never-displayed frames is wasted.
In the case you present it is a good thing. However, if your
computations for a frame take 1/60 s + a smaller amount of time, you
may "miss" the refresh and lose CPU time waiting for the next one.
In the worst case, almost 50% frames can be lost.
IIRC, you don't block immediately, only if you try to outrun the
monitor.
In your example, you would not be wasting any CPU time at all.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.