In case some of you missed it, whilst I was working on the last fix for font and scrolling glitches / testing, I announced that I had an idea for fixing the DX9 engine that cleared the display if you switched from window to full screen or full screen to window, or resize window, lose focus, etc.... I worked yesterday on a demo along with a custom made script that I coded to demonstrate the fix that solved the problem of the display not being reset and lost under the conditions mentioned above.
I was going to share this script and demo here but decided to check with Robert first just to be on the safe side and get his constructive feedback on what I had done, even though on my end it was working great. I wanted to know if there were maybe an alternative.
So basically to make a long story short, he acknowledged it was a good fix (in practice) and that I had found the problem, and basically came inside his trousers
So anyhow, to my surprise, he got back to me, saying that a light bulb went off inside his head, and managed to replace several lines of code I had written to a 5 byte fix LOL all this long DX9 was messed up over what was a 5 byte fix....... So anyhow, Robert (who initially did not believe me and thought I was lying !!!) decided to include this fix with some other general fixes that are not yet merged,
basically the depth buffer (ZENABLE) was set to true, and that is what was causing the display to vanish in thin air never to come back. I had made a script to automatically detect the conditions that causes display to clear and restore it.
But thanks to Robert now, my script won't be needed, so it's pointless to upload it. But since he wants to include this fix with other general fixes, I thought I'd share the display reset part of the fix since it is final and functional.
Until the general fixes get merged, here is the raw file (DX9screen.cpp) just copy that over your existing one, you will now be able to use DX9 and this will fix display reset issues - fully tested and works. (for lost devices / reset issues on surfaces, etc) you will have to wait for future fixes he is working on because I have never used surfaces and mangled with that aspect yet.
** UPDATE: These fixes are now merged, make sure you have the recent version.