mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-06 19:39:56 -05:00
Expose the SGCT statistics information through a property in the RenderEngine (closes #2195)
This commit is contained in:
+1
-1
Submodule apps/OpenSpace/ext/sgct updated: 26c8c4dc7c...3286bd718a
@@ -942,6 +942,9 @@ void setSgctDelegateFunctions() {
|
||||
sgctDelegate.setScreenshotFolder = [](std::string path) {
|
||||
Settings::instance().setCapturePath(std::move(path));
|
||||
};
|
||||
sgctDelegate.showStatistics = [](bool enabled) {
|
||||
Engine::instance().setStatsGraphVisibility(enabled);
|
||||
};
|
||||
}
|
||||
|
||||
void checkCommandLineForSettings(int& argc, char** argv, bool& hasSGCT, bool& hasProfile,
|
||||
|
||||
@@ -105,6 +105,8 @@ struct WindowDelegate {
|
||||
uint64_t (*swapGroupFrameNumber)() = []() { return uint64_t(0); };
|
||||
|
||||
void (*setScreenshotFolder)(std::string) = [](std::string) {};
|
||||
|
||||
void (*showStatistics)(bool) = [](bool) {};
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
@@ -180,6 +180,7 @@ private:
|
||||
|
||||
properties::IntListProperty _screenshotWindowIds;
|
||||
properties::BoolProperty _applyWarping;
|
||||
properties::BoolProperty _showStatistics;
|
||||
properties::BoolProperty _screenshotUseDate;
|
||||
properties::BoolProperty _showFrameInformation;
|
||||
properties::BoolProperty _disableMasterRendering;
|
||||
|
||||
@@ -131,6 +131,12 @@ namespace {
|
||||
"interface"
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo ShowStatisticsInfo = {
|
||||
"ShowStatistics",
|
||||
"Show Statistics",
|
||||
"Show updating, rendering, and network statistics on all rendering nodes"
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo ScreenshotUseDateInfo = {
|
||||
"ScreenshotUseDate",
|
||||
"Screenshot Folder uses Date",
|
||||
@@ -271,6 +277,7 @@ RenderEngine::RenderEngine()
|
||||
, _showCameraInfo(ShowCameraInfo, true)
|
||||
, _screenshotWindowIds(ScreenshotWindowIdsInfo)
|
||||
, _applyWarping(ApplyWarpingInfo, false)
|
||||
, _showStatistics(ShowStatisticsInfo, false)
|
||||
, _screenshotUseDate(ScreenshotUseDateInfo, false)
|
||||
, _showFrameInformation(ShowFrameNumberInfo, false)
|
||||
, _disableMasterRendering(DisableMasterInfo, false)
|
||||
@@ -338,6 +345,11 @@ RenderEngine::RenderEngine()
|
||||
addProperty(_screenshotWindowIds);
|
||||
addProperty(_applyWarping);
|
||||
|
||||
_showStatistics.onChange([this]() {
|
||||
global::windowDelegate->showStatistics(_showStatistics);
|
||||
});
|
||||
addProperty(_showStatistics);
|
||||
|
||||
_screenshotUseDate.onChange([this]() {
|
||||
// If there is no screenshot folder, don't bother with handling the change
|
||||
if (!FileSys.hasRegisteredToken("${STARTUP_SCREENSHOT}")) {
|
||||
|
||||
Reference in New Issue
Block a user