mirror of
https://github.com/orange-cpp/omath.git
synced 2026-04-18 21:23:28 +00:00
33 lines
1.8 KiB
C++
33 lines
1.8 KiB
C++
//
|
|
// Created by orange on 13.03.2026.
|
|
//
|
|
#pragma once
|
|
#include <omath/hud/hud_renderer_interface.hpp>
|
|
|
|
#ifdef OMATH_IMGUI_INTEGRATION
|
|
namespace omath::hud
|
|
{
|
|
class ImguiHudRenderer final : public HudRendererInterface
|
|
{
|
|
public:
|
|
~ImguiHudRenderer() override;
|
|
void add_line(const Vector2<float>& line_start, const Vector2<float>& line_end, const Color& color,
|
|
float thickness) override;
|
|
void add_polyline(const std::span<const Vector2<float>>& vertexes, const Color& color, float thickness) override;
|
|
void add_filled_polyline(const std::span<const Vector2<float>>& vertexes, const Color& color) override;
|
|
void add_rectangle(const Vector2<float>& min, const Vector2<float>& max, const Color& color) override;
|
|
void add_filled_rectangle(const Vector2<float>& min, const Vector2<float>& max, const Color& color) override;
|
|
void add_circle(const Vector2<float>& center, float radius, const Color& color, float thickness,
|
|
int segments = 0) override;
|
|
void add_filled_circle(const Vector2<float>& center, float radius, const Color& color,
|
|
int segments = 0) override;
|
|
void add_arc(const Vector2<float>& center, float radius, float a_min, float a_max, const Color& color,
|
|
float thickness, int segments = 0) override;
|
|
void add_image(const std::any& texture_id, const Vector2<float>& min, const Vector2<float>& max,
|
|
const Color& tint = Color{1.f, 1.f, 1.f, 1.f}) override;
|
|
void add_text(const Vector2<float>& position, const Color& color, const std::string_view& text) override;
|
|
[[nodiscard]]
|
|
virtual Vector2<float> calc_text_size(const std::string_view& text) override;
|
|
};
|
|
} // namespace omath::hud
|
|
#endif // OMATH_IMGUI_INTEGRATION
|