Hi,
Thanks a lot for your help. I really appreciate it.
I think I tried to use your code in too naive a way (shown below). I have a program that’s not a game but simply displays a mesh in a GLCanvas and responds to mouse clicks and drags. I’m looking to add code that will take a snapshot of the scene to specified resolution. So here’s my code:
public BufferedImage takeAPicture(int width, int height) {
if (myFBO == null) {
myFBO = new FrameBufferObject(width, height);
}
GL gl = myCanvas3D.getGL();
myFBO.init(myCanvas3D.getGL());
myFBO.activate(gl);
myFBO.readFrame(gl);
BufferedImage bi = myFBO.getBufferedImage();
myFBO.deactivate(gl);
return bi;
}
I think I have to tie this code into a GLEventListener, but I’m not doing that. Can you suggest a fix.
Once again, I very much appreciate your help.
Pahidla