#include <list>
#include "object.h"

std::list<render::_object*> _renderObjectList;

namespace render {

void _object::_removeFromList()
{
    _renderObjectList.remove(this);
}

void _object::_addToList()
{
    _renderObjectList.push_back(this);
}

_object::~_object()
{
    _removeFromList();
}

namespace core{

void removeAllObjects()
{
    while(_renderObjectList.size()) {
        _renderObjectList.back()->free();
    }

    _renderObjectList.clear();
}

}


}

