Minimizing with created images

BlitzPlus Forums/BlitzPlus Programming/Minimizing with created images

fallegon(Posted 2013) [#1]
After minimizing and re opening my app the images I made through the code seem to get confused with other images and display something random.


Yasha(Posted 2013) [#2]
I think this is an outstanding "bug" in BlitzPlus, because there's a function to fix this very problem that was added in an update to Blitz3D (BufferDirty), that doesn't seem to be available in the BlitzPlus version of the 2D engine.

It might be possible to implement the same functionality by hand, using Windows API calls, but I for one couldn't tell you how.


What you could do, as an interim, is use WindowMinimized and WindowMaximized to determine when the minimization events happen; keep a list of your dynamically modified images, with a bank containing a backup copy of the image data associated with each one (update the bank after the image is changed); and then on detecting maximization events rebuild the data in each image from the cached version. Not a great method but it should at least work.


fallegon(Posted 2013) [#3]
ok yeah that should work. I thougtht I had fixed it by puting in a function that would basicly re create the images every 10th frame. So while watching netflix and leaving my main menu screen open the availvidmem went througth the roof and the program became un responsive. I played around with reseting the images while watching my availvidmem and if I only reset the images after the player presses the resume button in a the pause menu its seems to stabalize. Problem being that until then the images are messed up till he clicked resume.(looks tacky) So then my next question would be is how to tell when the app is miminized and I think you already answered it. :)


Kryzon(Posted 2013) [#4]
These may help:

http://www.blitzbasic.com/Community/posts.php?topic=100880#1194964
http://msdn.microsoft.com/en-us/library/windows/desktop/ms633527(v=vs.85).aspx