Archived

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

Mouse cords?

This topic is 5155 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

Hi! I was just wondering if there is a easy way to get the mouse cords over the opengl screen? And how to hide the mouse.. I don´t want to use aux or glut.. Thanks //psan

Share this post


Link to post
Share on other sites
You can find the mouse cords like you can with the virtual keys in winproc. Like:


case WM_MOUSEMOVE:
{
mouse_x = LOWORD(lParam);
mouse_y = HIWORD(lParam);
return 0;
}


Oh and to enable and disable the mouse you use ShowCursor();
In the () just use TRUE or FALSE
---------------------------
The pipes clangor all the time.

[edited by - pipes clangor on November 5, 2003 12:19:53 AM]

Share this post


Link to post
Share on other sites
thx, the showcursor() function workes great, but I can´t get the other to work.. My intelligent guess is that I need to write some other code to get it to work

I´ve checked some webpages about it, maybe i´m stupid, but I can´t see what else I need in my program.

the code i´m refering to is:


case WM_MOUSEMOVE:
{
mouse_x = LOWORD(lParam);
mouse_y = HIWORD(lParam);
return 0;
}


edit: think i understand now, had to place it in "WndProc", know i just have to translate those cords to use them as -1,1 opengl cords

//Psan

[edited by - psan on November 6, 2003 8:04:42 AM]

Share this post


Link to post
Share on other sites