Reload graphics after full-screen/windowed change

BlitzMax Forums/BlitzMax Programming/Reload graphics after full-screen/windowed change

Grey Alien(Posted 2006) [#1]
Hi, I was reading a rotation thread in the beginners forum and there was some discussion about not loading graphics before calling graphics due to possible corruption. Well my framework tends to set a graphics mode then load everything in. Fine, but then the use can change screen mods (windowed/full-screen) simply by pressing F and this seems totally fine too, i.e. no corruption, but I haven't tested it on a huge range of PCs (none of my customers have reported a problem either). Is this something I should worry about or is it just a red herring? I know that in BlitzPlus Dynamic images got trashed if you alt+tabbed but it doesn't seem to be an issue in BMax.

Thanks.


degac(Posted 2006) [#2]
I think there is no problem about changing resolution/fullscreen/window mode. It's different from Blitz3d (dont' ask me why, probably is due to the concept of pixmap/image in Bmax).
I've tested a little program on different computer (laptop Cybergraphics, office compute with integrated intel g82845/g/gl..., geforce6600gt, radeon 8000) and it works without problem.
PS: the only problem I have is on the laptop: sometimes after a FLIP command to draw a message in the game the the new thing added is not redrawn correctly...
It will be interesting creating a 'pool' of user with different hardware for testing purpose.


Grey Alien(Posted 2006) [#3]
OK thanks for the info. In my BMax games I redraw the entire screen before each flip instead of adding a new element without redrawing everything else and then flipping as this is safer because you can't rely on what sort and how many backbuffers the destination PC has.


Dreamora(Posted 2006) [#4]
Thats by purpose. Think it was added through SyncMods between 1.18 and 1.20 with fixes between 1.20 and 1.22.
Reason behind it seems to be: If the graphics would be lost everytime again, how would you actually work usefully with canvas? Right you wouldn't as the old data would be lost if you use SetGraphics to draw onto a different canvas and it lead to many "pseudo bugs" including reports and interesting MAVs.


tonyg(Posted 2006) [#5]
Graphics mode switch


Defoc8(Posted 2006) [#6]
So bmax automatically restores textures when the context is
recreated? thats interesting...given display formats can be
changed by other apps and events outside of your control,
this is good news..ill have a look into this later..


Grey Alien(Posted 2006) [#7]
lovely, thanks. That's what I thought anyway so the confirmation is nice.