Feature/virtualproperty (#286)

* Add virtual property owner to OpenSpaceEngine

* Ability to add and remove virtual properties

* Do not try to render empty PropertyOwner name
Compile fix for iswaComponent
Add example in default.scene

* Delete virtual properties also in the OpenSpaceEngine dtor

* Make RenderablePlanet not crash if the nighttextures are not present

* - Add VirtualPropertyManager to manage ownership of virtual properties
- Only execute regex when it was necessary
-
This commit is contained in:
Alexander Bock
2017-04-13 14:38:28 -04:00
committed by GitHub
parent 8a617ee254
commit 76aed0578c
18 changed files with 499 additions and 97 deletions
+5 -12
View File
@@ -292,16 +292,7 @@ bool RenderablePlanet::initialize() {
LERROR(ss.str());
}
loadTexture();
while ((err = glGetError()) != GL_NO_ERROR) {
const GLubyte * errString = gluErrorString(err);
std::stringstream ss;
ss << "Error loading textures. OpenGL error: " << errString << std::endl;
LERROR(ss.str());
}
_geometry->initialize(this);
_geometry->initialize(this);
_programObject->deactivate();
@@ -309,6 +300,8 @@ bool RenderablePlanet::initialize() {
const GLubyte * errString = gluErrorString(err);
LERROR("Shader Programs Creation. OpenGL error: " << errString);
}
loadTexture();
return isReady();
}
@@ -394,13 +387,13 @@ void RenderablePlanet::render(const RenderData& data) {
_programObject->setUniform("texture1", dayUnit);
// Bind possible night texture
if (_hasNightTexture) {
if (_hasNightTexture && _nightTexture) {
nightUnit.activate();
_nightTexture->bind();
_programObject->setUniform("nightTex", nightUnit);
}
if (_hasHeightTexture) {
if (_hasHeightTexture && _heightMapTexture) {
heightUnit.activate();
_heightMapTexture->bind();
_programObject->setUniform("heightTex", heightUnit);