/*
QtWagon: a project about 3D objects.
Science and technology promotion license applied. Third party license automatically cascaded.
Zhikai Wang/ www.heteroclinic.net 2013
You can do anything with this file or any file(s) published as part QtWagon project, given this header is kept.
*/
#ifndef __DRAWABLESINGLETON
#define __DRAWABLESINGLETON
#include <deque>
#include "glMovingObject.h"
class drawablesSingleton{
protected:
	static drawablesSingleton * instance;
	drawablesSingleton() {};
	std::deque<glMovingObjectf *> dqofdrawables;
	
public:
	void add (glMovingObjectf * n_mvable) {
		dqofdrawables.push_back(n_mvable);
	}
	void draw () {
		for (std::deque<glMovingObjectf *>::const_iterator iter = dqofdrawables.begin();
			iter != dqofdrawables.end(); iter++)
			(**iter).drawv(3.0f);
	}


	static drawablesSingleton * getInstance () {
		if (NULL== instance) {
			instance = new drawablesSingleton();
		}
		return instance;
	}
	virtual ~drawablesSingleton() {
	}

};
#endif