4# include <OgreRenderTargetListener.h>
26class GpuTimer :
public Ogre::RenderTargetListener
33 explicit GpuTimer(Ogre::RenderTarget* target);
36 GpuTimer(
const GpuTimer&) =
delete;
37 GpuTimer& operator=(
const GpuTimer&) =
delete;
40 bool IsActive()
const {
return m_active; }
43 double MeanMilliseconds()
const {
return m_frames > 0 ? m_sumMs / double(m_frames) : -1.0; }
46 double MaxMilliseconds()
const {
return m_maxMs; }
49 int Frames()
const {
return m_frames; }
55 std::string Summary()
const;
57 void preRenderTargetUpdate(
const Ogre::RenderTargetEvent& evt)
override;
58 void postRenderTargetUpdate(
const Ogre::RenderTargetEvent& evt)
override;
63 static constexpr int kRing = 4;
64 Ogre::RenderTarget* m_target =
nullptr;
65 bool m_active =
false;
66 std::array<unsigned, kRing> m_queries {};
67 std::array<bool, kRing> m_pending {};
69 bool m_inQuery =
false;
Visualization utilities.
Definition VisualDomain.h:12