diff --git a/jme3-core/src/main/java/com/jme3/renderer/opengl/GLCapabilities.java b/jme3-core/src/main/java/com/jme3/renderer/opengl/GLCapabilities.java index f047cb19b3..6f9643ab9e 100755 --- a/jme3-core/src/main/java/com/jme3/renderer/opengl/GLCapabilities.java +++ b/jme3-core/src/main/java/com/jme3/renderer/opengl/GLCapabilities.java @@ -145,38 +145,7 @@ protected void loadCapabilitiesCommon() { if (hasExtension("GL_EXT_framebuffer_object") || caps.contains(Caps.OpenGL30) || caps.contains(Caps.OpenGLES20)) { - caps.add(Caps.FrameBuffer); - - limits.put(Limits.RenderBufferSize, getInteger(GLFbo.GL_MAX_RENDERBUFFER_SIZE_EXT)); - limits.put(Limits.FrameBufferAttachments, getInteger(GLFbo.GL_MAX_COLOR_ATTACHMENTS_EXT)); - - if (hasExtension("GL_EXT_framebuffer_blit") || caps.contains(Caps.OpenGL30)) { - caps.add(Caps.FrameBufferBlit); - } - - if (hasExtension("GL_EXT_framebuffer_multisample")) { - caps.add(Caps.FrameBufferMultisample); - limits.put(Limits.FrameBufferSamples, getInteger(GLExt.GL_MAX_SAMPLES_EXT)); - } - - if (hasExtension("GL_ARB_texture_multisample")) { - caps.add(Caps.TextureMultisample); - limits.put(Limits.ColorTextureSamples, getInteger(GLExt.GL_MAX_COLOR_TEXTURE_SAMPLES)); - limits.put(Limits.DepthTextureSamples, getInteger(GLExt.GL_MAX_DEPTH_TEXTURE_SAMPLES)); - if (!limits.containsKey(Limits.FrameBufferSamples)) { - // In case they want to query samples on main FB ... - limits.put(Limits.FrameBufferSamples, limits.get(Limits.ColorTextureSamples)); - } - } - - if (hasExtension("GL_ARB_draw_buffers") || caps.contains(Caps.OpenGL30)) { - limits.put(Limits.FrameBufferMrtAttachments, getInteger(GLExt.GL_MAX_DRAW_BUFFERS_ARB)); - if (limits.get(Limits.FrameBufferMrtAttachments) > 1) { - caps.add(Caps.FrameBufferMRT); - } - } else { - limits.put(Limits.FrameBufferMrtAttachments, 1); - } + loadGLExtFrameBufferObjectCapabilities(); } if (hasExtension("GL_ARB_multisample")) { @@ -241,6 +210,41 @@ protected void loadCapabilitiesCommon() { } } + private void loadGLExtFrameBufferObjectCapabilities() { + caps.add(Caps.FrameBuffer); + + limits.put(Limits.RenderBufferSize, getInteger(GLFbo.GL_MAX_RENDERBUFFER_SIZE_EXT)); + limits.put(Limits.FrameBufferAttachments, getInteger(GLFbo.GL_MAX_COLOR_ATTACHMENTS_EXT)); + + if (hasExtension("GL_EXT_framebuffer_blit") || caps.contains(Caps.OpenGL30)) { + caps.add(Caps.FrameBufferBlit); + } + + if (hasExtension("GL_EXT_framebuffer_multisample")) { + caps.add(Caps.FrameBufferMultisample); + limits.put(Limits.FrameBufferSamples, getInteger(GLExt.GL_MAX_SAMPLES_EXT)); + } + + if (hasExtension("GL_ARB_texture_multisample")) { + caps.add(Caps.TextureMultisample); + limits.put(Limits.ColorTextureSamples, getInteger(GLExt.GL_MAX_COLOR_TEXTURE_SAMPLES)); + limits.put(Limits.DepthTextureSamples, getInteger(GLExt.GL_MAX_DEPTH_TEXTURE_SAMPLES)); + if (!limits.containsKey(Limits.FrameBufferSamples)) { + // In case they want to query samples on main FB ... + limits.put(Limits.FrameBufferSamples, limits.get(Limits.ColorTextureSamples)); + } + } + + if (hasExtension("GL_ARB_draw_buffers") || caps.contains(Caps.OpenGL30)) { + limits.put(Limits.FrameBufferMrtAttachments, getInteger(GLExt.GL_MAX_DRAW_BUFFERS_ARB)); + if (limits.get(Limits.FrameBufferMrtAttachments) > 1) { + caps.add(Caps.FrameBufferMRT); + } + } else { + limits.put(Limits.FrameBufferMrtAttachments, 1); + } + } + private void loadTextureFormatExtensions() { boolean hasFloatTexture;