Support GLTracer and GL debug in Android

opengles2-fixes
Kirill Vainer 7 years ago
parent 406c3144d8
commit 259694605e
  1. 10
      jme3-android/src/main/java/com/jme3/system/android/OGLESContext.java
  2. 15
      jme3-core/src/main/java/com/jme3/renderer/opengl/GLTracer.java

@ -53,9 +53,11 @@ import com.jme3.input.dummy.DummyKeyInput;
import com.jme3.input.dummy.DummyMouseInput; import com.jme3.input.dummy.DummyMouseInput;
import com.jme3.renderer.android.AndroidGL; import com.jme3.renderer.android.AndroidGL;
import com.jme3.renderer.opengl.GL; import com.jme3.renderer.opengl.GL;
import com.jme3.renderer.opengl.GLDebugES;
import com.jme3.renderer.opengl.GLExt; import com.jme3.renderer.opengl.GLExt;
import com.jme3.renderer.opengl.GLFbo; import com.jme3.renderer.opengl.GLFbo;
import com.jme3.renderer.opengl.GLRenderer; import com.jme3.renderer.opengl.GLRenderer;
import com.jme3.renderer.opengl.GLTracer;
import com.jme3.system.*; import com.jme3.system.*;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import java.util.logging.Level; import java.util.logging.Level;
@ -195,8 +197,12 @@ public class OGLESContext implements JmeContext, GLSurfaceView.Renderer, SoftTex
timer = new NanoTimer(); timer = new NanoTimer();
Object gl = new AndroidGL(); Object gl = new AndroidGL();
// gl = GLTracer.createGlesTracer((GL)gl, (GLExt)gl); if (settings.getBoolean("GraphicsDebug")) {
// gl = new GLDebugES((GL)gl, (GLExt)gl); gl = new GLDebugES((GL) gl, (GLExt) gl, (GLFbo) gl);
}
if (settings.getBoolean("GraphicsTrace")) {
gl = GLTracer.createGlesTracer(gl, GL.class, GLFbo.class, GLExt.class);
}
renderer = new GLRenderer((GL)gl, (GLExt)gl, (GLFbo)gl); renderer = new GLRenderer((GL)gl, (GLExt)gl, (GLFbo)gl);
renderer.initialize(); renderer.initialize();

@ -165,16 +165,17 @@ public final class GLTracer implements InvocationHandler {
/** /**
* Creates a tracer implementation that wraps OpenGL ES 2. * Creates a tracer implementation that wraps OpenGL ES 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 createGlesTracer(Object glInterface, Class<?> glInterfaceClass) { public static Object createGlesTracer(Object glInterface, Class<?>... glInterfaceClasses) {
IntMap<String> constMap = generateConstantMap(GL.class, GLFbo.class, GLExt.class); IntMap<String> constMap = generateConstantMap(GL.class, GL2.class, GL3.class, GLFbo.class, GLExt.class);
return Proxy.newProxyInstance(glInterface.getClass().getClassLoader(), return Proxy.newProxyInstance(
new Class<?>[] { glInterfaceClass }, glInterface.getClass().getClassLoader(),
new GLTracer(glInterface, constMap)); glInterfaceClasses,
new GLTracer(glInterface, constMap));
} }
/** /**

Loading…
Cancel
Save