From 86c2c7f3413dba4f4b9c20cee8f809aa2c6b1420 Mon Sep 17 00:00:00 2001 From: Kirill Vainer Date: Wed, 14 Sep 2016 19:11:14 -0400 Subject: [PATCH] minor cleanup in GLRenderer --- .../com/jme3/renderer/opengl/GLRenderer.java | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) 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(); } } }