Microsoft DirectX 8.1 (C++)

IDirect3DDevice8::CreateRenderTarget

Creates a render target surface.

HRESULT CreateRenderTarget(
  UINT Width,
  UINT Height,
  D3DFORMAT Format,
  D3DMULTISAMPLE_TYPE MultiSample,
  BOOL Lockable,
  IDirect3DSurface8** ppSurface
);

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, describing the multisampling buffer type. This parameter specifies the antialiasing type for this render target. The type must be the same as that of the depth-stencil buffer when both surfaces are passed to SetRenderTarget.
Lockable
[in] Render targets are not lockable unless the application specifies TRUE for Lockable. Note that lockable render targets incur a performance cost on some graphics hardware.
ppSurface
[out, retval] Address of a pointer to a IDirect3DSurface8 interface.

Return Values

If the method succeeds, the return value is D3D_OK.

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

D3DERR_INVALIDCALL
D3DERR_OUTOFVIDEOMEMORY
E_OUTOFMEMORY

Remarks

Render target surfaces are placed in the D3DPOOL_DEFAULT memory class.

Requirements

  Header: Declared in D3d8.h.
  Import Library: Use D3d8.lib.