Commit d505364a authored by Janis Born's avatar Janis Born
Browse files

ArrayBuffer / VAO loaders now return NULL pointer on failure

parent b8a5afc5
......@@ -16,10 +16,10 @@ namespace OpenGL{
SharedArrayBuffer loadArrayBuffer(const std::string &_filename)
{
SharedArrayBuffer ab(new ArrayBuffer);
SharedGeometryData data = loadGeometryData(_filename);
if(data)
{
SharedArrayBuffer ab(new ArrayBuffer);
for(ArrayBuffer::AttributeVec::const_iterator it = data->mAttributes.begin();
it != data->mAttributes.end();
++it)
......@@ -32,7 +32,7 @@ SharedArrayBuffer loadArrayBuffer(const std::string &_filename)
}
else
{
return ab;
return SharedArrayBuffer();
}
}
......
......@@ -16,10 +16,17 @@ namespace OpenGL{
SharedVertexArrayObject loadVertexArrayObject(const std::string& _filename)
{
SharedVertexArrayObject vao(new VertexArrayObject);
SharedArrayBuffer ab = loadArrayBuffer(_filename);
vao->attachAllAttributes(ab);
return vao;
if(ab)
{
SharedVertexArrayObject vao(new VertexArrayObject);
vao->attachAllAttributes(ab);
return vao;
}
else
{
return SharedVertexArrayObject();
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment