I have my scene, drawn on a GLCanvas. I want to, sometimes, take the scene I’m rendering, and ALSO draw it to a BufferedImage so that I can take each frame and build a movie clip out of it. My question is, what’s the best way to get a BufferedImage containing the current scene?
I poked around in GLJPanel, and found it has a BufferedImage backbuffer, but I found no way to get at it. My only idea so far is to create an additional GLJPanel, and call paint() on it using the Graphics object from a BufferedImage I create. Then draw the resulting BufferedImage onto the screen through my GLCanvas (however that isn’t gonna be too easy since I don’t have any texture code currently).
Is this close to how I should be doing this? Is there a better way that would allow me to render to a BufferedImage and not take forever? Ideally, I could just use GLJPanel, and call getBackBuffer() or something, play with the BufferedImage it uses assuming it contains an image of the current scene, and then continue on to the next frame. Is this possible? If so I haven’t found a way.