diff options
author | Kenneth Russel <[email protected]> | 2006-06-19 20:56:54 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2006-06-19 20:56:54 +0000 |
commit | a0be832ec24145cb724a3a7a6cec72edcb4e95f9 (patch) | |
tree | 2553fb665ebe3d917b5d3a45229913eb9048aa9d /src/classes/javax/media | |
parent | f835b2a9298bce7790352b5750a47b0fead1e9c5 (diff) |
Added support to Java2D/JOGL bridge for GL_ARB_texture_rectangle
support in Java2D/OpenGL pipeline's FBO code path
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@816 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/javax/media')
-rw-r--r-- | src/classes/javax/media/opengl/GLJPanel.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/classes/javax/media/opengl/GLJPanel.java b/src/classes/javax/media/opengl/GLJPanel.java index b4b6b2c52..f98df3c5f 100644 --- a/src/classes/javax/media/opengl/GLJPanel.java +++ b/src/classes/javax/media/opengl/GLJPanel.java @@ -182,6 +182,9 @@ public class GLJPanel extends JPanel implements GLAutoDrawable { // incomplete in our context. private boolean checkedGLVendor; private boolean vendorIsATI; + // The texture target for Java2D's OpenGL pipeline when using FBOs + // -- either GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE_ARB + private int fboTextureTarget; // These are always set to (0, 0) except when the Java2D / OpenGL // pipeline is active @@ -345,9 +348,11 @@ public class GLJPanel extends JPanel implements GLAutoDrawable { System.err.println("GLJPanel: Binding to framebuffer object " + frameBuffer[0]); } + fboTextureTarget = Java2D.getOGLTextureType(g); + if (!checkedForFBObjectWorkarounds) { checkedForFBObjectWorkarounds = true; - gl.glBindTexture(GL.GL_TEXTURE_2D, 0); + gl.glBindTexture(fboTextureTarget, 0); gl.glBindFramebufferEXT(GL.GL_FRAMEBUFFER_EXT, frameBuffer[0]); if (gl.glCheckFramebufferStatusEXT(GL.GL_FRAMEBUFFER_EXT) != GL.GL_FRAMEBUFFER_COMPLETE_EXT) { @@ -374,11 +379,11 @@ public class GLJPanel extends JPanel implements GLAutoDrawable { frameBufferDepthBuffer[0] = 0; } - gl.glBindTexture(GL.GL_TEXTURE_2D, frameBufferTexture[0]); + gl.glBindTexture(fboTextureTarget, frameBufferTexture[0]); int[] width = new int[1]; int[] height = new int[1]; - gl.glGetTexLevelParameteriv(GL.GL_TEXTURE_2D, 0, GL.GL_TEXTURE_WIDTH, width, 0); - gl.glGetTexLevelParameteriv(GL.GL_TEXTURE_2D, 0, GL.GL_TEXTURE_HEIGHT, height, 0); + gl.glGetTexLevelParameteriv(fboTextureTarget, 0, GL.GL_TEXTURE_WIDTH, width, 0); + gl.glGetTexLevelParameteriv(fboTextureTarget, 0, GL.GL_TEXTURE_HEIGHT, height, 0); gl.glGenRenderbuffersEXT(1, frameBufferDepthBuffer, 0); if (DEBUG) { @@ -394,14 +399,14 @@ public class GLJPanel extends JPanel implements GLAutoDrawable { createNewDepthBuffer = false; } - gl.glBindTexture(GL.GL_TEXTURE_2D, 0); + gl.glBindTexture(fboTextureTarget, 0); gl.glBindFramebufferEXT(GL.GL_FRAMEBUFFER_EXT, frameBuffer[0]); if (fbObjectWorkarounds) { // Hook up the color and depth buffer attachment points for this framebuffer gl.glFramebufferTexture2DEXT(GL.GL_FRAMEBUFFER_EXT, GL.GL_COLOR_ATTACHMENT0_EXT, - GL.GL_TEXTURE_2D, + fboTextureTarget, frameBufferTexture[0], 0); if (DEBUG && VERBOSE) { |