mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-04 18:11:01 -05:00
Move Performance ImGui components into separate windows
This commit is contained in:
@@ -45,6 +45,9 @@ protected:
|
||||
ghoul::SharedMemory* _performanceMemory = nullptr;
|
||||
float _minMaxValues[2];
|
||||
int _sortingSelection;
|
||||
|
||||
bool _sceneGraphIsEnabled;
|
||||
bool _functionsIsEnabled;
|
||||
};
|
||||
|
||||
} // namespace gui
|
||||
|
||||
@@ -48,6 +48,9 @@ void GuiPerformanceComponent::initialize() {
|
||||
_minMaxValues[0] = 100.f;
|
||||
_minMaxValues[1] = 250.f;
|
||||
_sortingSelection = -1;
|
||||
|
||||
_sceneGraphIsEnabled = false;
|
||||
_functionsIsEnabled = false;
|
||||
}
|
||||
|
||||
void GuiPerformanceComponent::deinitialize() {
|
||||
@@ -62,10 +65,15 @@ void GuiPerformanceComponent::render() {
|
||||
if (OsEng.renderEngine().doesPerformanceMeasurements() &&
|
||||
ghoul::SharedMemory::exists(PerformanceManager::PerformanceMeasurementSharedData))
|
||||
{
|
||||
ImGui::SliderFloat2("Min values, max Value", _minMaxValues, 0.f, 10000.f);
|
||||
ImGui::SliderFloat2("Min values, max Value", _minMaxValues, 0.f, 250000.f);
|
||||
_minMaxValues[1] = fmaxf(_minMaxValues[0], _minMaxValues[1]);
|
||||
|
||||
if (ImGui::CollapsingHeader("SceneGraph")) {
|
||||
ImGui::Checkbox("SceneGraph", &_sceneGraphIsEnabled);
|
||||
ImGui::Checkbox("Functions", &_functionsIsEnabled);
|
||||
|
||||
if (_sceneGraphIsEnabled) {
|
||||
ImGui::Begin("SceneGraph", &_sceneGraphIsEnabled);
|
||||
|
||||
// The indices correspond to the index into the average array further below
|
||||
ImGui::Text("Sorting");
|
||||
ImGui::RadioButton("No Sorting", &_sortingSelection, -1);
|
||||
@@ -169,9 +177,11 @@ void GuiPerformanceComponent::render() {
|
||||
);
|
||||
}
|
||||
}
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
if (ImGui::CollapsingHeader("Functions")) {
|
||||
if (_functionsIsEnabled) {
|
||||
ImGui::Begin("Functions", &_functionsIsEnabled);
|
||||
using namespace performance;
|
||||
|
||||
if (!_performanceMemory)
|
||||
@@ -207,7 +217,7 @@ void GuiPerformanceComponent::render() {
|
||||
ImVec2(0, 40)
|
||||
);
|
||||
}
|
||||
|
||||
ImGui::End();
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user