mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-25 21:48:57 -05:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user