Hi Mark,
I've created surface restoration hack, that restores textures after logout without reloading graphics manualy.
But it need to be implemented into Blitz3D because there is still some textures that are not restored(that loaded into video memory with 256 flag).
Problem of blitz programs - that they stops execution of code if window lost focus. Game need set internal timers to pause, set all sounds to silent and so on...
So, I suggest to make few functions that will be called by blitz:
PauseGame() - will be called when window loses focus
ResumeGame() - will be called when window recieves focus
EndGame() - will be called when window closes, so user can unload all his stuff. And of course user can call this functions by himself if needed.
In my DLL that we have made with Platon this functions are finded in memory by DLL function and that called from DLL( written in PureBasic) when window lost/recieve focus and closes.
It works fine for handling usual focus lost, like Alt+Tab, Ctrl+Shift+Esc etc. But when user LogOut and than LogingIn ResumeGame function calls during RenderWorld command execution. And something crashes in it.
On small example it crashes VERY rarely. You can logout/login hundred times before it will crash. But on huge game it crases very often. It can crash at first time, or second. Sometimes from 5-th. I don't know why. Maybe in my game RenderWold rendering very big amounts of different textures complex meshes etc while in example there is only few cubes with texture...
Here is dlls and test code: http://www.arthurostapenko.com/other/blitzbugfixes/BSys2.rar
2 All Please test this on you games.
I've commented code, so I think it will be easy to integrate into any game.
Test for Win+L, Ctrl+Alt+Del, Ctrl+Alt+Esc, Alt+Tab. Launch game and change desktop resolution(there is still manual restoration here:( ), Launch programm and wait for screensaver(usual blitz game crashes after launching directX screensaver)- screensaver must not be launched while game window is active, but it launches if game is minimized :(
There is also small bug in blitz games- When game starts in fullscreen and than changed to windowed HWND_TOPMOST(I think) flag not cleared, so game in windowed mode is alway on top of other applications.
(When game launched in window mode than it is not "always on top".)
Also all other casual frameworks has fast fullscreen<->windowed mode change, without reloading all graphics.
It need to be integrated into Blitz3D also.
I've created surface restoration hack, that restores textures after logout without reloading graphics manualy.
But it need to be implemented into Blitz3D because there is still some textures that are not restored(that loaded into video memory with 256 flag).
Problem of blitz programs - that they stops execution of code if window lost focus. Game need set internal timers to pause, set all sounds to silent and so on...
So, I suggest to make few functions that will be called by blitz:
PauseGame() - will be called when window loses focus
ResumeGame() - will be called when window recieves focus
EndGame() - will be called when window closes, so user can unload all his stuff. And of course user can call this functions by himself if needed.
In my DLL that we have made with Platon this functions are finded in memory by DLL function and that called from DLL( written in PureBasic) when window lost/recieve focus and closes.
It works fine for handling usual focus lost, like Alt+Tab, Ctrl+Shift+Esc etc. But when user LogOut and than LogingIn ResumeGame function calls during RenderWorld command execution. And something crashes in it.
On small example it crashes VERY rarely. You can logout/login hundred times before it will crash. But on huge game it crases very often. It can crash at first time, or second. Sometimes from 5-th. I don't know why. Maybe in my game RenderWold rendering very big amounts of different textures complex meshes etc while in example there is only few cubes with texture...
Here is dlls and test code: http://www.arthurostapenko.com/other/blitzbugfixes/BSys2.rar
2 All Please test this on you games.
I've commented code, so I think it will be easy to integrate into any game.
Test for Win+L, Ctrl+Alt+Del, Ctrl+Alt+Esc, Alt+Tab. Launch game and change desktop resolution(there is still manual restoration here:( ), Launch programm and wait for screensaver(usual blitz game crashes after launching directX screensaver)- screensaver must not be launched while game window is active, but it launches if game is minimized :(
There is also small bug in blitz games- When game starts in fullscreen and than changed to windowed HWND_TOPMOST(I think) flag not cleared, so game in windowed mode is alway on top of other applications.
(When game launched in window mode than it is not "always on top".)
Also all other casual frameworks has fast fullscreen<->windowed mode change, without reloading all graphics.
It need to be integrated into Blitz3D also.