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

  1. #include <fastgraf.h>
  2.  
  3. void main(void);
  4.  
  5. void main()
  6. {
  7.    int delay, y;
  8.  
  9.    /* initialize the video environment */
  10.  
  11.    fg_initpm();
  12.    fg_setmode(20);
  13.  
  14.    /* define a processor-dependent panning delay */
  15.  
  16.    delay = fg_measure() / 16;
  17.  
  18.    /* draw a blue box with a white border on page 1 */
  19.  
  20.    fg_setpage(1);
  21.    fg_setcolor(9);
  22.    fg_fillpage();
  23.    fg_setcolor(15);
  24.    fg_box(0,319,0,199);
  25.    fg_move(160,100);
  26.    fg_justify(0,0);
  27.    fg_print("This is page 1",14);
  28.  
  29.    /* display what we just drew on page 1 */
  30.  
  31.    fg_setvpage(1);
  32.    fg_waitkey();
  33.  
  34.    /* draw a red hollow box at the top of page 0 (now invisible) */
  35.  
  36.    fg_setpage(0);
  37.    fg_setcolor(12);
  38.    fg_box(0,319,0,19);
  39.    fg_setcolor(15);
  40.    fg_move(160,10);
  41.    fg_print("SPLIT SCREEN",12);
  42.  
  43.    /* activate the split screen environment, making the first 20 lines   */
  44.    /* of page 0 appear at the bottom of the screen, and making the first */
  45.    /* 180 lines of page 1 appear at the top                              */
  46.  
  47.    fg_split(180);
  48.    fg_waitkey();
  49.  
  50.    /* pan upward in one-line increments, displaying the rest of page 1 */
  51.  
  52.    fg_setpage(1);
  53.    for (y = 0; y <= 20; y++)
  54.    {
  55.       fg_pan(0,y);
  56.       fg_stall(delay);
  57.    }
  58.    fg_waitkey();
  59.  
  60.    /* pan back down in one-line increments to the original position */
  61.  
  62.    for (y = 20; y >= 0; y--)
  63.    {
  64.       fg_pan(0,y);
  65.       fg_stall(delay);
  66.    }
  67.    fg_waitkey();
  68.  
  69.    /* restore 80x25 text mode and exit */
  70.  
  71.    fg_setmode(3);
  72.    fg_reset();
  73. }
  74.