Page 1 of 1

toggleFullscreen

Posted: Wed Jun 26, 2013 2:47 pm
by cgrossi
Hello.

In my game I have two canvases for the background, but when I change to full screen mode or return to window mode, those canvases aren't displayed anymore.. What can be happening?

Re: toggleFullscreen

Posted: Wed Jun 26, 2013 3:00 pm
by raidho36
Canvases are still displayed, it's just they're empty since they get flushed on display mode change. This is system-realated and it's documented behavior. You must simply generate your canvaes picture again. If you can't really do it, you're pretty limited to dumping them to hdd/ram before mode change and reading them back once mode is changed.

Canvases were re-allocated to be empty just by pure luck. If you had a lot of data left in your VRAM after big heavy games' previous launches then you could've had canvases full of garbage (and you probably could see some pieces of that games' textures in them).

Re: toggleFullscreen

Posted: Wed Jun 26, 2013 6:38 pm
by Automatik
Canvases were re-allocated to be empty just by pure luck. If you had a lot of data left in your VRAM after big heavy games' previous launches then you could've had canvases full of garbage (and you probably could see some pieces of that games' textures in them).
Slime told me on IRC that it's false: "it would be [true], if LÖVE didn't fill the canvas with transparency when it loads it"

Re: toggleFullscreen

Posted: Wed Jun 26, 2013 6:49 pm
by raidho36
Huh. This isn't generic behavior, but okay.