Add performance stats overlay in status bar

Show FPS, frame time, visible/total objects, and visible/total
triangles in the status bar. Toggled via Settings > Show Performance
Stats, persisted in app settings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dion Moult
2026-04-11 20:05:50 +10:00
parent bfac12dbe7
commit 6f6bebf387
8 changed files with 84 additions and 0 deletions
+6
View File
@@ -20,6 +20,7 @@
#include "SettingsWindow.h"
#include "AppSettings.h"
#include <QCheckBox>
#include <QDialogButtonBox>
#include <QFormLayout>
#include <QLineEdit>
@@ -40,6 +41,9 @@ void SettingsWindow::setupUi() {
geometry_library_edit_->setMinimumWidth(280);
form->addRow("Geometry Library", geometry_library_edit_);
show_stats_check_ = new QCheckBox(this);
form->addRow("Show Performance Stats", show_stats_check_);
auto* button_box = new QDialogButtonBox(
QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
@@ -60,9 +64,11 @@ void SettingsWindow::showEvent(QShowEvent* event) {
void SettingsWindow::syncFromSettings() {
geometry_library_edit_->setText(AppSettings::instance().geometryLibrary());
show_stats_check_->setChecked(AppSettings::instance().showStats());
}
void SettingsWindow::onAccepted() {
AppSettings::instance().setGeometryLibrary(geometry_library_edit_->text());
AppSettings::instance().setShowStats(show_stats_check_->isChecked());
accept();
}