MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ tick()

void MayaFlux::Kriya::Chimera::tick ( State &  state,
uint64_t  frame 
)
staticprivate

Definition at line 146 of file Chimera.cpp.

147{
148 state.ticks = frame + 1;
149 const double now = static_cast<double>(frame) / state.frame_rate;
150
151 uint32_t index = 0;
152 for (auto& layer : state.layers) {
153 const uint32_t current = index++;
154
155 if (now < layer.delay) {
156 continue;
157 }
158
159 const auto age = static_cast<float>(now - layer.delay);
160
161 if (layer.picture) {
162 if (layer.dirty && state.buffer->submit_layer(current, *layer.picture)) {
163 layer.dirty = false;
164 stamp(state, current, glm::vec4(age, 0.0F, 0.0F, 1.0F));
165 }
166 continue;
167 }
168
169 if (frame % layer.interval != 0) {
170 continue;
171 }
172
173 if (layer.image) {
174 if (state.buffer->submit_layer(current, layer.image)) {
175 stamp(state, current, glm::vec4(age, 0.0F, 0.0F, 1.0F));
176 }
177 } else if (layer.ring) {
178 feed(state, layer, current, now - layer.delay);
179 } else if (layer.collection) {
180 collect(state, layer, current, now - layer.delay);
181 }
182 }
183}
glm::vec2 current
uint32_t index
Definition VKDevice.cpp:122
static void stamp(State &state, uint32_t index, const glm::vec4 &timing)
Definition Chimera.cpp:139
static void collect(State &state, Layer &layer, uint32_t index, double elapsed)
Definition Chimera.cpp:200
static void feed(State &state, Layer &layer, uint32_t index, double elapsed)
Definition Chimera.cpp:231

References MayaFlux::Kriya::Chimera::State::buffer, collect(), current, feed(), MayaFlux::Kriya::Chimera::State::frame_rate, index, MayaFlux::Kriya::Chimera::State::layers, stamp(), and MayaFlux::Kriya::Chimera::State::ticks.

+ Here is the call graph for this function: