#ifndef GEOMETRY
#define GEOMETRY

#include "../math/aabbox.h"
#include "mesh.h"

#include <functional>
#include <vector>

namespace sleek
{
    namespace driver
    {
        class MeshBuffer;
        class Geometry
        {
            public:
                Geometry() noexcept;
                virtual ~Geometry() noexcept;

                MeshBuffer* createPlane(const math::vec2f &size = math::vec2f(5.f,5.f), const u32 polyCountX = 1, const u32 polyCountY = 1, const math::pixel &color = math::pixel(254,254,254,254)) const noexcept;
                MeshBuffer* createWall(const math::vec2f &size = math::vec2f(5.f,5.f), const math::pixel &color = math::pixel(254,254,254,254)) const noexcept;
                MeshBuffer* createCircle(const math::vec2f &radiusxy = math::vec2f(5.f,5.f), const f32 step_x = 10, const f32 step_y = 10, const math::pixel &color = math::pixel(254,254,254,254)) const noexcept;
                MeshBuffer* createSphere(const f32 radius = 5.f, u32 polyCountX = 16, u32 polyCountY = 16, const math::pixel &color = math::pixel(254,254,254,254)) const noexcept;
                MeshBuffer* createIcoSphere(const f32 radius = 5.f, u32 subdivide = 0, const math::pixel &color = math::pixel(254,254,254,254)) const noexcept;
                MeshBuffer* createCube(const math::vec3f &size = math::vec3f(5.f, 5.f, 5.f), const math::pixel &color = math::pixel(254,254,254,254)) const noexcept;
                MeshBuffer* createPolygone(const math::vec3f&,const math::vec3f&,const math::vec3f&, const math::pixel &color = math::pixel(254,254,254,254)) const noexcept;
                MeshBuffer* createPyramid(const math::vec3f &size = math::vec3f(5.f, 5.f, 5.f), const math::pixel &color = math::pixel(254,254,254,254)) const noexcept;
                MeshBuffer* createTorus(const f32 radiusX = 5.f, const f32 radiusY = 2.5f, const u32 polyCountX = 16, const u32 polyCountY = 16, const math::pixel &color = math::pixel(254,254,254,254)) const noexcept; // not implented
                MeshBuffer* createCone(const f32 radius = 5.f, const f32 length = 5.f, const u32 tesselation = 1, const math::pixel &color = math::pixel(254,254,254,254)) const noexcept; // not implented
                MeshBuffer* createCylindre(const f32 radius = 5.f, const f32 length = 5.f, const u32 tesselation = 1, const math::pixel &color = math::pixel(254,254,254,254)) const noexcept; // not implented

                //! @surface must define a vertex grid of [xpath*ypath] and with linear acess of expr "y*xpath+x"
                MeshBuffer* createSplineSurface(MeshBuffer *surface, u16 xpath, u16 ypath, u16 segments = 100, const math::pixel &color = math::pixel(254,254,254,254));
                MeshBuffer* createHeightfieldSurface(std::function<float(float, float)> gen, u16 xpath, u16 ypath, u16 segments = 100, const math::pixel &color = math::pixel(254,254,254,254));
            private:
        };
    }
}

#endif