[comp.sys.apollo] GPR Double Buffering

FERGUSON@TMASL.EXXON.COM (05/11/89)

The GPR Manual Says that you must have a DN590 to do double buffering.
How come GMR3d can do double buffering on an 8-plane 3000, and GPR
can't? On an 8-plane 4000, I would like to initialize GPR in borrow
or direct mode, with a 4-plane bitmap. I would then like to do a
gpr_$allocate_buffer, to create a second buffer just like the first
one.

Does GMR3D use GSR for double buffering, and GPR doesn't? This isn't
a real secret or anything is it (Ollie?) Thanks.

Scott Ferguson
ferguson@erevax.bitnet

scoville_w@apollo.COM (William Scoville) (05/12/89)

    I believe gmr3d does double buffering via software,
    if hardware doesn't support it, while gpr only double 
    buffers if it can use hardware. 

    If you wanted to "double buffer" on a node without
    2 buffers, you could play with the color maps,
    (I believe this is what gmr3d does). 

    What you do is make two color maps, one that makes
    planes 0-3 visible, and another that makes planes
    4-7 visible.

    When create the color maps, you set your color values to
    ignore either the upper 4 bits or lower 4. That is instead
    of just setting pixel value 0x01 to red (for example), you
    also need to set 0x11 to red, 0x21, 0x31 etc. For the other
    map, you do just the opposite. make value 0x10 = red, 0x11,
    0x12 etc. Do this for all the colors on both maps (it will
    allow you to use 15 colors).
    
    Then use two pixel values to draw the "buffers". For example,
    if I wanted to draw with a pixel value of 1, When drawing to
    the first buffer I would use a value of 0x01, but when drawing
    to the second buffer, I would use 0x10. This could easily be
    done by saying :
        if (buffer_two) draw_value = color value << 4;
        else draw_value = color_value;
    Then by swaping the color maps I could make one buffer invisible, 
    and make the other visible.
    
    You also need to set the plane mask to mask off the
    planes you are displaying while you draw the others. This should
    allow clears and blts to work without effecting the visible
    buffer.

    This method should really only be used in borrow mode, or
    you'll be making the other pads+DM appear and disappear.

                        -BS-

    Internet: scoville_w@apollo.com (preferred)
        UUCP: ...{decwrl!decvax, mit-eddie, attunix}!apollo!scoville_w
        USPS: mailstop chr 03 dw, Apollo Computer, 330 Billerica Rd., Chelmsford MA. 01824