Re: Can't create Device

From: Fredo (fredo68_at_hotmail.com)
Date: 11/02/04


Date: Mon, 1 Nov 2004 18:03:46 -0600

Okay, well, my Manager.Adapters issue seemed to be solved simply by
upgrading to the latest version of the DirectX SDK. Now that part runs in
debug and release runtimes just fine.

I still can't create the Device object. Running with the debug runtime
provides me with no additional information as to why the Device constructor
is throwing a InvalidCallException.

So here's some additional information and hopefully you can help me narrow
down the exact cause.

My original suspicion was that I was running into a problem because the
format of my backbuffer wasn't matching the desktop format. But there are
only two formats on this display adapter (X8R8G8B8 or R5G6B5). Neither of
which works at a number of resolutions that I've tried.

For now, I'm trying to do full-screen, which as I'm looking back at my
original post, I omitted, but I'm setting presParams.Windowed = false.

I mention this because the D3DApp.cs sample sets
presentParams.FullScreenRefreshRateInHz to 0 in windowed mode and to a real
refresh rate value when in full screen. I wasn't doing that, so I added
that.

It sets a number of other parameters that I'm not interested in. Do I have
to set every single parameter? Again, apart from the D3DApp as an example,
none of the sources I've seen seem to indicate that I need to set any other
parameters.

Passing in the present parameters structure directly or in an array of
present parameters as the last parameter of the Device constructor call
seems to make no difference. I mention this because the documentation states
it should be an array of present parameters, but the sample app and the
books I have, pass it in as simply the structure, but I suspect this is
simply a feature of C# that I was previously unaware of (the ability to
convert a parameter to an array of its type if needed).

So, I'm back to where I was in my original message. Stuck.

Pete