Original Post
I''m converting a program from the book Real-Time Rendering Tricks and Techniques in DirectX from DX8.1 to DX9.
I''ve sorted everything apart from this problem.
PROTOTYPE
long EnumerateModes(D3DDISPLAYMODE *pModes, long ModeCount);
//----------------------------------------------------------
// Name: EnumerateModes()
// Desc: Gets the number of display modes available.
//----------------------------------------------------------
long Application::EnumerateModes(D3DDISPLAYMODE *pModes,
long ModeCount)
{
//Get the actual number of available modes
long Count = g_pD3D->GetAdapterModeCount(D3DADAPTER_DEFAULT);
//If they asked for more than what is available, only give
//them what is available.
if (ModeCount > Count)
ModeCount = Count;
//Loop through the available modes, filling the array until
//it is full.
for (long ModeIndex = 0; ModeIndex < ModeCount; ModeIndex++)
{
g_pD3D->EnumAdapterModes(D3DADAPTER_DEFAULT, ModeIndex, &(pModes[ModeIndex]));
}
//Return the actual number available, in case they want to
//ask for more.
return Count;
}
This function worked no problem with 8.1 however now I get the following errors: -
c:\program files\microsoft visual studio\myprojects\vertexshader\application.cpp(312) : error C2660: ''GetAdapterModeCount'' : function does not take 1 parameters
c:\program files\microsoft visual studio\myprojects\vertexshader\application.cpp(324) : error C2660: ''EnumAdapterModes'' : function does not take 3 parameters
I understand partially why I''m getting the 2nd error because EnumAdapterModes has changed to a D3DFORMAT in DX9. However I am totally stumped why I get the 1st error. I mean it worked, compiled no problem in DX8.1??
Any help really appreciated.
Thanks and Happy New Year
Paul.