AWTGLReadBufferUtil unwanted remnants of dialogs

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

AWTGLReadBufferUtil unwanted remnants of dialogs

Nico Vink
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).
Reply | Threaded
Open this post in threaded view
|

Re: AWTGLReadBufferUtil unwanted remnants of dialogs

Wade Walker
Administrator
Nico Vink wrote
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.
I've seen this happen before -- usually it just means that the previous time you ran your app, it rendered the dialogs into video memory, and those contents are still there next time you start your app (since some drivers don't clear that memory for you).