mouse coords
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 :/
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.
Look up these functions:
GetCursorPos()
SetCursorPos()
GetAsyncKeyState()
They are easy to use and will report the hardware state at any given time.
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."
-----------
VenDrake
"When you and a friend are being chased by a King Cheata, you have but one chance, trip your friend."
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]
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]
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.
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.
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.
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.
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?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement