home *** CD-ROM | disk | FTP | other *** search
/ C++ Games Programming / CPPGAMES.ISO / fgl / fglight / exc.arj / TEMP / 14-08.C < prev    next >
Text File  |  1995-01-20  |  929b  |  49 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 old_mode;
  10.    int buttons, count;
  11.    int x, y;
  12.    char string[25];
  13.  
  14.    fg_initpm();
  15.    old_mode = fg_getmode();
  16.    fg_setmode(fg_automode());
  17.  
  18.    if (fg_mouseini() < 0)
  19.    {
  20.       fg_setmode(old_mode);
  21.       fg_reset();
  22.       exit(1);
  23.    }
  24.  
  25.    fg_setcolor(15);
  26.    fg_rect(0,fg_getmaxx(),0,fg_getmaxy());
  27.    fg_mousevis(1);
  28.  
  29.    do
  30.    {
  31.       fg_waitfor(54);
  32.       fg_mousebut(1,&count,&x,&y);
  33.       fg_mousepos(&x,&y,&buttons);
  34.       sprintf(string,"X=%3d  Y=%3d  count=%4d",x,y,count);
  35.       fg_mousevis(0);
  36.       fg_setcolor(15);
  37.       fg_rect(0,fg_xconvert(25),0,fg_yconvert(1));
  38.       fg_setcolor(0);
  39.       fg_locate(0,0);
  40.       fg_text(string,24);
  41.       fg_mousevis(1);
  42.       fg_mousebut(2,&count,&x,&y);
  43.    }
  44.    while (count == 0);
  45.  
  46.    fg_setmode(old_mode);
  47.    fg_reset();
  48. }
  49.