Renderer Changes

* Add new "Limits" enum to hold maximums of various renderer capabilities such as texture size
 * Add support for seamless cubemap (enabled by default for mipmapped cubemaps)
 * Fix conflict when using GL tracing with GL debugging
experimental
shadowislord 10 years ago
parent 9f3a145dd7
commit 16e3e00507
  1. 4
      jme3-core/src/main/java/com/jme3/renderer/opengl/GLDebugDesktop.java
  2. 12
      jme3-core/src/main/java/com/jme3/renderer/opengl/GLTracer.java

@ -3,12 +3,12 @@ package com.jme3.renderer.opengl;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.nio.IntBuffer; import java.nio.IntBuffer;
public class GLDebugGL2 extends GLDebugES { public class GLDebugDesktop extends GLDebugES implements GL2, GL3 {
private final GL2 gl2; private final GL2 gl2;
private final GL3 gl3; private final GL3 gl3;
public GLDebugGL2(GL gl, GLFbo glfbo) { public GLDebugDesktop(GL gl, GLFbo glfbo) {
super(gl, glfbo); super(gl, glfbo);
this.gl2 = gl instanceof GL2 ? (GL2) gl : null; this.gl2 = gl instanceof GL2 ? (GL2) gl : null;
this.gl3 = gl instanceof GL3 ? (GL3) gl : null; this.gl3 = gl instanceof GL3 ? (GL3) gl : null;

@ -71,6 +71,7 @@ public final class GLTracer implements InvocationHandler {
noEnumArgs("glTexImage2D", 1, 3, 4, 5); noEnumArgs("glTexImage2D", 1, 3, 4, 5);
noEnumArgs("glTexImage3D", 1, 3, 4, 5, 6); noEnumArgs("glTexImage3D", 1, 3, 4, 5, 6);
noEnumArgs("glTexSubImage3D", 1, 2, 3, 4, 5, 6, 7); noEnumArgs("glTexSubImage3D", 1, 2, 3, 4, 5, 6, 7);
noEnumArgs("glCompressedTexImage2D", 1, 3, 4, 5);
noEnumArgs("glCompressedTexSubImage3D", 1, 2, 3, 4, 5, 6, 7); noEnumArgs("glCompressedTexSubImage3D", 1, 2, 3, 4, 5, 6, 7);
noEnumArgs("glDeleteTextures", 0); noEnumArgs("glDeleteTextures", 0);
noEnumArgs("glReadPixels", 0, 1, 2, 3); noEnumArgs("glReadPixels", 0, 1, 2, 3);
@ -86,8 +87,12 @@ public final class GLTracer implements InvocationHandler {
noEnumArgs("glBindFramebufferEXT", 1); noEnumArgs("glBindFramebufferEXT", 1);
noEnumArgs("glBindRenderbufferEXT", 1); noEnumArgs("glBindRenderbufferEXT", 1);
noEnumArgs("glRenderbufferStorageEXT", 2, 3); noEnumArgs("glRenderbufferStorageEXT", 2, 3);
noEnumArgs("glRenderbufferStorageMultisampleEXT", 1, 3, 4);
noEnumArgs("glFramebufferRenderbufferEXT", 3); noEnumArgs("glFramebufferRenderbufferEXT", 3);
noEnumArgs("glFramebufferTexture2DEXT", 3, 4); noEnumArgs("glFramebufferTexture2DEXT", 3, 4);
noEnumArgs("glBlitFramebufferEXT", 0, 1, 2, 3, 4, 5, 6, 7, 8);
noEnumArgs("glCreateProgram", -1); noEnumArgs("glCreateProgram", -1);
noEnumArgs("glCreateShader", -1); noEnumArgs("glCreateShader", -1);
@ -110,6 +115,7 @@ public final class GLTracer implements InvocationHandler {
noEnumArgs("glDetachShader", 0, 1); noEnumArgs("glDetachShader", 0, 1);
noEnumArgs("glDeleteShader", 0); noEnumArgs("glDeleteShader", 0);
noEnumArgs("glDeleteProgram", 0); noEnumArgs("glDeleteProgram", 0);
noEnumArgs("glBindFragDataLocation", 0, 1);
} }
public GLTracer(Object obj, IntMap<String> constMap) { public GLTracer(Object obj, IntMap<String> constMap) {
@ -153,13 +159,13 @@ public final class GLTracer implements InvocationHandler {
* Creates a tracer implementation that wraps OpenGL 2+. * Creates a tracer implementation that wraps OpenGL 2+.
* *
* @param glInterface OGL object to wrap * @param glInterface OGL object to wrap
* @param glInterfaceClass The interface to implement * @param glInterfaceClasses The interface(s) to implement
* @return A tracer that implements the given interface * @return A tracer that implements the given interface
*/ */
public static Object createDesktopGlTracer(Object glInterface, Class<?> glInterfaceClass) { public static Object createDesktopGlTracer(Object glInterface, Class<?> ... glInterfaceClasses) {
IntMap<String> constMap = generateConstantMap(GL2.class, GLExt.class); IntMap<String> constMap = generateConstantMap(GL2.class, GLExt.class);
return Proxy.newProxyInstance(glInterface.getClass().getClassLoader(), return Proxy.newProxyInstance(glInterface.getClass().getClassLoader(),
new Class<?>[] { glInterfaceClass }, glInterfaceClasses,
new GLTracer(glInterface, constMap)); new GLTracer(glInterface, constMap));
} }

Loading…
Cancel
Save