Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

FpsCounter

Add this in your code:

#include <engine/tool/fps_counter.h>

Description

Component to display the FPS counter in the game.

Variables


NameTypeDescription
showAverageboolShould should average fps?

Public methods


GetTextRenderer

Get the text renderer used for displaying the FPS.

const std::weak_ptr<TextRenderer>& GetTextRenderer()

SetTextRenderer

Set the text renderer to use for displaying the FPS.

Parameters:

  • textRenderer: True to enable Multisampling
void SetTextRenderer(const std::shared_ptr<TextRenderer>& textRenderer)