www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/02/14/15:30:19

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
From: "Brent Ritchie" <Juicer_X AT hotmail DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Implementing a double buffer
Lines: 42
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <8ZUa8.25984$Hv5.3040659@news20.bellglobal.com>
Date: Thu, 14 Feb 2002 15:19:19 -0500
NNTP-Posting-Host: 64.231.112.87
X-Complaints-To: abuse AT sympatico DOT ca
X-Trace: news20.bellglobal.com 1013717956 64.231.112.87 (Thu, 14 Feb 2002 15:19:16 EST)
NNTP-Posting-Date: Thu, 14 Feb 2002 15:19:16 EST
Organization: Bell Sympatico
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hello,

    I 've got a small problem. I can't get a double buffer to work. I don't
know why it wouldn't? To me it looks ok. But if you can see anything wrong I
would appreciate any input.

bool end_game = TRUE;
character hero("George","Knight",10,10,12,12);

void init()
{
 allegro_init();
 install_keyboard();
 set_gfx_mode(GFX_AUTODETECT,800,600,0,0);
 install_timer();
 BITMAP *buffer = create_bitmap(800, 600);    // make a bitmap in system RAM
 clear_bitmap(buffer); // zero the memory bitmap
 vsync();
}

void shutdown()
{
 allegro_exit();
}

void input()
{
 if (key[KEY_ESC]) end_game = FALSE;
 hero.update(buffer);
 blit(buffer, screen, 0, 0, 0, 0, 800, 600);
 clear_bitmap(buffer);
}
 the calling order of the functions is init(), input(), shutdown().

the error message is:
test.h: In function `void input()':
test.h:23: `buffer' undeclared (first use this function)
test.h:23: (Each undeclared identifier is reported only once for each
function it appears in.)



- Raw text -


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