I'm making a Direct3D app, and I can easily go from Windowed to Fullscreen mode using IDirect3DDevice9::Reset
with new presentation parameters. However, when I use the same trick to go from fullscreen to windowed mode, the window has now lost its borders.
If I try doing SetWindowLong
to set the window style to WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU
(and then SetWindowPos
with SWP_FRAMECHANGED
), the window now gets its border, but the direct3d device no longer works. Resetting the device again doesn't work, and instead of Reset(),
doing Release()
then SetWindowLong()
then CreateDevice()
again, of course fails, as my managed resources are dependent on my device.
How do I make IDirect3DDevice9::Reset
to go back to windowed mode, while creating a bordered window?