#pragma once
#include <glad/glad.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>

#include "texture.h"
#include "shader.h"
#include "resourceManager.h"


class SpriteRenderer
{
public:
    // Constructor (inits shaders/shapes)
    SpriteRenderer(Shader& shader);
    // Destructor
    ~SpriteRenderer();
    // Renders a defined quad textured with given sprite
    void DrawSprite(Texture& texture, glm::vec2 position, glm::vec4 UV, glm::vec2 size = glm::vec2(10, 10), GLfloat rotate = 0.0f);
private:
    // Render state
    Shader shader;
    GLuint quadVAO, VBO, EBO;
    // Initializes and configures the quad's buffer and vertex attributes
    void initRenderData();
};