IDXGISwapChain::Present Method

Presents a rendered image to the user.

Note

Starting with Direct3D 11.1, we recommend not to use Present anymore to present a rendered image. Instead, use IDXGISwapChain1::Present1. For more info, see Remarks.

Syntax

public:
HRESULT Present(
         UINT SyncInterval,
         UINT Flags
)  

Parameters

SyncInterval
Type: UINT 

An integer that specifies how to synchronize presentation of a frame with the vertical blank.

For the bit-block transfer (bitblt) model (DXGI_SWAP_EFFECT_DISCARD or DXGI_SWAP_EFFECT_SEQUENTIAL), values are:

For the flip model (DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL), values are:

For an example that shows how sync-interval values affect a flip presentation queue, see Remarks.

If the update region straddles more than one output (each represented by IDXGIOutput), Present performs the synchronization to the output that contains the largest subrectangle of the target window’s client area.

Flags
Type: UINT 

For the flags, see DXGI_PRESENT at MSDN.

Return value

Type: HRESULT 

Possible return values include: S_OK, DXGI_ERROR_DEVICE_RESET or DXGI_ERROR_DEVICE_REMOVED (see DXGI_ERROR), DXGI_STATUS_OCCLUDED (see DXGI_STATUS), or D3DDDIERR_DEVICEREMOVED.

Note

The Present method can return either DXGI_ERROR_DEVICE_REMOVED or D3DDDIERR_DEVICEREMOVED if a video card has been physically removed from the computer, or a driver upgrade for the video card has occurred.

Remarks

The recommended present method for Xbox One is DXGIXPresentArray.

This method has also been superceded by the IDXGISwapChain1::Present1 method.

For the best performance when flipping swap-chain buffers in a full-screen application, see Full-Screen Application Performance Hints.

Because calling Present might cause the render thread to wait on the message-pump thread, be careful when calling this method in an application that uses multiple threads. For more details, see Multithreading Considerations.

For flip presentation model swap chains that you create with the DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL value set, a successful presentation unbinds back buffer 0 from the graphics pipeline, except for when you pass the DXGI_PRESENT_DO_NOT_SEQUENCE flag in the Flags parameter.

For info about how data values change when you present content to the screen, see Converting data for the color space.

Flip presentation model queue

Suppose the following frames with sync-interval values are queued from oldest (A) to newest (E) before you call Present.

A: 3, B: 0, C: 0, D: 1, E: 0

When you call Present, the runtime shows frame A for only 1 vertical blank interval. The runtime terminates frame A early because of the sync interval 0 in frame B. Then the runtime shows frame D for 1 vertical blank interval, and then frame E until you submit a new presentation. The runtime discards frames B and C.

Requirements

Header: Declared in d3d11_x.h (dxgi.h on other Windows platforms).

Library: Use d3d11_x.lib (dxgi.lib on other Windows platforms).

See also

IDXGISwapChain

IDXGISwapChain Members