home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c011 / 4.ddi / EXAMPLES / BAS / FXSIMPLE.BAS next >
Encoding:
BASIC Source File  |  1989-06-01  |  2.4 KB  |  89 lines

  1. '* fxSimple.BAS                                                             *'
  2. '* Copyright (c) Genus Microprogramming, Inc. 1988-89  All Rights Reserved. *'
  3.  
  4. '****************************************************************************'
  5. '                                                                            '
  6. ' This program is the simplest example of effect usage. It is an example     '
  7. ' Basic routine for PCX Effects.                                             '
  8. '                                                                            '
  9. ' NOTE: REQUIRES A CGA (or compatible) ADAPTER AND DISPLAY!                  '
  10. '                                                                            '
  11. ' Microsoft Basic 6.0                     Programmer: Chris Howard  5/25/89  '
  12. '                                                                            '
  13. '****************************************************************************'
  14.  
  15. ' Include the PCX Toolkit defines
  16. '$INCLUDE: 'pcxlib.bas'
  17. '$INCLUDE: 'fxlib.bas'
  18.  
  19. ' Globals
  20. pcxtype% = pcxCGA.4
  21. pcximage$ = "fxSimple.PCX"
  22. tempret% = -999
  23. retcode% = -999
  24.  
  25. '**********
  26.  
  27. main:
  28.  
  29.   ' Display program header
  30.   PRINT
  31.   PRINT " Simple Example Basic PCX Effects Program "
  32.   PRINT
  33.  
  34.   ' Get a key, to begin
  35.   PRINT "Press a key to run . . ."
  36.   DO
  37.   LOOP WHILE INKEY$ = ""
  38.   PRINT
  39.  
  40.   ' Free some conventional memory, using BASIC's SETMEM function
  41.   prevmem = SETMEM(-32000)
  42.  
  43.   ' Set the display type
  44.   retcode% = pcxSetDisplay%(pcxtype%)
  45.  
  46.   ' Select our effect
  47.   retcode% = fxSetEffect%(fxSAND)
  48.  
  49.   ' Calibrate the delay timer
  50.   retcode% = fxCalibrateDelay%
  51.  
  52.   ' Load the image
  53.   retcode% = fxFileImage%(pcxCMM, vptr&, pcximage$)
  54.   IF (retcode% = fxSUCCESS) THEN
  55.  
  56.     ' Set the mode we will be using
  57.     retcode% = pcxSetMode%(pcxGRAPHICS)
  58.     IF (retcode% = pcxSUCCESS) THEN
  59.  
  60.       ' and do it
  61.       retcode% = fxVirtualEffect(vptr&, 0, 0, fxNONE)
  62.  
  63.       ' Wait for a key
  64.       DO
  65.       LOOP WHILE INKEY$ = ""
  66.    
  67.       ' Return to text mode
  68.       tempret% = pcxSetMode%(pcxTEXT)
  69.  
  70.     END IF
  71.  
  72.     ' Free the image
  73.     tempret% = fxFreeImage%(vptr&)
  74.  
  75.   END IF
  76.  
  77.   ' Check if everything went OK
  78.   IF (retcode% <> pcxSUCCESS) THEN
  79.     PRINT
  80.     PRINT "An error occurred: ["; retcode%; "]"
  81.     PRINT
  82.     PRINT "You may not have a CGA, or the image FXSIMPLE.PCX may not"
  83.     PRINT "be in the current directory ..."
  84.     PRINT
  85.   END IF
  86.  
  87. END 'end of main
  88.  
  89.