Freigeben über


Device.UpdateTexture Method

Updates the dirty portions of a texture.

Namespace: Microsoft.WindowsMobile.DirectX.Direct3D
Assembly: Microsoft.WindowsMobile.DirectX (in microsoft.windowsmobile.directx.dll)

Syntax

'Declaration
Public Sub UpdateTexture ( _
    sourceTexture As BaseTexture, _
    destinationTexture As BaseTexture _
)
'Usage
Dim instance As Device
Dim sourceTexture As BaseTexture
Dim destinationTexture As BaseTexture

instance.UpdateTexture(sourceTexture, destinationTexture)
public void UpdateTexture (
    BaseTexture sourceTexture,
    BaseTexture destinationTexture
)
public:
void UpdateTexture (
    BaseTexture^ sourceTexture, 
    BaseTexture^ destinationTexture
)
public void UpdateTexture (
    BaseTexture sourceTexture, 
    BaseTexture destinationTexture
)
public function UpdateTexture (
    sourceTexture : BaseTexture, 
    destinationTexture : BaseTexture
)

Parameters

  • sourceTexture
    A BaseTexture object that represents the source texture thatmust be in system memory as provided with SystemMemory.
  • destinationTexture
    A BaseTexture object that represents the source texture.

Exceptions

Exception type Condition

InvalidCallException

The method call is invalid. For example, a parameter might contain an invalid value.

Remarks

To dirty a portion of a texture, either lock it or call AddDirtyRectangle.

UpdateTexture retrieves the dirty portions of the texture by calculating what has been accumulated since the last update operation.

For performance reasons, dirty regions are recorded only for level 0 of a texture. For sublevels, it is assumed that the corresponding (scaled) rectangle or box is also dirty. Dirty regions are automatically recorded when LockRectangle is called without NoDirtyUpdate or ReadOnly. Also, the destination surface of UpdateTexture is marked dirty.

This method fails if the textures are of different types, if their bottom-level buffers are of different sizes, or if their matching levels do not match. For example, consider a six-level source texture with the following dimensions:

32x16, 16x8, 8x4, 4x2, 2x1, 1x1

This six-level source texture could be the source for the following one-level destination:

1x1

For the following two-level destination:

2x1, 1x1

Or for the following three-level destination:

4x2, 2x1, 1x1

In addition, this method fails if the textures are of different formats. If the destination texture has fewer levels than the source, only the matching levels are copied. If the source texture has fewer levels than the destination, the method fails.

If the source texture contains dirty regions, the copy operation can be optimized by restricting it to those regions only. It is not guaranteed that only those bytes marked dirty will be copied.

.NET Framework Security

  • Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see .

Platforms

Windows CE, Windows Mobile for Pocket PC, Windows Mobile for Smartphone

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

Version Information

.NET Compact Framework

Supported in: 2.0

See Also

Reference

Device Class
Device Members
Microsoft.WindowsMobile.DirectX.Direct3D Namespace