/* $Id$
This file is part of libmspgl
-Copyright © 2007-2008, 2010 Mikko Rasa, Mikkosoft Productions
+Copyright © 2007-2008, 2010-2011 Mikko Rasa, Mikkosoft Productions
Distributed under the LGPL
*/
#include "object.h"
#include "objectinstance.h"
#include "instancescene.h"
+#include "renderer.h"
namespace Msp {
namespace GL {
renderables.erase(&r);
}
-void InstanceScene::render(const Tag &tag) const
+void InstanceScene::render(Renderer &renderer, const Tag &tag) const
{
+ // XXX Check that the object has this pass to avoid some unnecessary function calls
for(ObjectMap::const_iterator i=objects.begin(); i!=objects.end(); ++i)
- i->first->render(i->second.begin(), i->second.end(), tag);
+ for(InstanceSet::const_iterator j=i->second.begin(); j!=i->second.end(); ++j)
+ (*j)->render(renderer, tag);
for(RenderableSet::const_iterator i=renderables.begin(); i!=renderables.end(); ++i)
- (*i)->render(tag);
+ (*i)->render(renderer, tag);
}
} // namespace GL