Mail Archives: djgpp/1998/01/04/22:34:43

From: "Tony O'Bryan" <aho450s AT nic DOT smsu DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Speed with Allegro
Date: Sun, 04 Jan 1998 21:26:05 -0600
Organization: Southwest Missouri State University
Lines: 37
Message-ID: <>
References: <68p4ib$cr8$1 AT towncrier DOT cc DOT monash DOT edu DOT au>
Reply-To: aho450s AT nic DOT smsu DOT edu
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Robert Clayton wrote:
> Okay, my problem is this-
> I can make some sprites dance around the screen, and I have a little
> space ship that the player controls.  That's all fine and dandy, the
> problem is that I can't get it to run fast enough.  I can smoothly
> scroll the ships, etc.  I don't know why.
> It's not my machine, a P166.  I'm using Allegro, drawing the sprites
> onto a bitmap which I then show, using the double buffering technique.
> Any help?

There are several possible causes: Video mode and resolution, the types
and sizes of the images you're using, frame-rate control through the use
of a timer, inefficient algorithm, programming errors, your perception
of what "fast enough" means, etc.

In the Asteroids-type game I'm writing using 640x480x256 on a Pentium
120 with a Path 411 Trio 64 (S3 based), with lots of RLE objects and
four rotating bitmap images floating around the screen, I get about 30
frames per second which is an ideal speed for this particular game.  The
only way I can really help is to look at your source code.  Allegro has
good facilities for fast animation; it's just a matter of how you use
them and how fast is fast enough.

Bitmap formatted images take the longest to blit to the screen, so
should be used minimally at run-time.  RLE and compiled sprites are the
fastest but least flexible, but you can work around their limitations. 
One technique I use with frequently used bitmaps that need fine
rotations is to convert them to arrays of compiled sprites when the
program first starts.  It's memory-intensive, but the speed increase is

Feel free to e-mail me if you want to discuss details.
Tony O'Bryan

- Raw text -

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