Game Development Reference
In-Depth Information
Run the program and see what your frame-rate is. Frame-rates differ wildly from
computer to computer. There's not very much going on in the program, so the
frame-rate is going be quite high. Figure 7.5 shows the output when running the
program.
Initially the frame-rate displayed on my computer was about 60 frames per
second. This was because I had V-Sync turned on under my display settings.
Turning V-Sync off will give a better indication of the frames per second.
V-Sync and Frame-Rate
V-Sync is short for vertical synchronization. The computer screen refreshes a
certain number of times a second. V-Sync is an option that ensures that the
frame buffer is filled only as fast as the screen can read it. This prevents artifacts
like tearing, where the frame buffer changes as the data is being written to the
screen causing a visual tearing effect.
On some cards, V-Sync is turned on by default. V-Sync is the refresh rate of the
monitor (how often the monitor updates its display). If your monitor refreshes
at 60Hz and V-Sync is on, then your fps counter will never exceed 60fps. This is
fine most of time, but when developing a game and profiling the frame-rate, it's
important to not have the frame-rate locked. It can usually be turned off through
Figure 7.5
An fps counter.
 
Search WWH ::




Custom Search