From cd4a5ae4535b4b9c12b89c853c10397c7b9370bf Mon Sep 17 00:00:00 2001 From: codeanticode Date: Thu, 24 Oct 2013 17:59:27 -0400 Subject: [PATCH] constrain depth and stencil bits to requested values, use capabilities to obtain current values --- core/src/processing/opengl/PGL.java | 4 ++-- core/src/processing/opengl/PJOGL.java | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/core/src/processing/opengl/PGL.java b/core/src/processing/opengl/PGL.java index 87898ba99..b8b0d5bde 100644 --- a/core/src/processing/opengl/PGL.java +++ b/core/src/processing/opengl/PGL.java @@ -527,8 +527,8 @@ public abstract class PGL { boolean multisample = 1 < numSamples; boolean packed = ext.indexOf("packed_depth_stencil") != -1; - int depthBits = getDepthBits(); - int stencilBits = getStencilBits(); + int depthBits = PApplet.min(REQUESTED_DEPTH_BITS, getDepthBits()); + int stencilBits = PApplet.min(REQUESTED_STENCIL_BITS, getStencilBits()); genTextures(2, glColorTex); for (int i = 0; i < 2; i++) { diff --git a/core/src/processing/opengl/PJOGL.java b/core/src/processing/opengl/PJOGL.java index 62a929719..7868095d8 100644 --- a/core/src/processing/opengl/PJOGL.java +++ b/core/src/processing/opengl/PJOGL.java @@ -452,15 +452,13 @@ public class PJOGL extends PGL { @Override protected int getDepthBits() { - if (USE_JOGL_FBOLAYER) return capabilities.getDepthBits(); - else return super.getDepthBits(); + return capabilities.getDepthBits(); } @Override protected int getStencilBits() { - if (USE_JOGL_FBOLAYER) return capabilities.getStencilBits(); - else return super.getStencilBits(); + return capabilities.getStencilBits(); }