Archived

This topic is now archived and is closed to further replies.

Sanoz0r

mouse coords

Recommended Posts

Sanoz0r    122
Im trying to get coords for the mouse pointer in my 2d world but I can only get screen coords. mouseX = LOWORD(lParam); mouseY = HIWORD(lParam); This is my code :/

Share this post


Link to post
Share on other sites
Prototype    2014
You better stay away from message-based input and use Windows API functions instead.

Look up these functions:
GetCursorPos()
SetCursorPos()
GetAsyncKeyState()

They are easy to use and will report the hardware state at any given time.

Share this post


Link to post
Share on other sites
VenDrake    131
Use a coord-less mouse. (Sorry, I couldn''t resist)


-----------
VenDrake

"When you and a friend are being chased by a King Cheata, you have but one chance, trip your friend."

Share this post


Link to post
Share on other sites
ch1pz    218
POINT cursor_point;
GetCursorPos(&cursor_point);
ScreenToClient(window.hWnd, &cursor_point);

should do what you want (I think.)

[edited by - ch1pz on January 24, 2004 5:31:49 PM]

Share this post


Link to post
Share on other sites
Sanoz0r    122
hey

Sorry i meant to say "Im trying to get coords for the mouse pointer in my 3d world". Not 2d I need the coords for the perspective matrix.

Share this post


Link to post
Share on other sites
iNsAn1tY    476
Look for some info on the gluUnProject function...


Windows 95 - 32 bit extensions and a graphical shell for a 16 bit patch
to an 8 bit operating system originally coded for a 4 bit microprocessor,
written by a 2 bit company that can''t stand 1 bit of competition.

Share this post


Link to post
Share on other sites
myahmac    122
Why not just take the 2d points then select whatever object is closest to the pov camera, if that is what you are trying to do. what exactly are the cordinates for?

Share this post


Link to post
Share on other sites