Mail Archives: djgpp/1999/02/28/11:20:49
From: | krugman AT nospam DOT demon DOT co DOT uk (Kevin)
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Is Allegro too slow for 648 * 480 double buffering ?
|
Date: | Sun, 28 Feb 1999 15:53:45 GMT
|
Message-ID: | <36d9629e.17499764@158.152.254.68>
|
NNTP-Posting-Host: | reality-bytes.demon.co.uk
|
X-NNTP-Posting-Host: | reality-bytes.demon.co.uk:212.228.30.60
|
X-Trace: | news.demon.co.uk 920217214 nnrp-04:25863 NO-IDENT reality-bytes.demon.co.uk:212.228.30.60
|
X-Complaints-To: | abuse AT demon DOT net
|
X-Newsreader: | Forte Free Agent 1.11/32.235
|
Lines: | 59
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
Hi all,
I'm trying to do a spritey double buffered game and would like ideally
to do this at 640 * 480 * 8bpp. (Well I realy wanted 800 * 600, No
chance)
But the prrogram I have written to test the feasability of this idea
seems to indicate that Allegro would be too slow for this.
The following listing just doesn't finish switching and clearing the
buffers quickly enough, are my conclusions about Allegro correct, or
am I doing something wrong or missing something really important ?
I wanted to avoid the "dirty rectangle list" route. can I do this with
Allegro,, or have I to plunge in to the intricacies of Scitechs MGL
yet again.
Is there a VESA 2 library available for DJGPP apart from Scitec's
stuff.
#include "allegro.h"
int main()
{
allegro_init(); // Start the Allegro Graphics Library.
set_gfx_mode(GFX_AUTODETECT, 640, 480, 0, 0);
BITMAP *buffer = create_bitmap(640, 480);// Create buffer.
BITMAP *ball = create_bitmap(51,51); // Create a sprite bitmap.
clear(screen);
clear(buffer);
clear(ball);
circle(ball, 25,25,25,15); // Put something on the sprite bitmap.
int i = 429;
while(!kbhit())
{
// blit the sprite on to the back buffer.
blit(ball, buffer, 0,0, i,i--, 51,51);
if(i < 1) // If the sprite is at top of screen -
i = 429; // move it back to the bottom.
vsync(); // Wait for vertical retrace.
clear(screen);
// Blit the back buffer on to the screen.
blit(buffer, screen, 0,0, 0,0, 640,480);
clear(buffer);
}
allegro_exit(); // Shutdown the Allegro Graphics Library.
return 0; // And terminate.
}
Kevin.
If you wish to Email or ICQ me, use
kevin AT reality-bytes DOT demon DOT co DOT uk
or
25646989
- Raw text -