Always create the GUI element but make it switchable via scripting

This commit is contained in:
Alexander Bock
2014-12-08 12:41:31 +01:00
parent 9cd435f3e3
commit 56e1187ee7
6 changed files with 175 additions and 70 deletions

View File

@@ -25,6 +25,8 @@
#ifndef __GUI_H__
#define __GUI_H__
#include <openspace/scripting/scriptengine.h>
#include <ghoul/glm.h>
#include <map>
@@ -43,6 +45,11 @@ public:
GUI();
~GUI();
bool isEnabled() const;
void setEnabled(bool enabled);
void initialize();
void initializeGL();
void deinitializeGL();
@@ -56,9 +63,14 @@ public:
void startFrame(float deltaTime, const glm::vec2& windowSize, const glm::vec2& mousePos, bool mouseButtonsPressed[2]);
void endFrame();
static scripting::ScriptEngine::LuaLibrary luaLibrary();
private:
void renderPropertyWindow();
bool _isEnabled;
std::set<properties::Property*> _boolProperties;
std::set<properties::Property*> _intProperties;
std::set<properties::Property*> _floatProperties;

View File

@@ -29,7 +29,7 @@
#include <openspace/interaction/luaconsole.h>
#include <openspace/rendering/renderengine.h>
#include <openspace/engine/configurationmanager.h>
#include <openspace/engine/gui.h>
#include <ghoul/cmdparser/commandlineparser.h>
namespace openspace {
@@ -59,7 +59,7 @@ public:
scripting::ScriptEngine& scriptEngine();
LuaConsole& console();
GUI* gui() { return _gui; }
GUI& gui();
// SGCT callbacks
bool initializeGL();
@@ -97,7 +97,7 @@ private:
scripting::ScriptEngine _scriptEngine;
ghoul::cmdparser::CommandlineParser _commandlineParser;
LuaConsole _console;
GUI* _gui;
GUI _gui;
SyncBuffer* _syncBuffer;