home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Graphics / graphics-16000.iso / msdos / animutil / fastgfx / fg110c / 12-07.c < prev    next >
Text File  |  1992-01-30  |  910b  |  46 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.    old_mode = fg_getmode();
  15.    fg_setmode(fg_automode());
  16.  
  17.    if (fg_mouseini() < 0) {
  18.       fg_setmode(old_mode);
  19.       fg_reset();
  20.       exit(1);
  21.       }
  22.  
  23.    fg_setcolor(15);
  24.    fg_rect(0,fg_getmaxx(),0,fg_getmaxy());
  25.    fg_mousevis(1);
  26.  
  27.    do {
  28.       fg_waitfor(54);
  29.       fg_mousebut(1,&count,&x,&y);
  30.       fg_mousepos(&x,&y,&buttons);
  31.       sprintf(string,"X=%3d  Y=%3d  count=%4d",x,y,count);
  32.       fg_mousevis(0);
  33.       fg_setcolor(15);
  34.       fg_rect(0,fg_xconvert(25),0,fg_yconvert(1));
  35.       fg_setcolor(0);
  36.       fg_locate(0,0);
  37.       fg_text(string,24);
  38.       fg_mousevis(1);
  39.       fg_mousebut(2,&count,&x,&y);
  40.       }
  41.    while (count == 0);
  42.  
  43.    fg_setmode(old_mode);
  44.    fg_reset();
  45. }
  46.