vista graphics/images lost

BlitzMax Forums/BlitzMax Beginners Area/vista graphics/images lost

Warner(Posted 2009) [#1]
In a certain situation all loaded images dissapear. I'll try to describe it.

Since a while I'm using Vista Home Basic.
When I perform any Windows operation that requires permission, the desktop fades a bit, and the permission dialog appears. I click allow and the screen turns back to normal. A similair thing happens when starting the task manager.

If I have my windowed BMax program running under such circumstances, the screen turns black. The majority of the images seem to have dissapeared.

It happens for example on this program:


Is there anyone with the same problem, or does anybody know how to deal with it ?


Otus(Posted 2009) [#2]
Works fine here, both after a permission request and after starting task manager.

You could try if it happens with both OpenGL and Direct3D.

OpenGL:


D3D:



Warner(Posted 2009) [#3]
In both cases the problem appears. I seem to be able to restore the images locking and unlocking them with LockImage/UnlockImage.

However, I should still need to find a way to detect this graphicslost.
I tried testing if the TImage = null or TGraphics = null, but they remain valid.

Sometimes, only the lower half of the image dissapears. Then, when trying it again, the rest of the image dissapears as well.
Beside the images, the DrawText command doesn't work either after this. I'm not loading/setting any fonts.
And at one point, I got an unhandled memory exception on "Flip".

Isn't there a GraphicsLost() function ?


Warner(Posted 2009) [#4]
Okay, after reading on various other topics, I think I understand now.
Adding these lines to the main loop seem to do the trick:
	If AppSuspended()
		While AppSuspended()
			Delay 250    'wait till app returns
		Wend
		Graphics 800, 600    'graphics cmd. reloads all images
	End If