Sign in to follow this  
Bacterius

SlimDX and Multipoint

Recommended Posts

Hello,

I'm trying to use the Multipoint SDK in a SlimDX project for a multi-mouse game I'm making, but I'm having a little problem which I can't figure out how to solve. To initialize the Multipoint SDK, you apparently need a System.Windows.Window object (probably to get a handle to override mouse messages, I suppose). The problem is that I'm using a RenderForm instead as a window for my own DirectX drawing code, and while I can get the handle of this RenderForm, I don't know how to "cast" it to a System.Windows.Window object to be able to initialize Multipoint. Does anyone know how I could do this? Or do I have to create a "dummy" form used just to handle the mouse messages?

Thanks for your input everyone.

Share this post


Link to post
Share on other sites
Your problem is that [url="http://www.microsoft.com/download/en/details.aspx?id=9962"]"The MultiPoint Mouse SDK does not support Windows Forms UI development."[/url]

This means you either need to persuade SlimDX to work with WPF or to have two separate windows and somehow make them work together so that one handles the mice, and the other rendering.

Share this post


Link to post
Share on other sites
[quote name='Adam_42' timestamp='1318254304' post='4871061']
Your problem is that [url="http://www.microsoft.com/download/en/details.aspx?id=9962"]"The MultiPoint Mouse SDK does not support Windows Forms UI development."[/url]

This means you either need to persuade SlimDX to work with WPF or to have two separate windows and somehow make them work together so that one handles the mice, and the other rendering.
[/quote]
Ah, I see. Hmm I think I'll try and look for another library that will do the job, Multipoint seems a bit overkill for what I'm trying to do anyway, I just need control over two mice without all the bells and whistles, and it seems too much like a hack trying to get SlimDX to work like you describe.

For instance [url="http://www.multimolti.com/blog/2009/03/22/multiinput-class-multiple-mice-in-your-xna-game/"]this[/url] seems promising, even though it's made for XNA it actually asks for a handle during its initialization which I do have available in the RenderForm properties, I'll give it a shot tomorrow.

Thanks for your reply Adam.

Share this post


Link to post
Share on other sites
[quote name='Bacterius' timestamp='1318258415' post='4871079']
[quote name='Adam_42' timestamp='1318254304' post='4871061']
Your problem is that [url="http://www.microsoft.com/download/en/details.aspx?id=9962"]"The MultiPoint Mouse SDK does not support Windows Forms UI development."[/url]

This means you either need to persuade SlimDX to work with WPF or to have two separate windows and somehow make them work together so that one handles the mice, and the other rendering.
[/quote]
Ah, I see. Hmm I think I'll try and look for another library that will do the job, Multipoint seems a bit overkill for what I'm trying to do anyway, I just need control over two mice without all the bells and whistles, and it seems too much like a hack trying to get SlimDX to work like you describe.

For instance [url="http://www.multimolti.com/blog/2009/03/22/multiinput-class-multiple-mice-in-your-xna-game/"]this[/url] seems promising, even though it's made for XNA it actually asks for a handle during its initialization which I do have available in the RenderForm properties, I'll give it a shot tomorrow.

Thanks for your reply Adam.
[/quote]

When I saw this thread I was thinking of that link you just posted. You should be able to replicate (although probably not necessary, since it doesn't really need anything XNA - like you said, just a window handle). I believe that was done with RawInput, which SlimDX does expose.

Share this post


Link to post
Share on other sites
[quote name='Starnick' timestamp='1318263724' post='4871113']
[quote name='Bacterius' timestamp='1318258415' post='4871079']
[quote name='Adam_42' timestamp='1318254304' post='4871061']
Your problem is that [url="http://www.microsoft.com/download/en/details.aspx?id=9962"]"The MultiPoint Mouse SDK does not support Windows Forms UI development."[/url]

This means you either need to persuade SlimDX to work with WPF or to have two separate windows and somehow make them work together so that one handles the mice, and the other rendering.
[/quote]
Ah, I see. Hmm I think I'll try and look for another library that will do the job, Multipoint seems a bit overkill for what I'm trying to do anyway, I just need control over two mice without all the bells and whistles, and it seems too much like a hack trying to get SlimDX to work like you describe.

For instance [url="http://www.multimolti.com/blog/2009/03/22/multiinput-class-multiple-mice-in-your-xna-game/"]this[/url] seems promising, even though it's made for XNA it actually asks for a handle during its initialization which I do have available in the RenderForm properties, I'll give it a shot tomorrow.

Thanks for your reply Adam.
[/quote]

When I saw this thread I was thinking of that link you just posted. You should be able to replicate (although probably not necessary, since it doesn't really need anything XNA - like you said, just a window handle). I believe that was done with RawInput, which SlimDX does expose.
[/quote]

It works! Although it is a bit awkward to use with a messagepump (stutters a bit), it works. I think I'll be rewriting it using SlimDX's RawInput anyway because I'd like my application to work under x64 as well, and I like to be dependent of the least amount of external code possible. Thanks for your help everyone!


Share this post


Link to post
Share on other sites

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