VISU - PHP Game Framework

QuickstartDebugMetricsOverlay
in package

Table of Contents

Properties

$enabled  : bool
Should the debug overlay be rendered?
$container  : Container
$globalRows  : array<string|int, string>
Rows to be rendered on the next frame
$overlayTextRenderer  : DebugOverlayTextRenderer
$rows  : array<string|int, string>
An array of string to be renderd on the next frame

Methods

__construct()  : mixed
Constructor
__debugInfo()  : mixed
Because we are holding a reference to the container, we specify what to return on debug info To prevent irrelevant information from being dumped.
attachPass()  : void
Attaches a render pass to the given pipeline that renders the debug overlay
debugString()  : void
Adds a string to the global quickstart debug overlay, This allows you to quickly visualize debug information. Only intended for quick debugging.
formatNStoHuman()  : string
gameLoopMetrics()  : string
Generates the basic game loop metrics string
gameProfilerMetrics()  : array<string|int, string>
Generates the game profiler metrics strings

Properties

Methods

__construct()

Constructor

public __construct(Container $container) : mixed

As this is a debugging utility, we will use the container directly

Parameters
$container : Container

__debugInfo()

Because we are holding a reference to the container, we specify what to return on debug info To prevent irrelevant information from being dumped.

public __debugInfo() : mixed

debugString()

Adds a string to the global quickstart debug overlay, This allows you to quickly visualize debug information. Only intended for quick debugging.

public static debugString(string $row) : void
Parameters
$row : string

gameLoopMetrics()

Generates the basic game loop metrics string

private gameLoopMetrics(float $deltaTime) : string

Example: FPS: 60 | TC: 0.016 | UT: 0.000000 | FT: 0.000000 | delta: 0.0160

Explanation: FPS: Frames per second TC: Tick count, the amount of ticks that have been executed per frame UT: Update time, the time it took to execute the update loop FT: Frame time, the time it took to execute the draw loop

Parameters
$deltaTime : float
Return values
string

gameProfilerMetrics()

Generates the game profiler metrics strings

private gameProfilerMetrics(ProfilerInterface $profiler) : array<string|int, string>

Example: [RenderPass] CPU(10): 1.23 ms | GPU(10): 2.34 ms | Tri: 12345 [ShadowPass] CPU(10): 0.56 ms | GPU(10): 1.78 ms § | Tri: 6789

Parameters
$profiler : ProfilerInterface
Return values
array<string|int, string>

        
On this page

Search results