[comp.sys.amiga] Multiple viewports

baldwin@usceast.UUCP (Chuck Baldwin) (03/25/88)

[Not being entirely sure where this should go, I post to both]

I am trying to perform a conceptually simple task, of showing two
different views of a large bitmap by using two ViewPorts.  My code
is not in obvious error, and I get bizarre but repeatable results.

Allocate a View, two ViewPorts, two RasInfos, one RastPort, and one BitMap
Initialize these items appropriately:
   Point both RasInfo to BitMap
   Give each ViewPort it's own RasInfo
   Link two ViewPorts through vp.Next field
   Link ViewPorts into View
Do arcane things to generate copper lists
ON_DISPLAY;


The problem is this ... the first ViewPort has graphics correctly
rendered, but the second doesn't. In fact, the second ViewPort is black, which
is not the currently defined background color.  It's as if the display 
is not spewing electrons for the bottom half of the screen.

The program exits okay, so it's not as if I were corrupting system structures
or anything similarly catastrophic.

Anybody able to shed some light on this?  If you really need to see the
code, I can post it, but it's almost exactly like the example code in
RKM vol1 about using Views and ViewPorts.  Really!

                                         Mitch

(Hiding out here under an assumed name ...)

BITNET:   {SXA00051, SXAA00052} @ BAGAMCOK
UUCP:     seismo!ncr-sd!ncrcae!usceast!baldwin
          nosc!crash!pro-carolina!mitch

ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) (03/27/88)

In article <2554@usceast.UUCP> baldwin@usceast.UUCP (Chuck Baldwin) writes:
>I am trying to perform a conceptually simple task, of showing two
>different views of a large bitmap by using two ViewPorts.  My code
>is not in obvious error, and I get bizarre but repeatable results.
>
	I'm assuming that you've got one viewport on top of another, sort of
like a dragged screen effect.

>[ Outlines his procedure... ]
>
>The problem is this ... the first ViewPort has graphics correctly
>rendered, but the second doesn't. In fact, the second ViewPort is black, which
>is not the currently defined background color.  It's as if the display 
>is not spewing electrons for the bottom half of the screen.
>
	Sounds like it's not making it to the second ViewPort.  I would check
to make sure that the ViewPort.{DxOffset,DyOffset} variables are set up
correctly.  You must leave at least on blank video line between the bottom
of one viewport, and the top of the next one.

	It's hard to say what's going on without looking at the relevant
code section; this is only my suspicion.

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Leo L. Schwab -- The Guy in The Cape	ihnp4!ptsfa -\
 \_ -_		Recumbent Bikes:	      dual ---> !{well,unicom}!ewhac
O----^o	      The Only Way To Fly.	      hplabs / (pronounced "AE-wack")
"Work FOR?  I don't work FOR anybody!  I'm just having fun."  -- The Doctor

steveb@cbmvax.UUCP (Steve Beats) (03/28/88)

In article <2554@usceast.UUCP> baldwin@usceast.UUCP (Chuck Baldwin) writes:
>
>[Not being entirely sure where this should go, I post to both]
>
>I am trying to perform a conceptually simple task, of showing two
>different views of a large bitmap by using two ViewPorts.  My code
>is not in obvious error, and I get bizarre but repeatable results.
>
>Allocate a View, two ViewPorts, two RasInfos, one RastPort, and one BitMap
>Initialize these items appropriately:
>   Point both RasInfo to BitMap
>   Give each ViewPort it's own RasInfo
>   Link two ViewPorts through vp.Next field
>   Link ViewPorts into View
>Do arcane things to generate copper lists
>ON_DISPLAY;
>
>
>The problem is this ... the first ViewPort has graphics correctly
>rendered, but the second doesn't. In fact, the second ViewPort is black, which
>is not the currently defined background color.  It's as if the display 
>is not spewing electrons for the bottom half of the screen.
>
I suspect the line where you 'Do arcane things to generate copper lists'.  I
had a similar problem with linked ViewPorts.  When you call MakeVPort(v, vp)
it is not enough to call it with a pointer to the first ViewPort in your list.
YOU MUST CALL MakeVPort() FOR EVERY VIEWPORT LINKED TO vp.Next!!  I am pretty
sure this will fix your problems (poof).

	Steve