[comp.sys.amiga.tech] Finding active screen

CJC105@PSUVM.BITNET (Chris) (10/09/89)

How does one go about finding the active BitMap?  The method I am using now is:

move.l  GraphicsLibrary,a6    ;link to Graphics Library
move.l  34(a6),a1             ;Pointer to View
move.l  (a1),a1               ;Pointer to ViewPort
move.l  36(a1),a1             ;Pointer to RasInfo
move.l  4(a1),BitMapPointer   ;Pointer to Bitmap

It finds the active BitMap only if there is one screen open, otherwise it
tends to find the wrong BitMap.  I have a feeling that somewhere along the line
there is a list of screens I have to search through somewhere.  Is there any
easy way to find just the BitMap of the ACTIVE screen?

                                       Christopher Conrad
                                       CJC105 at psuvm

cmcmanis%pepper@Sun.COM (Chuck McManis) (10/09/89)

In article <89281.222710CJC105@PSUVM.BITNET> CJC105@PSUVM.BITNET (Chris) writes:
>How does one go about finding the active BitMap?  The method I am using now is:

Not sure of the assem code, but try :
	Lock = LockIBase();
	bm = IntuitionBase->FirstScreen->Rastport.BitMap;
	UnlockIBase(Lock);

--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.
"If I were driving a Macintosh, I'd have to stop before I could turn the wheel."

riley@batcomputer.tn.cornell.edu (Daniel S. Riley) (10/09/89)

In article <126033@sun.Eng.Sun.COM> cmcmanis@sun.UUCP (Chuck McManis) writes:
>In article <89281.222710CJC105@PSUVM.BITNET> CJC105@PSUVM.BITNET (Chris) writes:
>>How does one go about finding the active BitMap?  The method I am using now is:

>Not sure of the assem code, but try :
>	Lock = LockIBase();
>	bm = IntuitionBase->FirstScreen->Rastport.BitMap;
>	UnlockIBase(Lock);

I believe this gets you the frontmost screen, which isn't necessarily the
active screen (which I suppose is the screen with the currently active
window on it).  You might try instead

	Lock = LockIBase();
	bm = IntuitionBase->ActiveScreen->BitMap;
	UnlockIBase(Lock);

Screens.h claims that Screen.BitMap is an extra copy of the RastPort
BitMap.  You'll have to figure out the offsets yourself, or use the
handy structure definitions in the Commodore assembly headers.

Anyway, you wanting be looking in the public parts of IntuitionBase.
Gfx isn't responsible for this sort of stuff--Intuition is.

-Dan Riley (riley@tcgould.tn.cornell.edu, cornell!batcomputer!riley)
-Wilson Lab, Cornell U.

33014-18@sjsumcs.sjsu.edu (Eduardo Horvath) (10/13/89)

In article <9022@batcomputer.tn.cornell.edu> riley@tcgould.tn.cornell.edu (Daniel S. Riley) writes:
>In article <126033@sun.Eng.Sun.COM> cmcmanis@sun.UUCP (Chuck McManis) writes:
>>In article <89281.222710CJC105@PSUVM.BITNET> CJC105@PSUVM.BITNET (Chris) writes:
>>>How does one go about finding the active BitMap?  The method I am using now is:
>
[ lots eaten ]
>window on it).  You might try instead
>
>	Lock = LockIBase();
>	bm = IntuitionBase->ActiveScreen->BitMap;
>	UnlockIBase(Lock);
>
[ sommore eaten ]
>-Dan Riley (riley@tcgould.tn.cornell.edu, cornell!batcomputer!riley)
>-Wilson Lab, Cornell U.

I don't remember seeing an ActiveScreen pointer in IntutionBase.
However, there is an ActiveWindow, so try this:

	Lock = LockIBase();
	bm = IntuitionBase->ActiveWindow->Screen->BitMap;
	UnlockIBase(Lock);

I used something similar to take over another application's screen once.

	Eduardo Horvath