FpsWidget Class
Debug widget for real-time FPS metrics and frame pacing configuration. More...
Declaration
Base class
| class | ImGuiWidget |
|
Abstract base class for ImGui widgets rendered in debug overlays. More... | |
Public Constructors Index
| FpsWidget (helios::engine::tooling::FpsMetrics *fpsMetrics, helios::engine::tooling::FramePacer *framePacer=nullptr) | |
Public Member Functions Index
| void | draw () override |
|
Renders the FPS metrics UI using ImGui. More... | |
Private Member Attributes Index
| helios::engine::tooling::FpsMetrics * | fpsMetrics_ = nullptr |
|
Pointer to an FpsMetrics instance used for tracking and displaying FPS metrics. More... | |
| helios::engine::tooling::FramePacer * | framePacer_ = nullptr |
|
Pointer to a `FramePacer` instance for managing frame pacing and target FPS. More... | |
| float | targetFpsInput_ = 0.0f |
|
Stores the user-configured target frames per second (FPS) for frame pacing. More... | |
| bool | showInSeconds_ = false |
|
Determines whether timing information is displayed in seconds or milliseconds. More... | |
| int | historySizeInput_ = 60 |
|
Input value for configuring the size of the FPS history buffer. More... | |
Description
Debug widget for real-time FPS metrics and frame pacing configuration.
Displays average FPS, frame time, work time, idle time, and frame history graph. Optionally allows runtime configuration of frame pacing target FPS via buttons and sliders (requires a `FramePacer` instance).
This widget is not thread-safe. Use from the main/render thread only.
Definition at line 30 of file FpsWidget.ixx.
Public Constructors
FpsWidget()
| inline explicit |
Constructs the FpsWidget.
- Parameters
-
fpsMetrics Pointer to the FpsMetrics instance (must remain valid).
framePacer Optional pointer to FramePacer for runtime FPS configuration.
Definition at line 102 of file FpsWidget.ixx.
Public Member Functions
draw()
| inline virtual |
Renders the FPS metrics UI using ImGui.
Definition at line 118 of file FpsWidget.ixx.
Private Member Attributes
fpsMetrics_
|
Pointer to an FpsMetrics instance used for tracking and displaying FPS metrics.
This member provides direct access to real-time frame rate statistics, including current FPS, average FPS, and frame timing data, which are displayed in the widget. It is expected to be externally managed and supplied during widget initialization.
The pointer must remain valid throughout the lifetime of the FpsWidget instance.
Definition at line 43 of file FpsWidget.ixx.
framePacer_
|
Pointer to a `FramePacer` instance for managing frame pacing and target FPS.
Provides frame pacing control to synchronize application updates with a specified frame rate target, if set. When associated with a valid `FramePacer`, it enables runtime configuration of frame timing and update intervals.
This pointer must be initialized with a valid `FramePacer` instance or set to `nullptr` if frame pacing is not required. Ensure the lifetime of the referenced `FramePacer` extends beyond the usage of this pointer.
Definition at line 56 of file FpsWidget.ixx.
historySizeInput_
|
Input value for configuring the size of the FPS history buffer.
Determines the number of recent frame timing samples to store and display. This value directly influences the frame history graph rendering in the FPS widget. Typically adjusted by the user through the UI input field.
Must be within a valid range, with a lower limit of 1 and an upper limit of 1000 to prevent excessive memory usage or invalid states.
Definition at line 92 of file FpsWidget.ixx.
showInSeconds_
|
Determines whether timing information is displayed in seconds or milliseconds.
If set to `true`, all timing metrics (e.g., frame time, work time, idle time) are shown in seconds. If set to `false`, they are shown in milliseconds.
Used to toggle between different units of measurement for presenting frame timing metrics in the FPS widget UI.
Definition at line 80 of file FpsWidget.ixx.
targetFpsInput_
|
Stores the user-configured target frames per second (FPS) for frame pacing.
Acts as the intermediate value for the target FPS, used for runtime adjustments via buttons or sliders in the UI. This variable gets updated dynamically based on user input and reflects the desired frame rate. A value of `0.0f` indicates an uncapped frame rate.
This variable is synchronized with the target FPS of the associated `FramePacer` instance if provided.
Definition at line 69 of file FpsWidget.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.