#ifndef RENDERER3D_HPP
#define RENDERER3D_HPP

#include "open_engine/renderer/editor_camera.hpp"
#include "open_engine/scene/scene_camera.hpp"
#include "open_engine/renderer/model3d.hpp"
#include <cstdint>

namespace OpenEngine {

    // SHOULD BE MOVED ==================================

    enum class PrimitiveType
    {
        None = 0,
        Quad,
        Cube
    };

    Ref<Mesh> CreateMesh(const std::vector<MeshVertex>& vertices,
            const std::vector<uint32_t>& indices);
    void PopulateMesh(Mesh& mesh);
    Ref<Mesh> CreateCube(uint32_t id = -1);
    Ref<Mesh> CreateQuad(uint32_t id = -1, bool back_face = false);

    // ==================================================

    class Renderer3D
    {
        public:
            static void Init();
            static void Shutdown();

            static void BeginScene(const SceneCamera& camera, const glm::mat4& transform);
            static void BeginScene(const EditorCamera& camera);
            static void EndScene();

            static void DrawMesh(const Ref<Mesh>& mesh, Material& material,
                    const glm::mat4& transform);
            static void DrawMesh(const Ref<Mesh>& mesh, Material& material,
                    const glm::mat4& transform,
                    uint32_t entity_id);
            static void DrawModel(const Ref<Model3D>& model,
                    const glm::mat4& transform,
                    uint32_t entity_id);
    };
}

#endif // RENDERER3D_HPP
