unable to init direct3d

Started by
9 comments, last by Aiursrage2k 18 years, 6 months ago
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. =(
Advertisement
"Doesn't work" is a bit vague ;)

What error are you getting?
"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
What is the error code being returned by by the DX function that is failing?
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".
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...
if only I knew how to do that
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.
*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.
You're very welcome!

This topic is closed to new replies.

Advertisement