• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Programming a game
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Programming a game (From: Denis Vaillant <email@hidden>)
 >Re: Programming a game (From: Ambroise Confetti <email@hidden>)
 >Re: Programming a game (From: Clark Cox <email@hidden>)
 >Re: Programming a game (From: Ambroise Confetti <email@hidden>)

  • Prev by Date: How to prevent NSTableColumn from moving
  • Next by Date: Re: Subclassing From Code?
  • Previous by thread: Re: Programming a game
  • Next by thread: Transparent Image into Clipboard?
  • Index(es):
    • Date
    • Thread