delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/06/02/15:30:20

From: =?iso-8859-1?Q?G=FCnter_Ladwig?= <gladwig AT iname DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Best way to destroy bitmaps, font in Allegro?
Date: Fri, 2 Jun 2000 21:04:50 +0200
Organization: 1&1 Telekommunikation GmbH
Lines: 36
Message-ID: <8h914a$jfe$1@news.online.de>
References: <8h8va3$2ps6$1 AT newssvr04-int DOT news DOT prodigy DOT com>
NNTP-Posting-Host: pc19f2a96.dip0.t-ipconnect.de
Mime-Version: 1.0
X-Trace: news.online.de 959973322 19950 193.159.42.150 (2 Jun 2000 19:15:22 GMT)
X-Complaints-To: abuse AT online DOT de
NNTP-Posting-Date: 2 Jun 2000 19:15:22 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi!

> I have a basic question. What is the best way to destroy bitmaps and fonts
> in Allegro.
> I have to make sure that the bitmap/font is destroyed, but I am not sure
if
> it exists. They are created/destroyed by apps, not the OS.
>
> // Simplified
> BITMAP *B;
> FONT *F;
>
> // B may or may not be created
> if (!B) destroy_bitmap(B);
> if (!F) destroy_font(F);
>
> Note: The above bitmaps/fonts may not have had a create_bitmap/ font
> procedure applied to them.
>
> Does this destroy the bitmap/font if it is created, and skip if if it
isn't.
> I have been doing some testing, and I am not sure, especially with the
font.

Initialize all pointers with NULL, so that you know if it has been used or
not. Of course this does not guarantee that the pointer is valid.

ciao

guenter
----
Günter Ladwig
gladwig AT iname DOT com - http://cyberbobby.home.pages.de - ICQ: 14360158
"You know your game is in trouble...when you can look at a Dilbert comic
and not laugh, thinking, 'Been there, done that.'" (C) Steven Woodcock

- Raw text -


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