home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / PROGRAMM / FGL112C.ZIP / 09-24.C < prev    next >
Text File  |  1992-10-05  |  1KB  |  51 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 new_mode, old_mode;
  11.    char string[21];
  12.  
  13.    new_mode = fg_bestmode(320,200,2);
  14.    if (new_mode < 0 || new_mode == 12) {
  15.       printf("This program requires a 320 ");
  16.       printf("x 200 color graphics mode.\n");
  17.       exit(1);
  18.       }
  19.    old_mode = fg_getmode();
  20.    fg_setmode(new_mode);
  21.  
  22.    fg_setcolor(7);
  23.    fg_rect(0,319,0,199);
  24.    fg_setcolor(9);
  25.  
  26.    for (row = 0; row < 25; row++) {
  27.       sprintf(string,"   This is row %2d   ",row);
  28.       fg_locate(row,0);
  29.       fg_text(string,20);
  30.       fg_text(string,20);
  31.       }
  32.    fg_waitkey();
  33.  
  34.    fg_allocate(1);
  35.    fg_sethpage(1);
  36.    fg_save(96,223,88,111);
  37.    fg_setcolor(1);
  38.    fg_rect(96,223,88,111);
  39.    fg_setcolor(15);
  40.    fg_locate(12,13);
  41.    fg_text("Press any key.",14);
  42.    fg_waitkey();
  43.  
  44.    fg_restore(96,223,88,111);
  45.    fg_waitkey();
  46.  
  47.    fg_freepage(1);
  48.    fg_setmode(old_mode);
  49.    fg_reset();
  50. }
  51.