Vertices Engine  v1.9.2.92
A Cross Platform game engine developed by Virtex Edge Design.
Loading...
Searching...
No Matches
VerticesEngine.Diagnostics.vxTimeRulerDebugControl Class Reference

Realtime CPU measuring tool. More...

Inheritance diagram for VerticesEngine.Diagnostics.vxTimeRulerDebugControl:
VerticesEngine.Diagnostics.vxDebugUIControlBaseClass VerticesEngine.vxGameObject VerticesEngine.vxISelectable

Public Member Functions

override string GetCommand ()
 Gets the command.
 
override string GetDescription ()
 Gets the description.
 
void StartFrame ()
 Start new frame.
 
void BeginMark (string markerName, Color color)
 Start measure time.
 
void BeginMark (int barIndex, string markerName, Color color)
 Start measure time.
 
void EndMark (string markerName)
 End measuring.
 
void EndMark (int barIndex, string markerName)
 End measuring.
 
float GetAverageTime (int barIndex, string markerName)
 Get average time of given bar index and marker name.
 
void ResetLog ()
 Reset marker log.
 
void Draw (Vector2 position, int width)
 
void DrawGraph ()
 Draws the graph.
 
- Public Member Functions inherited from VerticesEngine.Diagnostics.vxDebugUIControlBaseClass
 vxDebugUIControlBaseClass (string toolName)
 
virtual bool RegisterCommand ()
 
virtual void CommandExecute (IDebugCommandHost host, string command, IList< string > args)
 Called when the main 'command' linked to this debug tool is called.
 
- Public Member Functions inherited from VerticesEngine.vxGameObject
virtual void OnEnabled ()
 Called on Component Enabled.
 
virtual void OnDisabled ()
 Called on Component Disabled.
 
virtual void OnSelected ()
 Called when Selected.
 
virtual void OnUnSelected ()
 Called when Unselected.
 
virtual string GetTitle ()
 Gets the title.
 
virtual Texture2D GetIcon (int w, int h)
 Gets the icon for this game object. Override this to provide per-entity cusomtization.
 
 vxGameObject ()
 Creates a new vxGameObject.
 
void Dispose ()
 Dispposes this Object.
 
virtual void OnGraphicsRefresh ()
 Called when there is a reset or refresh of Graphic settings such as resolution or setting.
 

Public Attributes

bool ShowGraph = false
 
- Public Attributes inherited from VerticesEngine.vxGameObject
bool OnlySelectInSandbox = false
 

Properties

bool ShowLog [get, set]
 Gets/Set log display or no.
 
int TargetSampleFrames [get, set]
 Gets/Sets target sample frames.
 
Vector2 Position [get, set]
 Gets/Sets TimeRuler rendering position.
 
int Width [get, set]
 Gets/Sets timer ruler width.
 
- Properties inherited from VerticesEngine.Diagnostics.vxDebugUIControlBaseClass
string DebugToolName [get]
 
- Properties inherited from VerticesEngine.vxGameObject
bool IsVisible [get, set]
 Is this Game Object currently visible? Note that an Object can be Enabled, but not visible.
 
bool IsEnabled [get, set]
 Is this Game Object Enabled currently.
 
string Id [get, set]
 A unqiue string id which allows references to items to be serialised between sessions.
 
Texture2D DefaultTexture [get]
 Gets the default texture.
 
vxEnumSandboxStatus SandboxState [get]
 State of the Entity which is triggered by the simulation.
 
vxSelectionState SelectionState [get, set]
 Gets or sets the selection state.
 
vxSelectionState PreviousSelectionState [get]
 Get's the previous selection state.
 
bool IsDisposed [get]
 

Additional Inherited Members

- Static Public Attributes inherited from VerticesEngine.vxGameObject
static List< string > NameRegister = new List<string>()
 The name register.
 
- Protected Member Functions inherited from VerticesEngine.Diagnostics.vxDebugUIControlBaseClass
virtual void AddArgument (string arg, string description, DebugCommandExecute callback)
 
- Protected Member Functions inherited from VerticesEngine.vxGameObject
virtual void OnVisibilityChanged ()
 Called when an Objects Visibility Changes.
 
virtual bool HasId ()
 
virtual void OnSelectionStateChange ()
 Called when the selection state changes.
 
virtual string GetIdPrefix ()
 
virtual void OnDisposed ()
 Called when the entity is disposed.
 
- Events inherited from VerticesEngine.vxGameObject
EventHandler< EventArgs > Selected
 Event Fired when the Items Selection stat Changes too Hovered.
 
EventHandler< EventArgs > UnSelected
 Event Fired when the Items Selection stat Changes too unselected (or unhovered)
 

Detailed Description

Realtime CPU measuring tool.

You can visually find bottle neck, and know how much you can put more CPU jobs by using this tool. Because of this is real time profile, you can find glitches in the game too.

TimeRuler provide the following features:

  • Up to 8 bars (Configurable)
  • Change colors for each markers
  • Marker logging.
  • It won't even generate BeginMark/EndMark method calls when you got rid of the TRACE constant.
  • It supports up to 32 (Configurable) nested BeginMark method calls.
  • Multithreaded safe
  • Automatically changes display frames based on frame duration.

How to use: Added TimerRuler instance to Game.Components and call timerRuler.StartFrame in top of the Game.Update method.

Then, surround the code that you want measure by BeginMark and EndMark.

timeRuler.BeginMark( "Update", Color.Blue ); // process that you want to measure. timerRuler.EndMark( "Update" );

Also, you can specify bar index of marker (default value is 0)

timeRuler.BeginMark( 1, "Update", Color.Blue );

All profiling methods has CondionalAttribute with "TRACE". If you not specified "TRACE" constant, it doesn't even generate method calls for BeginMark/EndMark. So, don't forget remove "TRACE" constant when you release your game.

Member Function Documentation

◆ BeginMark() [1/2]

void VerticesEngine.Diagnostics.vxTimeRulerDebugControl.BeginMark ( int barIndex,
string markerName,
Color color )

Start measure time.

Parameters
barIndexindex of bar
markerNamename of marker.
colorcolor/param>

◆ BeginMark() [2/2]

void VerticesEngine.Diagnostics.vxTimeRulerDebugControl.BeginMark ( string markerName,
Color color )

Start measure time.

Parameters
markerNamename of marker.
colorcolor/param>

◆ EndMark() [1/2]

void VerticesEngine.Diagnostics.vxTimeRulerDebugControl.EndMark ( int barIndex,
string markerName )

End measuring.

Parameters
barIndexIndex of bar.
markerNameName of marker.

◆ EndMark() [2/2]

void VerticesEngine.Diagnostics.vxTimeRulerDebugControl.EndMark ( string markerName)

End measuring.

Parameters
markerNameName of marker.

◆ GetAverageTime()

float VerticesEngine.Diagnostics.vxTimeRulerDebugControl.GetAverageTime ( int barIndex,
string markerName )

Get average time of given bar index and marker name.

Parameters
barIndexIndex of bar
markerNamename of marker
Returns
average spending time in ms.

◆ GetCommand()

override string VerticesEngine.Diagnostics.vxTimeRulerDebugControl.GetCommand ( )
virtual

Gets the command.

Returns
The command.

Reimplemented from VerticesEngine.Diagnostics.vxDebugUIControlBaseClass.

◆ GetDescription()

override string VerticesEngine.Diagnostics.vxTimeRulerDebugControl.GetDescription ( )
virtual

Gets the description.

Returns
The description.

Reimplemented from VerticesEngine.Diagnostics.vxDebugUIControlBaseClass.


The documentation for this class was generated from the following file: