Re: FBO with GLCanvas
Posted by Bob on Nov 28, 2019; 11:47am
URL: https://forum.jogamp.org/FBO-with-GLCanvas-tp4040147p4040150.html
Hello Julien,
Thank you for this quick answer.
I added setAutoSwapBufferMode(false) and setAutoSwapBufferMode(true) between calling display() to draw the screenshot.
This solved my first problem.
Do you have an idea for the second problem ?
I currently see two options:
- do not take into account the error. glReadBuffer ends with an error because getDefaultReadBuffer() is GL_BACK but when a FBO is bound, only GL_COLOR_ATTACHMENTi is allowed. However at this point, glGet(GL_READ_BUFFER) is GL_COLOR_ATTACHMENT0 so the following glReadPixels reads the correct buffer.
It is not really clean but this works.
- do not use AWTGLReadBufferUtil to create the BufferedImage. But I will have to copy most of the code to change only the line with glReadBuffer.
Thanks again