应用程序通过使用IDirect3D9接口的方法来创建Direct3D对象,并通过这个接口配置环境。
这个接口包括设备的枚举和检索能力的方法。
1. IDirect3D9::CheckDepthStencilMatch
说明:确定是否在一个特定的显示模式下深度模板格式和渲染目标格式相兼容
HRESULT CheckDepthStencilMatch
( UINT Adapter, //D3DADAPTER_DEFAULT
D3DDEVTYPE DeviceType, //device type
D3DFORMAT AdapterFormat, // format of the display mode
D3DFORMAT RenderTargetFormat, //the format of the render-target surface
D3DFORMAT DepthStencilFormat //the format of the depth-stencil surface
);
2. IDirect3D9::CheckDeviceFormat
说明:确定在一个指定的显卡上的表面格式是否能作为指定的资源类型,是否可以被用来作为一个纹理,是否能成为深度模板缓冲区,是否能成为渲染目标,或三者的任意组合。
HRESULT CheckDeviceFormat
( UINT Adapter, //D3DADAPTER_DEFAULT(指定主要显卡)
D3DDEVTYPE DeviceType, //device type(D3DDEVTYPE_HAL)
D3DFORMAT AdapterFormat, //指定要准备测试的显卡上的显示模式
DWORD Usage,
D3DRESOURCETYPE RType, //Resource type requested for use with the queried format
D3DFORMAT CheckFormat //Format of the surfaces which may be used, as defined by Usage
);