From: "Chris Wise" Newsgroups: comp.os.msdos.djgpp Subject: Re: Allegro and blitting to screen Date: 20 Jul 1998 03:15:53 GMT Organization: Materials Engineering, Monash Lines: 43 Message-ID: <01bdb38c$2b2b6720$cf86c282@mat-smurf.eng.monash.edu.au> References: <6onnuh$12p$2 AT oravannahka DOT Helsinki DOT FI> NNTP-Posting-Host: mat-wise.eng.monash.edu.au To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Tuomo A Turunen wrote in article <6onnuh$12p$2 AT oravannahka DOT Helsinki DOT FI>... > 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, ...)' ??? How fast is it? Make a frame rate counter that puts the frame rate on the screen. Then experiment with the program. For example comment out the clear(buffer); and see what happens to the framerate. Also try not doing any drawing to the buffer and see what happens to the frame rate. For the simple system that I tried, the blitting was the slowest component and then clearing the buffer. I implemented a dirty rectangles drawing system and got a modest frame rate increase. You should also try different drivers. I'm pretty sure that using vesa 2 can greatly increase your frame rate. I got around 120 fps on a pentium 166 with a rendition verite v1000 card that has vesa 2 built in and only 35 fps on a p100 with a cirrus logic card. Other systems were in between this. For example 57 fps on a p133 with an S3 trio card (no vesa 2) If you don't have vesa 2 built into your card, try using Scitech display doctor. Chris Wsie