[net.micro.amiga] double buffering

mykes@3comvax.UUCP (Mike Schwartz) (08/06/86)

I would like to see an example of how to do double buffered displays in
a FAST way.  I have seen and tried the method from the FISH example
(not to be confused with FISH disks), but it calls RethinkDisplay(), the
biggest CPU hog of all.  Unfortunately, my application cannot afford to
lose "several milliseconds" worth of time, especially when RethinkDisplay()
does a Forbid() and Permit() around all that CPU time.  The requirements
that I have are:  Page Flip must take almost zero time; Must be friendly to
intuition.

By friendly to intuition, I mean that I do not care if my screen can be 
pulled down or sent to the back (or front) - I do care that I can restore
the system so that Intuition will work when I exit (or do my own screen
to front and back gadgets).

Any help would be appreciated.

cmcmanis@sun.uucp (Chuck McManis) (08/07/86)

> I would like to see an example of how to do double buffered displays in
> a FAST way.  I have seen and tried the method from the FISH example
> (not to be confused with FISH disks), but it calls RethinkDisplay(), the
> biggest CPU hog of all.  Unfortunately, my application cannot afford to
> lose "several milliseconds" worth of time, especially when RethinkDisplay()
> does a Forbid() and Permit() around all that CPU time.  The requirements
> that I have are:  Page Flip must take almost zero time; Must be friendly to
> intuition.
> 
> By friendly to intuition, I mean that I do not care if my screen can be 
> pulled down or sent to the back (or front) - I do care that I can restore
> the system so that Intuition will work when I exit (or do my own screen
> to front and back gadgets).
> 
> Any help would be appreciated.

I have found what I consider to be a fairly simple way of doing this,
Basically, you declare a SUPERBITMAP that is twice as wide as the
screen, then to switch you just change the x offset from 0 to 
WINDOW_WIDTH and back again to swap bitmaps. The benefit is mainly
realized because you can use the same RPort values etc. The only
disadvantage is that all of your Draw calls have to have an offset
in their X co-ordinate. I use the variable WhichFrame which is always
added to the X variable on absolute moves or draws. And yes Intuition
has no trouble keeping itself straight.

--Chuck McManis
Sun Microsystems
{anywhere}!sun!cmcmanis		-or- 	cmcmanis on BIX