Files
palladium/source/lithium/pools.cpp
T

25 lines
529 B
C++
Raw Normal View History

2026-03-18 09:31:47 +01:00
#include <pd/core/core.hpp>
2026-03-16 17:33:46 +01:00
#include <pd/lithium/pools.hpp>
namespace PD {
namespace Li {
PD::Pool<Vertex> pVtxPool;
PD::Pool<u16> pIdxPool;
2026-03-17 16:47:19 +01:00
PD_API void InitPools(size_t max_vertices) {
2026-03-16 17:33:46 +01:00
pVtxPool.Init(max_vertices);
pIdxPool.Init(max_vertices * 2);
}
2026-03-18 09:31:47 +01:00
PD_API Vertex* AllocateVertices(size_t count) {
return pVtxPool.Allocate(count);
}
2026-03-16 17:33:46 +01:00
2026-03-17 16:47:19 +01:00
PD_API u16* AllocateIndices(size_t count) { return pIdxPool.Allocate(count); }
2026-03-16 17:33:46 +01:00
2026-03-17 16:47:19 +01:00
PD_API void ResetPools() {
2026-03-16 17:33:46 +01:00
pVtxPool.Reset();
pIdxPool.Reset();
}
} // namespace Li
} // namespace PD