GLRenderer: update viewport even if FBO ID already set

The inherited viewport state could be outdated or incorrect, this makes sure it matches exactly
experimental
shadowislord 10 years ago
parent ec2f47225c
commit d9cc9003ba
  1. 6
      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);

Loading…
Cancel
Save