AWTGLReadBufferUtil unwanted remnants of dialogs
Posted by Nico Vink on
URL: https://forum.jogamp.org/AWTGLReadBufferUtil-unwanted-remnants-of-dialogs-tp4032495.html
I'm using JOGL 2.1.5-01 in a Swing application. The rendering looks fine in a GLCanvas, and now I'm trying to get the rendering into an image for printing / saving.
I'm using the following code:
BufferedImage img = new AWTGLReadBufferUtil(gl3.getGLProfile(), false).readPixelsToBufferedImage(gl3.getGL(), true);
The resulting image includes my rendering, but in the background I'm getting transparent dialogs from my application. Interestingly, I never actually opened these dialogs, but somehow they are in the buffer when I read the image.
This is how I clear my canvas at the start of display:
gl3.glViewport(0, 0, width, height);
gl3.glClearBufferfv(GL3.GL_COLOR, 0, rgba, 0);
gl3.glClearBufferfv(GL3.GL_DEPTH, 0, ONE);
Note that rgba is an opaque white.
I'm guessing I should do something to select the proper buffer to render to / read from, but I can't find anything about it (and am not exactly sure what I'm looking for).