home *** CD-ROM | disk | FTP | other *** search
- * fxTest.FOR *
- * Copyright (c) Genus Microprogramming, Inc. 1988-89 All Rights Reserved. *
-
- *****************************************************************************
- * *
- * This program demonstrates the usage of an effect. It is an example *
- * Fortran routine for the PCX Effects Toolkit. *
- * *
- * To Compile: MS Fortran 4.1 FL /c fxtest.for *
- * Link fxtest,,,pcx_cl fx_cl; *
- * *
- * Microsoft Fortran 4.1 Programmer: Chris Howard 5/10/89 *
- * *
- *****************************************************************************
-
- * Include the PCX Toolkit and PCX Effects interfaces
- $INCLUDE: 'pcxint.for'
- $INCLUDE: 'fxint.for'
-
- PROGRAM fxTest
-
- * Include the PCX Toolkit and PCX Effects constants
- $INCLUDE: 'pcxlib.for'
- $INCLUDE: 'fxlib.for'
-
- * Globals
- CHARACTER*1 key
-
- CHARACTER*20 pcximage [C]
- INTEGER*2 pcxtype,retcode,bufmax
-
- PARAMETER (bufmax = 20000)
- CHARACTER buffer(bufmax)
-
- INTEGER*4 vfree,vreq,vptr
- INTEGER*2 width,depth,wx2,wy2
-
- DATA pcxtype /pcxCGA_6/
- DATA pcximage /'fxTest.PCX' C/
- DATA retcode /-999/
-
- ***********
-
- * Display program header
- PRINT '(A)',' '
- PRINT '(A)',' ╒═══════════════════════════════════════════════════
- +═══════════════════════╕'
- PRINT '(A)',' │ fxTest: Example Fortran Effects Program
- + PCX Effects 1.0x │'
- PRINT '(A)',' │ Copyright (c) Genus Microprogramming, Inc. 1988-89
- + All Rights Reserved. │'
- PRINT '(A)',' ╘═══════════════════════════════════════════════════
- +═══════════════════════╛'
- PRINT '(A)',' '
-
- * Get a key, to begin
- PRINT '(A)',' Press [ENTER] to run . . .'
- READ(*,'(A1)') key
-
- * Allocate a larger toolkit buffer, to speed up file and display speed.
- retcode = pcxSetBuffer(buffer,bufmax)
-
- * Check if we have expanded memory, and display
- IF (pcxEMInstalled .EQ. pcxSUCCESS) THEN
- vfree = pcxVirtualFree(pcxEMM)
- PRINT '(A,I8)',' Free EMM: ',vfree
- ENDIF
-
- * Display the amount of conventional free memory
- vfree = pcxVirtualFree(pcxCMM)
- PRINT '(A,I8)',' Free CMM: ',vfree
-
- * Look at the current hardware, to find a B/W mode
- retcode = pcxVideoInfo(adapter1)
-
- IF (adapter1 .EQ. viCGA) THEN
- pcxtype = pcxCGA_6
- ELSEIF (adapter1 .EQ. viEGA) THEN
- IF (display1 .EQ. viMDAdisp) THEN
- pcxtype = pcxEGA_F
- ELSE
- pcxtype = pcxEGA_10
- ENDIF
- ELSEIF (adapter1 .EQ. viVGA) THEN
- pcxtype = pcxVGA_11
- ELSEIF (adapter1 .EQ. viHGC) THEN
- pcxtype = pcxHERC
- ELSE
- pcxtype = -1
- ENDIF
-
- * If we found a mode, continue
- IF (pcxtype .NE. -1) THEN
-
- * Set the display type
- retcode = pcxSetDisplay(pcxtype)
-
- * Load the image
- retcode = fxFileImage(pcxCMM,vptr,pcximage)
- IF (retcode .EQ. fxSUCCESS) THEN
-
- * Change to graphics mode
- retcode = pcxSetMode(pcxGRAPHICS)
-
- * Calibrate the delay timer, and play a looping song
- retcode = fxCalibrateDelay
- retcode = fxPlayLoop(25)
- retcode = fxPlay('T120 MB O3 L32 C D E F G A B A G F E D 'C)
-
- * Select our effect
- retcode = fxSetEffect(fxRANDOM)
- retcode = fxSetGrain(8)
-
- * and do it
- retcode = fxVirtualEffect(vptr,0,0,fxNONE)
-
- * Kill the play
- retcode = fxPlayKill
-
- * Wait for a key
- READ(*,'(A1)') key
-
- * Get back to text mode
- retcode = pcxSetMode(pcxTEXT)
-
- * Were we successful?
- IF (retcode .NE. pcxSUCCESS) THEN
- PRINT '(A,I5)',' pcxVirtualScroll Error: ',retcode
- ENDIF
-
- ELSE
- * Error loading file to virtual buffer
- PRINT '(A,I5)',' Could not load image: ',retcode
- ENDIF
-
- * Destroy the image
- retcode = fxFreeImage(vptr)
-
- ELSE
- * We could not find a good mode
- PRINT '(A,I5)',' Could not find a good mode type . . .',retcode
- ENDIF
-
- END
-
-