LLGL 0.05 Beta
Loading...
Searching...
No Matches
LLGL::RenderingDebugger Class Reference

Rendering debugger interface. More...

#include <RenderingDebugger.h>

Classes

class  Message
 Rendering debugger message class. More...

Public Member Functions

 RenderingDebugger ()
 Initializes the internal data.
virtual ~RenderingDebugger ()
 Release the internal data.
void SetSource (const char *source)
 Sets the new source function name.
void SetDebugGroup (const char *name)
 Sets the new debug group name.
void SetTimeRecording (bool enabled)
 Enables or disables time recording. By default disabled.
bool GetTimeRecording () const
 Returns whether time recording is enabled.
void SetBreakOnError (bool enable)
 Enables or disables the flag to break the debugger when errors are reported. By default disabled.
bool GetBreakOnError () const
 Returns whether the flag to break the debugger when errors are reported is enabled.
void Errorf (const ErrorType type, const char *format,...)
 Posts an error message.
void Warningf (const WarningType type, const char *format,...)
 Posts a warning message.
void FlushProfile (FrameProfile *outputProfile=nullptr)
 Returns the current frame profile and resets the counters for the next frame.
void RecordProfile (const FrameProfile &profile)
 Records the specified profile with the current values.

Static Public Member Functions

static void MergeProfiles (FrameProfile &dst, const FrameProfile &src)
 Merges the source frame profile src into the destination frame profile dst.

Protected Member Functions

virtual void OnError (ErrorType type, Message &message)
 Callback function when an error was posted.
virtual void OnWarning (WarningType type, Message &message)
 Callback function when a warning was posted.

Detailed Description

Rendering debugger interface.

Remarks
This can be used to profile the renderer draw calls and buffer updates.

Constructor & Destructor Documentation

◆ RenderingDebugger()

LLGL::RenderingDebugger::RenderingDebugger ( )

Initializes the internal data.

◆ ~RenderingDebugger()

virtual LLGL::RenderingDebugger::~RenderingDebugger ( )
virtual

Release the internal data.

Member Function Documentation

◆ Errorf()

void LLGL::RenderingDebugger::Errorf ( const ErrorType type,
const char * format,
... )

Posts an error message.

Parameters
[in]typeSpecifies the type of error.
[in]formatSpecifies the formatted message. Same as ::printf.

◆ FlushProfile()

void LLGL::RenderingDebugger::FlushProfile ( FrameProfile * outputProfile = nullptr)

Returns the current frame profile and resets the counters for the next frame.

Parameters
[out]outputProfileOptional pointer to an output profile to retrieve the current values. By default null.

◆ GetBreakOnError()

bool LLGL::RenderingDebugger::GetBreakOnError ( ) const

Returns whether the flag to break the debugger when errors are reported is enabled.

See also
SetBreakOnError

◆ GetTimeRecording()

bool LLGL::RenderingDebugger::GetTimeRecording ( ) const

Returns whether time recording is enabled.

See also
SetTimeRecording

◆ MergeProfiles()

void LLGL::RenderingDebugger::MergeProfiles ( FrameProfile & dst,
const FrameProfile & src )
static

Merges the source frame profile src into the destination frame profile dst.

See also
FrameProfile

◆ OnError()

virtual void LLGL::RenderingDebugger::OnError ( ErrorType type,
Message & message )
protectedvirtual

Callback function when an error was posted.

Remarks
Use the 'message' parameter to block further occurrences of this error if you like. The following example shows a custom implementation that is equivalent to the default implementation:
class MyDebugger : public LLGL::RenderingDebugger {
void OnError(ErrorType type, Message& message) override {
"ERROR (%s) in '%s': %s\n",
LLGL::ToString(type), message.GetSource(), message.GetText()
);
message.Block();
}
};
Rendering debugger message class.
Definition RenderingDebugger.h:123
const UTF8String & GetSource() const
Returns the source function where this message occurred.
Definition RenderingDebugger.h:151
const UTF8String & GetText() const
Returns the message text.
Definition RenderingDebugger.h:145
void Block()
Blocks further occurrences of this message.
Rendering debugger interface.
Definition RenderingDebugger.h:29
virtual void OnError(ErrorType type, Message &message)
Callback function when an error was posted.
LLGL_EXPORT const char * ToString(const ShaderType val)
Returns a string representation for the specified ShaderType value, or null if the input type is inva...
LLGL_EXPORT void Errorf(const char *format,...)
Prints a formatted error message to the log.
ErrorType
Rendering debugger error types enumeration.
Definition RenderingDebuggerFlags.h:27
See also
RenderingDebugger::PostError
OnWarning

◆ OnWarning()

virtual void LLGL::RenderingDebugger::OnWarning ( WarningType type,
Message & message )
protectedvirtual

Callback function when a warning was posted.

See also
RenderingDebugger::PostWarning
OnError

◆ RecordProfile()

void LLGL::RenderingDebugger::RecordProfile ( const FrameProfile & profile)

Records the specified profile with the current values.

Parameters
[in]profileSpecifies the input profile whose values are to be merged with the current values.
See also
MergeProfiles

◆ SetBreakOnError()

void LLGL::RenderingDebugger::SetBreakOnError ( bool enable)

Enables or disables the flag to break the debugger when errors are reported. By default disabled.

Remarks
The render system enables this if it was created with the RenderSystemFlags::DebugBreakOnError flag. If this is enabled, the debugger (if present) will break on each OnError call.
See also
RenderSystemFlags::DebugBreakOnError
OnError

◆ SetDebugGroup()

void LLGL::RenderingDebugger::SetDebugGroup ( const char * name)

Sets the new debug group name.

Parameters
[in]namePointer to a null terminated string that specifies the name. If this is null, the debug group is disabled.
Note
This function only stores the pointer. Hence, the pointer must be valid until a new pointer or a null pointer is set.

◆ SetSource()

void LLGL::RenderingDebugger::SetSource ( const char * source)

Sets the new source function name.

Parameters
[in]sourcePointer to a null terminated string that specifies the name. If this is null, the source is disabled.
Note
This function only stores the pointer. Hence, the pointer must be valid until a new pointer or a null pointer is set.

◆ SetTimeRecording()

void LLGL::RenderingDebugger::SetTimeRecording ( bool enabled)

Enables or disables time recording. By default disabled.

See also
FrameProfile::timeRecords

◆ Warningf()

void LLGL::RenderingDebugger::Warningf ( const WarningType type,
const char * format,
... )

Posts a warning message.

Parameters
[in]typeSpecifies the type of error.
[in]formatSpecifies the formatted message. Same as ::printf.

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