diff --git a/core/src/processing/opengl/PGL.java b/core/src/processing/opengl/PGL.java index 2ce746115..4811047df 100644 --- a/core/src/processing/opengl/PGL.java +++ b/core/src/processing/opengl/PGL.java @@ -684,6 +684,16 @@ public class PGL { } + protected int getDepthBits() { + return capabilities.getDepthBits(); + } + + + protected int getStencilBits() { + return capabilities.getStencilBits(); + } + + protected Texture wrapBackTexture() { Texture tex = new Texture(pg.parent); tex.init(backTex.getName(), diff --git a/core/src/processing/opengl/PGraphicsOpenGL.java b/core/src/processing/opengl/PGraphicsOpenGL.java index 9dd7eb68a..ec318c6d7 100644 --- a/core/src/processing/opengl/PGraphicsOpenGL.java +++ b/core/src/processing/opengl/PGraphicsOpenGL.java @@ -6037,6 +6037,9 @@ public class PGraphicsOpenGL extends PGraphics { int temp[] = new int[2]; + depthBits = pgl.getDepthBits(); + stencilBits = pgl.getStencilBits(); + pgl.getIntegerv(PGL.MAX_TEXTURE_SIZE, temp, 0); maxTextureSize = temp[0]; @@ -6049,22 +6052,6 @@ public class PGraphicsOpenGL extends PGraphics { pgl.getIntegerv(PGL.ALIASED_POINT_SIZE_RANGE, temp, 0); maxPointSize = temp[1]; - pgl.getIntegerv(PGL.DEPTH_BITS, temp, 0); - depthBits = temp[0]; - - pgl.getIntegerv(PGL.STENCIL_BITS, temp, 0); - stencilBits = temp[0]; - - // Temporary fix to what seems to be a regression introduced by a recent - // fix in JOGL. See the discussion here: - // http://forum.jogamp.org/Enabling-Stencil-buffer-breaks-rendering-OSX-R11-td4026857.html - if (depthBits == 0) { - depthBits = 24; - } - if (stencilBits == 0) { - stencilBits = 8; - } - if (anisoSamplingSupported) { float ftemp[] = new float[1]; pgl.getFloatv(PGL.MAX_TEXTURE_MAX_ANISOTROPY, ftemp, 0);