CompuServe Messages

SwapBitsRastPort… help

    29-Jul-89 17:38:12
Sb: SwapBitsRastPort… help
Fm: Tim Coffey 72377,2617
To: ALL
I just added the fabulous SwapBitsRastPortClipRect() function to my nearly complete menuing program. The above function expects to receive a RastPort pointer and a ClipRect pointer. It does not seem to work quite right yet. Here is what I am doing: I want to render a small submenu at 'x,y' in screen 's'. The submenu is drawn in bitmap 'b'. I will implement a ClipRect 'cr' to call the function. Given that, this is what I am calling SwapBits…() with: (hybrid C code, I use Modula-2) cr->BitMap=b; cr->Bounds.MinX=x; cr->Bounds.MinY=x; cr->Bounds.MaxX=x+width; cr->Bounds.MaxY=y+height; cr->BitMap=b; … all other cr-> fields are NULL; … Then…. SwapBits…(&s->RPort,cr); The menu bitmap renders in the correct x,y position, but the image is offset some in the rectangle bounds I specified above. This offsetting causes a crash, of course. The offsetting appears to change based on the x value I am putting in the Bounds.MinX variable. Perhaps it is related to a Blitter MODULO value, I don't know. I think that I am incorrect in my assumptions in how the ClipRect structure works. No manual I have (RKM,Sybex..) give any good examples. Where am I going wrong? Advice is most appreciated. Tim