www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/18/11:10:32

Message-ID: <000f01bdb25d$c4e9c800$0a4e08c3@arthur>
Reply-To: "Arthur" <arfa AT clara DOT net>
From: "Arthur" <arfa AT clara DOT net>
To: "DJGPP Mailing List" <djgpp AT delorie DOT com>
Subject: Re: Allegro and blitting to screen
Date: Sat, 18 Jul 1998 16:05:51 +0100
MIME-Version: 1.0

>HELP !!??
>I'm programming a very nice game with DJGPP and allegro. I use SVGA
>640*480*256 colors, so graphic looks good. But the problem is the
>double buffering. It's just too slow. Example :
>
>  BITMAP *buffer = create_bitmap(640, 480);
>
>  clear(buffer);
>  while( game_continues) {
>    // some drawwing on the buffer
>    blit(buffer, screen, 0, 0, 0, 0, 640, 480);
>  }
>
>That is a the only way I can think of, but itsn't fast enough.
>So is there any faster way to do that 'blit(buffer, screen, ...)' ???

Double buffering appears to be a problem in Allegro. Even the Allegro demo
game doesn't go faster than 35fps on my P200MMX.

But double buffering is an inefficient method anyway. Page flipping is
better, and I imagine it is fairly easy to adapt your program to do this,
but you need enough video RAM to do it and for some games the "(dirty)
rectangle" method is faster. I suggest you try both of these methods instead
of double buffering. In comparison: at 1024x768, the dirty rectangle method
hit 434 fps on my machine, and never went below 350fps (and I'm pretty good
at that game).


James Arthur
jaa AT arfa DOT clara DOT net

- Raw text -


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