Original Post
I started learning directx 8 and now i am learning dx 9 but i have a problem with the initialization. i wanted to transfer the initialization from dx8 to my code and i realize that 2 functions don't work : g_Direct3D->GetAdapterModeCount(0) g_Direct3D->EnumAdapterModes(0, x, &d3ddm); the functions are integrated in a function that checks for display mode g_Direct3D->GetAdapterModeCount(0) takes 2 parameters and g_Direct3D->EnumAdapterModes(0, x, &d3ddm); takes 4 parameters help!; tnx
D3DFORMAT CGame::CheckDisplayMode(UINT nWidth, UINT nHeight, UINT nDepth)
{
UINT x;
D3DDISPLAYMODE d3ddm;
for(x = 0; x < g_Direct3D->GetAdapterModeCount(0); x++)
{
g_Direct3D->EnumAdapterModes(0, x, &d3ddm);
if(d3ddm.Width == nWidth)
{
if(d3ddm.Height == nHeight)
{
if((d3ddm.Format == D3DFMT_R5G6B5) || (d3ddm.Format == D3DFMT_X1R5G5B5) || (d3ddm.Format == D3DFMT_X4R4G4B4))
{
if(nDepth == 16)
{
return d3ddm.Format;
}
}
else if((d3ddm.Format == D3DFMT_R8G8B8) || (d3ddm.Format == D3DFMT_X8R8G8B8))
{
if(nDepth == 32)
{
return d3ddm.Format;
}
}
}
}
}
return D3DFMT_UNKNOWN;
}