change interface to have internal functions
parent
0a93fbe055
commit
16a0fbc7dc
|
@ -1,6 +1,6 @@
|
|||
cmake_minimum_required(VERSION 3.25)
|
||||
|
||||
set(BLT_GRAPHICS_VERSION 0.11.3)
|
||||
set(BLT_GRAPHICS_VERSION 0.11.4)
|
||||
set(BLT_GRAPHICS_TEST_VERSION 0.0.1)
|
||||
|
||||
project(BLT_WITH_GRAPHICS VERSION ${BLT_GRAPHICS_VERSION})
|
||||
|
|
|
@ -140,56 +140,56 @@ namespace blt::gfx
|
|||
|
||||
void create();
|
||||
|
||||
inline void drawRectangle(std::string_view texture, const rectangle2d_t& rectangle, blt::f32 z_index = 0)
|
||||
inline void drawRectangleInternal(std::string_view texture, const rectangle2d_t& rectangle, blt::f32 z_index = 0)
|
||||
{
|
||||
const static blt::vec4 empty{0, 0, 0, 1};
|
||||
const static blt::vec4 full{1, 1, 1, 1};
|
||||
complex_rectangles[texture][empty][full].emplace_back(-z_index, rectangle);
|
||||
}
|
||||
|
||||
inline void drawRectangle(const blt::vec4& color, const rectangle2d_t& rectangle, blt::f32 z_index = 0)
|
||||
inline void drawRectangleInternal(const blt::vec4& color, const rectangle2d_t& rectangle, blt::f32 z_index = 0)
|
||||
{
|
||||
const static blt::vec4 empty{0, 0, 0, 0};
|
||||
complex_rectangles[""][color][empty].emplace_back(-z_index, rectangle);
|
||||
}
|
||||
|
||||
inline void drawRectangle(const draw_state& draw_info, const rectangle2d_t& rectangle, blt::f32 z_index = 0)
|
||||
inline void drawRectangleInternal(const draw_state& draw_info, const rectangle2d_t& rectangle, blt::f32 z_index = 0)
|
||||
{
|
||||
complex_rectangles[draw_info.texture_name][draw_info.color][draw_info.blend].emplace_back(-z_index, rectangle);
|
||||
}
|
||||
|
||||
inline void drawLine(std::string_view texture, const line2d_t& line, blt::f32 z_index = 0)
|
||||
inline void drawLineInternal(std::string_view texture, const line2d_t& line, blt::f32 z_index = 0)
|
||||
{
|
||||
const static blt::vec4 empty{0, 0, 0, 1};
|
||||
const static blt::vec4 full{1, 1, 1, 1};
|
||||
complex_lines[texture][empty][full].emplace_back(-z_index, line);
|
||||
}
|
||||
|
||||
inline void drawLine(const blt::vec4& color, const line2d_t& line, blt::f32 z_index = 0)
|
||||
inline void drawLineInternal(const blt::vec4& color, const line2d_t& line, blt::f32 z_index = 0)
|
||||
{
|
||||
const static blt::vec4 empty{0, 0, 0, 0};
|
||||
complex_lines[""][color][empty].emplace_back(-z_index, line);
|
||||
}
|
||||
|
||||
inline void drawLine(const draw_state& draw_info, const line2d_t& line, blt::f32 z_index = 0)
|
||||
inline void drawLineInternal(const draw_state& draw_info, const line2d_t& line, blt::f32 z_index = 0)
|
||||
{
|
||||
complex_lines[draw_info.texture_name][draw_info.color][draw_info.blend].emplace_back(-z_index, line);
|
||||
}
|
||||
|
||||
inline void drawPoint(std::string_view texture, const point2d_t& point, blt::f32 z_index = 0)
|
||||
inline void drawPointInternal(std::string_view texture, const point2d_t& point, blt::f32 z_index = 0)
|
||||
{
|
||||
const static blt::vec4 empty{0, 0, 0, 1};
|
||||
const static blt::vec4 full{1, 1, 1, 1};
|
||||
complex_points[texture][empty][full].emplace_back(-z_index, point);
|
||||
}
|
||||
|
||||
inline void drawPoint(const blt::vec4& color, const point2d_t& point, blt::f32 z_index = 0)
|
||||
inline void drawPointInternal(const blt::vec4& color, const point2d_t& point, blt::f32 z_index = 0)
|
||||
{
|
||||
const static blt::vec4 empty{0, 0, 0, 0};
|
||||
complex_points[""][color][empty].emplace_back(-z_index, point);
|
||||
}
|
||||
|
||||
inline void drawPoint(const draw_state& draw_info, const point2d_t& point, blt::f32 z_index = 0)
|
||||
inline void drawPointInternal(const draw_state& draw_info, const point2d_t& point, blt::f32 z_index = 0)
|
||||
{
|
||||
complex_points[draw_info.texture_name][draw_info.color][draw_info.blend].emplace_back(-z_index, point);
|
||||
}
|
||||
|
@ -197,37 +197,37 @@ namespace blt::gfx
|
|||
template<typename T, typename... P>
|
||||
inline void drawRectangle(const T& render_info, P... p)
|
||||
{
|
||||
drawRectangle(render_info, {p...});
|
||||
drawRectangleInternal(render_info, {p...});
|
||||
}
|
||||
|
||||
template<typename T, typename... P>
|
||||
inline void drawPoint(const T& render_info, P... p)
|
||||
{
|
||||
drawPoint(render_info, {p...});
|
||||
drawPointInternal(render_info, {p...});
|
||||
}
|
||||
|
||||
template<typename T, typename... P>
|
||||
inline void drawLine(const T& render_info, P... p)
|
||||
{
|
||||
drawLine(render_info, {p...});
|
||||
drawLineInternal(render_info, {p...});
|
||||
}
|
||||
|
||||
template<typename T, typename... P>
|
||||
inline void drawRectangle(const T& render_info, blt::f32 z_index, P... p)
|
||||
{
|
||||
drawRectangle(render_info, {p...}, z_index);
|
||||
drawRectangleInternal(render_info, {p...}, z_index);
|
||||
}
|
||||
|
||||
template<typename T, typename... P>
|
||||
inline void drawPoint(const T& render_info, blt::f32 z_index, P... p)
|
||||
{
|
||||
drawPoint(render_info, {p...}, z_index);
|
||||
drawPointInternal(render_info, {p...}, z_index);
|
||||
}
|
||||
|
||||
template<typename T, typename... P>
|
||||
inline void drawLine(const T& render_info, blt::f32 z_index, P... p)
|
||||
{
|
||||
drawLine(render_info, {p...}, z_index);
|
||||
drawLineInternal(render_info, {p...}, z_index);
|
||||
}
|
||||
|
||||
void render(bool transparency = true);
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit c8ce910fe17ecbc64ad728aac731c1fda8e84c33
|
||||
Subproject commit 69e6a505d6dda11d4b510901a7b344315bbc5ebe
|
Loading…
Reference in New Issue