home *** CD-ROM | disk | FTP | other *** search
/ C++ Games Programming / CPPGAMES.ISO / fgl / fglight / exc.arj / TEMP / 11-04.C < prev    next >
Text File  |  1995-01-20  |  1KB  |  58 lines

  1. #include <fastgraf.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. void main(void);
  6.  
  7. void main()
  8. {
  9.    int row;
  10.    int old_mode;
  11.    char string[17];
  12.  
  13.    fg_initpm();
  14.    old_mode = fg_getmode();
  15.  
  16.    if (fg_testmode(3,2))
  17.       fg_setmode(3);
  18.    else if (fg_testmode(7,2))
  19.       fg_setmode(7);
  20.    else
  21.    {
  22.       printf("This program requires\n");
  23.       printf("an 80-column display.\n");
  24.       exit(1);
  25.    }
  26.  
  27.    fg_cursor(0);
  28.    fg_setattr(9,7,0);
  29.  
  30.    for (row = 0; row < 25; row++)
  31.    {
  32.       sprintf(string," This is row %2d ",row);
  33.       fg_locate(row,0);
  34.       fg_text(string,16);
  35.       fg_text(string,16);
  36.       fg_text(string,16);
  37.       fg_text(string,16);
  38.       fg_text(string,16);
  39.    }
  40.    fg_waitkey();
  41.  
  42.    fg_allocate(1);
  43.    fg_transfer(32,47,11,13,0,24,0,1);
  44.    fg_setcolor(1);
  45.    fg_rect(32,47,11,13);
  46.    fg_setattr(15,1,0);
  47.    fg_locate(12,33);
  48.    fg_text("Press any key.",14);
  49.    fg_waitkey();
  50.  
  51.    fg_transfer(0,15,22,24,32,13,1,0);
  52.    fg_waitkey();
  53.  
  54.    fg_freepage(1);
  55.    fg_setmode(old_mode);
  56.    fg_reset();
  57. }
  58.