From a0a67abf06e318b85f1fef20e13ff087eb42cac1 Mon Sep 17 00:00:00 2001 From: "jul..om" Date: Sun, 4 Nov 2012 11:27:50 +0000 Subject: [PATCH] Fixes a bug in the frame buffers (thanks to Nehon's suggestion) git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9950 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../jogl/com/jme3/renderer/jogl/JoglRenderer.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/engine/src/jogl/com/jme3/renderer/jogl/JoglRenderer.java b/engine/src/jogl/com/jme3/renderer/jogl/JoglRenderer.java index 55ebdb243..e04c7dd8d 100644 --- a/engine/src/jogl/com/jme3/renderer/jogl/JoglRenderer.java +++ b/engine/src/jogl/com/jme3/renderer/jogl/JoglRenderer.java @@ -1436,11 +1436,13 @@ public class JoglRenderer implements Renderer { } if (fb.getWidth() > maxRBSize || fb.getHeight() > maxRBSize) { - throw new UnsupportedOperationException("Resolution " + fb.getWidth() + ":" - + fb.getHeight() + " is not supported."); + throw new RendererException("Resolution " + fb.getWidth() + + ":" + fb.getHeight() + " is not supported."); } - if (fb.getSamples() > 0 && gl.isExtensionAvailable("GL_EXT_framebuffer_multisample") + TextureUtil.GLImageFormat glFmt = TextureUtil.getImageFormatWithError(rb.getFormat()); + + if (fb.getSamples() > 1 && gl.isExtensionAvailable("GL_EXT_framebuffer_multisample") && gl.isFunctionAvailable("glRenderbufferStorageMultisample")) { int samples = fb.getSamples(); if (maxFBOSamples < samples) { @@ -1448,11 +1450,11 @@ public class JoglRenderer implements Renderer { } gl.getGL2() .glRenderbufferStorageMultisample(GL.GL_RENDERBUFFER, samples, - TextureUtil.convertTextureFormat(rb.getFormat()), fb.getWidth(), + glFmt.internalFormat, fb.getWidth(), fb.getHeight()); } else { gl.glRenderbufferStorage(GL.GL_RENDERBUFFER, - TextureUtil.convertTextureFormat(rb.getFormat()), fb.getWidth(), fb.getHeight()); + glFmt.internalFormat, fb.getWidth(), fb.getHeight()); } }