'Future.Library XMSget/XMSput, Pageing and Mouse Support
'

REM $INCLUDE: 'future.bi'

Set640x400 8'Set 640x400 svga screen

handle% = AllocateXMS(256000) 'get 256000 bytes of XMS memory
handle1% = AllocateXMS(256000) 'get 256000 bytes of XMS memory

FOR i% = 0 TO 400
Future.BOX 320 - i%, 200 - i%, 320 + i%, 200 + i%, i%
NEXT

Future.XMSGet 0, 0, 639, 399, handle%

Future.CLS 0

FOR i% = 0 TO 200 STEP 2
Future.CIRCLE 320, 200, i%, i%
NEXT

Future.XMSGet 0, 0, 639, 399, handle1%
Future.MouseOn
DO

IF newposX% <> Future.MouseX OR newposY% <> Future.MouseY THEN

        P% = P% XOR 1

        Setpage P%

        newposX% = Future.MouseX
        newposY% = Future.MouseY
        
        Future.XMSPut 0, 0, handle% 'redraw screen

        SetMaskColor 0
        Future.XMSPut newposX% - 320, newposY% - 200, handle1% 'redraw screen
        SetMaskColor -1
       
        viewpage P%
      
END IF

LOOP UNTIL INKEY$ = CHR$(27)

Future.MouseOff

DeallocateXMS handle%  'free up EMS memory
DeallocateXMS handle1%  'free up EMS memory
ReSetScreen

