Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

pause for animation

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.



thanks.


Comments

  • : 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.



    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.



    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.



    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.



    Old computer games were dependant on the frame-rate to determine the game speed. This would make those games too fast on newer computers.



    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.



    You need DJGPP, Linux, Xwindows, Visual C++ (with DirectX SDK 6.0+) to use Allegro



    If you want Allegro, go to:



    http://www.talula.demon.co.uk/allegro/



    -Xotor-


Sign In or Register to comment.