🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #7947

Re: Who frees CUSTOMBITMAPs?

#7947
From: markv
Date: Tue, 08 Jan 1991 17:25
39 lines
2573 bytes
In article <324@smosjc.UUCP>, brett@smosjc.UUCP (Brett Coon) writes:
> When you open a screen with the CUSTOMBITMAP flag set in the NewScreen struc-
> ture, will CloseScreen free the bitmap memory?  If so, how can I prevent this
> from happenning so that I can free the memory myself at a later time?

No, Intuition does NOT free memory on a CUSTOMBITMAP screen, its up to
you.  That includes both the Bitmap struct and the actual raster.
 
> On a related topic, is it correct that memory must be freed in the same block
> sizes in which it is allocated?  I.E. if I use AllocRaster to allocate a 
> 640x200 bitmap, I can't free it as two 320x200 bitmaps, right?

To be on the safe side in all cases the answer is yes.  The reason is
to insure future compatibilty with new or replacement functions that
might want to do resource tracking, etc.

> Finally, if I want to open a 320x200 pixel screen that shows 1/2 of a 640x200
> pixel bitmap, is it correct that I should specify 320x200 in the NewScreen
> structure but 640x200 in my (custom) BitMap structure?

You can not do this at the SCREEN level.  When you set the resolution
on the NewScreen structure, you are setting the HARDWARE resolution.
The bitmap for the screen must be equal in size to the screen.  The
system is trying to fit your 640 pixels on the display in LORES via
overscan.

The better way to do this is open a conventional screen, then open a
SuperBitMap window.  If it's a borderless backdrop window, the visual
effect will be the same, but you'll have the advantage of a window for
its IDCMP, and you can easily scroll the bitmap with ScrollVPort().
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mark Gooderum			Only...		\    Good Cheer !!!
Academic Computing Services	       ///	  \___________________________
University of Kansas		     ///  /|         __    _
Bix:	  markgood	      \\\  ///  /__| |\/| | | _   /_\  makes it
Bitnet:   MARKV@UKANVAX		\/\/  /    | |  | | |__| /   \ possible...
Internet: markv@kuhub.cc.ukans.edu
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Technical Details
Message-ID: <27752.2789ac45@kuhub.cc.ukans.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!caen!kuhub.cc.ukans.edu!markv
References: <324@smosjc.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!caen!kuhub.cc.ukans.edu!markv
From: markv@kuhub.cc.ukans.edu
Newsgroups: comp.sys.amiga.tech
Subject: Re: Who frees CUSTOMBITMAPs?
Message-ID: <27752.2789ac45@kuhub.cc.ukans.edu>
Date: 8 Jan 91 17:25:57 GMT
References: <324@smosjc.UUCP>
Organization: University of Kansas Academic Computing Services
Lines: 39