home *** CD-ROM | disk | FTP | other *** search
- '* fxSimple.BAS *'
- '* Copyright (c) Genus Microprogramming, Inc. 1988-89 All Rights Reserved. *'
-
- '****************************************************************************'
- ' '
- ' This program is the simplest example of effect usage. It is an example '
- ' Basic routine for PCX Effects. '
- ' '
- ' NOTE: REQUIRES A CGA (or compatible) ADAPTER AND DISPLAY! '
- ' '
- ' Microsoft Basic 6.0 Programmer: Chris Howard 5/25/89 '
- ' '
- '****************************************************************************'
-
- ' Include the PCX Toolkit defines
- '$INCLUDE: 'pcxlib.bas'
- '$INCLUDE: 'fxlib.bas'
-
- ' Globals
- pcxtype% = pcxCGA.4
- pcximage$ = "fxSimple.PCX"
- tempret% = -999
- retcode% = -999
-
- '**********
-
- main:
-
- ' Display program header
- PRINT
- PRINT " Simple Example Basic PCX Effects Program "
- PRINT
-
- ' Get a key, to begin
- PRINT "Press a key to run . . ."
- DO
- LOOP WHILE INKEY$ = ""
- PRINT
-
- ' Free some conventional memory, using BASIC's SETMEM function
- prevmem = SETMEM(-32000)
-
- ' Set the display type
- retcode% = pcxSetDisplay%(pcxtype%)
-
- ' Select our effect
- retcode% = fxSetEffect%(fxSAND)
-
- ' Calibrate the delay timer
- retcode% = fxCalibrateDelay%
-
- ' Load the image
- retcode% = fxFileImage%(pcxCMM, vptr&, pcximage$)
- IF (retcode% = fxSUCCESS) THEN
-
- ' Set the mode we will be using
- retcode% = pcxSetMode%(pcxGRAPHICS)
- IF (retcode% = pcxSUCCESS) THEN
-
- ' and do it
- retcode% = fxVirtualEffect(vptr&, 0, 0, fxNONE)
-
- ' Wait for a key
- DO
- LOOP WHILE INKEY$ = ""
-
- ' Return to text mode
- tempret% = pcxSetMode%(pcxTEXT)
-
- END IF
-
- ' Free the image
- tempret% = fxFreeImage%(vptr&)
-
- END IF
-
- ' Check if everything went OK
- IF (retcode% <> pcxSUCCESS) THEN
- PRINT
- PRINT "An error occurred: ["; retcode%; "]"
- PRINT
- PRINT "You may not have a CGA, or the image FXSIMPLE.PCX may not"
- PRINT "be in the current directory ..."
- PRINT
- END IF
-
- END 'end of main
-
-