Partager via


IDirect3DMobileTexture::LockRect

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This method locks a rectangle on a texture resource.

Syntax

HRESULT LockRect(
  UINT Level,
  D3DMLOCKED_RECT* pLockedRect,
  CONST RECT* pRect,
  DWORD Flags
);

Parameters

  • Level
    [in] Specifies the level of the texture resource to lock.
  • pLockedRect
    [out] Pointer to a D3DMLOCKED_RECT structure that describes the locked region.
  • pRect
    [in] Pointer to a rectangle to lock. Specified by a pointer to a RECT structure. Specifying NULL for this parameter expands the dirty region to cover the entire texture.
  • Flags
    [in] A combination of one or more D3DMLOCK Values to describe the type of lock to perform. The following list shows the allowable flags.

    • D3DMLOCK_READONLY
    • D3DMLOCK_NO_DIRTY_UPDATE

Return Value

If the method succeeds, the return value is D3DM_OK (see D3DM Values).

If the method fails, the return value can be D3DMERR_INVALIDCALL (see D3DMERR Values).

Remarks

For performance reasons, dirty regions are only recorded for level zero of a texture. Dirty regions are automatically recorded when IDirect3DMobileTexture::LockRect is called without D3DMLOCK_NO_DIRTY_UPDATE or D3DMLOCK_READONLY (see D3DMLOCK Values). For more information, see IDirect3DMobileDevice::UpdateTexture.

A multisample backbuffer cannot be locked. Video memory textures cannot be locked, but must be modified by calling IDirect3DMobileDevice::CopyRects or IDirect3DMobileDevice::UpdateTexture.

Requirements

Header d3dm.h
Library D3dm.lib, D3dmguid.lib
Windows Embedded CE Windows CE 5.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

IDirect3DMobileTexture
D3DMLOCKED_RECT
D3DMLOCK Values
IDirect3DMobileDevice::UpdateTexture
IDirect3DMobileDevice::CopyRects
IDirect3DMobileDevice::UpdateTexture

Other Resources

RECT