文档章节

DXUT框架剖析(11)

rise-worlds
 rise-worlds
发布于 2016/06/20 13:42
字数 945
阅读 0
收藏 0

DXUT统计函数

函数
描述

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 the 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计时器函数

函数
描述

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 with DXUTKillTimer .

本文转载自:http://www.cnblogs.com/flying_bat/archive/2008/05/17/1201327.html

rise-worlds

rise-worlds

粉丝 3
博文 1755
码字总数 0
作品 0
深圳
程序员
私信 提问
如何使用DXUT框架

DXUT是什么? DXUT即DirectX Utility Library,它是微软为DirectX Samples写的一个框架,有了这个框架,Sample的构建就方便多了,这个框架实际上抽取了构建Sample的公共代码,比如处理窗口消...

吞吞吐吐的
2017/10/12
0
0
《Artech的WCF技术剖析系列》系列技术文章整理收藏

《Artech的WCF技术剖析系列》系列技术文章整理收藏 WCF技术剖析系列来自博客园的Artech,Artech在这个系列中帮助大家对WCF有更全面的认识。收藏在这里供大家学习参考 1WCF技术剖析之一:通过...

开元中国2015
2015/06/22
24
0
libevent源码深度剖析

作者:http://blog.csdn.net/sparkliang/article/category/660506 libevent源码深度剖析十三——libevent信号处理注意点 libevent源码深度剖析十三——libevent信号处理注意点前面讲到了lib...

晨曦之光
2012/03/09
2.8K
0
DirectX11--HR宏关于dxerr库的替代方案

DirectX11 With Windows SDK完整目录 欢迎加入QQ群: 727623616 可以一起探讨DX11,以及有什么问题也可以在这里汇报。 综述 参考文章:https://blogs.msdn.microsoft.com/chuckw/2012/04/24/...

X_Jun
2018/12/24
0
0
DXUT

DXUT 是一个建立在 Direct3D 之上的一个层,简化 了 Windows 和 Direct3D 的 API。它能帮助开发者建立一个更健壮、更易于生成的示例,原型,工具或游戏,...

大胖森
2015/04/30
724
0

没有更多内容

加载失败,请刷新页面

加载更多

OSChina 周六乱弹 —— 如果是个帅小伙你愿意和他出去吗

Osc乱弹歌单(2019)请戳(这里) 【今日歌曲】 小小编辑推荐:《Ghost 》游戏《死亡搁浅》原声 《Ghost 》游戏(《死亡搁浅》原声) - Au/Ra / Alan Walker 手机党少年们想听歌,请使劲儿戳...

小小编辑
今天
195
7
java通过ServerSocket与Socket实现通信

首先说一下ServerSocket与Socket. 1.ServerSocket ServerSocket是用来监听客户端Socket连接的类,如果没有连接会一直处于等待状态. ServetSocket有三个构造方法: (1) ServerSocket(int port);...

Blueeeeeee
今天
6
0
用 Sphinx 搭建博客时,如何自定义插件?

之前有不少同学看过我的个人博客(http://python-online.cn),也根据我写的教程完成了自己个人站点的搭建。 点此:使用 Python 30分钟 教你快速搭建一个博客 为防有的同学不清楚 Sphinx ,这...

王炳明
昨天
5
0
黑客之道-40本书籍助你快速入门黑客技术免费下载

场景 黑客是一个中文词语,皆源自英文hacker,随着灰鸽子的出现,灰鸽子成为了很多假借黑客名义控制他人电脑的黑客技术,于是出现了“骇客”与"黑客"分家。2012年电影频道节目中心出品的电影...

badaoliumang
昨天
16
0
很遗憾,没有一篇文章能讲清楚线程的生命周期!

(手机横屏看源码更方便) 注:java源码分析部分如无特殊说明均基于 java8 版本。 简介 大家都知道线程是有生命周期,但是彤哥可以认真负责地告诉你网上几乎没有一篇文章讲得是完全正确的。 ...

彤哥读源码
昨天
19
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部