Jump to content
  • Advertisement
Sign in to follow this  
leonlylin

Get synchronization!

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

i use a texture for the mouse instead of the system's,but i find that they are not synchronization,when i use getcursor funtion . how to make them synchronization?

Share this post


Link to post
Share on other sites
Advertisement
Well you need to transform the mouse movement in screen coordinates.
If you want to use Win32Api you should catch the WM_MOUSEMOVE message in the WndProc function. Your code should look like this:
case WM_MOUSEMOVE:
{
xmouse = LOWORD(lParam);
ymouse = HIWORD(lParam);
}

If you want to use DirectInput, there is a tutorial on this on 32Bits site.

Share this post


Link to post
Share on other sites
Quote:
Original post by leonlylin
this method i have tried.but they are still not synchronization.


What do you mean when you say there is no sincronization?
Could you provide more details?

Share this post


Link to post
Share on other sites
What he means is, at least by my understanding as I had this problem, is when you use a textured cursor in DirectX and rely on Windows to tell you when the mouse is moved, there is a smooth delay in when your program updates the position of the cursor texture on the screen.

So, following the steps

1. User Moves Mouse
2. Shortly after (not instantly), the mouse will move on the screen.

It's an annoying little thing. I never did solve it.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!