MochiEngine
Loading...
Searching...
No Matches
Mochi::DebugLayer Class Reference

The debug layer is a layer automatically injected in the Engine if the game is in debug mode. It provides a text indicating that it is a development build, an FPS counter and two perpendicular lines crossing at the center of the screen. More...

#include <DebugLayer.h>

Inheritance diagram for Mochi::DebugLayer:
Mochi::Layer

Public Member Functions

virtual void InitLayer () override
 Override this to initialize members and data of your layer when the engine adds this layer to the layer list. This is useful if you want to create the layer and delay its inclusion on the engine.
virtual bool Update (const float &dt) override
 Override this to give your layer a way to be updated each frame.
virtual void Render () const override
 Override this to send the render commands to the engine. This task could be done on the update, but making it here its clearer.
virtual void GUI () const override
 Override this to draw the GUI of your layer. Even if this could be done anywhere, doing it here ensure it to be drawn after all rendering is done.
virtual void Debug () const override
 Override this to print, draw or show debug GUI's. This will be called after all renderings and other GUIs and will only be shown while in DEBUG configuration.
Public Member Functions inherited from Mochi::Layer
 Layer ()
 Default constructor. It initializes with references to the engine subsystems. Should only be constructed after the engine is setup.

Additional Inherited Members

Protected Attributes inherited from Mochi::Layer
FS::PackCatalogmCatalog
Scripting::ScriptingManagermScripting
Graphics::CameramCamera
Event::EventBusmEventBus
Graphics::AbstractGUImGUI
Input::IActionManagermActionManager
Audio::IAudioManagermAudioManager
Graphics::IRenderermRenderer
Debug::IGizmosmGizmos

Detailed Description

The debug layer is a layer automatically injected in the Engine if the game is in debug mode. It provides a text indicating that it is a development build, an FPS counter and two perpendicular lines crossing at the center of the screen.

Member Function Documentation

◆ Debug()

void Mochi::DebugLayer::Debug ( ) const
overridevirtual

Override this to print, draw or show debug GUI's. This will be called after all renderings and other GUIs and will only be shown while in DEBUG configuration.

Reimplemented from Mochi::Layer.

◆ GUI()

void Mochi::DebugLayer::GUI ( ) const
overridevirtual

Override this to draw the GUI of your layer. Even if this could be done anywhere, doing it here ensure it to be drawn after all rendering is done.

Reimplemented from Mochi::Layer.

◆ InitLayer()

void Mochi::DebugLayer::InitLayer ( )
overridevirtual

Override this to initialize members and data of your layer when the engine adds this layer to the layer list. This is useful if you want to create the layer and delay its inclusion on the engine.

Reimplemented from Mochi::Layer.

◆ Render()

void Mochi::DebugLayer::Render ( ) const
overridevirtual

Override this to send the render commands to the engine. This task could be done on the update, but making it here its clearer.

Reimplemented from Mochi::Layer.

◆ Update()

bool Mochi::DebugLayer::Update ( const float & dt)
overridevirtual

Override this to give your layer a way to be updated each frame.

Parameters
dtThe delta time
Returns
true if the execution should continue, false if the execution should halt.

Reimplemented from Mochi::Layer.


The documentation for this class was generated from the following files:
  • Engine/src/Debug/DebugLayer.h
  • Engine/src/Debug/DebugLayer.cpp