Jump to content
  • Advertisement
Sign in to follow this  
silverphyre673

getting mouse position locks up program

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

Hey. I'm using win32 API and just started handling mouse messages with my input class. It looks something like this: (in the callback function's messages switching routine)
case WM_MOUSEMOVE:
        {
            input.mouse_x = LOWORD(lParam);
            input.mouse_y = HIWORD(lParam);
            break;
        }
mouse_x and mouse_y are just integers. Unfortunately, every time I run the program with this in it, it locks up permanently as soon as I move the mouse. This is the problem code; it works fine when I comment it out. Any ideas why? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
What about if you comment out the 2 input lines but leave the message handler and the break? I get the feeling that the problem lies elsewhere. Is 'input' initialised properly?

Share this post


Link to post
Share on other sites
Have you intialised x and y to be zero? You may have a devide by zero error.

Share this post


Link to post
Share on other sites
What do you return from your message handling routine when you break from the switch?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!