#pragma once

#include <memory>
#include <vector>

class DrawingContext;
class OpenGlShaderProgram;
class SceneModel;

class OpenGlMeshPainter
{
public:
    OpenGlMeshPainter();

    void paint(SceneModel* model, DrawingContext* context);

private:
    void initializeShader();
    void initializeBuffers();

    void paint(const std::vector<float>& verts, const std::vector<unsigned>& elements, const std::vector<float>& color, bool lines = false);

    unsigned mVertexBuffer{0};
    unsigned mElementBuffer{0};
    unsigned mVertexArray{0};
    std::unique_ptr<OpenGlShaderProgram> mShaderProgram;
};
