PROGRAM BlitterInteraction
?
?
? Program is Low Level One To Open Window, Draw A Filled Box, And Then
? Directly Use The Blitter To Move The Box To Another Area Of The Window
? Since It Uses BltBitMap Without Overlap Storage, Use Only Within
? A Single Window.
? Served As The Beginning Of The F-Basic BLOCK Image Transfer Statements
?
?
INTEGER I,J,K,L,M
INTEGER GfxsBase,BitPtr,Rast1,Rast2,SourceBitMap
&SYSLIB 1
GfxsBase=OPENLIB("graphics.library",0)
IF NOT GfxsBase THEN GOTO End1
I=WINDOW #1(0,0,640,200,0,0,0,0,-1,-1,31,@"WINDOW1",-1)
CURS_INV
COLOR_BOXFILL #3 (0,30,30,70,70)
BitPtr=ALLOCATE_WITH(40,0)
IF NOT BitPtr THEN
   {NoMem}
   PRINT "One Of The Memory Calls Failed"
   GOTO End1
ENDIF
K=InitBitMap(GfxsBase,BitPtr,2,40,40)
Rast1=AllocRaster(GfxsBase,40,40)
Rast2=AllocRaster(GfxsBase,40,40)
IF NOT Rast1 OR NOT Rast2 THEN GOTO NoMem
#(BitPtr+8)=Rast1
#(BitPtr+12)=Rast2
SourceBitMap=WINDOW_INFO(3)      ; ? RastPort Structure Of Current Window
SourceBitMap=#(SourceBitMap+4)   ; ? BitMap Structure Of Current Window

? copy from current window to temporary bitmap structure
L=BltBitMap(GfxsBase,SourceBitMap,30,30,BitPtr,0,0,40,40,C0'16,FF'16,0)

? copy back to current window at location 100,100
L=BltBitMap(GfxsBase,BitPtr,0,0,SourceBitMap,100,100,40,40,C0'16,FF'16,0)

DELAY(50)
I=DEALLOCATE(40,BitPtr)
I=FreeRaster(GfxsBase,Rast1,40,40)
I=FreeRaster(GfxsBase,Rast2,40,40)
{End1}
WINDOW_CLOSE #1
END
