DXUT框架剖析(10)
2016-06-20 00:00
337 查看
管理DXUT框架的函数
函数
描述
DXUTResetFrameworkState
将框架状态重置为初始默认状态,之前设置的框架状态改变将失效。
DXUTShutdown
触发程序终止和清空框架
DXUTGetExitCode
获取框架的退出代码
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.
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.
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:
检索Direct3D变量的函数
函数
描述
DXUTGetD3DObject
获取一个指向IDirect3D9对象的指针
DXUTGetD3D9Device
获取一个指向代表当前设备的IDirect3DDevice9接口指针
DXUTGetDeviceSettings
获取用来创建当前设备的结构体DXUTDeviceSettings
DXUTGetPresentParameters
获取当前设备的提交(presentation)参数
DXUTGetD3D9BackBufferSurfaceDesc
获取一个指向当前设备后台缓冲区表面的D3DSURFACE_DESC结构体的指针
DXUTGetD3D9DeviceCaps
获取一个指向当前设备的D3DCAPS9结构体的指针
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.
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.
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.
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.
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.
函数
描述
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.exe echo %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.
相关文章推荐
- 安全幻想曲2008
- Nebula3的Input系统
- 验证微软数字签名
- Lua第三方插件列表
- 失眠的调养
- C++批判(5)
- C# 关闭显示器的函数
- VS2005 SP1安装注意事项
- 关于部分Vista驱动丢失的解决办法
- IOCP中的socket错误和资源释放处理方法
- TinyXML应用例子
- Direct3D中的绘制(5)
- Linux销售代表的“抗议” [转]
- 深度解析VC中的消息传递机制(上)
- 【转贴】DXUT编程指南(四):通过DXUT使用设备
- FVF的D3DFVF_XYZ和D3DFVF_XYZRHW的区别
- 项目经理成长日记(3)——给自己的定位
- IrfanView 4.36 中文版发布了
- Windows任务管理器不显示用户名的解决方法
- D3D中的纹理映射(1)