Hi, I tried all day yesterday to compile Love so I could add this one function, but I have bad luck with other people's code. I just need to bypass having to store ImageData in Lua and go straight to the pointer, and I was wondering if someone who already knows how to compile Love could do it for me real quick. This code might be incorrect, I don't know how the Lua interface works, but something like this. I'm hoping it's not a big deal, and I would be thankful to have it
Canvas:getImageData basically takes a screenshot of the canvas and stores the screenshot in a new ImageData - the new ImageData needs to be stored somewhere that will properly deallocate the data when it's no longer referenced anywhere (normally Lua will take care of that for you.)
If the new ImageData is created (via canvas->getImageData) without making sure it will eventually be cleaned up properly, then you'll have a memory leak.
Additionally, if the pointer to the ImageData's memory is accessed after the ImageData is deallocated, bad / unexpected things will happen.