Add progress bar to the loading screen

Add configuration options to customize the loading screen
This commit is contained in:
Alexander Bock
2017-11-05 14:49:46 -05:00
parent 3afd2bf514
commit dc9831b6a6
10 changed files with 446 additions and 89 deletions
+32 -4
View File
@@ -26,6 +26,7 @@
#define __OPENSPACE_CORE___LOADINGSCREEN___H__
#include <ghoul/glm.h>
#include <ghoul/misc/boolean.h>
#include <ghoul/opengl/ghoul_gl.h>
#include <memory>
@@ -45,13 +46,27 @@ namespace openspace {
class LoadingScreen {
public:
LoadingScreen();
using ShowMessage = ghoul::Boolean;
using ShowNodeNames = ghoul::Boolean;
using ShowProgressbar = ghoul::Boolean;
LoadingScreen(ShowMessage showMessage, ShowNodeNames showNodeNames,
ShowProgressbar showProgressbar);
~LoadingScreen();
void render();
void postMessage(std::string message);
void setItemNumber(int nItems);
void tickItem();
enum class Phase {
Construction,
Initialization
};
void setPhase(Phase phase);
enum class ItemStatus {
Started,
@@ -61,9 +76,15 @@ public:
void updateItem(const std::string& itemName, ItemStatus newStatus);
private:
bool _showMessage;
bool _showNodeNames;
bool _showProgressbar;
Phase _phase;
int _iProgress;
int _nItems;
std::unique_ptr<ghoul::opengl::ProgramObject> _program;
std::unique_ptr<ghoul::opengl::Texture> _logoTexture;
@@ -76,10 +97,17 @@ private:
GLuint vbo;
} _logo;
struct {
GLuint vaoFill;
GLuint vboFill;
GLuint vaoBox;
GLuint vboBox;
} _progressbar;
std::string _message;
std::mutex _messageMutex;
struct Item {
std::string name;
ItemStatus status;