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(); }