Game programming

Moderators: None (Apply to moderate this forum)
Number of threads: 2070
Number of posts: 5361

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Edit Report
pause for animation Posted by robert on 23 Mar 2000 at 12:20 AM
Is waiting for vertical retrace the only method to pause? Won't the delay depend on how much is drawn, and be different everytime. what is a "timer". how is it accessed? I use C DOS, and my own library.<br>
<br>
thanks.


Edit Report
Here's how it works Posted by Xotor on 23 Mar 2000 at 5:34 PM
: Is waiting for vertical retrace the only method to pause? Won't the delay depend on how much is drawn, and be different everytime. what is a "timer". how is it accessed? I use C DOS, and my own library.<br>
<br>
A timer is simply an a bit of code that calls a function at a set interval. The normal timer that the PC clock uses is usually too slow for most games, only ticking something like eighteen times a second.<br>
<br>
If you're using a library like Allegro which can install its own timers for you, you can use the timer to judge when you want to display a frame. Allegro uses a hardware timer which has 1193181 times a second.<br>
<br>
What you use the timer for is to update your game's data, and then have a constant loop display the image. That way the frame-rate is dependant on the processor, etc. but the game itself isn't. Thus a person with a faster computer may enjoy higher frame-rate, but his game will still play at the same speed as a slow computer.<br>
<br>
Old computer games were dependant on the frame-rate to determine the game speed. This would make those games too fast on newer computers.<br>
<br>
Games like DOOM are frame-rate independant for game movement. The game may be jerkier for slower computers but the game speed is still the same. That's how slow computers can play against fast computers and still syncronize.<br>
<br>
You need DJGPP, Linux, Xwindows, Visual C++ (with DirectX SDK 6.0+) to use Allegro<br>
<br>
If you want Allegro, go to:<br>
<br>
http://www.talula.demon.co.uk/allegro/<br>
<br>
-Xotor-





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.