diff options
author | Kenneth Russel <[email protected]> | 2006-02-13 20:31:01 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2006-02-13 20:31:01 +0000 |
commit | 5dee49ac7ee9869b17406430272ac0fc642f1179 (patch) | |
tree | 93addf6657e800a987bded16f25ec55ab2ea49bd /src/classes/javax/media/opengl/GLJPanel.java | |
parent | 33c8d8f296705d370a3ee33e3489f34ed44afa7f (diff) |
Added workaround for apparent driver problem when FBOs are enabled in
the Java2D/JOGL bridge apparently causing exhaustion of VRAM
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@607 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/javax/media/opengl/GLJPanel.java')
-rw-r--r-- | src/classes/javax/media/opengl/GLJPanel.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/classes/javax/media/opengl/GLJPanel.java b/src/classes/javax/media/opengl/GLJPanel.java index 65d47e65d..dbc5e432a 100644 --- a/src/classes/javax/media/opengl/GLJPanel.java +++ b/src/classes/javax/media/opengl/GLJPanel.java @@ -392,6 +392,17 @@ public class GLJPanel extends JPanel implements GLAutoDrawable { return true; } + private void postGL(Graphics g) { + if (Java2D.isFBOEnabled() && + Java2D.getOGLSurfaceType(g) == Java2D.FBOBJECT) { + // Unbind the framebuffer from our context to work around + // apparent driver bugs or at least unspecified behavior causing + // OpenGL to run out of memory with certain cards and drivers + GL gl = joglContext.getGL(); + gl.glBindFramebufferEXT(GL.GL_FRAMEBUFFER_EXT, 0); + } + } + /** Overridden to cause OpenGL rendering to be performed during repaint cycles. Subclasses which override this method must call super.paintComponent() in their paintComponent() method in order @@ -865,6 +876,9 @@ public class GLJPanel extends JPanel implements GLAutoDrawable { } } drawableHelper.init(GLJPanel.this); + if (oglPipelineEnabled) { + postGL(g); + } } public void display(GLAutoDrawable drawable) { @@ -1018,6 +1032,8 @@ public class GLJPanel extends JPanel implements GLAutoDrawable { // rendering results, resulting in apparent mouse lag GL gl = getGL(); gl.glFinish(); + + postGL(g); } } |