summaryrefslogtreecommitdiff
path: root/include/llmr/renderer/frame_history.hpp
blob: 35ef3cdf472e8fe5e95dbccf4e3acf5cefb285d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef LLMR_RENDERER_FRAME_HISTORY
#define LLMR_RENDERER_FRAME_HISTORY

#include <deque>
#include <cassert>
#include <cmath>

#include <llmr/platform/platform.hpp>
#include <llmr/util/time.hpp>

namespace llmr {

struct FrameSnapshot {
    explicit inline FrameSnapshot(timestamp t, float z) : t(t), z(z) {}
    float t;
    float z;
};

class FrameHistory {
public:
    // Record frame history that will be used to calculate fading params
    void record(timestamp now, float zoom);

    bool needsAnimation(timestamp duration) const;

public:
    std::deque<FrameSnapshot> history;
};

}

#endif