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

  1. #include <conio.h>
  2. #include <fastgraf.h>
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5.  
  6. void main(void);
  7.  
  8. void main()
  9. {
  10.    int new_mode, old_mode;
  11.  
  12.    fg_initpm();
  13.    new_mode = fg_bestmode(320,200,2);
  14.    if (new_mode < 0 || new_mode == 12)
  15.    {
  16.       printf("This program requires a 320 ");
  17.       printf("x 200 color graphics mode.\n");
  18.       exit(1);
  19.    }
  20.    old_mode = fg_getmode();
  21.    fg_setmode(new_mode);
  22.    fg_allocate(1);
  23.    fg_sethpage(1);
  24.  
  25.    fg_setcolor(9);
  26.    fg_rect(0,319,0,199);
  27.    fg_setcolor(15);
  28.    fg_rect(132,188,50,150);
  29.  
  30.    fg_setcolor(10);
  31.    fg_move(160,67);
  32.    fg_draw(175,107);
  33.    fg_draw(140,82);
  34.    fg_draw(180,82);
  35.    fg_draw(145,107);
  36.    fg_draw(160,67);
  37.    fg_paint(160,77);
  38.    fg_paint(150,87);
  39.    fg_paint(160,87);
  40.    fg_paint(170,87);
  41.    fg_paint(155,97);
  42.    fg_paint(165,97);
  43.  
  44.    while (kbhit() == 0)
  45.    {
  46.       fg_waitfor(1);
  47.       fg_scroll(136,184,50,150,-4,0);
  48.    }
  49.    fg_waitkey();
  50.  
  51.    fg_freepage(1);
  52.    fg_setmode(old_mode);
  53.    fg_reset();
  54. }
  55.