home *** CD-ROM | disk | FTP | other *** search
/ Inside Multimedia 1994 October / IMM1094.ISO / program / vdopub / vidshow.c < prev    next >
C/C++ Source or Header  |  1993-11-29  |  1KB  |  60 lines

  1. /* VIDSHOW.C, sample C program to show the simplest way to play */
  2. /* back a .VDO file from within a program.    Simply include VPLAY.H */
  3. /* and link to VPLAY.LIB */
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6. #include <string.h>
  7. #include <alloc.h>
  8.  
  9. #include "vplay.h"    // Include video play header.
  10.  
  11.  
  12. char far * far fmalloc(long int size);
  13. void far ffree(char far *tmp);
  14.  
  15. unsigned char far * far memalloc(long int siz)
  16. {
  17.         return(farmalloc(siz));  // DOS far memory allocation functions
  18. }
  19.  
  20. void far memfree(char far *memory)
  21. {
  22.         farfree(memory);
  23. }
  24.  
  25.  
  26. void main(int argc,char **argv)
  27. {
  28.     int xloc=0,yloc=0;
  29.     char far *buff;
  30.     char fname[80];
  31.  
  32.     if ( argc != 2 )
  33.     {
  34.         printf("Usage: VIDPLAY <FNAME>\n");
  35.         printf("Where:\n");
  36.         printf("  FNAME is a file name with the assumed extension of .VDO.\n");
  37.         printf("  VIDPLAY plays back video files compressed with VIDCMP.\n");
  38.         exit(1);
  39.     }
  40.  
  41.     VDOVidOn();
  42.  
  43.     strcpy(fname,argv[1]);
  44.     strcat(fname,".VDO");
  45.  
  46.     if ( SetVDO(fname, NOFADE, MCGA1 ) ) // If VDO file is available.
  47.     {
  48.  
  49.         do
  50.         {
  51.             PlayVDOFrame(xloc,yloc,FULLSIZE,VIDSCREEN);
  52.         } while ( !kbhit() );
  53.  
  54.         CloseVDO();
  55.     }
  56.  
  57.     VDOVidOff();
  58. }
  59.  
  60.