Page 1 of 1
Image vanishes on its own accord
Posted: Sun Sep 22, 2013 5:31 am
by xXxMoNkEyMaNxXx
This is an ongoing problem in many of my projects. I go to test something, the test looks good, I leave it running. Poof! Whatever was there is no more and it's a black, empty window of sadness.
Example:
download/file.php?id=7239
(From
viewtopic.php?f=5&t=29865)
It's a problem with what I'm currently working on too, but it's more severe. I have no idea why this happens. Please ask for more if you need it.
Re: Image vanishes on its own accord
Posted: Sun Sep 22, 2013 6:25 am
by Boolsheet
This is an issue in LÖVE. You have to keep a reference to the Image around or the garbage collector will collect it and the shader is sad that his image disappeared.
For example the line where you load the image. If you mark the sky variable as a local, then Lua doesn't need it anymore once main.lua is loaded and throws it away. Try making the sky variable a global so it will keep the reference.
Code: Select all
sky=love.graphics.newImage'Skymap.png'
Re: Image vanishes on its own accord
Posted: Sun Sep 22, 2013 6:56 am
by xXxMoNkEyMaNxXx
Thank you grandly. One of my attempts to fix this was to call the garbage collector xD
My project is a perfect image offset rotate + scale -- colouring the pixels using a weighted average the based on the area of intersection with the pixel being rendered. It is totally over the top, a.k.a. my style. However, I'm hoping that it will be stunning when I finish it, because I've had the idea for quite some time.