diff --git a/jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java b/jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java index a3b71b92a..2052f91d2 100644 --- a/jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java +++ b/jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java @@ -1648,15 +1648,13 @@ public final class GLRenderer implements Renderer { if (fb.getNumColorBuffers() == 0) { // make sure to select NONE as draw buf // no color buffer attached. - if (gl2 != null) { - if (context.boundDrawBuf != NONE) { - gl2.glDrawBuffer(GL.GL_NONE); - context.boundDrawBuf = NONE; - } - if (context.boundReadBuf != NONE) { - gl2.glReadBuffer(GL.GL_NONE); - context.boundReadBuf = NONE; - } + if (context.boundDrawBuf != NONE) { + gl2.glDrawBuffer(GL.GL_NONE); + context.boundDrawBuf = NONE; + } + if (context.boundReadBuf != NONE) { + gl2.glReadBuffer(GL.GL_NONE); + context.boundReadBuf = NONE; } } else { if (fb.getNumColorBuffers() > limits.get(Limits.FrameBufferAttachments)) { @@ -1687,11 +1685,9 @@ public final class GLRenderer implements Renderer { } else { RenderBuffer rb = fb.getColorBuffer(fb.getTargetIndex()); // select this draw buffer - if (gl2 != null) { - if (context.boundDrawBuf != rb.getSlot()) { - gl2.glDrawBuffer(GLFbo.GL_COLOR_ATTACHMENT0_EXT + rb.getSlot()); - context.boundDrawBuf = rb.getSlot(); - } + if (context.boundDrawBuf != rb.getSlot()) { + gl2.glDrawBuffer(GLFbo.GL_COLOR_ATTACHMENT0_EXT + rb.getSlot()); + context.boundDrawBuf = rb.getSlot(); } } }