/*
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 __GLWIDGETSINGLETON
#define __GLWIDGETSINGLETON
#include "glwidget.h"
#include "glMovingObject.h"
class GLWidget;
//class glwidgetSingleton : public QWidget{
//	Q_OBJECT
class glwidgetSingleton {
protected:
		 GLWidget * glwidget;
	glwidgetSingleton();
	//std::deque<glMovingObjectf *> dqofdrawables;

	 GLWidget * getWidget() {
		 return  glwidget;
	 };
	static glwidgetSingleton * instance;

public:



	static GLWidget * getInstance () {
		if (NULL== instance) {
			instance = new glwidgetSingleton();
		}
		return instance->getWidget();
	}
	virtual ~glwidgetSingleton() {
		//if (glwidget != NULL) { 

		//	delete glwidget; //warning, incomplete class, no destructor called, so comment
		//}
		//glwidget = NULL;
	}

};
#endif