本文版权归博客园 lovedday 所有,转载请详细标明原创作者及原文出处,以示尊重!

原创作者: lovedday 

原文出处:DXUT框架剖析(10)

管理DXUT框架的函数

函数 描述
DXUTResetFrameworkState 将框架状态重置为初始默认状态,之前设置的框架状态改变将失效。
DXUTShutdown 触发程序终止和清空框架
DXUTGetExitCode 获取框架的退出代码

DXUTResetFrameworkState

Resets DXUT state to its initial default state. All previous DXUT state changes are lost.

 VOID DXUTResetFrameworkState() ;

Parameters

None.

Return Values

No return value.

Remarks

This function does not normally need to be called. It is useful for testing purposes because the application process does not have to be restarted to reset DXUT back to its initial state.

DXUTShutdown

Triggers program termination and DXUT cleanup.

 VOID DXUTShutdown(    int   nExitCode  ) ;

Parameters

nExitCode
[in] The exit code returned via the DXUTGetExitCode function. The default value is 0

Return Values

No return value.

Remarks

It is not necessary for the application to call this function, since the application lifespan is handled by DXUT. However, the application can call this function to cleanly terminate the application process.

DXUTGetExitCode

Get DXUT exit code.

 INT DXUTGetExitCode() ;

Parameters

None.

Return Values

A DXUT exit code, which will be one of the following possible values.

Value Description
0 Successful execution.
1 An undetermined error occurred.
2 No Direct3D device could be found with the specified device settings.
3 A media file could not be found.
4 The Direct3D device has a non-zero reference count, meaning that some objects were not released.
5 An error occurred when attempting to create an Direct3D device.
6 An error occurred when attempting to reset an Direct3D device.
7 An error occurred in the device creation callback function.
8 An error occurred in the device creation callback function.
9 The incorrect version of Direct3D or D3DX is installed.
10 The last device used upon exit was a REF device type.
11 The device was removed.

Remarks

The return value of this function is typically used in the application as the return code of the application's WinMain function. Command-line tests can then be performed on applications using this return code.

The following is an example of command-line usage that uses DXUT exit code:

start /wait BasicHLSL.exeecho %errorlevel%

检索Direct3D变量的函数

函数 描述
DXUTGetD3DObject 获取一个指向IDirect3D9对象的指针
DXUTGetD3D9Device 获取一个指向代表当前设备的IDirect3DDevice9接口指针
DXUTGetDeviceSettings 获取用来创建当前设备的结构体DXUTDeviceSettings
DXUTGetPresentParameters 获取当前设备的提交(presentation)参数
DXUTGetD3D9BackBufferSurfaceDesc 获取一个指向当前设备后台缓冲区表面的D3DSURFACE_DESC结构体的指针
DXUTGetD3D9DeviceCaps 获取一个指向当前设备的D3DCAPS9结构体的指针

DXUTGetD3DObject

Get a pointer to the IDirect3D9 object.

 IDirect3D9 * DXUTGetD3DObject() ;

Parameters

None.

Return Values

Pointer to the IDirect3D9 object. NULL is returned if no IDirect3D9 object has been created. See Remarks.

Remarks

This function exposes access to a global IDirect3D9 object. The reference count on this object interface is not incremented, so a calling function should not release the IDirect3D9 interface pointer returned by this function.

DXUTGetDeviceSettings

Get the DXUTDeviceSettings structure used to create the current device.

 DXUTDeviceSettings DXUTGetDeviceSettings() ;

Parameters

None.

Return Values

DXUTDeviceSettings structure used to create the current device.

Remarks

This settings structure can describe either a Direct3D 9 device or a Direct3D 10 device as defined the structure's DXUTDeviceVersion member.

If no device exists, then the DXUTDeviceSettings structure is filled with zeros.

DXUTGetPresentParameters

Get the presentation parameters of the Direct3D 9 device.

 D3DPRESENT_PARAMETERS DXUTGetPresentParameters() ;

Parameters

None.

Return Values

The presentation parameters of the Direct3D 9 device.

Remarks

If no Direct3D 9 device exists, then the D3DPRESENT_PARAMETERS structure is filled with zeros.

DXUTGetD3D9BackBufferSurfaceDesc

Get a pointer to a D3DSURFACE_DESC surface description of the current Direct3D 9 back buffer.

 CONST D3DSURFACE_DESC * DXUTGetD3D9BackBufferSurfaceDesc() ;

Parameters

None.

Return Values

Pointer to a D3DSURFACE_DESC surface description of the current Direct3D 9 back buffer.

Remarks

If no Direct3D 9 device exists, then the D3DSURFACE_DESC structure is filled with zeros.

DXUTGetD3D9DeviceCaps

Get a pointer to the D3DCAPS9 capabilities of the current device.

 CONST D3DCAPS9 * DXUTGetD3D9DeviceCaps() ;

Parameters

None.

Return Values

Pointer to the D3DCAPS9 capabilities of the Direct3D 9 device.

Remarks

If no Direct3D 9 device exists, then the D3DCAPS9 structure is filled with zeros.

DXUT框架剖析(10)相关推荐

  1. DXUT框架剖析系列文章(原创:天行健 君子当自强而不息)

    本文版权归博客园 lovedday 所有,转载请详细标明原创作者及原文出处,以示尊重! 原创作者: lovedday  原创博客:天行健 君子当自强而不息 原文出处:DXUT框架剖析 DXUT框架剖析 ...

  2. DXUT框架剖析(14)

    本文版权归博客园 lovedday 所有,转载请详细标明原创作者及原文出处,以示尊重! 原创作者: lovedday  原文出处:DXUT框架剖析(14) 控件是用户接口的重要组成部分,为了便于用户操 ...

  3. DXUT框架剖析(13)

    本文版权归博客园 lovedday 所有,转载请详细标明原创作者及原文出处,以示尊重! 原创作者: lovedday  原文出处:DXUT框架剖析(13) 添加文本 DXUT框架对文本绘制进行了封装, ...

  4. DXUT框架剖析(9)

    本文版权归博客园 lovedday 所有,转载请详细标明原创作者及原文出处,以示尊重! 原创作者: lovedday  原文出处:DXUT框架剖析(9) 下面列出允许改变DXUT行为和获取内部变量的函 ...

  5. DXUT框架剖析(8)

    本文版权归博客园 lovedday 所有,转载请详细标明原创作者及原文出处,以示尊重! 原创作者: lovedday  原文出处:DXUT框架剖析(8) DXUT框架与错误处理 Direct3D AP ...

  6. DXUT框架剖析(7)

    本文版权归博客园 lovedday 所有,转载请详细标明原创作者及原文出处,以示尊重! 原创作者: lovedday  原文出处:DXUT框架剖析(7) (2)帧事件 框架也提供了帧事件,它在渲染过程 ...

  7. DXUT框架剖析(5)

    本文版权归博客园 lovedday 所有,转载请详细标明原创作者及原文出处,以示尊重! 原创作者: lovedday  原文出处:DXUT框架剖析(5) 修改可用的设备 应用程序可以通过DXUTSet ...

  8. DXUT框架剖析(4)

    本文版权归博客园 lovedday 所有,转载请详细标明原创作者及原文出处,以示尊重! 原创作者: lovedday  原文出处:DXUT框架剖析(4) 创建一个设备 通常可以用标准的Direct3D ...

  9. DXUT框架剖析(3)

    本文版权归博客园 lovedday所有,转载请详细标明原创作者及原文出处,以示尊重! 原创作者:lovedday 原文出处:DXUT框架剖析(3) 初始化DXUT 使用DXUT框架之前,首先需要初始化 ...

最新文章

  1. 尚硅谷学习:createElement 方法笔记
  2. 首款脑机接口耳机来了!预售1300元,可监测注意力,「意念」切歌、接电话
  3. Raspberry Pi 软件源
  4. [系统安全] 三十一.恶意代码检测(1)恶意代码攻击溯源及恶意样本分析
  5. 云端的ABAP Restful服务开发
  6. office教程:教你Excel 怎么样使用信息函数
  7. 梅宏院士:步入软件定义的时代
  8. Windows Server 2008 R2/2012 网络负载平衡NLB相关内容
  9. 设计素材模板|艺术感中国风海报
  10. java根据周数获取日期_java获取日期的周数和所属年份
  11. 企业数据分析流程与高级分析模型
  12. VS2010快捷键大全
  13. Oracle索引的原理及使用
  14. 除了赚钱,腾讯游戏还有诗和远方!
  15. 转载:TD之父李世鹤:TD即将安乐死
  16. 用批处理的方式压缩文件
  17. GCC 中的 aligned 和 packed 属性(关于地址对齐)
  18. 创造与魔法维护服务器奖励,创造与魔法5月最新兑换码大全 创造与魔法礼包码2021及使用方法一览...
  19. windows服务器443端口被占用---云锁
  20. coursera android,Coursera

热门文章

  1. 实验2-1-3 计算物体自由下落的距离 (5 分)
  2. js保存网络图片至本地
  3. 一般试卷的纸张大小是多少_档案产品库纸张整理专家
  4. layuit 框架_Layui|经典模块化前端框架
  5. 海绵城市工程_打造透水“民心路”、共创海绵“生态城”|市政工程管理处持续推进城市道路“黑臭水体改造”工程...
  6. 修改10g自动统计信息收集作业GATHER_STATS_JOB到仅仅周末执行
  7. matplotlib——折线图
  8. 修改android的wifi客户端名称的两种方法
  9. 预算执行审计计算机审计方法,预算执行审计中计算机审计思路和SQL语句运用.doc...
  10. 注册表删除chrome插件