DXUTSetConstantFrameTime
Microsoft DirectX 9.0 SDK Update (October 2004)

DXUTSetConstantFrameTime Function


Enables or disables a constant frame time.

Syntax

HRESULT DXUTSetConstantFrameTime(      

    BOOL bEnabled,     FLOAT fTimePerFrame );

Parameters

bEnabled
[in] If TRUE, a constant frame time will be enabled.
fTimePerFrame
[in] Time per frame, in seconds. The default value is 0.0333f, so the fTime parameter of LPDXUTCALLBACKFRAMEMOVE and LPDXUTCALLBACKFRAMERENDER will advance one second for every 30 frames.

Return Value

If the function succeeds, the return value is S_OK.

If the function fails, the return value can be one of the error codes in DXUTERR.

Remarks

This function simulates a fixed-frame rate render loop by sending a constant value for elapsed time to the LPDXUTCALLBACKFRAMEMOVE and LPDXUTCALLBACKFRAMERENDER callback functions. The default rate is one second for every 30 frames. The application itself will continue to render at an unregulated rate (which may be far higher than the specified frame rate).

This function is useful for saving the rendered output to a video format for playback, allowing animation at a rate independent of the actual rate at which frames were rendered.

Function Information

Headerdxut.h
Import libraryNone
Minimum operating systems Windows 98

See Also

LPDXUTCALLBACKFRAMEMOVE, LPDXUTCALLBACKFRAMERENDER


© 2004 Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center.