Start feeding every declared layer on the frame clock.
471{
472 Chimera set;
473
476 "ChimeraBuilder::start needs a buffer and at least one layer");
477 return set;
478 }
479
482 "ChimeraBuilder::start declared {} layers, the buffer holds {}",
484 return set;
485 }
486
489 "ChimeraBuilder::start needs a pipeline to feed the layers");
490 return set;
491 }
492
495 continue;
496 }
497
501 "ChimeraBuilder::start found no stream in the pipeline for from_pipeline");
502 return set;
503 }
504 }
505
506 auto state = std::make_shared<Chimera::State>();
507
512
514 for (
const auto&
layer : state->layers) {
518 }
521 }
523 }
524
528 }
529
530 const std::weak_ptr<Chimera::State> weak = state;
533 if (const auto running = weak.lock()) {
534 Chimera::tick(*running, cycle);
535 }
536 },
538
540 const auto cycles = static_cast<uint32_t>(std::max(std::round(action.seconds * state->frame_rate), 1.0));
541
544 const auto running = weak.lock();
545 if (!running || cycle == 0) {
546 return;
547 }
548
549 Chimera view;
550 view.m_state = running;
552 },
555
557 }
558
560
561 set.m_guard = std::shared_ptr<void>(nullptr, [state](void*) { state->halt(); });
562 set.m_state = std::move(state);
563 return set;
564}
#define MF_ERROR(comp, ctx,...)
BufferOperation & every_n_cycles(uint32_t n)
Set cycle interval for periodic execution.
static BufferOperation dispatch_to(OperationFunction handler, Buffers::ProcessingToken token=Buffers::ProcessingToken::AUDIO_BACKEND)
Create a dispatch operation for external processing.
ChimeraBuilder & params(const glm::vec4 &values)
Params for the layer in the buffer's per-layer data, such as placement.
std::optional< Portal::Graphics::RenderConfig > m_render
ChimeraBuilder & fit(Portal::Graphics::FitMode mode)
Fit frames of another extent into this layer in this way, instead of the buffer's.
std::vector< Action > m_actions
ChimeraBuilder & level(double weight)
Weight passed to the shader for the layer.
std::shared_ptr< Buffers::TextureArrayBuffer > m_buffer
ChimeraBuilder & layer()
Open the next layer.
std::shared_ptr< BufferPipeline > m_pipeline
std::vector< Chimera::Layer > m_layers
@ GRAPHICS_BACKEND
Standard graphics processing backend configuration.
@ Configuration
Configuration and parameter updates.
@ Kriya
Automatable tasks and fluent scheduling api for Nodes and Buffers.
std::variant< std::vector< double >, std::vector< float >, std::vector< uint8_t >, std::vector< uint16_t >, std::vector< uint32_t >, std::vector< std::complex< float > >, std::vector< std::complex< double > >, std::vector< glm::vec2 >, std::vector< glm::vec3 >, std::vector< glm::vec4 >, std::vector< glm::mat4 > > DataVariant
Multi-type data storage for different precision needs.
MAYAFLUX_API uint32_t s_registered_frame_rate