1 #ifndef BLANK_APP_FRAMECOUNTER_HPP_
2 #define BLANK_APP_FRAMECOUNTER_HPP_
13 void EnterFrame() noexcept;
14 void EnterHandle() noexcept;
15 void ExitHandle() noexcept;
16 void EnterUpdate() noexcept;
17 void ExitUpdate() noexcept;
18 void EnterRender() noexcept;
19 void ExitRender() noexcept;
20 void ExitFrame() noexcept;
22 float AvgHandle() const noexcept { return avg.handle; }
23 float AvgUpdate() const noexcept { return avg.update; }
24 float AvgRender() const noexcept { return avg.render; }
25 float AvgFrame() const noexcept { return avg.total; }
26 float AvgRunning() const noexcept { return avg.handle + avg.update + avg.render; }
27 float AvgWaiting() const noexcept { return avg.total - AvgRunning(); }
29 bool Changed() const noexcept { return changed; }
31 void Print(std::ostream &) const;
37 static constexpr int NUM_FRAMES = 32;
38 static constexpr float factor = 1.0f / float(NUM_FRAMES);
48 Uint32 last_enter = 0;
52 Frame<int> running = Frame<int>{};
53 Frame<float> avg = Frame<float>{};