diff --git a/CMakeLists.txt b/CMakeLists.txt index 224f9b7..3978d16 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.25) include(FetchContent) -set(BLT_GRAPHICS_VERSION 2.0.5) +set(BLT_GRAPHICS_VERSION 2.0.6) set(BLT_GRAPHICS_TEST_VERSION 0.0.1) project(BLT_WITH_GRAPHICS VERSION ${BLT_GRAPHICS_VERSION}) diff --git a/include/blt/gfx/renderer/batch_2d_renderer.h b/include/blt/gfx/renderer/batch_2d_renderer.h index b48cd61..e58feb6 100644 --- a/include/blt/gfx/renderer/batch_2d_renderer.h +++ b/include/blt/gfx/renderer/batch_2d_renderer.h @@ -109,6 +109,7 @@ namespace blt::gfx struct curve2d_t { + curve2d_t(vec2 p0, vec2 p1); curve2d_t(vec2 p0, vec2 p1, vec2 p2); curve2d_t(vec2 p0, vec2 p1, vec2 p2, vec2 p3); diff --git a/src/blt/gfx/renderer/batch_2d_renderer.cpp b/src/blt/gfx/renderer/batch_2d_renderer.cpp index 2982d3f..3cd52a9 100644 --- a/src/blt/gfx/renderer/batch_2d_renderer.cpp +++ b/src/blt/gfx/renderer/batch_2d_renderer.cpp @@ -127,6 +127,13 @@ namespace blt::gfx return length; } + curve2d_t::curve2d_t(const vec2 p0, const vec2 p1): m_p0(p0), m_p3(p1) + { + const auto dir = (p1 - p0) / 3; + m_p1 = p0 + dir; + m_p2 = p1 - dir; + } + curve2d_t::curve2d_t(const vec2 p0, const vec2 p1, const vec2 p2): m_p0(p0), m_p1(p1), m_p2(p1), m_p3(p2) {}