mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-24 04:58:59 -05:00
Add progress bar to the loading screen
Add configuration options to customize the loading screen
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user