?/TD>
Microsoft DirectX 9.0

IDirect3DDevice9::UpdateSurface Method


Copies rectangular subsets of pixels from one surface to another.

Syntax

HRESULT UpdateSurface(      

    IDirect3DSurface9* pSourceSurface,     CONST RECT* pSourceRect,     IDirect3DSurface9* pDestinationSurface,     CONST POINT* pDestinationPoint );

Parameters

pSourceSurface
[in] Pointer to an IDirect3DSurface9 interface, representing the source surface. This parameter must point to a different surface than pDestinationSurface.
pSourceRect
[in] Pointer to a rectangle on the source surface. Specifying NULL for this parameter causes the entire surface to be copied.
pDestinationSurface
[in] Pointer to an IDirect3DSurface9 interface, representing the destination surface.
pDestinationPoint
[in] Pointer to the upper left corner of the destination rectangle. Specifying NULL for this parameter causes the entire surface to be copied.

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 values.

D3DERR_INVALIDCALLThe method call is invalid. For example, a method's parameter may have an invalid value.


Remarks

This method is similar to CopyRects in Microsoft?DirectX?8.0.

This function has the following restrictions.

The following table shows the supported combinations.

Dest formats
Texture RT texture RT Off-screen plain
Src formats Texture Yes Yes Yes* Yes
RT texture No No No No
RT No No No No
Off-screen plain Yes Yes Yes Yes

* If the driver does not support the requested copy, it will be emulated using lock and copy.

If the application needs to copy data from a D3DPOOL_DEFAULT render target to a D3DPOOL_SYSTEMMEM surface, it can use IDirect3DDevice9::GetRenderTargetData.



© 2002 Microsoft Corporation. All rights reserved.