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
Allegro flicker free animation Posted by Rene on 26 Feb 2000 at 6:04 PM
How do i do flicker free animation with allegro. I made a white rectangle (40x40) move across the screen, an it flickered VERY much. I did not insert a vsync(), because in a game i would not like to wait for retraces. <br>
So, how can i create flicker free animation???


Edit Report
Re: Allegro flicker free animation Posted by Unknown on 27 Feb 2000 at 1:17 PM
: How do i do flicker free animation with allegro. I made a white rectangle (40x40) move across the screen, an it flickered VERY much. I did not insert a vsync(), because in a game i would not like to wait for retraces. <br>
: So, how can i create flicker free animation???<br>
<br>
Flickering is caused by the VR (vertical<br>
retrace) or no double buffer. Every C/C++<br>
game waits for the VB and implmements a double<br>
buffer. You have no choice.<br>
<br>
// Animation example<br>
<br>
while (Animate)<br>
{<br>
Draw(); // Draw Sprites to DB<br>
Move(); // Change coordinates<br>
VR(); // Wait for VR<br>
CopyDB(); // Copy DB to screen<br>
}<br>
<br>
// VR function<br>
<br>
void VR()<br>
{<br>
while ((inp(0x03DA) & 0x08)) {};<br>
while (!(inp(0x03DA) & 0x08)) {};<br>
}<br>
<br>
(Personally, I wouldn't recommend C/C++ to<br>
beginning game programmers. Java is much easier, cuz everything is predefined. Check out: http://www.javagamepark.com).<br>
<br>






 

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.