public static Object createProxy(GL gl, Object obj, Class<?>... implementedInterfaces) {
        try {
            return Proxy.newProxyInstance(
                    GLDebug.class.getClassLoader(),
                    implementedInterfaces,
                    new GLDebug(gl, obj)
            );
        } catch (NoSuchMethodException nsme) {
            throw new IllegalArgumentException ("Could not initialize the proxy because the glGetError method wasn't " +
                    "found!", nsme);
        }
    }
Creates a debug-proxied object, which will call {@link GL#glGetError()} after every method invocation and throw
a {@link com.jme3.renderer.RendererException} if there was a GL Error.

@param gl The GL Context, required to call {@link GL#glGetError()}
@param obj The object which methods will be proxied
@param implementedInterfaces The interfaces/class this object implements
@return The Proxy object (or null if an error occurred)
jme3-core/src/main/java/com/jme3/renderer/opengl/GLDebug.java