Implemet CutTex Rendering

This commit is contained in:
2025-12-30 22:28:03 +01:00
parent 6e502d73d8
commit b4b1144c60
2 changed files with 19 additions and 0 deletions

View File

@@ -209,6 +209,17 @@ void Iron::Drawlist::DrawCircleFilled(const fvec2& center, float rad, ui color,
PathFill(color);
}
void Iron::Drawlist::DrawCutTex(fvec2 pos, fvec2 size, fvec4 cut_rect,
ui color) {
auto r = Iron::PrimRect(pos, size);
auto cmd = NewCommand();
auto uv = cut_rect / fvec4(pTex->Size(), pTex->Size());
uv.y = 1.f - uv.y;
uv.w = 1.f - uv.w;
Iron::CmdQuad(cmd.get(), r, uv, color);
Push(std::move(cmd));
}
void Iron::Drawlist::DrawPolyLine(const std::vector<fvec2>& points, ui clr,
ui flags, int thickness) {
if (points.size() < 2) {