delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/15/08:51:45

Message-ID: <F77915E7F086D31197F4009027CC81C9143FC1@probe-2.as-london.acclaim.com>
From: Shawn Hargreaves <SHargreaves AT acclaimstudios DOT co DOT uk>
To: djgpp AT delorie DOT com
Subject: Re: vsync()
Date: Wed, 15 Dec 1999 13:04:00 -0000
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Reply-To: djgpp AT delorie DOT com

zack97 AT localnet DOT com writes:
> This is probably a really dumb question, but can I go without the
> vsync(); (in allegro) if my game will run very fast? 

Sure, you don't have to call vsync() if you don't want to! The point
of doing it is to synchronise your drawing with the monitor retrace,
which can help to avoid tearing artifacts while the screen is updated,
but depending on how your updating is done that might or might not
be a problem. Ideally you should make it configurable, so the user can
tweak it to whatever settings look best on their hardware.

> Cause I'm making a game and it runs at 1000+ fps without the vsync 
> and it runs at like 50 with the vsync...I know 50 is still ok, but 
> I'm not done yet.....

A vsync() waits for the monitor refresh, which is a fixed frequency,
so of course it won't let your program run any faster than the refresh.
But there is no point in doing that in any case: rendering 1000+ fps
is pointless because your monitor can't physically display that many,
and there is no point bothering to draw frames that won't ever be
displayed...


	Shawn Hargreaves.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019