Export (0) Print
Expand All
Expand Minimize

IDirect3DDevice9::GetRenderTarget method

Retrieves a render-target surface.

Syntax


HRESULT GetRenderTarget(
  [in]   DWORD RenderTargetIndex,
  [out]  IDirect3DSurface9 **ppRenderTarget
);

Parameters

RenderTargetIndex [in]

Type: DWORD

Index of the render target. See Remarks.

ppRenderTarget [out]

Type: IDirect3DSurface9**

Address of a pointer to an IDirect3DSurface9 interface, representing the returned render-target surface for this device.

Return value

Type: HRESULT

If the method succeeds, the return value is D3D_OK. If the method fails, the return value can be D3DERR_INVALIDCALL if one of the arguments is invalid, or D3DERR_NOTFOUND if there's no render target available for the given index.

Remarks

Typically, methods that return state will not work on a device that is created using D3DCREATE_PUREDEVICE. This method however, will work even on a pure device because it returns an interface.

The device can now support multiple render targets. The number of render targets supported by a device is contained in the NumSimultaneousRTs member of D3DCAPS9. See Multiple Render Targets (Direct3D 9).

Calling this method will increase the internal reference count on the IDirect3DSurface9 interface. Failure to call IUnknown::Release when finished using the IDirect3DSurface9 interface results in a memory leak.

Requirements

Header

D3D9.h

Library

D3D9.lib

See also

IDirect3DDevice9
IDirect3DDevice9::SetRenderTarget

 

 

Community Additions

ADD
Show:
© 2014 Microsoft