Is my algorithim incorrect?
Ok. I'm having a wierd error with my program.
I'm attempting to detect if the mouse position is within a certain bounding box. I'm using a funtion that returns an int (used to be a bool, but, well, I've been trying different things out) if the mouse is within certain boundaries (described in the arguments).
Now here's the thing. The detection algorithim I've used works perfectly for me in past program that I've written in QBASIC (yeah, oldy!). Anyways, it's not working now. I've set up a statement to determine the output of the funtion by having it set a variable to whatever its return is. It never changes.
The function to set the mouse variables works for sure. The coords display perfectly onscreen.
Is my algorithim written incorrectly? Is my compiler screwy (gcc-c++)?
If anybody could help I'd really appreciate it. Thanks!
mouse_stats ms; // Global Mouse Stats
int CheckMouse_InBox(int x, int y, int w, int h)
if ( (ms.x > x) && (ms.y > y) && (ms.x < w) && (ms.y < h) )
Neptune Computer Entertainment
"You design 'em, we make 'em!"
Check out our latest project @: