ScreenSpaceRenderables can be creates through scripts, ScreenSpaceRenderable is now a factory

This commit is contained in:
Michael Nilsson
2016-05-03 10:39:32 -04:00
parent 40cd7e98ec
commit 4d61694f75
13 changed files with 118 additions and 6 deletions
+18 -1
View File
@@ -33,7 +33,6 @@ namespace openspace {
ScreenSpaceImage::ScreenSpaceImage(std::string texturePath)
:ScreenSpaceRenderable()
,_texturePath("texturePath", "Texture path", texturePath)
{
_id = id();
setName("ScreenSpaceImage" + std::to_string(_id));
@@ -45,6 +44,24 @@ ScreenSpaceImage::ScreenSpaceImage(std::string texturePath)
_texturePath.onChange([this](){ loadTexture(); });
}
ScreenSpaceImage::ScreenSpaceImage(const ghoul::Dictionary& dictionary)
:ScreenSpaceRenderable()
,_texturePath("texturePath", "Texture path", "")
{
_id = id();
setName("ScreenSpaceImage" + std::to_string(_id));
std::string texturePath;
dictionary.getValue("TexturePath", texturePath);
_texturePath.set(texturePath);
registerProperties();
addProperty(_texturePath);
OsEng.gui()._screenSpaceProperty.registerProperty(&_texturePath);
_texturePath.onChange([this](){ loadTexture(); });
}
ScreenSpaceImage::~ScreenSpaceImage(){}
bool ScreenSpaceImage::initialize(){