Microsoft DirectX 8.0 (C++) |
A Microsoft® Direct3D® device can perform bump mapping if it supports either the D3DTOP_BUMPENVMAP or D3DTOP_BUMPENVMAPLUMINANCE texture blending operation. Additionally, applications should check the device capabilities to make sure the device supports an appropriate number of blending stages, usually at least three, and exposes at least one bump-mapping pixel format.
The following code example checks device capabilities to detect support for bump mapping in the current device, using the given criteria.
BOOL SupportsBumpMapping() { D3DCAPS8 d3dCaps; d3dDevice->GetDeviceCaps( &d3dCaps ); // Does this device support the two bump mapping blend operations? if ( 0 == d3dCaps.TextureOpCaps & ( D3DTEXOPCAPS_BUMPENVMAP | D3DTEXOPCAPS_BUMPENVMAPLUMINANCE )) return FALSE; // Does this device support up to three blending stages? if( d3dCaps.MaxTextureBlendStages < 3 ) return FALSE; }