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

  1. {* fxSimple.PAS                                                             *}
  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.   Pascal routine for PCX Effects.
  8.  
  9.   NOTE: REQUIRES A CGA (or compatible) ADAPTER AND DISPLAY!                   
  10.  
  11.   Borland Turbo Pascal 4.0/5.0            Programmer: Chris Howard  5/25/89
  12.  
  13. *****************************************************************************}
  14.  
  15. Program fxSimple;
  16.  
  17. {$M 16384,0,65535}
  18.  
  19. { Include the PCX Toolkit Unit, and the PCX Effects Unit }
  20. uses pcx_tp,fx_tp,crt;
  21.  
  22. { Globals }
  23. const
  24.   pcxtype        = pcxCGA_4;
  25.   pcximage       = 'fxSimple.PCX';
  26.  
  27. var
  28.   vptr           : longint;
  29.   retcode        : integer;
  30.   tempret        : integer;
  31.   key            : char;
  32.  
  33. {**********}
  34.  
  35. begin
  36.  
  37.   { Display program header }
  38.   writeln;
  39.   writeln(' Simple Example Pascal PCX Program ');
  40.   writeln;
  41.  
  42.   { Get a key, to begin }
  43.   write('Press a key to run . . .');
  44.   key := ReadKey;
  45.   writeln;
  46.  
  47.   { Set the display type }
  48.   retcode := pcxSetDisplay(pcxtype);
  49.  
  50.   { Select our effect }
  51.   retcode := fxSetEffect(fxSAND);
  52.  
  53.   { Calibrate the delay timer }
  54.   retcode := fxCalibrateDelay;
  55.  
  56.   { Load the image }
  57.   retcode := fxFileImage(pcxCMM,@vptr,pcximage);
  58.   if (retcode = fxSUCCESS) then begin
  59.  
  60.     { Set the mode we will be using }
  61.     retcode := pcxSetMode(pcxGRAPHICS);
  62.     if (retcode = pcxSUCCESS) then begin
  63.  
  64.       { and do it }
  65.       retcode := fxVirtualEffect(vptr,0,0,fxNONE);
  66.  
  67.       { Wait for a key }
  68.       key := ReadKey;
  69.  
  70.       { Get back to text mode }
  71.       tempret := pcxSetMode(pcxTEXT);
  72.  
  73.     end;
  74.  
  75.     { Destroy the virtual buffer }
  76.     tempret := fxFreeImage(vptr);
  77.  
  78.   end;
  79.  
  80.   { Check if everything went OK }
  81.   if (retcode <> pcxSUCCESS) then begin
  82.     writeln;
  83.     writeln('An error occurred: [',retcode,']');
  84.     writeln;
  85.     writeln('You may not have a CGA, or the image FXSIMPLE.PCX may not');
  86.     writeln('be in the current directory ...');
  87.     writeln;
  88.   end; {of if}
  89.  
  90. end. { end of main }
  91.  
  92.