Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


IDirect3DDevice8::CreateDevice problems

This topic is 5699 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

Hi, Just started with DirectX, and have been using Drunken Hyena''s tutorials. However, I''ve run into a fundemental problem, a problem creating the DX device. I''m using Dev C++ 4 with a ATi XPERT 99/00 (yup, I need to upgrade soon ) Here''s the initation of D3D:

 if (!iD3D) FatalError("Fatal error getting D3D instance");


 if (FAILED(hr)) FatalError("Fatal error getting display mode");


 d3dpp.AutoDepthStencilFormat = D3DFMT_D16;


 if (FAILED(hr))
 FatalError("Error creating device");
 return hr;
CreateDevice always fails, and I have tried a number of parameters. Any ideas?

Share this post

Link to post
Share on other sites
You aren't setting backbuffer width and height.
Also why don't you switch to HAL?

Also to use ZBuffering as you state in your D3DPRESENT_PARAMETERS instance, you must set the EnableAutoDepthStencil to TRUE too. The format isn't enough.

[edited by - aker_jus on May 3, 2003 3:48:38 PM]

Share this post

Link to post
Share on other sites
Nah, I don't think you need to set backbufferheight & width for windowed mode...

At least I didn't need that, but you will need to set the BackBuffer.Format to the Format the current displaysettings use.
(which is what you did...)

[edited by - bilsa on May 3, 2003 7:01:59 PM]

Share this post

Link to post
Share on other sites
Okay I dont think this is the problem but if you are using a ZBuffer then you need:

d3dpp.EnableAutoDepthStencil = TRUE;

i think.

Other than that it looks good, try stepping through the debugger to that line and check the values, im guessing hWnd is NULL.

Hope this helps

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!