[comp.sys.amiga.tech] Custom Bit Maps & Intuition

SXA00051@BAGAMCOK.BITNET (Mitchell Morris) (06/07/88)

Sure ... newWindow->Flags = ACTIVATE | BORDERLESS | SMART_REFRESH;

If you don't specify WINDOWMOVE, WINDOWDEPTH, or WINDOWCLOSE your
window won't have the title bar rendered at all.

                                     Mitch

cmcmanis%pepper@Sun.COM (Chuck McManis) (06/07/88)

In article <10628@agate.BERKELEY.EDU> (Pete Goodeve) writes:
->
->This has probably all been dealt with before, but if so I missed it, and
->it has just become a sort of urgent problem...
		...
->I can, of course, open a window over the whole screen to put my bitmap in,
->but then the screen is going to get its own bitmap too at the moment it's
->created, which is a lot of wasted space if it's high-res/four-plane, say.
->Is there any way around all this, aside from going the non-Intuition custom
->viewport route?  I'll be grateful for any help.  Thanks,
->                                            -- Pete --

If you open a full size window that is the same size as the screen that
is SIMPLE_REFRESH, then the screen and window will share bitmap memory
and everything will be hunky dory. (plus you can write to it through 
either the screen rastport or the window rastport.) The only memory you
'waste' is for a rastport struct, some layers stuff, and a TextFont or
two. (less than 1K anyway). 


--Chuck McManis
uucp: {anywhere}!sun!cmcmanis   BIX: cmcmanis  ARPAnet: cmcmanis@sun.com
These opinions are my own and no one elses, but you knew that didn't you.

mriley@pnet02.cts.com (Mark Riley) (06/08/88)

I came up against the same problem when trying to display a picture
who's bitmap was already in memory.  I didn't want that and the
screen's bitmap to be in memory at the same time.  What I ended up
doing was blitting the top 11 rasters or so to a temporary area and
then blitting them back after I'd opened the screen with the
CUSTOMBITMAP and SCREENQUIET flags set.  A little extra code, but it
saves gobs of chip memory.  (So much for SCREENQUIET working like
it's supposed to, huh?  ;-)

-Mark-  (Still trying to think of a signature...  ;-)

UUCP: {ihnp4!scgvaxd!cadovax, <backbone>}!gryphon!pnet02!mriley
INET: mriley@pnet02.cts.com

mp1u+@andrew.cmu.edu (Michael Portuesi) (06/09/88)

> *Excerpts from ext.nn.comp.sys.amiga.tech: 7-Jun-88 Custom Bit Maps &*
> *Intuition Pete Goodeve@violet.berk (1031)*

> I can, of course, open a window over the whole screen to put my bitmap in,
> but then the screen is going to get its own bitmap too at the moment it's
> created, which is a lot of wasted space if it's high-res/four-plane, say.

I thought that backdrop windows used the screen's bitmap for their own bitmap.
Thus you could open up a backdrop window over the whole screen and not waste
any space.  I believe this is the method the Intuition manual advises.

                        --M

Michael Portuesi / Information Technology Center / Carnegie Mellon University
ARPA/UUCP: mp1u+@andrew.cmu.edu                     BITNET: rainwalker@drycas

"if you ain't ill it'll fix your car"

carolyn@cbmvax.UUCP (Carolyn Scheppner CATS) (06/09/88)

In article <1723@puff.cs.wisc.edu> avery@puff.WISC.EDU (Aaron Avery) writes:
>In article <10628@agate.BERKELEY.EDU> pete@violet.berkeley.edu (Pete Goodeve) writes:
>>I can, of course, open a window over the whole screen to put my bitmap in,
>>but then the screen is going to get its own bitmap too at the moment it's
>>created, which is a lot of wasted space if it's high-res/four-plane, say.
>
>You can do this anyway. Use your CUSTOMBITMAP example, then open the window
>on top of it as a SUPER_BITMAP window, pointing them both at the same BitMap.
>The best window to open, as Carolyn mentioned, is a BORDERLESS, BACKDROP
>window, but be sure to call ShowTitle() to get that pesky title bar behind your
>window. I remember some problems with this, but I think that was only if I
>tried to render into it. I hope it helps.

I think BORDERLESS is still incompatible with SUPER_BITMAP since it is
documented that SUPER_BITMAP must be GIMME_ZERO_ZERO.

But as I proved to somebody else today, there is almost no overhead
for adding a normal BACKDROP|BORDERLESS window to a CUSTOM screen.
It does not require separate bitplanes.


-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Carolyn Scheppner -- CATS   >>Commodore Amiga Technical Support<<
                     UUCP  ...{allegra,ihnp4,rutgers}!cbmvax!carolyn 
                     PHONE 215-431-9180
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

pete@violet.berkeley.edu (Pete Goodeve) (06/12/88)

Thanks for all your responses to my question, but I'm afraid the answer is
pretty much what I had expected: there ain't none!  No simple answer anyway.

I originally wrote <10628@agate.BERKELEY.EDU>:
-->
-->Okay, I have a simple goal (at least I thought it was...):  I want to put
-->up an Intuition screen containing a pre-generated custom bitmap,
-->uncluttered by title bar or other ornaments.
-->[]

The reason for this is that I want to have several bitmaps around (as many
as chip memory has space for) that I can pop up in a hurry.  They'll each
need their own custom screen because they may be of different resolutions
and depths.

The crux of the problem is at the OpenScreen(); here I can either:

a)  set CUSTOMBITMAP in the NewScreen structure, and give it a pointer to my
    (already filled) bitmap.

        ...in which case, before I can make any other call, Intuition
        instantly slaps a title bar (or the equivalent blank space if
        SCREENQUIET is also specified) across the top of my bit planes IN
        MEMORY.  It is then too late to recover the lost picture area.
        I can allocate the same bitmap to a window (as Aaron Avery in
        <1723@puff.cs.wisc.edu> suggested), but it does me no good, the
        pixels have been overwritten.

or

b)  not set CUSTOMBITMAP.

        ...in which case, equally instantly, Intuition allocates chip
        memory for bitplanes and a bitmap of the requested size.  It's true
        that I can then for instance open a borderless backdrop window
        without incurring any further penalty, but I can't use my original
        bitmap without either copying it or opening the window as
        SUPER_BITMAP.  Either way I have that superfluous, useless, bitmap
        hanging about, which I really don't want.



Only Mark Riley in article <4370@gryphon.CTS.COM> seems to have a solution:

 > I came up against the same problem when trying to display a picture
 > who's bitmap was already in memory.  I didn't want that and the
 > screen's bitmap to be in memory at the same time.  What I ended up
 > doing was blitting the top 11 rasters or so to a temporary area and
 > then blitting them back after I'd opened the screen with the
 > CUSTOMBITMAP and SCREENQUIET flags set.  A little extra code, but it
 > saves gobs of chip memory.  (So much for SCREENQUIET working like
 > it's supposed to, huh?  ;-)

I guess that's what I'll have to do.  I can think of one other possibility:
I could make each bitmap just enough bigger for the title bar ABOVE the
picture, then -- AFTER I've done OPenScreen() and ShowTitle(screen,FALSE)
-- I can adjust the screen's ViewPort vertical offset appropriately.
I think Mark's way is less work and space, though.  Thanks.

Actually, though I hate to suggest anything so crass, could this be
considered an Intution bug that ought to be fixed?  It should be possible
to have a custom bitmap left ENTIRELY alone.

                                            -- Pete --

peter@sugar.UUCP (Peter da Silva) (06/12/88)

In article ... pete@violet.berkeley.edu (Pete Goodeve) writes:
> Okay, I have a simple goal (at least I thought it was...):  I want to put
> up an Intuition screen containing a pre-generated custom bitmap,
                                      ^^^^^^^^^^^^^
This is, of course, the key phrase that everyone missed. You have a big old
bitmap that you want to put into a new screen that you haven't opened yet.
You can, of course, open the screen and then copy the bitmap in, or play with
a superbitmap window, or whatatever... but there is no way you can open a
screen with an existing bitmap without, as you put it,

> leaving a black space in [the title bar's] place over the top of my picture.

I ran into this problem myself, when I wanted to read a bitmap from a FORM
ILBM and wrap a screen around it. Eventually I just gave up and where I had
been allocating the bitmap I allocated a SCREENBEHIND screen and rendered
into its bitmap. Then I shoved it to the front to display it.

Yes, this is a bug. No, there isn't a workaround that lets you do things in
the order you want. There you go.
-- 
-- Peter da Silva      `-_-'      ...!hoptoad!academ!uhnix1!sugar!peter
-- "Have you hugged your U wolf today?" ...!bellcore!tness1!sugar!peter
-- Disclaimer: These may be the official opinions of Hackercorp.