home *** CD-ROM | disk | FTP | other *** search
- /* fxSimple.C */
- /* Copyright (c) Genus Microprogramming, Inc. 1988-89 All Rights Reserved. */
-
- /****************************************************************************
-
- This program is the simplest example of effect usage. It is an example
- C routine for PCX Effects.
-
- NOTE: REQUIRES A CGA (or compatible) ADAPTER AND DISPLAY!
-
- Microsoft C version 5.1 Programmer: Chris Howard 5/25/89
-
- *****************************************************************************/
-
- #include <stdio.h>
- #include <stdlib.h>
- #include <conio.h>
-
- /* Include the PCX Toolkit defines */
- #include "pcxlib.h"
- #include "fxlib.h"
-
- /* Globals - DECLARE AS "char far" FOR LATTICE C */
- int pcxtype = pcxCGA_4;
- char pcximage[] = "fxSimple.PCX";
-
- /**********/
-
- void main(argc,argv)
- int argc;
- char *argv[];
-
- {
-
- int retcode;
- long vptr;
-
- /* Display program header */
- printf("\n");
- printf(" Simple Example C PCX Effects Program \n\n");
-
- printf(" Press a key to run ...");
- getch();
- printf("\n");
-
- /* Set the display type */
- pcxSetDisplay(pcxtype);
-
- /* Select our effect */
- fxSetEffect(fxSAND);
-
- /* Calibrate the delay timer */
- fxCalibrateDelay();
-
- /* Load the image */
- retcode = fxFileImage(pcxCMM,&vptr,pcximage);
- if (retcode == fxSUCCESS) {
-
- /* Set the mode we will be using */
- retcode = pcxSetMode(pcxGRAPHICS);
- if (retcode == pcxSUCCESS) {
-
- /* and do it */
- retcode = fxVirtualEffect(vptr,0,0,fxNONE);
-
- /* Wait for a key */
- getch();
-
- /* Get back to text mode */
- pcxSetMode(pcxTEXT);
-
- }
-
- /* Free the image from memory */
- fxFreeImage(vptr);
- }
-
- /* Check if everything went OK */
- if (retcode != pcxSUCCESS) {
- printf("\nAn error occurred: [%d]\n\n",retcode);
- printf("You may not have a CGA, or the image FXSIMPLE.PCX may not\n");
- printf("be in the current directory ...\n\n");
- }
-
- } /* end of main */
-
-