1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 12:23:53 +00:00

Add C API for plots and messages.

This commit is contained in:
Bartosz Taudul 2019-06-24 20:54:43 +02:00
parent 48e08acb62
commit c749a2e3fe
2 changed files with 44 additions and 0 deletions

View File

@ -31,6 +31,12 @@ typedef const void* TracyCZoneCtx;
#define TracyCFrameMarkEnd(x) #define TracyCFrameMarkEnd(x)
#define TracyCFrameImage(x,y,z,w,a) #define TracyCFrameImage(x,y,z,w,a)
#define TracyCPlot(x,y)
#define TracyCMessage(x,y)
#define TracyCMessageL(x)
#define TracyCMessageC(x,y,z)
#define TracyCMessageLC(x,y)
#else #else
#ifndef TracyConcat #ifndef TracyConcat
@ -106,6 +112,19 @@ void ___tracy_emit_frame_image( void* image, uint16_t w, uint16_t h, uint8_t off
#define TracyCFrameMarkEnd( name ) ___tracy_emit_frame_mark_end( name ); #define TracyCFrameMarkEnd( name ) ___tracy_emit_frame_mark_end( name );
#define TracyCFrameImage( image, width, height, offset, flip ) ___tracy_emit_frame_image( image, width, height, offset, flip ); #define TracyCFrameImage( image, width, height, offset, flip ) ___tracy_emit_frame_image( image, width, height, offset, flip );
void ___tracy_emit_plot( const char* name, double val );
void ___tracy_emit_message( const char* txt, size_t size );
void ___tracy_emit_messageL( const char* txt );
void ___tracy_emit_messageC( const char* txt, size_t size, uint32_t color );
void ___tracy_emit_messageLC( const char* txt, uint32_t color );
#define TracyCPlot( name, val ) ___tracy_emit_plot( name, val );
#define TracyCMessage( txt, size ) ___tracy_emit_message( txt, size );
#define TracyCMessageL( txt ) ___tracy_emit_messageL( txt );
#define TracyCMessageC( txt, size, color ) ___tracy_emit_messageC( txt, size, color );
#define TracyCMessageLC( txt, color ) ___tracy_emit_messageLC( txt, color );
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -2284,6 +2284,31 @@ void ___tracy_emit_frame_image( void* image, uint16_t w, uint16_t h, uint8_t off
tracy::Profiler::SendFrameImage( image, w, h, offset, flip ); tracy::Profiler::SendFrameImage( image, w, h, offset, flip );
} }
void ___tracy_emit_plot( const char* name, double val )
{
tracy::Profiler::PlotData( name, val );
}
void ___tracy_emit_message( const char* txt, size_t size )
{
tracy::Profiler::Message( txt, size );
}
void ___tracy_emit_messageL( const char* txt )
{
tracy::Profiler::Message( txt );
}
void ___tracy_emit_messageC( const char* txt, size_t size, uint32_t color )
{
tracy::Profiler::MessageColor( txt, size, color );
}
void ___tracy_emit_messageLC( const char* txt, uint32_t color )
{
tracy::Profiler::MessageColor( txt, color );
}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif