Package com.jme3.renderer.opengl
Class GLDebug
java.lang.Object
com.jme3.renderer.opengl.GLDebug
- All Implemented Interfaces:
InvocationHandler
This class uses Reflection to intercept method calls to the Proxy Object (
This means we don't have to generate a class with overrides for every possible method just to add a
Note that we should not call
Note that this class is general purpose and as such every class instance (every object) can be guarded as long as the passed gl instance is valid.
createProxy(GL, Object, Class[])
and extends them with the Error Checking in checkError().This means we don't have to generate a class with overrides for every possible method just to add a
checkError() call.Note that we should not call
checkError() for GL.glGetError(), it doesn't make sense.Note that this class is general purpose and as such every class instance (every object) can be guarded as long as the passed gl instance is valid.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionprotected voidstatic ObjectcreateProxy(GL gl, Object obj, Class<?>... implementedInterfaces) Creates a debug-proxied object, which will callGL.glGetError()after every method invocation and throw aRendererExceptionif there was a GL Error.protected StringdecodeError(int err)
-
Field Details
-
obj
-
gl
-
methodGlGetError
-
-
Method Details
-
decodeError
-
checkError
protected void checkError() -
invoke
- Specified by:
invokein interfaceInvocationHandler- Throws:
Throwable
-
createProxy
Creates a debug-proxied object, which will callGL.glGetError()after every method invocation and throw aRendererExceptionif there was a GL Error.- Parameters:
gl- The GL Context, required to callGL.glGetError()obj- The object which methods will be proxiedimplementedInterfaces- The interfaces/class this object implements- Returns:
- The Proxy object (or null if an error occurred)
-