Donner 0.5.1
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
donner::editor::repro::ReproRecorder Class Reference

Records editor UI inputs frame-by-frame. Not thread-safe; must be invoked from the UI thread (where ImGui context is active). More...

#include "donner/editor/repro/ReproRecorder.h"

Public Member Functions

 ReproRecorder (ReproRecorderOptions options)
void snapshotFrame ()
 Call ONCE per frame, after ImGui::NewFrame and before any widget code consumes input events. Reads the current ImGuiIO state, diffs against the previous frame's snapshot, appends a frame record + any discrete events to the in-memory recording buffer.
bool flush ()
 Serialize the in-memory recording to the configured output path. Called from the editor's shutdown path (or invoked manually from a signal handler); safe to call more than once (subsequent calls overwrite the file atomically).
std::size_t frameCount () const
 Number of frames captured so far. Useful for diagnostics / debug logging.

Detailed Description

Records editor UI inputs frame-by-frame. Not thread-safe; must be invoked from the UI thread (where ImGui context is active).

Member Function Documentation

◆ flush()

bool donner::editor::repro::ReproRecorder::flush ( )
nodiscard

Serialize the in-memory recording to the configured output path. Called from the editor's shutdown path (or invoked manually from a signal handler); safe to call more than once (subsequent calls overwrite the file atomically).

Returns true on success.

◆ snapshotFrame()

void donner::editor::repro::ReproRecorder::snapshotFrame ( )

Call ONCE per frame, after ImGui::NewFrame and before any widget code consumes input events. Reads the current ImGuiIO state, diffs against the previous frame's snapshot, appends a frame record + any discrete events to the in-memory recording buffer.

Cheap (a few dozen ImGui field reads + a small vector append), but the buffer grows linearly with recording duration. A 10-minute session at 60 fps produces ~36k frames; back-of-envelope ~5 MB serialized. Not streamed to disk; held entirely in memory until flush().


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