Saving Texture Files

Part of the Hologram app is drawing something on the screen. That means dynamically modifying a texture map based on touches on the device. This is done through framebuffers which allow you to render into that texture map. I’ve got that part working. But eventually, I’d like to save out those texture maps and that’s where it’s getting a bit tricky. I’ve almost got it working through a call to glReadPixels and something like this. And then I need to convert that data into an image using CGImageCreate and CGDataProviderCreateWithData doing something like this.

The problem is that the process seems to work the first time I load a file, but not after that. I think I’m close to fixing it, though…

Comments are closed.