Fix Renderer.copyFrameBuffer() exception

experimental
shadowislord 10 years ago
parent c7b6445a35
commit af58aeb779
  1. 13
      jme3-lwjgl/src/main/java/com/jme3/renderer/lwjgl/LwjglRenderer.java

@ -66,7 +66,6 @@ import jme3tools.converters.MipMapGenerator;
import jme3tools.shader.ShaderDebug; import jme3tools.shader.ShaderDebug;
import static org.lwjgl.opengl.ARBDrawInstanced.*; import static org.lwjgl.opengl.ARBDrawInstanced.*;
import static org.lwjgl.opengl.ARBFramebufferObject.*;
import static org.lwjgl.opengl.ARBInstancedArrays.*; import static org.lwjgl.opengl.ARBInstancedArrays.*;
import static org.lwjgl.opengl.ARBMultisample.*; import static org.lwjgl.opengl.ARBMultisample.*;
import static org.lwjgl.opengl.ARBTextureMultisample.*; import static org.lwjgl.opengl.ARBTextureMultisample.*;
@ -84,8 +83,6 @@ import static org.lwjgl.opengl.GL14.*;
import static org.lwjgl.opengl.GL15.*; import static org.lwjgl.opengl.GL15.*;
import static org.lwjgl.opengl.GL20.*; import static org.lwjgl.opengl.GL20.*;
import org.lwjgl.opengl.GL30; import org.lwjgl.opengl.GL30;
//import static org.lwjgl.opengl.GL21.*;
//import static org.lwjgl.opengl.GL30.*;
public class LwjglRenderer implements Renderer { public class LwjglRenderer implements Renderer {
@ -398,6 +395,10 @@ public class LwjglRenderer implements Renderer {
maxFBOAttachs = intBuf16.get(0); maxFBOAttachs = intBuf16.get(0);
logger.log(Level.FINER, "FBO Max renderbuffers: {0}", maxFBOAttachs); logger.log(Level.FINER, "FBO Max renderbuffers: {0}", maxFBOAttachs);
if (hasExtension("GL_EXT_framebuffer_blit")) {
caps.add(Caps.FrameBufferBlit);
}
if (hasExtension("GL_EXT_framebuffer_multisample")) { if (hasExtension("GL_EXT_framebuffer_multisample")) {
caps.add(Caps.FrameBufferMultisample); caps.add(Caps.FrameBufferMultisample);
@ -1002,8 +1003,6 @@ public class LwjglRenderer implements Renderer {
return GL_FRAGMENT_SHADER; return GL_FRAGMENT_SHADER;
case Vertex: case Vertex:
return GL_VERTEX_SHADER; return GL_VERTEX_SHADER;
// case Geometry:
// return ARBGeometryShader4.GL_GEOMETRY_SHADER_ARB;
default: default:
throw new UnsupportedOperationException("Unrecognized shader type."); throw new UnsupportedOperationException("Unrecognized shader type.");
} }
@ -1459,7 +1458,9 @@ public class LwjglRenderer implements Renderer {
if (attachmentSlot == FrameBuffer.SLOT_DEPTH) { if (attachmentSlot == FrameBuffer.SLOT_DEPTH) {
return GL_DEPTH_ATTACHMENT_EXT; return GL_DEPTH_ATTACHMENT_EXT;
} else if (attachmentSlot == FrameBuffer.SLOT_DEPTH_STENCIL) { } else if (attachmentSlot == FrameBuffer.SLOT_DEPTH_STENCIL) {
return GL_DEPTH_STENCIL_ATTACHMENT; // NOTE: Using depth stencil format requires GL3, this is already
// checked via render caps.
return GL30.GL_DEPTH_STENCIL_ATTACHMENT;
} else if (attachmentSlot < 0 || attachmentSlot >= 16) { } else if (attachmentSlot < 0 || attachmentSlot >= 16) {
throw new UnsupportedOperationException("Invalid FBO attachment slot: " + attachmentSlot); throw new UnsupportedOperationException("Invalid FBO attachment slot: " + attachmentSlot);
} }

Loading…
Cancel
Save