www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/17/02:10:24

From: twidler AT aol DOT com (Twidler)
Newsgroups: comp.os.msdos.djgpp
Subject: RE: Bad Flicker
Lines: 22
NNTP-Posting-Host: ladder02.news.aol.com
X-Admin: news AT aol DOT com
Date: 17 Oct 1998 06:04:19 GMT
Organization: AOL Canada http://www.aol.ca
References: <000a01bdf914$369a83c0$9d4b08c3 AT arthur>
Message-ID: <19981017020419.25669.00001999@ng112.aol.com>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
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

- Raw text -


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