27 #include "generic/containers/contiguous_map.h"
28 #include "generic/property.h"
29 #include "generic/managed.h"
30 #include "renderers/renderer.h"
32 #include "interfaces.h"
33 #include "nodes/stage_node.h"
42 WRITE_OPERATION_UPDATE,
43 WRITE_OPERATION_REMOVE,
48 WriteOperation operation;
53 #define MAX_STAGED_WRITES 1024
70 write.operation = WRITE_OPERATION_ADD;
72 stage_write(node, write);
75 void update_stage_node(StageNode* node,
const AABB& bounds) {
77 write.operation = WRITE_OPERATION_UPDATE;
78 write.new_bounds = bounds;
80 stage_write(node, write);
83 void remove_stage_node(StageNode* node) {
85 write.operation = WRITE_OPERATION_REMOVE;
87 stage_write(node, write);
93 virtual void apply_staged_write(
const StagedWrite& write) = 0;
95 void stage_write(StageNode* node,
const StagedWrite& op);
99 bool do_generates_renderables_for_descendents()
const override {
104 thread::Mutex staging_lock_;
106 ContiguousMap<StageNode*, std::vector<StagedWrite>> staged_writes_;
107 std::size_t write_count_ = 0;
113 DEFINE_ENUM_HASH(smlt::WriteOperation);
116 #endif // PARTITIONER_H