home *** CD-ROM | disk | FTP | other *** search
- {* fxSimple.PAS *}
- {* Copyright (c) Genus Microprogramming, Inc. 1988-89 All Rights Reserved. *}
-
- {****************************************************************************
-
- This program is the simplest example of effect usage. It is an example
- Pascal routine for PCX Effects.
-
- NOTE: REQUIRES A CGA (or compatible) ADAPTER AND DISPLAY!
-
- Borland Turbo Pascal 4.0/5.0 Programmer: Chris Howard 5/25/89
-
- *****************************************************************************}
-
- Program fxSimple;
-
- {$M 16384,0,65535}
-
- { Include the PCX Toolkit Unit, and the PCX Effects Unit }
- uses pcx_tp,fx_tp,crt;
-
- { Globals }
- const
- pcxtype = pcxCGA_4;
- pcximage = 'fxSimple.PCX';
-
- var
- vptr : longint;
- retcode : integer;
- tempret : integer;
- key : char;
-
- {**********}
-
- begin
-
- { Display program header }
- writeln;
- writeln(' Simple Example Pascal PCX Program ');
- writeln;
-
- { Get a key, to begin }
- write('Press a key to run . . .');
- key := ReadKey;
- writeln;
-
- { 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 begin
-
- { Set the mode we will be using }
- retcode := pcxSetMode(pcxGRAPHICS);
- if (retcode = pcxSUCCESS) then begin
-
- { and do it }
- retcode := fxVirtualEffect(vptr,0,0,fxNONE);
-
- { Wait for a key }
- key := ReadKey;
-
- { Get back to text mode }
- tempret := pcxSetMode(pcxTEXT);
-
- end;
-
- { Destroy the virtual buffer }
- tempret := fxFreeImage(vptr);
-
- end;
-
- { Check if everything went OK }
- if (retcode <> pcxSUCCESS) then begin
- writeln;
- writeln('An error occurred: [',retcode,']');
- writeln;
- writeln('You may not have a CGA, or the image FXSIMPLE.PCX may not');
- writeln('be in the current directory ...');
- writeln;
- end; {of if}
-
- end. { end of main }
-
-