QSDK 1.1 Documentation
Main Page | Modules | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

Q::StatsLayer Struct Reference
[User Interface]

On-screen engine stats. More...

#include <Q/q.h>

Inheritance diagram for Q::StatsLayer:

Q::Layer Q::ObjectBase List of all members.

Public Types

enum  Category {
  Fps = 0x0001,
  General = 0x0002,
  Loading = 0x0004,
  Memory = 0x0008,
  Objects = 0x0010,
  Instances = 0x0020,
  Draw = 0x0040,
  Times = 0x0080,
  Sounds = 0x0100,
  Clumps = 0x0200
}

Public Member Functions

 StatsLayer ()
 ~StatsLayer ()
unsigned int categories () const
unsigned int pointSize () const
Maths::Color4b color () const
Maths::Color4b shadowColor () const
bool compactMode () const
bool historyEnabled () const
Utils::Result setCategories (unsigned int)
Utils::Result setPointSize (unsigned int)
Utils::Result setColor (const Maths::Color4b &color)
Utils::Result setShadowColor (const Maths::Color4b &color)
Utils::Result setCompactMode (bool)
Utils::Result setHistoryEnabled (bool)
Utils::Result resetHistory ()

Static Public Member Functions

StatsLayer create (const Screen &screen, const Font &font, unsigned int pointSize, float margin, const Maths::Vec2f &center, const Maths::Vec2f &alignment, const Maths::Color4b &color, const Maths::Color4b &shadowColor, bool isAlwaysTop=false)
ClassType classType ()
StatsLayer cast (const ObjectBase &obj)

Detailed Description

On-screen engine stats.

A StatsLayer is a layer that displays application statistics. Those statistics are categorized.

Note:
By default, all categories are displayed and the mode is not compact. The update period is one second.
Warning:
The StatsLayer reads statistics by pulling them. Everytime statistics are read, they get reset so using a StatsLayer may conflict with other modules that read statistics.


Member Enumeration Documentation

enum Q::StatsLayer::Category
 

The categories of statistics the StatsLayer displays.

Enumeration values:
Fps  Display the frame rate.
General  Display the time the application has been runing, the render cache size, the number of active zones and the number of active loading paths.
Loading  Display the size and the contents of the load queue.
Memory  Display the total memory allocated, the size of the memory pool, how much memory is free, the number of OIDs and number of strings.
Objects  Display the size of the object cache, the overflow size and how much object memory is free.
Instances  Display the number of updated instances, the number of instances moved and the number of instances drawn since last update.
Draw  Display the number of shaders, the number of textures, the number of triangles and the number of matrices.
Times  Display the time spent rendering, the time spent in the application, the time spent updating and the time spent loading.
Sounds  Display the size of the sound cache, how much sound memory is free and the number of playing audio voices
Clumps  Display the size of the last load clump, the time spent for it, the time spent reading it and the time spent restoring it.


Constructor & Destructor Documentation

Q::StatsLayer::StatsLayer  ) 
 

Create a null StatsLayer handle.

Q::StatsLayer::~StatsLayer  ) 
 

Destroy the layer, removing it from its parent screen.


Member Function Documentation

StatsLayer Q::StatsLayer::cast const ObjectBase obj  )  [static]
 

If the object referenced by obj is a StatsLayer, then return a suitable reference to the object.

unsigned int Q::StatsLayer::categories  )  const
 

Return the display categories. The StatsLayer only displays the statistics associated with the specified categories.

ClassType Q::StatsLayer::classType  )  [static]
 

Return the type of this class.

Maths::Color4b Q::StatsLayer::color  )  const
 

Return the color of the layer.

bool Q::StatsLayer::compactMode  )  const
 

Indicates whether the display mode is compact or not. If true, only the frame rate is displayed in the top-right corner. If false, all the selected categories are displayed. By default, the compact mode is false.

StatsLayer Q::StatsLayer::create const Screen screen,
const Font font,
unsigned int  pointSize,
float  margin,
const Maths::Vec2f center,
const Maths::Vec2f alignment,
const Maths::Color4b color,
const Maths::Color4b shadowColor,
bool  isAlwaysTop = false
[static]
 

Create a StatsLayer with the given dimensions and position. The specified font is used to render the statistics. The statistics are displayed with a shadow, color specifies the color of the foreground text, shadowColor the color of the background shadow. The value of pointSize is the height of an individual character of text in the screen's virtual coordinate system. The text inside the layer is offset from the edge of the layer by the margin.

Note:
By default, the StatsLayer displays all categories of statistics. Call StatsLayer::setCategories to disable some of them.
Parameters:
center The center of the layer. It determines the location of the rectangle in the screen's virtual coordinate system.
alignment The alignment of the layer. It determines the location of the origin of the layer's local coordinate system. An alignment of (0,0) places the origin at the bottom left of the layer and an alignment of (1,1) places it at the top right.

bool Q::StatsLayer::historyEnabled  )  const
 

Indicates whether historical data (e.g. minimum frame rate, maximum times) is computed or not. Disabling it allows the user to prevent spurious data from adding noise to those figures in some cases.

unsigned int Q::StatsLayer::pointSize  )  const
 

Return the point size of the text.

Utils::Result Q::StatsLayer::resetHistory  ) 
 

Reset all historical data (e.g. minimum frame rate, maximum times).

Utils::Result Q::StatsLayer::setCategories unsigned  int  ) 
 

Set the display categories. The StatsLayer only displays the statistics associated with the specified categories.

Utils::Result Q::StatsLayer::setColor const Maths::Color4b color  ) 
 

Set the color of the layer.

Utils::Result Q::StatsLayer::setCompactMode bool   ) 
 

Set the compact mode. If true, only the frame rate is displayed in the top-right corner. If false, all the selected categories are displayed. By default, the compact mode is false.

Utils::Result Q::StatsLayer::setHistoryEnabled bool   ) 
 

Indicate whether historical data (e.g. minimum frame rate, maximum times) is computed or not. Disabling it allows the user to prevent spurious data from adding noise to those figures in some cases.

Utils::Result Q::StatsLayer::setPointSize unsigned  int  ) 
 

Set the point size of the text.

Utils::Result Q::StatsLayer::setShadowColor const Maths::Color4b color  ) 
 

Set the dropped shadow color of the layer.

Maths::Color4b Q::StatsLayer::shadowColor  )  const
 

Return the dropped shadow color of the layer.

Return to QSDK documentation Contents page. Contact details for support, information and fault-reporting.
Qube Software Limited © 2000-2004