0

How do I perform a runtime fullscreen/ and window mode swap s

  1. UnregisterClass
  2. Free all the directX device
  3. Re- initlize all the wc class format
  4. Re- initlize all the direct stuff

However, there is two problem to it.

  1. I managed to create a new window but the old window is closed or deleted.
  2. The client of the new Window is black. Which mean that the direct didnt link to new client.

2nd)

4

1 回答 1

2

不,您无需创建新窗口,只需使用旧窗口即可。基本上你可以用新的表示参数调用 IDirect3DDevice9::Reset 。进入全屏模式时,需要做以下事情。

  1. 设置 D3DPRESENT_PARAMETERS.Windowed = true
  2. 调整后备缓冲区大小(我们总是将后备缓冲区大小设置为渲染窗口大小)
  3. 使用新的纵横比更新投影矩阵(后缓冲区宽度/后缓冲区高度)
  4. 释放与设备关联的任何显式渲染目标、深度模板表面、附加交换链、状态块和 D3DPOOL_DEFAULT 资源。
  5. 调用 IDirect3DDevice9::Reset() 进入全屏模式。

请注意,当您的应用程序进入全屏模式时,它将挂起所有应用程序,包括开发环境(如 Visual Studio)。所以你最好换个显示器做全屏调试。

于 2013-09-01T01:14:17.593 回答