DirectX SDK

DirectDrawSurface7.SetPriority

The DirectDrawSurface7.SetPriority method assigns the texture management priority for this texture. This method succeeds only on managed textures (see Remarks).

object.SetPriority(Priority As Long)

Parameters

object
Object expression that resolves to a DirectDrawSurface7 object.
Priority
Value specifying the new texture-management priority for the texture.

Error Codes

If the method fails, it raises an error, and Err.Number can be set to DDERR_INVALIDOBJECT if the parameter is invalid or the texture is not managed by Direct3D.

Remarks

Priorities are used to determine when managed textures are to be removed from memory. A texture assigned 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.

See Also

DirectDrawSurface7.GetPriority, Automatic Texture Management