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

  1. REM $INCLUDE: 'fastgraf.bi'
  2.  
  3. DEFINT A-Z
  4.  
  5. CONST VBwidth = 640
  6. CONST VBheight = 400
  7.  
  8. REM initialize the video environment
  9.  
  10. OldMode = FGgetmode
  11. FGsetmode 19
  12. FGvbinit
  13.  
  14. REM set up a 640x400 virtual buffer
  15.  
  16. SetMemStatus& = SETMEM(-(CLNG(VBwidth)*CLNG(VBheight)+16))
  17. Handle = FGvballoc(VBwidth,VBheight)
  18. IF Handle < 0 THEN
  19.    FGsetmode OldMode
  20.    FGreset
  21.    PRINT "Could not create the virtual buffer."
  22.    STOP
  23. END IF
  24. Status = FGvbopen(Handle)
  25.  
  26. REM draw a 320x200 rectangle in each virtual buffer quadrant
  27.  
  28. FGsetcolor 9
  29. FGrect 0, 319, 0, 199
  30. FGsetcolor 10
  31. FGrect 320, 639, 0, 199
  32. FGsetcolor 11
  33. FGrect 0, 319, 200, 399
  34. FGsetcolor 12
  35. FGrect 320, 639, 200, 399
  36.  
  37. REM paste each rectangle to the 320x200 active video page
  38.  
  39. FGvbpaste 0, 319, 0, 199, 0, 199
  40. FGwaitkey
  41. FGvbpaste 320, 639, 0, 199, 0, 199
  42. FGwaitkey
  43. FGvbpaste 0, 319, 200, 399, 0, 199
  44. FGwaitkey
  45. FGvbpaste 320, 639, 200, 399, 0, 199
  46. FGwaitkey
  47.  
  48. REM paste the center 320x200 subset of the virtual buffer
  49.  
  50. FGvbpaste 160, 479, 100, 299, 0, 199
  51. FGwaitkey
  52.  
  53. REM close the virtual buffer
  54.  
  55. FGvbclose
  56. FGvbfree Handle
  57.  
  58. REM restore original video mode and exit
  59.  
  60. FGsetmode OldMode
  61. FGreset
  62. END
  63.