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

  1. * fxSimple.FOR                                                              *
  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. * Fortran routine for PCX Effects.                                          * 
  8. *                                                                           *
  9. * NOTE: REQUIRES A CGA (or compatible) ADAPTER AND DISPLAY!                 *
  10. *                                                                           *
  11. * Microsoft Fortran 4.1                   Programmer: Chris Howard  5/25/89 *
  12. *                                                                           *
  13. *****************************************************************************
  14.  
  15. * Include the PCX Toolkit and PCX Effects interfaces
  16. $INCLUDE: 'pcxint.for'
  17. $INCLUDE: 'fxint.for'
  18.  
  19. PROGRAM fxSimple
  20.  
  21. * Include the PCX Toolkit and PCX Effects constants
  22. $INCLUDE: 'pcxlib.for'
  23. $INCLUDE: 'fxlib.for'
  24.  
  25. * Globals
  26.       CHARACTER*20  pcximage [C]
  27.       INTEGER*2     pcxtype,retcode,tempret
  28.       INTEGER*4     vptr
  29.  
  30.       CHARACTER*1   key
  31.  
  32.       DATA pcxtype  /pcxCGA_4/
  33.       DATA pcximage /'fxSimple.PCX' C/
  34.       DATA retcode  /-999/
  35.       DATA tempret  /-999/
  36.  
  37. ***********
  38.  
  39. * Display program header
  40.       PRINT '(A)',' '
  41.       PRINT '(A)','  Simple Example Fortran PCX Effects Program '
  42.       PRINT '(A)',' '
  43.  
  44. *     Get a key, to begin
  45.       PRINT '(A)',' Press [ENTER] to run . . .'
  46.       READ(*,'(A1)') key
  47.  
  48. *     Set the display type 
  49.       retcode = pcxSetDisplay(pcxtype)
  50.  
  51. *     Select our effect
  52.       retcode = fxSetEffect(fxSAND)
  53.  
  54. *     Calibrate the delay timer
  55.       retcode = fxCalibrateDelay
  56.  
  57. *     Load the image
  58.       retcode = fxFileImage(pcxCMM,vptr,pcximage)
  59.       IF (retcode .EQ. fxSUCCESS) THEN
  60.  
  61. *       Set the mode we will be using
  62.         retcode = pcxSetMode(pcxGRAPHICS)
  63.         IF (retcode .EQ. pcxSUCCESS) THEN
  64.  
  65. *         and do it
  66.           retcode = fxVirtualEffect(vptr,0,0,fxNONE)
  67.  
  68. *         Wait for a key
  69.           READ(*,'(A1)') key
  70.  
  71. *         Return to text mode
  72.           tempret = pcxSetMode(pcxTEXT)
  73.  
  74.         ENDIF
  75.  
  76. *       Free the image from memory
  77.         tempret = fxFreeImage(vptr)
  78.  
  79.       ENDIF
  80.  
  81. *     Check if everything went OK
  82.       IF (retcode .NE. pcxSUCCESS) THEN
  83.         PRINT '(A)',' '
  84.         PRINT '(A,I3,A)',' An error occurred: [',retcode,' ]'
  85.         PRINT '(A)',' '
  86.         PRINT '(A)',' You may not have a CGA, or the image FXSIMPLE.PCX'
  87.         PRINT '(A)',' may not be in the current directory.'
  88.         PRINT '(A)',' '
  89.       ENDIF
  90.  
  91.       END
  92.