cougar autumn
November 28th, 2001, 01:30 AM
I come into such a function, and got a big surprise at its appearance.
Details are following:
HRESULT D3DEnum_EnumerateDevices( HRESULT
(*AppConfirmFn)(DDCAPS*, D3DDEVICEDESC7*) )
{
// Store the device enumeration callback function.
g_fnAppConfirmFn = AppConfirmFn;
// Enumerate drivers, devices, and modes.
DirectDrawEnumerateEx( DriverEnumCallback, NULL,
DDENUM_ATTACHEDSECONDARYDEVICES |
DDENUM_DETACHEDSECONDARYDEVICES |
DDENUM_NONDISPLAYDEVICES );
// Make sure that devices were enumerated.
if( 0 == g_dwNumDevicesEnumerated )
{
DEBUG_MSG( _T("No devices and/or modes were enumerated!") );
return D3DENUMERR_ENUMERATIONFAILED;
}
if( 0 == g_dwNumDevices )
{
DEBUG_MSG( _T("No enumerated devices were accepted!") );
DEBUG_MSG( _T("Try enabling the D3D Reference Rasterizer.") );
return D3DENUMERR_SUGGESTREFRAST;
}
return S_OK;
}
Any explanation of those parameters is greatly appreciated.
Thanks in advance.
VC++ developer
Details are following:
HRESULT D3DEnum_EnumerateDevices( HRESULT
(*AppConfirmFn)(DDCAPS*, D3DDEVICEDESC7*) )
{
// Store the device enumeration callback function.
g_fnAppConfirmFn = AppConfirmFn;
// Enumerate drivers, devices, and modes.
DirectDrawEnumerateEx( DriverEnumCallback, NULL,
DDENUM_ATTACHEDSECONDARYDEVICES |
DDENUM_DETACHEDSECONDARYDEVICES |
DDENUM_NONDISPLAYDEVICES );
// Make sure that devices were enumerated.
if( 0 == g_dwNumDevicesEnumerated )
{
DEBUG_MSG( _T("No devices and/or modes were enumerated!") );
return D3DENUMERR_ENUMERATIONFAILED;
}
if( 0 == g_dwNumDevices )
{
DEBUG_MSG( _T("No enumerated devices were accepted!") );
DEBUG_MSG( _T("Try enabling the D3D Reference Rasterizer.") );
return D3DENUMERR_SUGGESTREFRAST;
}
return S_OK;
}
Any explanation of those parameters is greatly appreciated.
Thanks in advance.
VC++ developer