🔒 Locked
D3D9 Runtime Error
Advertisement
Original Post
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);
}
...
/*********************************************************/
What about all the other presentation parameters that you need to set?
I did what I was told to do in a book, and it doessnt work, so please explain, I''m new to DX.
Here is a screenshot:
http://strife.fox.50megs.com/cgi-bin/i/error.JPG
http://strife.fox.50megs.com/cgi-bin/i/error.JPG
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]
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]
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
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
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.
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.
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]
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
Do any of the SDK samples run? If not then your card may not support DX9.
Stay Casual,
Ken
Drunken Hyena
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.
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.
http://dew.mg2.org/coligna/dxview.log
[edited by - KitsuneStrife on May 11, 2004 6:42:13 PM]
[edited by - KitsuneStrife on May 11, 2004 6:42:13 PM]
Yes, on several occasions.
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;"?
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
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.
Advertisement