libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
Loading...
Searching...
No Matches
Fast::GfxDebugger Class Reference

Graphics display-list debugger for the Fast3D renderer. More...

#include <GfxDebugger.h>

Inheritance diagram for Fast::GfxDebugger:
[legend]
Collaboration diagram for Fast::GfxDebugger:
[legend]

Public Member Functions

 GfxDebugger ()
 Constructs the GfxDebugger component.
 
void RequestDebugging ()
 Requests that the renderer pause after the next display list.
 
bool IsDebugging () const
 Returns true if the debugger is currently paused on a display list.
 
bool IsDebuggingRequested () const
 Returns true if a debugging pause has been requested but not yet honoured.
 
void DebugDisplayList (F3DGfx *cmds)
 Captures a display list for debugging inspection.
 
void ResumeGame ()
 Resumes game execution after a debugging pause.
 
const F3DGfxGetDisplayList () const
 Returns the currently captured display list.
 
const std::vector< const F3DGfx * > & GetBreakPoint () const
 Returns the current breakpoint path.
 
bool HasBreakPoint (const std::vector< const F3DGfx * > &path) const
 Checks whether a breakpoint is set at the given command path.
 
void SetBreakPoint (const std::vector< const F3DGfx * > &bp)
 Sets a breakpoint at the given display-list command path.
 
- Public Member Functions inherited from Ship::Component
 Component (const std::string &name, std::shared_ptr< Context > context=nullptr)
 Constructs a Component with the given name.
 
virtual ~Component ()
 
void Init (const nlohmann::json &initArgs=nlohmann::json::object())
 Performs one-time initialization of this component.
 
bool IsInitialized () const
 Returns true once Init() (or MarkInitialized()) has completed successfully.
 
const std::string & GetName () const
 Returns the name of this Component.
 
std::string ToString () const
 Returns a human-readable string representation (e.g. "Name (id)").
 
std::string ToTreeString (int depth=0) const
 Returns a human-readable tree representation of this component and its children.
 
 operator std::string () const
 Conversion operator to std::string; equivalent to ToString().
 
ParentComponentListGetParents ()
 Returns a mutable reference to the parent list.
 
const ParentComponentListGetParents () const
 Returns a const reference to the parent list.
 
ComponentListGetChildren ()
 Returns a mutable reference to the child list.
 
const ComponentListGetChildren () const
 Returns a const reference to the child list.
 
virtual std::shared_ptr< ComponentTryGetSharedComponent () noexcept
 Returns a shared_ptr to this Component when available, otherwise nullptr.
 
virtual std::shared_ptr< ComponentGetSharedComponent ()
 Returns a shared_ptr to this Component via the correct enable_shared_from_this base.
 
template<typename T >
bool HasInChildren () const
 Checks whether any descendant Component matches type T via BFS.
 
template<typename T >
std::shared_ptr< T > GetFirstInChildren () const
 Returns the first descendant that matches type T via BFS.
 
template<typename T >
std::shared_ptr< std::vector< std::shared_ptr< T > > > GetInChildren () const
 Returns all descendants that match type T via BFS.
 
template<typename T >
bool HasInParents () const
 Checks whether any ancestor Component matches type T via BFS.
 
template<typename T >
std::shared_ptr< T > GetFirstInParents () const
 Returns the first ancestor that matches type T via BFS.
 
template<typename T >
std::shared_ptr< std::vector< std::shared_ptr< T > > > GetInParents () const
 Returns all ancestors that match type T via BFS.
 
- Public Member Functions inherited from Ship::Part
 Part ()
 Constructs a Part and assigns it a unique ID.
 
 Part (std::shared_ptr< Context > context)
 Constructs a Part with an explicit Context reference and unique ID.
 
virtual ~Part ()=default
 
uint64_t GetId () const
 Returns the unique identifier for this Part.
 
bool operator== (const Part &other) const
 Compares two Parts for equality by their unique IDs.
 
std::shared_ptr< ContextGetContext () const
 Returns the Context this Part belongs to, or nullptr if unset.
 
void SetContext (std::shared_ptr< Context > ctx)
 Sets the Context this Part belongs to.
 

Additional Inherited Members

- Protected Member Functions inherited from Ship::Component
virtual void OnInit (const nlohmann::json &initArgs=nlohmann::json::object())
 Override this to implement component-specific initialization logic.
 
void MarkInitialized ()
 Marks this component as initialized without going through Init().
 
template<typename T >
std::shared_ptr< T > RequireDependency (const std::shared_ptr< T > &dependency, const std::string &dependencyName) const
 Returns a cached dependency after validating it exists and is initialized.
 
- Protected Member Functions inherited from Ship::Part
virtual void OnAdded (bool forced)
 Called after this Part has been added to a PartList.
 
virtual void OnRemoved (bool forced)
 Called after this Part has been removed from a PartList.
 

Detailed Description

Graphics display-list debugger for the Fast3D renderer.

GfxDebugger allows pausing execution at a specific display-list command, inspecting the current display list, and stepping through rendering. It is used by the GfxDebuggerWindow GUI panel.

Required Context children: None — GfxDebugger has no dependencies on other components. However, it must be present as a direct child of the Context because the Fast3D interpreter looks it up via Context::GetChildren().GetFirst<GfxDebugger>() on every rendered frame.

Obtain the instance from Context::GetChildren().GetFirst<Fast::GfxDebugger>().

Constructor & Destructor Documentation

◆ GfxDebugger()

Fast::GfxDebugger::GfxDebugger ( )

Constructs the GfxDebugger component.

Member Function Documentation

◆ DebugDisplayList()

void Fast::GfxDebugger::DebugDisplayList ( F3DGfx cmds)

Captures a display list for debugging inspection.

Parameters
cmdsPointer to the head of the display list to debug.

◆ GetBreakPoint()

const std::vector< const F3DGfx * > & Fast::GfxDebugger::GetBreakPoint ( ) const

Returns the current breakpoint path.

Returns
Vector of display-list command pointers forming the breakpoint path.

◆ GetDisplayList()

const F3DGfx * Fast::GfxDebugger::GetDisplayList ( ) const

Returns the currently captured display list.

Returns
Pointer to the display list head, or nullptr if none is captured.

◆ HasBreakPoint()

bool Fast::GfxDebugger::HasBreakPoint ( const std::vector< const F3DGfx * > &  path) const

Checks whether a breakpoint is set at the given command path.

Parameters
pathDisplay-list command path to check.
Returns
true if a breakpoint exists at the path.

◆ IsDebugging()

bool Fast::GfxDebugger::IsDebugging ( ) const

Returns true if the debugger is currently paused on a display list.

◆ IsDebuggingRequested()

bool Fast::GfxDebugger::IsDebuggingRequested ( ) const

Returns true if a debugging pause has been requested but not yet honoured.

◆ RequestDebugging()

void Fast::GfxDebugger::RequestDebugging ( )

Requests that the renderer pause after the next display list.

◆ ResumeGame()

void Fast::GfxDebugger::ResumeGame ( )

Resumes game execution after a debugging pause.

◆ SetBreakPoint()

void Fast::GfxDebugger::SetBreakPoint ( const std::vector< const F3DGfx * > &  bp)

Sets a breakpoint at the given display-list command path.

Parameters
bpDisplay-list command path where execution should pause.

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