Jump to content
  • Advertisement
Sign in to follow this  

unable to init direct3d

This topic is 4608 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
"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
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
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
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
*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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!