Archived

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

Zeblar Nagrim

Easy d3d8 question

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