diff --git a/src/objects/Triangle.cpp b/src/objects/Triangle.cpp index 7943e7e7..9d5b409e 100644 --- a/src/objects/Triangle.cpp +++ b/src/objects/Triangle.cpp @@ -9,6 +9,10 @@ namespace gp { GP_CORE_DEBUG("Initializing Triangle ({0}, {1}), ({2}, {3}), ({4}, {5})", p1.x, p1.y, p2.x, p2.y, p3.x, p3.y); } + shared_ptr Triangle::create(Point p1, Point p2, Point p3) { + return make_shared(p1, p2, p3); + } + bool Triangle::_contains(float x, float y) const { return checkTriangleContains({x, y}, m_Points[0], m_Points[1], m_Points[2]); } diff --git a/src/objects/Triangle.h b/src/objects/Triangle.h index 1404d19b..6095de8e 100644 --- a/src/objects/Triangle.h +++ b/src/objects/Triangle.h @@ -19,6 +19,8 @@ namespace gp { */ Triangle(Point p1, Point p2, Point p3); + static shared_ptr create(Point p1, Point p2, Point p3); + virtual ~Triangle() = default; [[nodiscard]] std::string toString() const override; diff --git a/src/rendering/Renderer.cpp b/src/rendering/Renderer.cpp index c2e14f0a..558f94c8 100644 --- a/src/rendering/Renderer.cpp +++ b/src/rendering/Renderer.cpp @@ -13,7 +13,7 @@ namespace gp { m_TriangleBatch({{{ShaderDataType::Float2, "position"}, {ShaderDataType::Float, "z"}, {ShaderDataType::Float4, "color"}}, - 6, 4, m_Window.m_SolidShader}), + 3, 3, m_Window.m_SolidShader}), m_QuadBatch({{ {ShaderDataType::Float2, "position"}, {ShaderDataType::Float, "z"},