Skip to main content
GameDev.net gamedev.net
🔒 Locked

WM_MOUSEMOVE problem

Started by dnagcat Apr 22, 2003 at 12:39 AM 1 replies 450+ views
Original Post
dnagcat
dnagcat
I have an OpenGL window where the coordinates of the pointer are printed to the screen. The problem is when the cursor is not moving (of course) I don''t get the message therefore my coordinates are not displayed anymore. Does anyone have a work around for this...Its probably quite easy but I''ve been staring at the screen to long to see it! I was thinking since I have a SwapBuffers() call it might not work right. I wasn''t clear to explain, but as long as the cursor is over the window...moving or not, I would like the coordinates displayed as shown below... Here is some code.
case WM_MOUSEMOVE:
		xmouse = LOWORD(lParam)-(w/2);
		ymouse = -(HIWORD(lParam)-(h/2));
		TextOut(hLDC, 0, 0, szBuffer, 
			wsprintf(szBuffer, TEXT("x:%i y:%i"), xmouse, ymouse));
		
		break;
 
Check out: [a href="http://www.lanceusa.com"]
Colin Jeanne
Colin Jeanne
Store the x and y positions in global variables then draw the text of their location each frame. Use WM_MOUSEMOVE to update the locations.



Qui fut tout, et qui ne fut rien
Invader''s Realm
dnagcat
dnagcat
Hey, thanks...that worked pretty good. Only problem is if flickers with the refresh of the window. I may need to find some other way of displaying the coordinates.
Thanks

Check out: [a href="http://www.lanceusa.com"]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.