Skip to content

Commit

Permalink
Add ImGuiTestApp::testContext()
Browse files Browse the repository at this point in the history
This is a convenience getter to access the context from
anywhere

Signed-off-by: Sergio Martins <[email protected]>
  • Loading branch information
iamsergio committed Nov 4, 2024
1 parent 1b6b7d3 commit dd50403
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ui/test/ImGuiTestApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,5 @@ void ImGuiTestApp::printWindows() {
fmt::println(" popup name={}; flags={}", data.Window->Name, flagsString(data.Window->Flags));
}
}

ImGuiTestContext* ImGuiTestApp::testContext() const { return _engine ? _engine->TestContext : nullptr; }
2 changes: 2 additions & 0 deletions src/ui/test/ImGuiTestApp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ class ImGuiTestApp {
// Runs the gui tests and returns true on success
bool runTests();

ImGuiTestContext* testContext() const;

/**
Captures a screenshot.
Expand Down

0 comments on commit dd50403

Please sign in to comment.