2017-09-10 18:09:57 +00:00
|
|
|
#ifndef __TRACYSCOPED_HPP__
|
|
|
|
#define __TRACYSCOPED_HPP__
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2017-09-25 19:13:59 +00:00
|
|
|
#include "../common/TracySystem.hpp"
|
2017-09-10 18:09:57 +00:00
|
|
|
#include "TracyProfiler.hpp"
|
|
|
|
|
|
|
|
namespace tracy
|
|
|
|
{
|
|
|
|
|
|
|
|
class ScopedZone
|
|
|
|
{
|
|
|
|
public:
|
2017-09-25 20:46:14 +00:00
|
|
|
ScopedZone( const char* file, const char* function, uint32_t line, uint32_t color )
|
|
|
|
: m_id( Profiler::ZoneBegin( QueueZoneBegin { Profiler::GetTime(), (uint64_t)file, (uint64_t)function, line, GetThreadHandle(), color } ) )
|
2017-09-10 18:09:57 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
~ScopedZone()
|
|
|
|
{
|
2017-09-23 19:09:46 +00:00
|
|
|
Profiler::ZoneEnd( m_id, QueueZoneEnd { Profiler::GetTime() } );
|
2017-09-10 18:09:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
uint64_t m_id;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|