Sets a new color buffer for the device.
HRESULT SetRenderTarget( DWORD RenderTargetIndex, IDirect3DSurface9 * pRenderTarget );
If the method succeeds, the return value is D3D_OK. This method will return D3DERR_INVALIDCALL if either:
The device can 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.
Some hardware tests the compatibility of the depth stencil buffer with the color buffer. If this is done, it is only done in a debug build.
Restrictions for using this method include the following:
These restrictions are validated only when using the debug runtime when any of the IDirect3DDevice9 Draw methods are called.
Cube textures differ from other surfaces in that they are collections of surfaces. To call IDirect3DDevice9::SetRenderTarget with a cube texture, you must select an individual face using IDirect3DCubeTexture9::GetCubeMapSurface and pass the resulting surface to IDirect3DDevice9::SetRenderTarget.
Header: Declared in D3d9.h.