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

原创作者: lovedday 

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

下面列出允许改变DXUT行为和获取内部变量的函数,这些函数在使用DXUT框架的Direct3D程序中是非常实用的。

管理窗口的DXUT函数

函数 描述
DXUTGetHINSTANCE 获取应用程序实例的句柄
DXUTGetHWND 获取当前设备窗口的句柄
DXUTGetHWNDFocus 获取当前获得焦点的窗口的句柄
DXUTGetHWNDDeviceFullScreen 获取全屏模式设备窗口的句柄
DXUTGetHWNDDeviceWindowed 获取窗口模式设备窗口的句柄
DXUTGetWindowClientRect 获取应用程序设备窗口的客户区矩形
DXUTGetWindowTitle 获取指向应用程序窗口标题的指针
DXUTIsWindowed 检查应用程序是否处在窗口模式下

DXUTGetHINSTANCE

Get a handle to the application instance.

HINSTANCE DXUTGetHINSTANCE();

Parameters

None.

Return Values

A handle to the application instance.

DXUTGetHWND

Get a handle to the current device window.

HWND DXUTGetHWND();

Parameters

None.

Return Values

A handle to the current device window.

DXUTGetHWNDFocus

Get the handle of the focus window.

HWND DXUTGetHWNDFocus();

Parameters

None.

Return Values

Handle to the focus window.

Remarks

The focus window informs Direct3D when the application is switched to a background window with an ALT+TAB key entry, a mouse click, or by other means. It is typically the same window as the device window.

DXUTGetHWNDDeviceFullScreen

Get the handle of the device window used when the application is fullscreen.

HWND DXUTGetHWNDDeviceFullScreen();

Parameters

None.

Return Values

Returns a handle of the device window used when the application is fullscreen.

DXUTGetHWNDDeviceWindowed

Get the handle of the device window used when the application is windowed.

HWND DXUTGetHWNDDeviceWindowed();

Parameters

None.

Return Values

Returns a handle of the device window used when the application is windowed.

DXUTGetWindowClientRect

Get the current client RECT of the application window.

CONST RECT * DXUTGetWindowClientRect();

Parameters

None.

Return Values

Returns the current client RECT of the application window.

DXUTGetWindowTitle

Get a pointer to a string containing the application window title.

LPCWSTR DXUTGetWindowTitle();

Parameters

None.

Return Values

Pointer to a string containing the application window title.

DXUTIsWindowed

Indicates whether the application is in windowed mode.

BOOL DXUTIsWindowed();

Parameters

None.

Return Values

If TRUE, the application is in windowed mode. If the application is not in windowed mode, or no device exists, then FALSE is returned.

管理设备的DXUT函数

函数 描述
DXUTSetCursorSettings 为全屏模式下光标的用法设置选项
DXUTSetMultimonSettings 为框架如何在多显示器配置中工作设置选项
DXUTToggleFullscreen 使应用程序在窗口模式和全屏模式间切换
DXUTToggleREF 使应用程序在硬件抽象层和参考设备间切换

DXUTSetCursorSettings

Sets options for cursor usage in full-screen mode.

HRESULT DXUTSetCursorSettings(  bool bShowCursorWhenFullScreen,  bool bClipCursorWhenFullScreen);

Parameters

bShowCursorWhenFullScreen
[in] Cursor visibility flag. If true, the cursor will be visible when the application is running in full-screen mode.
bClipCursorWhenFullScreen
[in] Cursor clipping flag. If true, the cursor will be restricted from exiting the screen boundaries when the application is running in full screen mode.

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.

DXUTSetMultimonSettings

Sets options for how DXUT functions on multiple monitors.

VOID DXUTSetMultimonSettings(  BOOL bAutoChangeAdapter);

Parameters

bAutoChangeAdapter
[in] If TRUE and the application window is relocated to a different monitor, DXUT will automatically change to use the new monitor's adapter, and device callback functions will be called to recreate the scene.

Return Values

No return value.

DXUTToggleFullscreen

Switches the application between windowed and full-screen modes.

HRESULT DXUTToggleFullscreen();

Parameters

None.

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 works regardless of which Direct3D API version the application is using.

Toggling between windowed and full-screen modes will result in swap chain being resized if using Direct3D 10, or the device being reset or recreated if using Direct3D 9.

DXUTToggleREF

Switches the application between HAL and reference device types.

HRESULT DXUTToggleREF();

Parameters

None.

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 works regardless of which Direct3D API version the application is using.

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

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

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

  2. DXUT框架剖析(14)

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

  3. DXUT框架剖析(13)

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

  4. DXUT框架剖析(11)

    本文版权归博客园 原创作者:  原文出处:DXUT框架剖析(11) DXUT统计函数 函数 描述 DXUTGetFPS 获取当前每秒提交的帧数 DXUTGetFrameStats 获取一个指向字符串的 ...

  5. DXUT框架剖析(10)

    本文版权归博客园 lovedday 所有,转载请详细标明原创作者及原文出处,以示尊重! 原创作者: lovedday  原文出处:DXUT框架剖析(10) 管理DXUT框架的函数 函数 描述 DXUT ...

  6. DXUT框架剖析(8)

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

  7. DXUT框架剖析(7)

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

  8. DXUT框架剖析(6)

    本文版权归博客园 lovedday 所有,转载请详细标明原创作者及原文出处,以示尊重! 原创作者: lovedday  原文出处:DXUT框架剖析(6) 在窗口和设备创建好之后,应用程序需要使用消息循 ...

  9. DXUT框架剖析(5)

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

最新文章

  1. Linux常用端口查询命令及常见端口和端口分类
  2. Java8 新特性lambda表达式(一)初始
  3. linux文件 内存映射 锁,linux – mmap:将映射文件立即加载到内存中吗?
  4. 基于应用日志的扫描器检测实践
  5. [BZOJ 5072]小A的树
  6. 主动学习(Active Learning)领域部分经典论文汇总
  7. Linux虚拟化技术KVM入门必看
  8. 一些压力测试结果(Mysql,Zookeeper,Redis,Mongodb)
  9. python给矩阵赋值_python 实现矩阵旋转
  10. 电机控制基础之坐标变换(Clark变换及反变换 + Park变换及反变换 + 推导 + 仿真)
  11. stc15单片机c语言 pdf,stc15单片机编程指南.pdf
  12. 判断43是不是质数用c语言,1是素数吗(c语言判断一个数为素数)
  13. 升华网第三次培训心得
  14. C语言程序设计笔记(浙大翁恺版) 第三周:判断
  15. Win11十二月系统更新了什么内容?
  16. C++遍历文件夹下的所有文件
  17. 如何无痕在线去水印,水印云一键去除法
  18. 计算机打字教程ppt,计算机打字基础教学.ppt
  19. JavaSE02-JVM、JRE、JDK
  20. Eclipse 中WebService简单应用:手机归属地查询

热门文章

  1. ❤️《JUC并发编程从入门到高级》(建议收藏)❤️
  2. HoloLens1开发(三):Trilib插件动态加载模型-Part1
  3. input 限制只能输入数字,且保留小数后两位
  4. PCL之直通滤波--PassThrough
  5. git 创建和修改ssh_key
  6. 组网胖模式_胖AP和瘦AP的区别,组网优缺点分析
  7. python如何使用函数_python中函数使用
  8. SpringBoot集成gRPC微服务工程搭建实践
  9. 深入剖析WebRTC事件机制之Sigslot
  10. java中map类型_Java中Map类型遍历的两种方式对比