Microsoft.DirectX.Direct3D.NotAvailableException why?

Hi all,

I get a:

Microsoft.DirectX.Direct3D.NotAvailableException

from the following line of code:

device = new Device(0, DeviceType.Hardware, this, CreateFlags.SoftwareVertexProcessing, presentParams);

I guessing that its because the HW video is saying it isn't available or is not compatible with DX9
Am i doing something fundamentally wrong or is this the case

Cheers very much for your time

Felix




Answer this question

Microsoft.DirectX.Direct3D.NotAvailableException why?

  • skittles972001

    Also try to set the debug version of DirectX and debug output level to full output either in control panel->DirectX or in VS options->Debugging->DirectX and see if you get more info than the exception in the output debug window.


  • Maf

    Additional the code part that initializes your presentParams could be helpful too.



  • arctix

    Thanks alot for your help everyone,

    It turns out that in control panel -> DirectX under the Direct3D tab the 'Allow Hardware Acceleration' check box was not selected. After selecting it, it seems that the device is now available. Presumably this meant that when Direct3D API requested the device, the device was not allowing access because hardware accelleration was not being allowed.

    Cheers everyone,

    Felix



  • Ryan Stemen

    You can't use a feature in hardware that's not available on your graphics card. Have you switched to the software rasterizer to see if the code still runs What kind of video card are you using

  • Microsoft.DirectX.Direct3D.NotAvailableException why?