diff options
author | Sven Gothel <[email protected]> | 2014-02-18 21:49:37 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-02-18 21:49:37 +0100 |
commit | b96fc594f15fcf9ee0fd238ce8d7a10aea781d32 (patch) | |
tree | 858e2362b3ccbcc2e948d677ad20321249f68da4 /src | |
parent | 41190c3830157abdf9649cbf7767e57108f55075 (diff) |
GLContextImpl/GLDrawableImpl.getDefaultReadBuffer(..): Pass hint whether dedicated read-drawable is being used (double buffering)
Diffstat (limited to 'src')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/GLContextImpl.java | 2 | ||||
-rw-r--r-- | src/jogl/classes/jogamp/opengl/GLDrawableImpl.java | 4 | ||||
-rw-r--r-- | src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java | 4 |
3 files changed, 6 insertions, 4 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java index b133fc017..9ccd78589 100644 --- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java @@ -2231,7 +2231,7 @@ public abstract class GLContextImpl extends GLContext { @Override public final int getDefaultReadFramebuffer() { return drawable.getDefaultReadFramebuffer(); } @Override - public final int getDefaultReadBuffer() { return drawable.getDefaultReadBuffer(gl); } + public final int getDefaultReadBuffer() { return drawable.getDefaultReadBuffer(gl, drawableRead != drawable); } //--------------------------------------------------------------------------- // GL_ARB_debug_output, GL_AMD_debug_output helpers diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableImpl.java b/src/jogl/classes/jogamp/opengl/GLDrawableImpl.java index 94d39a4ab..d11274560 100644 --- a/src/jogl/classes/jogamp/opengl/GLDrawableImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLDrawableImpl.java @@ -260,8 +260,8 @@ public abstract class GLDrawableImpl implements GLDrawable { /** Callback for special implementations, allowing GLContext to fetch a custom default read framebuffer. Defaults to zero. */ protected int getDefaultReadFramebuffer() { return 0; } /** Callback for special implementations, allowing GLContext to fetch a custom default read buffer of current framebuffer. */ - protected int getDefaultReadBuffer(GL gl) { - if(gl.isGLES() || getChosenGLCapabilities().getDoubleBuffered()) { + protected int getDefaultReadBuffer(GL gl, boolean hasDedicatedDrawableRead) { + if( gl.isGLES() || hasDedicatedDrawableRead || getChosenGLCapabilities().getDoubleBuffered() ) { // Note-1: Neither ES1 nor ES2 supports selecting the read buffer via glReadBuffer // Note-2: ES3 only supports GL_BACK, GL_NONE or GL_COLOR_ATTACHMENT0+i return GL.GL_BACK; diff --git a/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java b/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java index 0e9d142ba..6f5fa3eed 100644 --- a/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java @@ -325,7 +325,9 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable { protected final int getDefaultReadFramebuffer() { return initialized ? fbos[fboIFront].getReadFramebuffer() : 0; } @Override - protected final int getDefaultReadBuffer(GL gl) { return initialized ? fbos[fboIFront].getDefaultReadBuffer() : GL.GL_COLOR_ATTACHMENT0 ; } + protected final int getDefaultReadBuffer(GL gl, boolean hasDedicatedDrawableRead) { + return initialized ? fbos[fboIFront].getDefaultReadBuffer() : GL.GL_COLOR_ATTACHMENT0 ; + } @Override protected final void setRealizedImpl() { |