home *** CD-ROM | disk | FTP | other *** search
/ C++ Games Programming / CPPGAMES.ISO / fgl / fglight / exbas.arj / TEMP / 08-16.BAS < prev    next >
BASIC Source File  |  1995-01-31  |  1KB  |  58 lines

  1. REM $INCLUDE: 'fastgraf.bi'
  2.  
  3. DEFINT A-Z
  4.  
  5. CONST VBwidth = 1000
  6. CONST VBheight = 50
  7.  
  8. REM initialize the video environment
  9.  
  10. OldMode = FGgetmode
  11. FGsetmode 20
  12. FGvbinit
  13.  
  14. REM fill the screen with light blue pixels
  15.  
  16. FGsetcolor 9
  17. FGfillpage
  18.  
  19. REM set up the virtual buffer
  20.  
  21. SetMemStatus& = SETMEM(-(CLNG(VBwidth)*CLNG(VBheight)+16))
  22. Handle = FGvballoc(VBwidth,VBheight)
  23. IF Handle < 0 THEN
  24.    FGsetmode OldMode
  25.    FGreset
  26.    PRINT "Could not create the virtual buffer."
  27.    STOP
  28. END IF
  29. Status = FGvbopen(Handle)
  30.  
  31. REM fill the virtual buffer with a series of narrow rectangles
  32.  
  33. FOR X = 0 TO VBwidth-1
  34.    FGsetcolor X
  35.    FGrect X, X, 0, VBheight-1
  36. NEXT
  37.  
  38. REM scroll the virtual buffer through a 100x50 window on the
  39. REM visual page, such that the top half scrolls left and the
  40. REM bottom half scrolls right
  41.  
  42. FOR X = 0 TO VBwidth-100
  43.    FGvbpaste X, X+99, 0, 24, 110, 99
  44.    FGvbpaste VBwidth-100-X, VBwidth-1-X, 25, 49, 110, 124
  45. NEXT
  46. FGwaitkey
  47.  
  48. REM close the virtual buffer
  49.  
  50. FGvbclose
  51. FGvbfree Handle
  52.  
  53. REM restore original video mode and exit
  54.  
  55. FGsetmode OldMode
  56. FGreset
  57. END
  58.