1 #ifndef GONG_APP_FRAMECOUNTER_HPP_
2 #define GONG_APP_FRAMECOUNTER_HPP_
27 void EnterFrame() noexcept;
28 void EnterHandle() noexcept;
29 void ExitHandle() noexcept;
30 void EnterUpdate() noexcept;
31 void ExitUpdate() noexcept;
32 void EnterRender() noexcept;
33 void ExitRender() noexcept;
34 void ExitFrame() noexcept;
36 const Frame<int> &Peak() const noexcept { return peak; }
37 const Frame<float> &Average() const noexcept { return avg; }
39 bool Changed() const noexcept { return changed; }
41 void Print(std::ostream &) const;
46 void Accumulate() noexcept;
50 static constexpr int NUM_FRAMES = 32;
51 static constexpr float factor = 1.0f / float(NUM_FRAMES);
53 Uint32 last_enter = 0;
57 Frame<int> current = Frame<int>{};
58 Frame<int> sum = Frame<int>{};
59 Frame<int> max = Frame<int>{};
61 Frame<int> peak = Frame<int>{};
62 Frame<float> avg = Frame<float>{};
70 FrameCounter::Frame<T>::Frame()