Platform SDK: DirectX

IDirectDrawSurface7::SetPriority

The IDirectDrawSurface7::GetPriority method assigns the texture-management priority for this texture. This method succeeds only on managed textures (see Remarks).

HRESULT SetPriority(
  DWORD dwPriority
);

Parameters

dwPriority
Value specifying the new texture-management priority for the texture.

Return Values

If the method succeeds, the return value is D3D_OK.

If it fails, the method returns an error. It returns DDERR_INVALIDOBJECT if the parameter is invalid or if the texture is not managed by Direct3D.

Remarks

This method was introduced with the IDirectDrawSurface7 interface.

Priorities are used to determine when managed textures are to be removed from memory. A texture with a low priority is removed before a texture with a high priority. If two textures have the same priority, the texture that was used more recently is kept in memory; the other texture is removed.

Applications can set and retrieve priorities only for managed textures (those that were created with the DDSCAPS2_TEXTUREMANAGE flag). Calling this method on a nonmanaged texture causes the method to fail and return DDERR_INVALIDOBJECT.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 98.
  Header: Declared in ddraw.h.

See Also

IDirectDrawSurface7::GetPriority, Automatic Texture Management, Textures