Jump to content
  • Advertisement
Sign in to follow this  

MDX: DirectInput: Convertign absolute Coordinates

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

Could somebody explain me how to convert absolute mouse coordinates to screen coordinates? Here is my Code:
     public Mouse()
            device = new Microsoft.DirectX.DirectInput.Device(SystemGuid.Mouse);
            device.Properties.AxisModeAbsolute = true;

            pos = new Point();
            pos.posX = 512;  // For testing
            pos.posY = 368;

      override public void Poll()
            MouseState state = device.CurrentMouseState;
            pos.posX += state.X;
            pos.posY += state.Y;
            mouseButtons = state.GetMouseButtons();
But in pos.posX and posY are always values like 4852852 -34828358 2358283 8562836 5813851 3858235 2358888 -6353455 and so on. How can I get "the real" position? Thanks :-)

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!