From 1d1f808cb6bb399d2569a3ab2bcfc73da59ea6c4 Mon Sep 17 00:00:00 2001 From: Julien Gouesse Date: Fri, 15 Aug 2014 21:43:31 +0200 Subject: Drives the OpenGL-ES code path more robust, especially when dealing with the stencils --- .../java/com/ardor3d/scene/state/jogl/JoglStencilStateUtil.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ardor3d-jogl/src/main/java/com/ardor3d/scene/state/jogl/JoglStencilStateUtil.java b/ardor3d-jogl/src/main/java/com/ardor3d/scene/state/jogl/JoglStencilStateUtil.java index d624b60..c027d0b 100644 --- a/ardor3d-jogl/src/main/java/com/ardor3d/scene/state/jogl/JoglStencilStateUtil.java +++ b/ardor3d-jogl/src/main/java/com/ardor3d/scene/state/jogl/JoglStencilStateUtil.java @@ -38,7 +38,9 @@ public abstract class JoglStencilStateUtil { setEnabled(state.isEnabled(), caps.isTwoSidedStencilSupported() ? state.isUseTwoSided() : false, record, caps); if (state.isEnabled()) { if (state.isUseTwoSided() && caps.isTwoSidedStencilSupported()) { - gl.getGL2().glActiveStencilFaceEXT(GL.GL_BACK); + if (gl.isGL2()) { + gl.getGL2().glActiveStencilFaceEXT(GL.GL_BACK); + } applyMask(state.getStencilWriteMaskBack(), record, 2); applyFunc(getGLStencilFunction(state.getStencilFunctionBack()), state.getStencilReferenceBack(), state.getStencilFuncMaskBack(), record, 2); @@ -46,7 +48,9 @@ public abstract class JoglStencilStateUtil { getGLStencilOp(state.getStencilOpZFailBack(), caps), getGLStencilOp(state.getStencilOpZPassBack(), caps), record, 2); - gl.getGL2().glActiveStencilFaceEXT(GL.GL_FRONT); + if (gl.isGL2()) { + gl.getGL2().glActiveStencilFaceEXT(GL.GL_FRONT); + } applyMask(state.getStencilWriteMaskFront(), record, 1); applyFunc(getGLStencilFunction(state.getStencilFunctionFront()), state.getStencilReferenceFront(), state.getStencilFuncMaskFront(), record, 1); -- cgit v1.2.3