mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-01 00:09:58 -05:00
Feature/globals handling (#1352)
* Cleaner handling of global state * Prevent Lua memory corruption (closes #982) * Initialize glfw first thing to prevent weird joystick loading bug during startup
This commit is contained in:
@@ -298,13 +298,13 @@ void RenderableTimeVaryingVolume::initializeGL() {
|
||||
);
|
||||
|
||||
_raycaster->initialize();
|
||||
global::raycasterManager.attachRaycaster(*_raycaster.get());
|
||||
global::raycasterManager->attachRaycaster(*_raycaster.get());
|
||||
onEnabledChange([&](bool enabled) {
|
||||
if (enabled) {
|
||||
global::raycasterManager.attachRaycaster(*_raycaster.get());
|
||||
global::raycasterManager->attachRaycaster(*_raycaster.get());
|
||||
}
|
||||
else {
|
||||
global::raycasterManager.detachRaycaster(*_raycaster.get());
|
||||
global::raycasterManager->detachRaycaster(*_raycaster.get());
|
||||
}
|
||||
});
|
||||
|
||||
@@ -366,7 +366,7 @@ RenderableTimeVaryingVolume::Timestep* RenderableTimeVaryingVolume::currentTimes
|
||||
if (_volumeTimesteps.empty()) {
|
||||
return nullptr;
|
||||
}
|
||||
double currentTime = global::timeManager.time().j2000Seconds();
|
||||
double currentTime = global::timeManager->time().j2000Seconds();
|
||||
|
||||
// Get the first item with time > currentTime
|
||||
auto currentTimestepIt = _volumeTimesteps.upper_bound(currentTime);
|
||||
@@ -427,7 +427,7 @@ RenderableTimeVaryingVolume::Timestep* RenderableTimeVaryingVolume::timestepFrom
|
||||
void RenderableTimeVaryingVolume::jumpToTimestep(int target) {
|
||||
Timestep* t = timestepFromIndex(target);
|
||||
if (t) {
|
||||
global::timeManager.setTimeNextFrame(Time(t->metadata.time));
|
||||
global::timeManager->setTimeNextFrame(Time(t->metadata.time));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -487,7 +487,7 @@ bool RenderableTimeVaryingVolume::isReady() const {
|
||||
|
||||
void RenderableTimeVaryingVolume::deinitializeGL() {
|
||||
if (_raycaster) {
|
||||
global::raycasterManager.detachRaycaster(*_raycaster.get());
|
||||
global::raycasterManager->detachRaycaster(*_raycaster.get());
|
||||
_raycaster = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user