Jump to content
  • Advertisement
Sign in to follow this  
freka586

[SlimDX] AdapterCollection is null

This topic is 3646 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 all, I am currently considering moving an existing MDX implementation to SlimDX. When messing around with it I got a NullRefException when trying to get an adapter for a given window handle. Syntactically things are very much the same as the MDX version, but maybe I should be using a different approach for SlimDX? This is the code snippet: foreach (AdapterInformation ai in Direct3D.Adapters) { int adapterMonitor = Direct3D.GetAdapterMonitor(ai.Adapter).ToInt32(); if (adapterMonitor == windowMonitor) { return ai; } }

Share this post


Link to post
Share on other sites
Advertisement
The application is meant to be used in a multi-monitor environment, where typically there are 3-4 displays hooked up to individual outputs of 2 graphics cards.

While you can actually render the image on one adapter and then display it on a separate one, this is not as fast since the produced image would need to be transferred across the bus.

Share this post


Link to post
Share on other sites
This sounds like a bug. I have filed an issue here, please feel free to add any relevant additional information you may have.

I won't be able to take a look in any detail until tomorrow afternoon, but one of the other developers may get some time before that.

Share this post


Link to post
Share on other sites
I'm betting that you haven't called Direct3D.Initialize. It is required that you call this method before any other Direct3D method in your program.

The reasoning behind this is that if the user doesn't want to use a particular subsystem (such as Direct3D or DirectInput), he can avoid having it load and create objects by not calling the Initialize method. It is possible that for the next release the Direct3D class will become an instance class to allow support for Direct3D9Ex.

Share this post


Link to post
Share on other sites
That would indeed be a good bet :)
So, I guess the bug can be written off as User error, thanks for quick input.

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!