29 lines
900 B
C++
29 lines
900 B
C++
#pragma once
|
|
|
|
#include "detail/Visual_Prepare.hpp"
|
|
|
|
namespace aethera::render_3d::detail {
|
|
inline bool Pixel_Spec::valid(const Item& item) noexcept {
|
|
return finite(item.position) && finite(item.size_px) && item.size_px > 0.0F;
|
|
}
|
|
|
|
} // namespace aethera::render_3d::detail
|
|
|
|
namespace aethera::render_3d {
|
|
/* 具体 Visual 复用 Basic_Visual 的 Prepare、发布及缓冲推进钩子。 */
|
|
struct Pixel_Visual::Private : Prev_Private {};
|
|
}
|
|
|
|
namespace aethera::render_3d::detail {
|
|
|
|
inline void Pixel_Spec::prepare(const std::vector<Item>& items, Prepared_Data& output) {
|
|
reserve_position_color(output, items.size());
|
|
output.sizes.reserve(items.size());
|
|
for (const auto& item : items) {
|
|
output.positions.push_back({item.position.x, item.position.y, item.position.z});
|
|
output.colors.push_back(channels(item.color));
|
|
output.sizes.push_back(item.size_px);
|
|
}
|
|
}
|
|
}
|