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
)
Not applicable.
Parameters
- sourceTexture
A BaseTexture object that represents the source texture that must be in system memory. For more information, see SystemMemory.
- destinationTexture
A BaseTexture object that represents the source texture.
Exceptions
Exception type | Condition |
---|---|
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 have 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.
Platforms
Windows CE, Windows Mobile for Pocket PC, Windows Mobile for Smartphone
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.
Version Information
.NET Compact Framework
Supported in: 2.0
See Also
Reference
Device Class
Device Members
Microsoft.WindowsMobile.DirectX.Direct3D Namespace