Actually implement ultra-rendering

This commit is contained in:
2026-04-02 23:29:53 +02:00
parent b5321ca1a1
commit 1cf3b6f8e6
7 changed files with 23 additions and 10 deletions
+6 -1
View File
@@ -1,4 +1,4 @@
#include <pd/ultra/canvas.hpp>
#include <pd/ultra/container.hpp>
#include <pd/ultra/elems/element.hpp>
namespace PD {
@@ -11,5 +11,10 @@ PD_API bool ElementBase::RevisionUpdate(PD::u32 req) {
return false;
}
}
PD_API void ElementBase::Update() {
if (!pParent) pRenderspace = PD::fvec4(pPos, pPos + pSize);
pRenderspace = PD::fvec4(pParent->GetTopLeft() + pPos,
pParent->GetTopLeft() + pPos + pSize);
}
} // namespace Ultra
} // namespace PD
+3 -3
View File
@@ -3,9 +3,9 @@
namespace PD {
namespace Ultra {
PD_API void Image::Draw(PD::Li::Drawlist& l) {
// l.BindTexture(*pTex);
// l.PathRect(pRenderspace.TopLeft(), pRenderspace.BotRight(), pRounding);
// l.PathFill(pColor);
l.BindTexture(*pTex);
l.PathRect(pRenderspace.TopLeft(), pRenderspace.BotRight(), pRounding);
l.PathFill(pColor);
}
} // namespace Ultra
} // namespace PD
+1 -1
View File
@@ -3,7 +3,7 @@
namespace PD {
namespace Ultra {
PD_API void Rect::Draw(PD::Li::Drawlist& l) {
l.PathRect(pPos, pPos + pSize, pRounding);
l.PathRect(pRenderspace.TopLeft(), pRenderspace.BotRight(), pRounding);
if (pLined) {
l.PathStroke(pColor, pThickness, LiDrawFlags_Close);
} else {
+1 -1
View File
@@ -3,7 +3,7 @@
namespace PD {
namespace Ultra {
PD_API void Text::Draw(PD::Li::Drawlist& l) {
l.DrawText(pPos, pText.c_str(), pColor);
l.DrawText(pRenderspace.TopLeft(), pText.c_str(), pColor);
}
} // namespace Ultra
} // namespace PD