#ifndef GLTEST_GLAPP_H
#define GLTEST_GLAPP_H

#include "GLObjects/IGLObject.h"
#include "Shaders/ShaderProgram.h"

#include <GLFW/glfw3.h>
#include <list>

class OGL {
private:
	GLFWwindow* _window;
	std::list<IGLObject*> _glObjects;
	ShaderProgram* _curShaderProgram;

private:
	OGL();
	~OGL();
	OGL(const OGL &) = delete;
	void operator=(const OGL &) = delete;
	void updateFpsCounter() const;
	friend void cursorPositionCallback(GLFWwindow* window, double xpos, double ypos);

public:
	static OGL * instance();
	void init();
	void run();
	void addObject(IGLObject* object);
	ShaderProgram* getCurShaderProgram();
	void setCurShaderProgram(ShaderProgram* sp);
};


#endif //GLTEST_GLAPP_H
