Skip to main content
GameDev.net gamedev.net
🔒 Locked

Getting the absolute mouse position with SlimDX

Started by Narf the Mouse Sep 23, 2009 at 7:33 PM 12 replies 4.7k views
Narf the Mouse
Narf the Mouse
Quote:
Original post by snake5
Quote:
specifically for solutions using SlimDX

Could you please explain why? I don't really understand the idea behind this..

It's for a graphics library using SlimDX.
Evil Steve
Evil Steve
Quote:
Original post by Narf the Mouse
It's for a graphics library using SlimDX.
So? SlimDX is built on top of the Windows OS, there's no reason not to use the Windows OS to get the cursor position. The cursor position has nothing to do with graphics.
jtagge75
jtagge75
Why? Getting/setting the mouse position has nothing to do with the graphics API that is being used.
Narf the Mouse
Narf the Mouse
Quote:
Original post by jtagge75
Why? Getting/setting the mouse position has nothing to do with the graphics API that is being used.

Gee, maybe it's the Mouse class in the SlimDX library. Having a Mouse class is generally a sign of Mouse-related data.

Now go dogpile on someone else.
Flimflam
Flimflam
Quote:
Original post by Narf the Mouse
Quote:
Original post by jtagge75
Why? Getting/setting the mouse position has nothing to do with the graphics API that is being used.

Gee, maybe it's the Mouse class in the SlimDX library. Having a Mouse class is generally a sign of Mouse-related data.

Now go dogpile on someone else.


Gee, if you'd actually done your research you'd realize that the mouse related functionality in SlimDX is simply a wrapper for DirectInput, and in DirectInput there is no way to deduce the absolute mouse position because mouse data is all relative to its last position. There isn't even an actual Mouse class in SlimDX. It's a generic Device class that accepts a MouseState struct. If the SlimDX group were for some reason to implement this, it would no doubt simply reference Cursor.Position internally, thus be completely redundant.

Does it bug you that much that you have to get all snooty to us because you have to use Cursor.Position instead of a property that should not even really be inside the MouseState struct?

If you're writing anything using the .NET framework, you should feel no worries using a property from a critical component of the .NET framework. That's what it's there for.

I apologize if I sound irate, but there's really no reason for this to be an issue.

[Edited by - Flimflam on September 25, 2009 12:16:43 AM]
Codeka
Codeka
Quote:
Original post by Narf the Mouse
Quote:
Original post by jtagge75
Why? Getting/setting the mouse position has nothing to do with the graphics API that is being used.

Gee, maybe it's the Mouse class in the SlimDX library. Having a Mouse class is generally a sign of Mouse-related data.

Now go dogpile on someone else.
SlimDX is open source. If you don't like the way they've implemented certain features, I'm sure they'd appreciate patches.
robot9706
robot9706

You can set the AxisMode in Properties:


_mouse.Properties.AxisMode = DeviceAxisMode.Absolute;
Gavin Williams
Gavin Williams

System.Drawing.Point p = renderform.PointToClient(SlimDX.Windows.RenderForm.MousePosition);

jpetrie
jpetrie



SlimDX is open source. If you don't like the way they've implemented certain features, I'm sure they'd appreciate patches.

To be fair, SlimDX wouldn't accept such a patch since it would add functionality that isn't in the API it wraps.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.