Computer Graphics

Moderators: Sephiroth
Number of threads: 1217
Number of posts: 2607

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
DirectX Initialization Problem Posted by KodyKinzel on 22 Dec 2009 at 10:15 AM
I'm so sorry if this is in the wrong section.

My problem is that this line of code keeps failing:

d3d = Direct3DCreate9 ( D3D_SDK_VERSION );
if ( !d3d )
{
MessageBox ( hWnd, L"CGraphics::Initialize failed on Direct3DCreate9() ", L"Error!" , NULL );
return false;
}

if this helps solve the problem, this is inside a function of a class, and the original definition of d3d is also in that class, which I coded so:

LPDIRECT3D9 d3d;

I keep getting my failure message box, and I cannot figure out why it keeps failing. I have searched the internet, and my initialization method appears to be the same as all the others that I have seen.
Report
Re: DirectX Initialization Problem Posted by anthrax11 on 27 Dec 2009 at 6:21 PM
Well, there aren't many reasons why this should fail.

Check that you have DirectX version 9.0c(use DxDiag). If you do, then make sure the versions of the DirectX header files you are using match the library files you are linking against(d3d9.h/d3d9.lib), which means they should both be from the same SDK package(you'll probably want the DirectX SDK August 2009 version).

If that doesn't help, then see if other DX9 applications also fail, in which case reinstalling DirectX 9 or the video card drivers might work.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.