Class GLProfiler
- java.lang.Object
-
- com.badlogic.gdx.graphics.profiling.GLProfiler
-
public class GLProfiler extends java.lang.ObjectWhen enabled, collects statistics about GL calls and checks for GL errors. Enabling will wrap Gdx.gl* instances with delegate classes which provide described functionality and route GL calls to the actual GL instances.- See Also:
GL20Interceptor,GL30Interceptor
-
-
Constructor Summary
Constructors Constructor Description GLProfiler(Graphics graphics)Create a new instance of GLProfiler to monitor aGraphicsinstance's gl calls
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddisable()Disables profiling by resetting theGL20andGL30instances with the original ones.voidenable()Enables profiling by replacing theGL20andGL30instances with profiling ones.intgetCalls()intgetDrawCalls()GLErrorListenergetListener()intgetShaderSwitches()intgetTextureBindings()FloatCountergetVertexCount()booleanisEnabled()voidreset()Will reset the statistical information which has been collected so far.voidsetListener(GLErrorListener errorListener)Set the current listener for theGLProfilertoerrorListener
-
-
-
Method Detail
-
enable
public void enable()
Enables profiling by replacing theGL20andGL30instances with profiling ones.
-
disable
public void disable()
Disables profiling by resetting theGL20andGL30instances with the original ones.
-
setListener
public void setListener(GLErrorListener errorListener)
Set the current listener for theGLProfilertoerrorListener
-
getListener
public GLErrorListener getListener()
- Returns:
- the current
GLErrorListener
-
isEnabled
public boolean isEnabled()
- Returns:
- true if the GLProfiler is currently profiling
-
getCalls
public int getCalls()
- Returns:
- the total gl calls made since the last reset
-
getTextureBindings
public int getTextureBindings()
- Returns:
- the total amount of texture bindings made since the last reset
-
getDrawCalls
public int getDrawCalls()
- Returns:
- the total amount of draw calls made since the last reset
-
getShaderSwitches
public int getShaderSwitches()
- Returns:
- the total amount of shader switches made since the last reset
-
getVertexCount
public FloatCounter getVertexCount()
- Returns:
FloatCountercontaining information about rendered vertices since the last reset
-
reset
public void reset()
Will reset the statistical information which has been collected so far. This should be called after every frame. Error listener is kept as it is.
-
-