Jump to content
  • Advertisement

Archived

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

disjunction

dx mouse input question

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

is it possible to set up the mouses absolute coordinates to be 0<=x<=wid, 0<=y<=hgt ? or is dxinput not ideal for that? just putting it into absolute mode does not work, as the relative value is too high, and the units are not correct.

Share this post


Link to post
Share on other sites
Advertisement
All DI does is it retrieves data from hardware (mouse, in this case). If you want to constrain your coordinates to screen, you have to do it yourself. It''s really easy: just force them inside your screen rect. You probably should use relative data, btw.

Share this post


Link to post
Share on other sites
i tried it with relative coordinates, in my 640x480 display, i had a static point and i added the di to it each time... but it was really inaccurate. And, the di units dont seem to be correct... what are they in, and how can i convert to pixels?

Share this post


Link to post
Share on other sites
quote:
Original post by disjunction
And, the di units dont seem to be correct... what are they in, and how can i convert to pixels?


They''re in whatever units you specify. One of the device properties is the range (I forgot which one). You can set the range to -10,000-10,000, which will give you considerable precision. Then, use a scale factor, that can be adjusted via ''mouse sensitivity'' control, if you have it, to convert device units to pixels.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!