Operating System: Windows 10
Render System: D3D9
Hey all,
It's been a while. but I've recently gotten back to working on a personal project and I'm having a bit of an issue when switching from full screen to windowed. I had a similar question before, but I've gotten little further along since then (things render now when doing the second switch )
Testing Environment:
I have one background texture (material definition included below) which covers the whole window as well as some CEGUI UI elements. My monitor resolution is set to 1920x1200
Steps:
1) Start in Windowed mode (I usually use 1680 x1050 here)
2) Switch to FullScreen at some resolution smaller than 1920x1200 (Everything looks good)
3) Switch to Windowed at 1920x1200
After running through these steps, what I see is the background texture only rendering in what would have fit in the FullScreen resolution, i.e. a small rectangle in the upper left of my screen. I've tried switching to full screen at different resolutions and the area being drawn to after the switch back to windowed always matches the fullscreen resolution.
I've traced the device reset in a debugger to see whether the dimensions in the presentation parameters are correct when the reset occurs, and they are, though I do notice that the visible area for the window immediately after the reset matches the old full screen resolution. I can get the values if you guys think it useful.
I also ran across a function called D3D9RenderWindow::_finishSwitchingFullscreen() which checks whether the application window size matches the desired resolution (which it does; nothing really changes after this call).
I have a loop on a timer printing my window size using GetWindowRect() as well as the viewport size and both have the correct resolution for the new mode.
What else can I check? What other information can I provide to help clarify the situation?
Edit: I just ran another quick test and if I switch back to Windowed mode in the same resolution and the switch again to the higher resolution, it works. So there is something about switching resolution and mode at the same time.
Here are the logs that I have for the switch:
From Windowed to FullScreen
Code: Select all
[18:07:51] Ogre: D3D9 : RenderSystem Option: Video Mode = 640 x 480 @ 32-bit colour
[18:07:52] Ogre: D3D9 device: 0x[0A958EE0] lost. Releasing D3D9 texture: _cegui_ogre_7
[18:07:52] Ogre: Released D3D9 texture: _cegui_ogre_7
[18:07:52] Ogre: D3D9 device: 0x[0A958EE0] lost. Releasing D3D9 texture: _cegui_ogre_17
[18:07:52] Ogre: Released D3D9 texture: _cegui_ogre_17
[18:07:52] Ogre: D3D9 device: 0x[0A958EE0] lost. Releasing D3D9 texture: _cegui_ogre_12
[18:07:52] Ogre: Released D3D9 texture: _cegui_ogre_12
[18:07:52] Ogre: D3D9 device: 0x[0A958EE0] lost. Releasing D3D9 texture: _cegui_ogre_32
[18:07:52] Ogre: Released D3D9 texture: _cegui_ogre_32
[18:07:52] Ogre: D3D9 device: 0x[0A958EE0] lost. Releasing D3D9 texture: _cegui_ogre_22
[18:07:52] Ogre: Released D3D9 texture: _cegui_ogre_22
[18:07:52] Ogre: D3D9 device: 0x[0A958EE0] lost. Releasing D3D9 texture: _cegui_ogre_27
[18:07:52] Ogre: Released D3D9 texture: _cegui_ogre_27
[18:07:52] Ogre: D3D9 device: 0x[0A958EE0] lost. Releasing D3D9 texture: _cegui_ogre_37
[18:07:52] Ogre: Released D3D9 texture: _cegui_ogre_37
[18:07:52] Ogre: D3D9 device: 0x[0A958EE0] lost. Releasing D3D9 texture: _cegui_ogre_52
[18:07:52] Ogre: Released D3D9 texture: _cegui_ogre_52
[18:07:52] Ogre: D3D9 device: 0x[0A958EE0] lost. Releasing D3D9 texture: _cegui_ogre_62
[18:07:52] Ogre: Released D3D9 texture: _cegui_ogre_62
[18:07:52] Ogre: D3D9 device: 0x[0A958EE0] lost. Releasing D3D9 texture: _cegui_ogre_57
[18:07:52] Ogre: Released D3D9 texture: _cegui_ogre_57
[18:07:52] Ogre: D3D9 Device 0x[0A958EE0] entered lost state
[18:07:52] Ogre: !!! Direct3D Device successfully restored.
[18:07:52] Ogre: D3D9 device: 0x[0A958EE0] was reset
[18:08:02] Ogre: D3D9 : RenderSystem Option: Video Mode = 640 x 480 @ 32-bit colour
Code: Select all
[18:37:32] Ogre: D3D9 : RenderSystem Option: Video Mode = 1920 x 1200 @ 32-bit colour
[18:08:13] Ogre: D3D9 device: 0x[0A958EE0] lost. Releasing D3D9 texture: _cegui_ogre_7
[18:08:13] Ogre: Released D3D9 texture: _cegui_ogre_7
[18:08:13] Ogre: D3D9 device: 0x[0A958EE0] lost. Releasing D3D9 texture: _cegui_ogre_17
[18:08:13] Ogre: Released D3D9 texture: _cegui_ogre_17
[18:08:13] Ogre: D3D9 device: 0x[0A958EE0] lost. Releasing D3D9 texture: _cegui_ogre_12
[18:08:13] Ogre: Released D3D9 texture: _cegui_ogre_12
[18:08:13] Ogre: D3D9 device: 0x[0A958EE0] lost. Releasing D3D9 texture: _cegui_ogre_32
[18:08:13] Ogre: Released D3D9 texture: _cegui_ogre_32
[18:08:13] Ogre: D3D9 device: 0x[0A958EE0] lost. Releasing D3D9 texture: _cegui_ogre_22
[18:08:13] Ogre: Released D3D9 texture: _cegui_ogre_22
[18:08:13] Ogre: D3D9 device: 0x[0A958EE0] lost. Releasing D3D9 texture: _cegui_ogre_27
[18:08:13] Ogre: Released D3D9 texture: _cegui_ogre_27
[18:08:13] Ogre: D3D9 device: 0x[0A958EE0] lost. Releasing D3D9 texture: _cegui_ogre_37
[18:08:13] Ogre: Released D3D9 texture: _cegui_ogre_37
[18:08:13] Ogre: D3D9 device: 0x[0A958EE0] lost. Releasing D3D9 texture: _cegui_ogre_52
[18:08:13] Ogre: Released D3D9 texture: _cegui_ogre_52
[18:08:13] Ogre: D3D9 device: 0x[0A958EE0] lost. Releasing D3D9 texture: _cegui_ogre_62
[18:08:13] Ogre: Released D3D9 texture: _cegui_ogre_62
[18:08:13] Ogre: D3D9 device: 0x[0A958EE0] lost. Releasing D3D9 texture: _cegui_ogre_57
[18:08:13] Ogre: Released D3D9 texture: _cegui_ogre_57
[18:08:13] Ogre: D3D9 Device 0x[0A958EE0] entered lost state
[18:08:13] Ogre: Warning: D3D9: disabling VSync in windowed mode can cause timing issues at lower frame rates, turn VSync on if you observe this problem.
[18:08:13] Ogre: !!! Direct3D Device successfully restored.
[18:08:13] Ogre: D3D9 device: 0x[0A958EE0] was reset
Code: Select all
material LoginStateBackground
{
technique
{
pass
{
depth_check off
depth_write off
lighting off
texture_unit
{
texture LoadScreen.png 2d 0
}
}
}
}
The Wanderer