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
Easy d3d8 question
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!
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).
for d3dpp.AutoDepthStencilFormat instead of
using d3ddm.Format(it''s a back-buffer format).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement