Condividi tramite


IDirect3DSwapChain9Ex::GetPresentStatistics method

Gets presentation statistics so an application can identify frames that do not have a Present method call.

Syntax

HRESULT GetPresentStatistics(
  [out] D3DPRESENTSTATS *pPresentationStatistics
);

Parameters

Return value

Type: HRESULT

Possible return values include: S_OK or D3DERR_DEVICEREMOVED (see D3DERR).

For FlipEx present statistics, GetPresentStatistics returns D3DERR_PRESENT_STATISTICS_DISJOINT in the following situations:

  • First call to GetPresentStatistics ever, which indicates the beginning of a sequence
  • DWM transition from on to off
  • Mode change: either windowed mode to or from full screen or full screen to full screen transitions

Remarks

The device must be created with the D3DCREATE_ENABLE_PRESENTSTATS flag, otherwise, the data returned by the method is undefined. While in windowed mode, all structure values will be zeroes.

Use the structure returned from this method to determine if a frame was skipped. A frame in this context is a period of time separated by 2 vertical retraces. For instance, if a monitor is set to refresh at 60hz, then you are running at 60 frames per second.

Requirements

Header

D3d9.h

Library

D3D9.lib

See also

IDirect3DSwapChain9Ex