From 4f44fc490c647a0f3f5fc8b277266649c11b3691 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Sun, 10 Apr 2005 00:34:23 +0000 Subject: Fixed Issue 148: Swing Component Shadow on GLJPanel The test case specifies alpha bits in the GLCapabilities, which caused the GLJPanel to create a TYPE_INT_ARGB BufferedImage to store the results of the readback of the frame buffer for rendering into the GLJPanel. This appears to not be the correct thing to do, because it causes this BufferedImage to be alpha-blended with whatever other rendering is performed into Java2D's backing store. Therefore when the button was redrawn, its image would show up in this backing store alpha-blended with the OpenGL rendering results since both were redrawn simultaneously. I believe the correct solution is to never create a BufferedImage with an alpha component for the framebuffer readback even if alpha bits are specified in the GLCapabilities. This is what has been implemented in the JOGL source base. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@258 232f8b59-042b-4e1e-8c03-345bb8c30851 --- src/net/java/games/jogl/GLJPanel.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/net/java') diff --git a/src/net/java/games/jogl/GLJPanel.java b/src/net/java/games/jogl/GLJPanel.java index 234908b80..229cc3446 100644 --- a/src/net/java/games/jogl/GLJPanel.java +++ b/src/net/java/games/jogl/GLJPanel.java @@ -454,11 +454,7 @@ public final class GLJPanel extends JPanel implements GLDrawable { // Should be more flexible in these BufferedImage formats; // perhaps see what the preferred image types are on the // given platform - if (offscreenCaps.getAlphaBits() > 0) { - awtFormat = BufferedImage.TYPE_INT_ARGB; - } else { - awtFormat = BufferedImage.TYPE_INT_RGB; - } + awtFormat = BufferedImage.TYPE_INT_RGB; // This seems to be a good choice on all platforms hwGLFormat = GL.GL_UNSIGNED_INT_8_8_8_8_REV; -- cgit v1.2.3