You.i Engine
CYIHud Class Reference

Detailed Description

A class used to display information on top of the rendered scenes.

This class is used to render one or more information bars on top of the rendered scenes. Each bar is made of one or more section which can display data.

An instance of this class is held by CYIApp and used to display debugging information.

#include <debug/YiHud.h>

Classes

class  Bar
 
class  Section
 
class  SectionGroup
 

Public Types

enum  BarAlignment {
  BarAlignment::TopLeft,
  BarAlignment::TopCenter,
  BarAlignment::TopRight,
  BarAlignment::Center,
  BarAlignment::BottomLeft,
  BarAlignment::BottomCenter,
  BarAlignment::BottomRight
}
 
enum  HudSection : uint8_t {
  HudSection::ReservedGroupSection = 0,
  HudSection::DrawIndicator,
  HudSection::FrameMax,
  HudSection::FrameMinAvg,
  HudSection::Frames,
  HudSection::UpdateMax,
  HudSection::UpdateMinAvg,
  HudSection::DrawMax,
  HudSection::DrawMinAvg,
  HudSection::SwapMax,
  HudSection::SwapMinAvg,
  HudSection::ToolsMax,
  HudSection::ToolsMinAvg,
  HudSection::FPSMin,
  HudSection::FPSAvgMax,
  HudSection::Overdraw,
  HudSection::LegacyUpdate,
  HudSection::LegacyDraw,
  HudSection::LegacySwap,
  HudSection::LegacyFPS,
  HudSection::AtlasUsageRegular,
  HudSection::AtlasUsageSDF,
  HudSection::SystemMemory,
  HudSection::SystemMemoryTotal,
  HudSection::SystemMemoryPercentage,
  HudSection::ProcessMemory,
  HudSection::RSSMemory,
  HudSection::GPUMemory,
  HudSection::GPUMemoryTotal,
  HudSection::GPUMemoryPercentage,
  HudSection::SystemCPUUsagePercentage,
  HudSection::PerCPUUsageGraph,
  HudSection::ProcessCPUUsagePercentage,
  HudSection::GPUUsagePercentage,
  HudSection::LoadAverages,
  HudSection::EngineVersion,
  HudSection::EngineHash,
  HudSection::AppVersion,
  HudSection::EngineBuildConfiguration,
  HudSection::NetworkResponseRecordingWarning,
  HudSection::UserText,
  HudSection::UserSection
}
 

Public Member Functions

 CYIHud ()
 
BarAddBar (BarAlignment alignment)
 
void SetSectionEnabled (HudSection section, bool enabled)
 
bool IsSectionEnabled (HudSection section) const
 
std::vector< const Bar * > GetBars () const
 
std::vector< Bar * > GetBars ()
 
BarGetMainBar ()
 
bool Update ()
 
void Draw ()
 

Static Public Member Functions

static void SetUserText (const CYIString &text)
 
static const CYIStringGetUserText ()
 

Member Enumeration Documentation

◆ BarAlignment

enum CYIHud::BarAlignment
strong

An enum listing the various supported alignment positions for HUD bars.

Enumerator
TopLeft 
TopCenter 
TopRight 
Center 
BottomLeft 
BottomCenter 
BottomRight 

◆ HudSection

enum CYIHud::HudSection : uint8_t
strong

The type of a HUD section. These types are used to control showing/hiding sections from the HUD dev panel widget.

Warning
CYIHud::HudSection::ReservedGroupSection is a reserved section type and cannot be used in user-created sections. Add a section of type CYIHud::SectionGroup if a section group is needed.
Enumerator
ReservedGroupSection 
DrawIndicator 
FrameMax 
FrameMinAvg 
Frames 
UpdateMax 
UpdateMinAvg 
DrawMax 
DrawMinAvg 
SwapMax 
SwapMinAvg 
ToolsMax 
ToolsMinAvg 
FPSMin 
FPSAvgMax 
Overdraw 
LegacyUpdate 
LegacyDraw 
LegacySwap 
LegacyFPS 
AtlasUsageRegular 
AtlasUsageSDF 
SystemMemory 
SystemMemoryTotal 
SystemMemoryPercentage 
ProcessMemory 
RSSMemory 
GPUMemory 
GPUMemoryTotal 
GPUMemoryPercentage 
SystemCPUUsagePercentage 
PerCPUUsageGraph 
ProcessCPUUsagePercentage 
GPUUsagePercentage 
LoadAverages 
EngineVersion 
EngineHash 
AppVersion 
EngineBuildConfiguration 
NetworkResponseRecordingWarning 
UserText 
UserSection 

Constructor & Destructor Documentation

◆ CYIHud()

CYIHud::CYIHud ( )

Member Function Documentation

◆ AddBar()

Bar* CYIHud::AddBar ( BarAlignment  alignment)

Adds a new bar to this HUD instance. The bar will have alignemnt alignment. Multiple bars can be added with the same alignment: in that case, the bars will be drawn vertically offset from each other.

Note
CYIHud only supports having a one bar with CYIHud::BarAlignment::Center alignment.
The returned pointer is invalidated upon subsequent calls to AddBar.
See also
CYIHud::Section

◆ Draw()

void CYIHud::Draw ( )

Draws this HUD.

◆ GetBars() [1/2]

std::vector<const Bar *> CYIHud::GetBars ( ) const

Returns all bars contained in this HUD. Returns an empty list if this HUD does not contain any bars.

◆ GetBars() [2/2]

std::vector<Bar *> CYIHud::GetBars ( )

◆ GetMainBar()

Bar* CYIHud::GetMainBar ( )

Returns the first bar contained in this HUD. Returns nullptr if this HUD does not contain any bars.

◆ GetUserText()

static const CYIString& CYIHud::GetUserText ( )
static

◆ IsSectionEnabled()

bool CYIHud::IsSectionEnabled ( HudSection  section) const

Returns true if at least one section within this HUD has type section and is enabled.

◆ SetSectionEnabled()

void CYIHud::SetSectionEnabled ( HudSection  section,
bool  enabled 
)

Sets the enabled status every section with type section to enabled.

◆ SetUserText()

static void CYIHud::SetUserText ( const CYIString text)
static

Sets the text for all HudSection::UserText sections to text. This function is static and does not require a specific CYIHud instance.

◆ Update()

bool CYIHud::Update ( )

Updates this HUD. This function is typically called once per frame. Returns true if a draw should be forced.


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