Jump to content
  • Advertisement
Sign in to follow this  
Martaver

DirectInput SetCooperativeLevels failure

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

Hi guys, I've been busting my brain over an error I've been getting for days now, and I simply have no idea what's causing it. I hope some of you have ideas on what's going on. I'm writing a simple rendering engine in C# & Managed DX9.0b: - I have a RenderState, which is a singleton class that all modules in my engine manipulate. It contains the Direct3D device & the module which draws to the device etc. - I have a 'Render-to' Control which also exists exclusively in the RenderState, along with the stuff that draws to it. - I also have an interface for dynamically loaded DLLs to interact with the system as 'plugins'. So far, all of this stuff works fine - I can render stuff from my plugins, the control works - it's all dandy. My problem comes when I try to initialize a 'camera' plugin that would control my view in the engine. I create a new DirectInput device like so: device = new Device(SystemGuid.Keyboard); device.SetCooperativeLevel( RenderState.Display, CooperativeLevelFlags.Background | //Can be used at all times. CooperativeLevelFlags.NonExclusive); //Other applications may use this device. RenderState.Display being the Control associated with the RenderState that I described above. At this point, the app dies - throwing an 'InputException', which I would have to say is the least descriptive exception I've ever seen. If I do: device.SetCooperativeLevel( new Form(), CooperativeLevelFlags.Background | //Can be used at all times. CooperativeLevelFlags.NonExclusive); //Other applications may use this device. I get 'UnsupportedException' - whose MSDN description is something like 'function is not available at this time'. Anyone have any ideas?

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!