From d9cc9003ba3a6f76c85fa01b90a8c3409c45d1bc Mon Sep 17 00:00:00 2001 From: shadowislord Date: Sun, 15 Feb 2015 16:45:07 -0500 Subject: [PATCH] GLRenderer: update viewport even if FBO ID already set The inherited viewport state could be outdated or incorrect, this makes sure it matches exactly --- .../src/main/java/com/jme3/renderer/opengl/GLRenderer.java | 6 +++--- 1 file changed, 3 insertions(+), 3 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 ff957abda..d0776f7c6 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 @@ -1563,13 +1563,13 @@ public class GLRenderer implements Renderer { updateFrameBuffer(fb); } + // update viewport to reflect framebuffer's resolution + setViewPort(0, 0, fb.getWidth(), fb.getHeight()); + if (context.boundFBO != fb.getId()) { glfbo.glBindFramebufferEXT(GLExt.GL_FRAMEBUFFER_EXT, fb.getId()); statistics.onFrameBufferUse(fb, true); - // update viewport to reflect framebuffer's resolution - setViewPort(0, 0, fb.getWidth(), fb.getHeight()); - context.boundFBO = fb.getId(); } else { statistics.onFrameBufferUse(fb, false);