#ifndef TEXTURED_RECTANGLE_H
#define TEXTURED_RECTANGLE_H

#include <opengl-playground/openglgraphics.hpp>
#include <opengl-playground/opengltexture.hpp>
#include <epoxy/gl.h>
#include <memory>

class TexturedRectangle : public OpenGlGraphics
{
	public:
		TexturedRectangle(float x0, float y0, float x1, float y1, std::shared_ptr<OpenGlShaderProgram> &shaderprog,
				  std::shared_ptr<OpenGlTexture> &texture);
		void realize();
		void render();
		void setZoom(float zoom);
		float getZoom();
		void setOffset(float x_off, float y_off);
		float getOffsetX();
		float getOffsetY();
		void setBaseColor(const glm::vec4 &color);
	private:
		std::shared_ptr<OpenGlTexture> m_texture;
		void calculateModelMatrix();
		glm::vec4 base_color;
		float pos1[2];
		float pos2[2];
		float x_offset;
		float y_offset;
		float zoom;
		GLuint vao;
};

#endif // TEXTURED_RECTANGLE_H
