• Advertisement

Archived

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

mouse coords

This topic is 5202 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
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
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
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
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
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
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

  • Advertisement