Refactor PD::Li Pools system, Upgrade PD::Pool and add better logging
- Add ResetFast to Pool using c++20 concept - Add Put function to Pool - Use Pool Index instead of pointers in Command - Add accessor to Li Pools to prevent wrong command usage - Add Command Formatter - Use ResetFast for all Pools - Add Reset func to Li::Vertex (for ResetFast) - Add Pool Expandor and Put funcs to Lithium pools - Add getters for GfxDriverBase to PD::Li Pools
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#include <iostream>
|
||||
#include <pd/drivers/gfx.hpp>
|
||||
#include <pd/lithium/drawlist.hpp>
|
||||
#include <pd/lithium/formatters.hpp>
|
||||
#include <pd/lithium/math.hpp>
|
||||
|
||||
namespace PD {
|
||||
@@ -16,9 +18,10 @@ PD_API void Drawlist::Optimize() {}
|
||||
|
||||
PD_API void Drawlist::Clear() {
|
||||
UnbindTexture();
|
||||
pPath.Reset();
|
||||
pVertices.Reset();
|
||||
pIndices.Reset();
|
||||
pPath.ResetFast();
|
||||
pVertices.ResetFast();
|
||||
pIndices.ResetFast();
|
||||
pCommands.ResetFast();
|
||||
}
|
||||
|
||||
/** Command Allocation */
|
||||
@@ -262,6 +265,7 @@ PD_API void Drawlist::DrawConvexPolyFilled(const Pool<fvec2>& points,
|
||||
uv_tl.y + ((points[i].y - minY) / (maxY - minY)) * (uv_bl.y - uv_tl.y);
|
||||
cmd.Add(Vertex(points[i], fvec2(u, v), color));
|
||||
}
|
||||
std::cout << std::format("{}: {}", __PRETTY_FUNCTION__, cmd);
|
||||
}
|
||||
|
||||
PD_API void Drawlist::PrimQuad(Command& cmd, const Rect& quad, const Rect& uv,
|
||||
|
||||
Reference in New Issue
Block a user