Mail Archives: djgpp/1998/10/17/10:01:36
From: | "Arthur" <arfa AT clara DOT net>
|
To: | <djgpp AT delorie DOT com>
|
Subject: | RE: Bad Flicker
|
Date: | Sat, 17 Oct 1998 14:58:06 +0100
|
Message-ID: | <000401bdf9d6$2a525bc0$764e08c3@arthur>
|
MIME-Version: | 1.0
|
X-Priority: | 3 (Normal)
|
X-MSMail-Priority: | Normal
|
X-Mailer: | Microsoft Outlook 8.5, Build 4.71.2173.0
|
Importance: | Normal
|
In-Reply-To: | <19981017020419.25669.00001999@ng112.aol.com>
|
X-MimeOLE: | Produced By Microsoft MimeOLE V4.72.3110.3
|
Reply-To: | djgpp AT delorie DOT com
|
> Use a double buffer in your program..
>
> blit everything to a seperate bitmap(the size of your screen) and when
> everything is drawn there, then blit the seperate bitmap to the screen.
>
> like:
>
> BITMAP *buffer=create_bitmap(320, 200);
>
> do
> {
> x=x+1;
> blit(happyface, buffer, 0, 0, x, y, 20, 100);
> blit(bird, buffer, 0, 0, x, y, 10, 10);
>
> blit(buffer, screen, 0, 0, 0, 0, 320, 200);
> clear(buffer);
> }while(whatever)
>
> doing this eliminates the flicker...try it.
>
> twidler
Do that in 640x480 VESA and you'll die a horrible flickery death, or at
least get shearing. Add a vsync() before blitting the buffer to the screen.
It'll limit your framerate, but there are ways around that. Check out George
Foot's Allegro Vivace tutorial (can't remember the address - George?)
James Arthur
jaa AT arfa DOT clara DOT net
ICQ#15054819
- Raw text -