FBO with GLCanvas
Posted by Bob on Nov 27, 2019; 11:55am
URL: https://forum.jogamp.org/FBO-with-GLCanvas-tp4040147.html
Hello,
I am currently facing two problems using AWT GLCanvas and FBO:
- when I bind a FBO and call display on the GLCanvas, drawings are done in the FBO. But GLCanvas swaps buffers (GLDrawableImpl.swapBuffers) leading to a change in the screen: the old back buffer is put in front.
- when I try to take a screenshot with AWTGLReadBufferUtil.readPixelsToBufferedImage, the read buffer is changed to the default read buffer of the default framebuffer, not the currently bound FBO. This is done in GLReadBufferUtil.readPixelsImpl (l.227): gl2es3.glReadBuffer(gl2es3.getDefaultReadBuffer());. There is an error (visible with DebugGL) because the read buffer should be GL_COLOR_ATTACHMENT0.
The goal is to take a screenshot of the screen with some customisation:
1. bind a FBO
2. perform screenshot specific customisation
3. perform default drawings
4. take screenshot
5. bind default framebuffer
I am using jogamp 2.3.2 on Windows with an Intel HD Graphics.
Is there something I do wrong ?
Thanks