DXGIXSetFrameNotification

Registers the application to be notified on frame events.

Syntax

HRESULT DXGIXSetFrameNotification(
         DXGIX_FRAME_NOTIFICATION NotificationType,
         HANDLE hEvent
)  

Parameters

NotificationType
Type: DXGIX_FRAME_NOTIFICATION 

[in] The type of notification to receive, as one of the DXGIX_FRAME_NOTIFICATION enumeration constants:

Value Description
FRAME_NOTIFICATION_QUEUED The “queued” notification is signaled when a frame is queued. It can be used to determine CPU stalls (if any) after DXGIXPresentArray due to the present queue being full. The CPU time line portion of the frame’s DXGIX_FRAME_STATISTICS structure is guaranteed to be valid after this event is signaled.
FRAME_NOTIFICATION_COMPLETED The “completed” notification is signaled when the GPU is finished rendering a frame. The GPU time line portion of the frame’s DXGIX_FRAME_STATISTICS structure is guaranteed to be valid after this event is signaled.
FRAME_NOTIFICATION_FLIPPED The “flipped” notification is signaled when a frame is flipped to be displayed out. The Display time line portion of the frame’s DXGIX_FRAME_STATISTICS structure is guaranteed to be valid after this event is signaled.

hEvent
Type: HANDLE 

[in] A handle to the event that will be set.

The event is typically created using CreateEvent or CreateEventEx. This can be a manually resettable or auto-resetting event. The system will set the event continually until the application exits or until notification is turned off by setting hEvent to NULL.

If you specify a different hEvent from the one previously specified, the system will stop notifying using the previous event, and will continuously notify using the new event.

Return value

Type: HRESULT 

This method returns one of the Direct3D 11 return codes.

Remarks

There is a small delay between when the frame is completed or flipped and when the associated event is signaled. The exact time of the frame completion or flip along with other information can be queried using DXGIXGetFrameStatistics.

Requirements

Header: Declared in d3d11_x.h.

Library: Use d3d11_x.lib.