Implement a simple loading animation.

Loading currently doesn't happen, because loading tries to do some GL
actions which cannot happen in a background thread (in GLUT anyway).

TODO: move all GL options to the main thread, and leave the rest of the
loading to the background.
This commit is contained in:
2018-04-12 14:25:01 +02:00
parent 2bd84abe94
commit 30aa25a09e
3 changed files with 92 additions and 26 deletions

View File

@@ -1,6 +1,7 @@
#pragma once
#include <string>
#include <future>
#include "LayerInfo.hpp"
#include "LayerData.hpp"
#include "LayerVisualisation.hpp"
@@ -78,6 +79,9 @@ namespace fmri
std::vector<std::vector<LayerData>>::iterator currentData;
std::vector<std::unique_ptr<LayerVisualisation>> layerVisualisations;
std::vector<std::unique_ptr<Animation>> interactionAnimations;
bool isLoading = false;
std::future<void> loadingFuture;
RenderingState() noexcept;
@@ -92,5 +96,11 @@ namespace fmri
void renderLayerName(const std::string& name) const;
void drawLayer(float time, unsigned long i) const;
void queueUpdate();
void renderLoadingScreen() const;
void renderVisualisation(float time) const;
};
}