home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c011 / 4.ddi / EXAMPLES / CLIPPER / FXSIMPLE.PRG next >
Encoding:
Text File  |  1989-06-01  |  2.2 KB  |  87 lines

  1. * fxSimple.PRG                                                              *
  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. * Clipper routine for PCX Effects.                                          *
  8. *                                                                           *
  9. * NOTE: REQUIRES A CGA (or compatible) ADAPTER AND DISPLAY!                 *
  10. *                                                                           *
  11. * Nantucket Clipper                       Programmer: Chris Howard  5/25/89 *
  12. *                                                                           *
  13. *****************************************************************************
  14.  
  15. * Include the PCX Toolkit defines
  16. SET PROCEDURE TO pcxlib
  17. DO  pcxInit
  18. * and PCX Effects
  19. SET PROCEDURE TO fxlib
  20. DO  fxInit
  21.  
  22. PRIVATE  pcximage,pcxtype
  23.  
  24. * Globals
  25. pcximage = "fxSimple.PCX"
  26. pcxtype  = pcxCGA_4
  27. vptr     = SPACE(4)
  28.  
  29. **********
  30.  
  31. * Main
  32.  
  33.   * Display program header
  34.   ?
  35.   ? " Simple Example Clipper PCX Effects Program "
  36.   ?
  37.  
  38.   * Get a key, to begin
  39.   ? "Press a key to run . . ."
  40.   INKEY(0)
  41.  
  42.   * Set the display type 
  43.   retcode = pcxSD(pcxtype)
  44.  
  45.   * Select our effect
  46.   retcode = fxSE(fxSAND)
  47.  
  48.   * Calibrate the delay timer
  49.   retcode = fxCD()
  50.  
  51.   * Load the image
  52.   retcode = fxFI(pcxCMM,vptr,pcximage)
  53.   IF (retcode = fxSUCCESS)
  54.  
  55.     * Set the mode we will be using
  56.     retcode = pcxSM(pcxGRAPHICS)
  57.     IF (retcode = pcxSUCCESS)
  58.  
  59.       * and do it
  60.       retcode = fxVE(vptr,0,0,fxNONE)
  61.  
  62.       * Wait for a key
  63.       INKEY(0)
  64.  
  65.       * Return to text mode
  66.       tempret = pcxSM(pcxTEXT)
  67.  
  68.     ENDIF
  69.  
  70.     * Free the image from memory
  71.     tempret = fxRI(vptr)
  72.  
  73.   ENDIF
  74.  
  75.   * Check if everything went OK
  76.   IF (retcode <> pcxSUCCESS)
  77.     ?
  78.     ? "An error occurred: [",retcode,"]"
  79.     ?
  80.     ? "You may not have a CGA, or the image FXSIMPLE.PCX may not"
  81.     ? "be in the current directory ..."
  82.     ?
  83.   ENDIF
  84.  
  85. RETURN && Main
  86.  
  87.