public class Statistics
extends java.lang.Object
The Statistics
can be retrieved by using Renderer.getStatistics()
.
Modifier and Type | Field and Description |
---|---|
protected boolean |
enabled
Enables or disables updates.
|
protected IntMap<java.lang.Void> |
fbosUsed
IDs of all FBOs in use.
|
protected int |
lastShader
ID of the most recently used shader.
|
protected int |
memoryFrameBuffers
Number of active frame buffers.
|
protected int |
memoryShaders
Number of active shaders.
|
protected int |
memoryTextures
Number of active textures.
|
protected int |
numFboSwitches
Number of FBO switches during the current frame.
|
protected int |
numObjects
Number of object used during the current frame.
|
protected int |
numShaderSwitches
Number of shader switches during the current frame.
|
protected int |
numTextureBinds
Number of texture binds during the current frame.
|
protected int |
numTriangles
Number of mesh primitives rendered during the current frame.
|
protected int |
numUniformsSet
Number of uniforms set during the current frame.
|
protected int |
numVertices
Number of mesh vertices rendered during the current frame.
|
protected IntMap<java.lang.Void> |
shadersUsed
IDs of all shaders in use.
|
protected IntMap<java.lang.Void> |
texturesUsed
IDs of all textures in use.
|
Constructor and Description |
---|
Statistics() |
Modifier and Type | Method and Description |
---|---|
void |
clearFrame()
Clears all frame-specific statistics such as objects used per frame.
|
void |
clearMemory()
Called when video memory is cleared.
|
void |
getData(int[] data)
Retrieves the statistics data into the given array.
|
java.lang.String[] |
getLabels()
Returns a list of labels corresponding to each statistic.
|
boolean |
isEnabled()
Tests whether updates are enabled.
|
void |
onDeleteFrameBuffer()
Called by the Renderer when it deletes a framebuffer.
|
void |
onDeleteShader()
Called by the Renderer when it deletes a shader.
|
void |
onDeleteTexture()
Called by the Renderer when it deletes a texture.
|
void |
onFrameBufferUse(FrameBuffer fb,
boolean wasSwitched)
Called by the Renderer when a framebuffer has been set.
|
void |
onMeshDrawn(Mesh mesh,
int lod)
Called by the Renderer when a mesh has been drawn.
|
void |
onMeshDrawn(Mesh mesh,
int lod,
int count)
Called by the Renderer when a mesh has been drawn.
|
void |
onNewFrameBuffer()
Called by the Renderer when it creates a new framebuffer.
|
void |
onNewShader()
Called by the Renderer when it creates a new shader.
|
void |
onNewTexture()
Called by the Renderer when it creates a new texture.
|
void |
onShaderUse(Shader shader,
boolean wasSwitched)
Called by the Renderer when a shader has been utilized.
|
void |
onTextureUse(Image image,
boolean wasSwitched)
Called by the Renderer when a texture has been set.
|
void |
onUniformSet()
Called by the Renderer when a uniform was set.
|
void |
setEnabled(boolean f)
Enables or disables updates.
|
protected boolean enabled
protected int numObjects
protected int numTriangles
protected int numVertices
protected int numShaderSwitches
protected int numTextureBinds
protected int numFboSwitches
protected int numUniformsSet
protected int memoryShaders
protected int memoryFrameBuffers
protected int memoryTextures
protected IntMap<java.lang.Void> shadersUsed
protected IntMap<java.lang.Void> texturesUsed
protected IntMap<java.lang.Void> fbosUsed
protected int lastShader
public java.lang.String[] getLabels()
getData(int[])
public void getData(int[] data)
getLabels()
.data
- The data array to write topublic void onMeshDrawn(Mesh mesh, int lod, int count)
mesh
- the Mesh that was drawn (not null)lod
- which level of detailcount
- multiplier for triangles and verticespublic void onMeshDrawn(Mesh mesh, int lod)
mesh
- the Mesh that was drawn (not null)lod
- which level of detailpublic void onShaderUse(Shader shader, boolean wasSwitched)
shader
- The shader that was usedwasSwitched
- If true, the shader has required a state switchpublic void onUniformSet()
public void onTextureUse(Image image, boolean wasSwitched)
image
- The image that was setwasSwitched
- If true, the texture has required a state switchpublic void onFrameBufferUse(FrameBuffer fb, boolean wasSwitched)
fb
- The framebuffer that was setwasSwitched
- If true, the framebuffer required a state switchpublic void clearFrame()
public void onNewShader()
public void onNewTexture()
public void onNewFrameBuffer()
public void onDeleteShader()
public void onDeleteTexture()
public void onDeleteFrameBuffer()
public void clearMemory()
public void setEnabled(boolean f)
f
- true to enable, false to disablepublic boolean isEnabled()