DirectX框架解析11(DXUT统计函数 DXUT时间函数 DXUT计时器函数)
2011-11-17 10:22
323 查看
DXUT统计函数
DXUT时间函数
fTimePerFrame [in] Time per frame, in seconds. The default value is 0.0333f, so the fTime parameter of LPDXUTCALLBACKFRAMEMOVE and the render callback functions will advance one second for every 30 frames.
LPDXUTCALLBACKFRAMEMOVE and render 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.
DXUT计时器函数
fTimeoutInSecs [in] Interval, in seconds, between successive calls to the timer callback function. The default value is 1.0f.
pnIDEvent [in] Optional pointer to a variable to receive the event ID for the new timer. This event ID will be passed to the timer callback function to indicate which timer generated the event, allowing the application to use a single
callback function for multiple timers. The default value is NULL. pCallbackUserContext [in] Pointer to a user-defined value which is passed to the callback function. Typically used by an application to pass a pointer to a data structure that provides context information for the callback function. The default value
is NULL
pUserContext [in] Pointer to a user-defined value which is passed to the callback function. Typically used by an application to pass a pointer to a data structure that provides context information for the callback function. The default value
is NULL
DXUTKillTimer .
函数 | 描述 |
DXUTGetFPS | 获取当前每秒提交的帧数 |
DXUTGetFrameStats | 获取一个指向字符串的指针,该字符串包括每秒帧数、分辨率、后台缓冲区格式、深度缓冲区格式。 |
DXUTGetDeviceStats | 获取一个指向字符串的指针,该字符串包括当前设备类型、顶点运算行为和设备名。 |
DXUTGetFPS
Get the current number of frames being presented per second.FLOAT DXUTGetFPS() ;
Parameters
None.Return Values
The current number of frames being presented per second.DXUTGetFrameStats
Get a pointer to a string containing the current number of frames per second (optionally), resolution, back buffer format, and depth stencil format.LPCWSTR DXUTGetFrameStats( bool bIncludeFPS ) ;
Parameters
bIncludeFPS [in] If true, the string returned will contain the frames per second. Otherwise, it will not.Return Values
Pointer to a string containing the current number of frames per second (optionally), resolution, back buffer format, and depth stencil format.DXUTGetDeviceStats
Get a pointer to a string containing the current device type, vertex processing behavior, and device name.LPCWSTR DXUTGetDeviceStats() ;
Parameters
None.Return Values
Pointer to a string containing the current device type, vertex processing behavior, and device name.DXUT时间函数
函数 | 描述 |
DXUTGetTime | 获取当前时间(秒) |
DXUTGetElapsedTime | 获取从上一帧到当前帧所经过的时间 |
DXUTSetConstantFrameTime | 启用或禁用固定帧时间 |
DXUTGetTime
Get the current time, in seconds.DOUBLE DXUTGetTime() ;
Parameters
None.Return Values
The current time, in seconds.Remarks
DXUT internally uses the best practices for high resolution timing information as described in the "Game Timing and Multicore Processors" article in the DirectX SDK.DXUTGetElapsedTime
Get the time elapsed since the last frame.FLOAT DXUTGetElapsedTime() ;
Parameters
None.Return Values
Time elapsed, in seconds, since the last frame.Remarks
DXUT internally uses the best practices for high resolution timing information as described in the "Game Timing and Multicore Processors" article in the DirectX SDK.DXUTSetConstantFrameTime
Enables or disables a constant frame time.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 the render callback functions will advance one second for every 30 frames.
Return Values
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 theLPDXUTCALLBACKFRAMEMOVE and render 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.
DXUT计时器函数
函数 | 描述 |
DXUTSetTimer | 添加一个新的计时器 |
DXUTKillTimer | 卸载一个已有的计时器 |
DXUTSetTimer
Starts a DXUT timer that will trigger a callback function at regular intervals.HRESULT DXUTSetTimer( LPDXUTCALLBACKTIMER pCallbackTimer , FLOAT fTimeoutInSecs , UINT * pnIDEvent , void * pCallbackUserContext ) ;
Parameters
pCallbackTimer [in] Pointer to a timer callback function. The callback function is to be called at the specified fTimeoutInSecs timeout intervals. May not be NULL.fTimeoutInSecs [in] Interval, in seconds, between successive calls to the timer callback function. The default value is 1.0f.
pnIDEvent [in] Optional pointer to a variable to receive the event ID for the new timer. This event ID will be passed to the timer callback function to indicate which timer generated the event, allowing the application to use a single
callback function for multiple timers. The default value is NULL. pCallbackUserContext [in] Pointer to a user-defined value which is passed to the callback function. Typically used by an application to pass a pointer to a data structure that provides context information for the callback function. The default value
is NULL
Return Values
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
Timers created with DXUTSetTimer can be destroyed with DXUTKillTimer.LPDXUTCALLBACKTIMER
A timer to be called at specified time intervals by DXUT.VOID LPDXUTCALLBACKTIMER( UINT idEvent , void* pUserContext ) ;
Parameters
idEvent [in] Specifies a nonzero timer event ID. Indicates which timer generated the event, allowing the application to use a single callback function for multiple timers.pUserContext [in] Pointer to a user-defined value which is passed to the callback function. Typically used by an application to pass a pointer to a data structure that provides context information for the callback function. The default value
is NULL
Return Values
No return value.Remarks
DXUT will call this function at the start of the frame, before calling LPDXUTCALLBACKFRAMEMOVE or LPDXUTCALLBACKD3D10FRAMERENDER.DXUTKillTimer
Uninstalls an existing timer.HRESULT DXUTKillTimer( UINT nIDEvent ) ;
Parameters
nIDEvent [in] The event ID for the timer being destroyed. This ID is provided to the application by the DXUTSetTimer method.Return Values
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
Timers created with DXUTSetTimer can be destroyed withDXUTKillTimer .
相关文章推荐
- DirectX框架解析10 (管理DXUT框架的函数 和 管理DXUT框架的函数)
- DXUT11框架浅析(5)--基础函数
- DXUT11框架浅析(6)--功能函数
- DXUT框架剖析(11)
- DXUT11框架浅析(4)--调试相关
- 【转贴】DXUT 框架函数介绍
- Hieroglyph3(基于DirectX 11的开源渲染引擎) 框架分析
- Android通用网络请求解析框架.11(总结)
- DXUT框架剖析(11)
- Directx9.0 学习教程2 - 使用DXUT框架
- DXUT框架剖析(11)
- 【ci框架】源码解读:URI.php中_fetch_uri_string()函数的解析
- DXUT框架剖析(11)
- DXUT 框架函数介绍 学习开发游戏UI
- 【转贴】DXUT 框架函数介绍
- DXUT 框架函数介绍 学习开发游戏UI
- 【转贴】DXUT 框架函数介绍
- Introduction to 3D Game Programming with DirectX 11学习笔记 4.4 演示程序框架
- NS2中Mac802_11::recv(Packet *p, Handler *h )函数解析
- DirectX框架解析9(管理窗口的DXUT函数 和 管理设备的DXUT函数)