Package arc.profiling
Class GLProfiler
java.lang.Object
arc.profiling.GLProfiler
When enabled, collects statistics about GL calls and checks for GL errors.
Enabling will wrap Core.gl* instances with delegate classes which provide described functionality
and route GL calls to the actual GL instances.
- See Also:
-
Constructor Summary
ConstructorDescriptionGLProfiler
(Graphics graphics) Create a new instance of GLProfiler to monitor aGraphics
instance's gl calls -
Method Summary
Modifier and TypeMethodDescriptionvoid
disable()
Disables profiling by resetting theGL20
andGL30
instances with the original ones.void
enable()
Enables profiling by replacing theGL20
andGL30
instances with profiling ones.int
getCalls()
int
int
int
int
boolean
void
reset()
Will reset the statistical information which has been collected so far.void
setListener
(GLErrorListener errorListener) Set the current listener for theGLProfiler
toerrorListener
-
Constructor Details
-
GLProfiler
Create a new instance of GLProfiler to monitor aGraphics
instance's gl calls- Parameters:
graphics
- instance to monitor with this instance
-
-
Method Details
-
enable
public void enable()Enables profiling by replacing theGL20
andGL30
instances with profiling ones. -
disable
public void disable()Disables profiling by resetting theGL20
andGL30
instances with the original ones. -
getListener
- Returns:
- the current
GLErrorListener
-
setListener
Set the current listener for theGLProfiler
toerrorListener
-
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
-
getStateChanges
public int getStateChanges() -
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
- Returns:
FloatCounter
containing 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.
-