IDirect3DResource9::SetPriority method (d3d9helper.h)

Assigns the priority of a resource for scheduling purposes.

Syntax

DWORD SetPriority(
  [in] DWORD PriorityNew
);

Parameters

[in] PriorityNew

Type: DWORD

Priority to assign to a resource.

Differences between Direct3D 9 and Direct3D 9 for Windows Vista

The priority can be any DWORD value; Direct3D 9 for Windows Vista also supports any of these pre-defined values D3D9_RESOURCE_PRIORITY.

Return value

Type: DWORD

Returns the previous priority value for the resource.

Remarks

This method is used to change the priority of managed resources (resources created with the D3DPOOL_MANAGED flag). This method returns 0 on non-managed resources.

Priorities are used to determine when managed resources are to be removed from memory. A resource assigned a low priority is removed before a resource with a high priority. If two resources have the same priority, the resource that was used more recently is kept in memory; the other resource is removed. Managed resources have a default priority of 0.

Windows Vista only - When this method is called using an IDirect3D9Ex interface, only resources created with the D3DPOOL_DEFAULT flag will be affected.

Requirements

Requirement Value
Target Platform Windows
Header d3d9helper.h (include D3D9.h)
Library D3D9.lib

See also

IDirect3DResource9