D3DXCheckTextureRequirements
Checks texture-creation parameters.
HRESULT D3DXCheckTextureRequirements(
LPDIRECT3DDEVICE9 pDevice,
UINT * pWidth,
UINT * pHeight,
UINT * pNumMipLevels,
DWORD Usage,
D3DFORMAT * pFormat,
D3DPOOL Pool
);
Parameters
- pDevice
- [in] Pointer to an IDirect3DDevice9 interface, representing the device to be associated with the texture.
- pWidth
- [in, out] Pointer to the requested width in pixels, or NULL. Returns the corrected size.
- pHeight
- [in, out] Pointer to the requested height in pixels, or NULL. Returns the corrected size.
- pNumMipLevels
- [in, out] Pointer to number of requested mipmap levels, or NULL. Returns the corrected number of mipmap levels.
- Usage
- [in] 0 or D3DUSAGE_RENDERTARGET. Setting this flag to D3DUSAGE_RENDERTARGET indicates that the surface is to be used as a render target. The resource can then be passed to the pNewRenderTarget parameter of the IDirect3DDevice9::SetRenderTarget method. If D3DUSAGE_RENDERTARGET is specified, the application should check that the device supports this operation by calling IDirect3D9::CheckDeviceFormat.
- pFormat
- [in, out] Pointer to a member of the D3DFORMAT enumerated type. Specifies the desired pixel format, or NULL. Returns the corrected format.
- Pool
- [in] Member of the D3DPOOL enumerated type, describing the memory class into which the texture should be placed.
Return Values
If the function succeeds, the return value is D3D_OK. If the function fails, the return value can be one of the following: D3DERR_INVALIDCALL.
D3DERR_NOTAVAILABLE
Remarks
If parameters to this function are invalid, this function returns corrected parameters.
This function uses the following heuristics when comparing the requested requirements against available formats:
- Do not choose a format that has fewer channels.
- Avoid FOURCC And 24-bit formats unless explicitly requested.
- Try not to add new channels.
- Try not to change the number of bits per channel.
- Try to avoid converting between types of formats. For instance, avoid converting an ARGB format to a depth format.
Requirements
Header: Declared in D3dx9tex.h.