home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
CPROG
/
WGT_TC21.ZIP
/
WGT12.C
< prev
next >
Wrap
C/C++ Source or Header
|
1992-07-17
|
901b
|
39 lines
#include <conio.h>
#include "c:\tc\wgt\wgt.h"
/* WORDUP Graphics Toolkit Version 2.1
Demonstration program 12
Demonstrates mouse functions and msetbounds
*/
void main(void)
{
vga256(); // initializes system
wcls(0);
minit(); // init mouse
mon(); // turn it on
//msetbounds(50,50,270,150);
// unremark this line to try setting the boundaries
do {
mread(); // read mouse
// stores info into mx,my,but
gotoxy(1,1);
printf("X: %i Y: %i Button: %i ",mx,my,but);
// use printf when you don't want to convert integers to strings by itoa(..)
if (but !=0) // button pressed
{
moff(); // must turn off mouse
wsetcolor(my); // before drawing or
wfill_circle(mx,my,30); // mouse cursor will smear
mon(); // on screen.
}
} while (!kbhit());
getch();
textmode(C80); // used to return to text mode
}