d3d9.dllCreateRenderTarget
Microsoft DirectX 9.0 SDK Update (October 2004)

IDirect3DDevice9::CreateRenderTarget Method


Creates a render-target surface.

Syntax

HRESULT CreateRenderTarget(      

    UINT Width,     UINT Height,     D3DFORMAT Format,     D3DMULTISAMPLE_TYPE MultiSample,     DWORD MultisampleQuality,     BOOL Lockable,     IDirect3DSurface9** ppSurface,     HANDLE* pSharedHandle );

Parameters

Width
[in] Width of the render-target surface, in pixels.
Height
[in] Height of the render-target surface, in pixels.
Format
[in] Member of the D3DFORMAT enumerated type, describing the format of the render target.
MultiSample
[in] Member of the D3DMULTISAMPLE_TYPE enumerated type, which describes the multisampling buffer type. This parameter specifies the antialiasing type for this render target. When this surface is passed to IDirect3DDevice9::SetRenderTarget, its multisample type must be the same as that of the depth-stencil set by IDirect3DDevice9::SetDepthStencilSurface.
MultisampleQuality
[in] Quality level. The valid range is between zero and one less than the level returned by pQualityLevels used by IDirect3D9::CheckDeviceMultiSampleType. Passing a larger value returns the error, D3DERR_INVALIDCALL. The MultisampleQuality values of paired render targets, depth stencil surfaces, and the multisample type must all match.
Lockable
[in] Render targets are not lockable unless the application specifies TRUE for Lockable. Note that lockable render targets reduce performance on some graphics hardware.
ppSurface
[out, retval] Address of a pointer to an IDirect3DSurface9 interface.
pSharedHandle
[in] Reserved. Set this parameter to NULL.

Return Value

If the method succeeds, the return value is D3D_OK.

If the method fails, the return value can be one of the following:

D3DERR_NOTAVAILABLEThis device does not support the queried multisample type.
D3DERR_INVALIDCALLThe method call is invalid. For example, a method's parameter may have an invalid value.
D3DERR_OUTOFVIDEOMEMORYNot enough display memory to perform the operation.
E_OUTOFMEMORYCould not allocate sufficient memory to complete the call.



Remarks

Render-target surfaces are placed in the D3DPOOL_DEFAULT memory class.

The creation of lockable, multisampled render targets is not supported.



© 2004 Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center.