Mail Archives: djgpp/1996/12/26/19:09:25
Benjamin D Chambers (chambersb AT juno DOT com) wrote:
: I've seen a program get over 200fps with Allegro on a Pentium-133. (Clear
: the buffer, draw on buffer, copy to video). Was just a test, but it
: worked :)
Well .. I've just downloaded Allegro and got it to compile. I also ported
my program to use Allegro instead of my own VBE 2.0 lib.
Basically, the program is :
---
InitGraphics(); // init graphics system
DBCreate(); // create a double buffer in ram
// do for 480 frames, ie when line from top moves to bottom
for (i=0,col=0; i<480; i++)
{
// throw 640x480 pixels into the dbuffer each frame
// -> simulates a really bad case of rendering
for (y=0; y<480; y++)
for (x=0; x<640; x++) DBPutPixel(x,y,col=(col+1)%256);
// draw 2 lines in dbuffer
// 1 line moves down, the other moves across
DBDrawLine(0,i,640,i,100);
DBDrawLine(i,0,i,480,100);
// blast dbuffer to video
DBCopyToVideo();
// clear dbuffer to 0
DBClear(0);
}
// free the dbuffer
DBFree();
// shut down
CloseGraphics();
---
I ported this to Allegro, using BITMAP *dbuffer, and putpixel to this
dbuffer, etc.
The result I got was 17fps using my own vbe 2.0 lib, and 7fps using
Allegro.
I calculated this frame rate by dividing 480 (since I threw this many
frames in the program) by the time in seconds it took to execute the own
thing.
Looks like I'll be keeping my vbe lib around for a while ... :)
- Raw text -