mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-06 19:39:56 -05:00
Let performance measurement consume mouse events
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user