Jump to content
  • Advertisement

Archived

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

Zeblar Nagrim

Easy d3d8 question

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

Why doesn´t this work? Also this always force me to reboot my computer couse all other Direct3D applications fail to create device after this debug error!
  

bool CD3DMain::Initialize(HWND hwnd)
{
  m_lpD3D = Direct3DCreate8( D3D_SDK_VERSION );

  D3DDISPLAYMODE d3ddm;
  m_lpD3D->GetAdapterDisplayMode( D3DADAPTER_DEFAULT, &d3ddm );

  D3DPRESENT_PARAMETERS d3dpp;
  ZeroMemory( &d3dpp, sizeof(d3dpp) );
  d3dpp.Windowed = TRUE;
  d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
  d3dpp.BackBufferFormat = d3ddm.Format;
  d3dpp.EnableAutoDepthStencil = TRUE;
  d3dpp.AutoDepthStencilFormat = d3ddm.Format;

  HRESULT hr = m_lpD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd, 			D3DCREATE_HARDWARE_VERTEXPROCESSING, &d3dpp, &m_lpDevice );

  // This doesn´t work

  assert(SUCCEEDED(hr));

  return true;
}

  
Zeblar Nagrim, Lord of Chaos

Share this post


Link to post
Share on other sites
Advertisement
You should use D3DFMT_D16(it''s a depth-buffer format)
for d3dpp.AutoDepthStencilFormat instead of
using d3ddm.Format(it''s a back-buffer format).

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!