Sign in to follow this  
infernosnow

unable to init direct3d

Recommended Posts

infernosnow    139
www.kryolinth.com/all.rtf is all my code. It's very simple and well commented, so it shouldn't be confusing. PROBLEM: completely works on my computer that has DX 9.0c SDK installed on it (the computer I compiled it on) however DOESN'T work on this computer. Why not? I have installed new drivers, I have installed DirectX 9.0c runtime, I have updated the hardware somethingerother for my graphics card, I have all windows updates, I have restarted my computer. As for the code that initializes direct3d, it's the SAME code that microsoft uses in their tutorial about how to initialize direct3d. The ONLY differences is that I'm using a function that has all the code in it and I rename g_pd3d and g_pd3dDevice to pd3d and pd3dDevice (without the g_) So I really don't know why this works on one computer but not the other. I ran dxDiag and it does say I have DirectX 9.0c. so WTF? Is there something wrong with my code??? EDIT: oh yeah, I also installed the M$.NET framework and when I was running dxDiag I tested Direct3D and it WORKS for 7-9. SO I figure it HAS to be something wrong with my code. =(

Share this post


Link to post
Share on other sites
infernosnow    139
"Unable to init Direct3d"

you can ctrl+f to search and find right where that error is in the code. The if statement refers to the initdirect3d function down below

Share this post


Link to post
Share on other sites
infernosnow    139
I don't know.. I don't see any error code like that. All I see is the message box that appears after the window is created and it says "Unable to init direct3d".

Share this post


Link to post
Share on other sites
Dave Hunt    4872
Well, since you have the source code, you can add a message box that displays the return value of the function that is failing, or check it in the debugger...

Share this post


Link to post
Share on other sites
Dave Hunt    4872
I think the problem is that you are using the reference device (D3DDEVTYPE_REF). Only developer runtimes of DirectX will have a reference device. You should only be using the reference device for testing features that your video card doesn't support. Try changing it to D3DDEVTYPE_HAL.

Share this post


Link to post
Share on other sites
infernosnow    139
*asplodes*
IT WORKS!
*worships you*

thankyou. I wonder why the book that I bought codes it as "REF" instead of "HAL" then... Confusing.

But thanks. Much appreciated Mr. Hunt.

Share this post


Link to post
Share on other sites
Aiursrage2k    320
Ref means its running in software which is quite slow...

Quote:

D3DDEVTYPE_REF
Direct3D features are implemented in software; however, the reference rasterizer does make use of special CPU instructions whenever it can.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this