This commit is contained in:
yangxiao 2015-04-01 17:58:41 +08:00
parent 4b7ae430a8
commit 2cc9814702
1 changed files with 4 additions and 2 deletions

View File

@ -91,10 +91,12 @@ bool Skybox::init(const std::string& positive_x, const std::string& negative_x,
const std::string& positive_y, const std::string& negative_y,
const std::string& positive_z, const std::string& negative_z)
{
init();
auto texture = TextureCube::create(positive_x, negative_x, positive_y, negative_y, positive_z, negative_z);
setTexture(texture);
if (texture == nullptr)
return false;
init();
setTexture(texture);
return true;
}