Mail Archives: djgpp/1996/05/13/18:33:43
Xref: | news2.mv.net comp.os.msdos.djgpp:3801
|
From: | 004277a AT news DOT acadiau DOT ca (Hafiz Awang Pon)
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | mouse problem in allegro
|
Date: | 13 May 96 06:14:24 GMT
|
Organization: | Dalhousie University
|
Lines: | 44
|
Message-ID: | <3196d340.0@131.162.2.91>
|
NNTP-Posting-Host: | iceberg.acadiau.ca
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
I wrote the program below to learn how to use
the mouse routine in allegro:
#include <stdio.h>
#include "allegro.h"
main() {
int lastx, lasty;
allegro_init();
install_keyboard();
install_mouse();
position_mouse(160, 100);
printf("x %d\n", mouse_x);
printf("y %d\n", mouse_y);
lastx = mouse_x;
lasty = mouse_y;
do {
if (mouse_x != lastx) {
printf("x %d\n", mouse_x);
lastx = mouse_x;
}
if (mouse_y != lasty) {
printf("y %d\n", mouse_y);
lasty = mouse_y;
}
if (mouse_b & 1) {
printf("left\n");
}
if (mouse_b & 2) {
printf("right\n");
}
} while (!keypressed());
}
the thing is that this program works under the dos
box in windows but not in msdos. the problem is that
it's not displaying the correct x and y coords.
any ideas why this is happening?
thanx in advance.
004277a AT dragon DOT acadiau DOT ca
http://dragon.acadiau.ca/~004277a
- Raw text -