Sign in to follow this  

Cursor Position slowly becoming less pixel perfect when moving from origin

This topic is 814 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 am running into a really strange problem where the more I move away from the top-left of my windowed game the cursor position will slowly become further from the "correct" position. For example, I have an 800, 600 window that I print the mouse position to on the screen. When I move it to the bottom right of my window, it is saying the position is 784, 561.

 

I create using CreateWindowExA with WS_EX_APPWINDOW as the first parameter (extended style), and the only window syle flag is WS_VISIBLE.
 

I get the mouse position with

 

    POINT winCursorPoint;

    GetCursorPos(&winCursorPoint);

    BOOL success = ScreenToClient(mWindowHandle, &winCursorPoint);

    mCurrentMousePosition.x = winCursorPoint.x;

    mCurrentMousePosition.y = winCursorPoint.y;

 

Is there some other window creation flag or mouse positioning calculation that needs to be done?

Share this post


Link to post
Share on other sites

This topic is 814 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this