修改一些

This commit is contained in:
2026-08-18 10:50:14 +08:00
parent 4581b3fc05
commit 182fa2232a
26 changed files with 695 additions and 126 deletions
@@ -1,5 +1,6 @@
#include <renderive/error/Error_Policy.hpp>
#include "Renderable_Base_p.hpp"
#include "renderive/renderable/Renderable_Build.hpp"
#include <algorithm>
#include <limits>
#include <stdexcept>
@@ -223,15 +224,33 @@ bool Renderable_Base::is_visible() const noexcept {
return d_func().visible.load(std::memory_order_acquire);
}
std::string Renderable_Base::object_name() const {
const auto& implementation = d_func();
std::lock_guard lock(implementation.metadata_mutex);
return implementation.object_name;
return d_func().object_name;
}
void Renderable_Base::set_object_name(std::string name) {
auto& implementation = d_func();
std::lock_guard lock(implementation.metadata_mutex);
void renderive::detail::Renderable_Build_Access::set_object_name(
Renderable_Base& renderable, std::string name) {
auto& implementation = renderable.d_func();
if (implementation.real_time_data_state->scene_lifetime)
::renderive::error::unexpected<std::logic_error>(
"object_name is immutable after scene construction");
implementation.object_name = std::move(name);
}
void renderive::detail::Renderable_Build_Access::set_topology(
Renderable_Base& renderable, renderive::Renderable_Build_Topology topology) {
auto& implementation = renderable.d_func();
if (implementation.real_time_data_state->scene_lifetime)
::renderive::error::unexpected<std::logic_error>(
"renderable build topology is immutable after scene construction");
implementation.build_topology = std::move(topology);
}
const renderive::Renderable_Build_Topology&
renderive::detail::Renderable_Build_Access::topology(
const Renderable_Base& renderable) noexcept {
return renderable.d_func().build_topology;
}
void renderive::detail::Renderable_Build_Access::complete(
Renderable_Base& renderable) noexcept {
renderable.d_func().build_topology = {};
}
void Renderable_Base::set_visible(bool visible) {
d_func().set_visible(visible);
}