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.

转载于:https://my.oschina.net/riseworlds/blog/695410

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值