xcal
基于 C++23 的现代图形渲染引擎
载入中...
搜索中...
未找到
timelinedriver.hpp
浏览该文件的文档.
1
11#pragma once
12#include <xcal/public.h>
13
14#include <memory>
15#include <vector>
18
19namespace xcal::animation {
20
22 private:
23 Timeline *timeline_;
24 std::vector<std::unique_ptr<AnimationDriver>> animation_drivers_;
25 float_t frame_rate_ = 60.0f;
26 float_t current_time_ = 0.0f;
27 float_t duration_ = 0.0f;
28
29 public:
31 : timeline_(timeline), animation_drivers_() {}
32 ~TimelineDriver() = default;
33
34 public:
35 void ready_to_play();
36 void next();
37 bool finished() const {
38 return duration_ <= current_time_ || animation_drivers_.empty();
39 }
40
41 float_t frame_rate() const { return frame_rate_; }
43 frame_rate_ = frame_rate;
44 return this;
45 }
46 float_t duration() const { return duration_; }
47
48 public:
49 TimelineDriver(const TimelineDriver &) = delete;
53};
54
55} // namespace xcal::animation
This file contains the declaration of AnimationDriver class.
TimelineDriver(const TimelineDriver &)=delete
TimelineDriver & operator=(TimelineDriver &&)=delete
TimelineDriver(TimelineDriver &&)=delete
TimelineDriver & operator=(const TimelineDriver &)=delete
TimelineDriver * set_frame_rate(float_t frame_rate)
float float_t
Definition public.h:27
#define XCAL_API
Definition public.h:69