Actually implement ultra-rendering
This commit is contained in:
@@ -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,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
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user