Let performance measurement consume mouse events

This commit is contained in:
Alexander Bock
2017-11-24 12:13:39 -05:00
parent 13aebb78b2
commit 55afc617f3
2 changed files with 8 additions and 5 deletions
+4 -4
View File
@@ -189,7 +189,7 @@ ImGUIModule::ImGUIModule() : OpenSpaceModule(Name) {
OsEng.registerModuleKeyboardCallback(
[&](Key key, KeyModifier mod, KeyAction action) -> bool {
if (gui.isEnabled()) {
if (gui.isEnabled() || gui._performance.isEnabled()) {
return gui.keyCallback(key, mod, action);
}
else {
@@ -200,7 +200,7 @@ ImGUIModule::ImGUIModule() : OpenSpaceModule(Name) {
OsEng.registerModuleCharCallback(
[&](unsigned int codepoint, KeyModifier modifier) -> bool {
if (gui.isEnabled()) {
if (gui.isEnabled() || gui._performance.isEnabled()) {
return gui.charCallback(codepoint, modifier);
}
else {
@@ -211,7 +211,7 @@ ImGUIModule::ImGUIModule() : OpenSpaceModule(Name) {
OsEng.registerModuleMouseButtonCallback(
[&](MouseButton button, MouseAction action) -> bool {
if (gui.isEnabled()) {
if (gui.isEnabled() || gui._performance.isEnabled()) {
return gui.mouseButtonCallback(button, action);
}
else {
@@ -222,7 +222,7 @@ ImGUIModule::ImGUIModule() : OpenSpaceModule(Name) {
OsEng.registerModuleMouseScrollWheelCallback(
[&](double, double posY) -> bool {
if (gui.isEnabled()) {
if (gui.isEnabled() || gui._performance.isEnabled()) {
return gui.mouseWheelCallback(posY);
}
else {
+4 -1
View File
@@ -615,7 +615,10 @@ void GUI::endFrame() {
_program->rebuildFromFile();
}
if (OsEng.renderEngine().doesPerformanceMeasurements()) {
bool perf = OsEng.renderEngine().doesPerformanceMeasurements();
_performance.setEnabled(perf);
if (_performance.isEnabled()) {
_performance.render();
}