Skip to main content
gamedev.net
🔒 Locked

D3D9 Runtime Error

Started by KitsuneStrife 15 replies 1.4k views
Original Post
KitsuneStrife
KitsuneStrife
Microsoft.DirectX.Direct3D.InvalidCallException /*********************************************************/ ... private Device device = null; /// /// We will initialize our graphics device here /// public void InitializeGraphics() { // Set our presentation parameters PresentParameters presentParams = new PresentParameters(); presentParams.Windowed = true; presentParams.SwapEffect = SwapEffect.Discard; // Create our device /* Error Here */ device = new Device(0, DeviceType.Hardware, this, CreateFlags.SoftwareVertexProcessing, presentParams); } ... /*********************************************************/
KitsuneStrife
KitsuneStrife
I did what I was told to do in a book, and it doessnt work, so please explain, I''m new to DX.
KitsuneStrife
KitsuneStrife
Here is a screenshot:
http://strife.fox.50megs.com/cgi-bin/i/error.JPG
Muhammad Haggag
Muhammad Haggag
Do you have the debug dx runtime? If not, install it so that you get debug output, which will tell you exactly what's wrong (edit: You might want to check the forum FAQ).

The problem you encountered is that there's a wrong parameter in your Presentation parameters - something that your card doesn't support, it seems. Unfortunately, I don't know what presentation parameters is initialized to by default.

Muhammad Haggag,
Optimize
Bitwise account: MHaggag -

[edited by - Coder on May 6, 2004 7:23:49 AM]

DrunkenHyena
DrunkenHyena
Most samples for MDX try to show off how much less code you need by depending on defaults, but they rarely do a good job of stating what needs to be set and when.

My advice is the same as in Unmanaged DX, set all of the members of your PresentParameters. Then you always know what you''re setting. Even better, make sure you understand WHY you''re setting them and WHAT you''re setting them to.

Stay Casual,

Ken
Drunken Hyena
Stay Casual,KenDrunken Hyena</FON
KitsuneStrife
KitsuneStrife
ARGH!!! I tried to set the setting according to what some of the examples included with the SDK, but I''m still getting the error.
Would it help if I got a new graphics card? DOH! I''m on a notebook, I cant upgrade the graphics. Oh well, it was a good dream while it lasted.
Muhammad Haggag
Muhammad Haggag
quote:
Original post by KitsuneStrife
ARGH!!! I tried to set the setting according to what some of the examples included with the SDK, but I'm still getting the error.
Would it help if I got a new graphics card? DOH! I'm on a notebook, I cant upgrade the graphics. Oh well, it was a good dream while it lasted.

Never despair. What's your card type? Fire up DirectX Caps Viewer (Under DXSDk\Utilities), save the D3D caps into a file, and either post it here enclosed with [ source ][/ source ] tags (without the spaces between the square brackets and "source"), or mail it to me.

Have you installed the debug runtime? If you don't understand what I'm talking about, read the forum FAQ, and if not there yet, send me an email.

Muhammad Haggag,
Optimize
Bitwise account: MHaggag -
[edit]Clarification

[edited by - Coder on May 10, 2004 4:34:59 PM]

DrunkenHyena
DrunkenHyena
If you set up the debug runtime it would tell you why it''s failing.

Do any of the SDK samples run? If not then your card may not support DX9.


Stay Casual,

Ken
Drunken Hyena
Stay Casual,KenDrunken Hyena</FON
KitsuneStrife
KitsuneStrife
My graphics specs for my notebook:
AGP-enabled Intel® ® 815EM graphics chip with up to 11 MB video SDRAM (shared) and 3Dgraphics support and Intel''s Dynamic Video Memory Technology

I will post the CAPS later today.

And yes, the samples work in full-screen, but when I Alt+ENTER, they crash.
KitsuneStrife
KitsuneStrife
http://dew.mg2.org/coligna/dxview.log

[edited by - KitsuneStrife on May 11, 2004 6:42:13 PM]
Alvarny
Alvarny
If the samples crash when in windowed mode theres a problem. Have you tried reinstalling Direct X?
Muhammad Haggag
Muhammad Haggag
Sample-crashing means you have a driver bug, most probably. Do all the samples crash on mode-switching, or just the managed ones?

Try changing your app to run in full-screen (i.e Windowed = false)

Muhammad Haggag,
Optimize
Bitwise account: MHaggag -

KitsuneStrife
KitsuneStrife
I tried making my app to go full screen, but it didnt change my resolution of the screen, and it still gave the error. Is there another thing I need to do other than changing it to "presentParams.Windowed = false;"?
Supernat02
Supernat02
I think you also have to set the width and height parameters to valid values when running full screen (i.e. 800x600, 1280x1024, etc).

Chris
Chris ByersMicrosoft DirectX MVP - 2005
Muhammad Haggag
Muhammad Haggag
quote:
Original post by KitsuneStrife
I tried making my app to go full screen, but it didnt change my resolution of the screen, and it still gave the error. Is there another thing I need to do other than changing it to "presentParams.Windowed = false;"?

Do the managed samples work? If they do, modify the code of anyone to write the presentParams to a file, and check that one for some working parameters.

Muhammad Haggag,
Optimize
Bitwise account: MHaggag -

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.