Skip to content

Commit

Permalink
add global __hxcpp_tracy_* telemetry functions
Browse files Browse the repository at this point in the history
  • Loading branch information
dazKind committed Sep 8, 2024
1 parent 4e9c48d commit 1377502
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/hx/Telemetry.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,12 @@ void __hxcpp_hxt_ignore_allocs(int delta);
int __hxcpp_gc_reserved_bytes();
int __hxcpp_gc_used_bytes();

#ifdef HXCPP_TRACY
void __hxcpp_tracy_framemark();
void __hxcpp_tracy_plot(String name, float val);
void __hxcpp_tracy_plot_config(String name, uint8_t format, bool step, bool fill, int color);
void __hxcpp_tracy_message(String msg, int color);
void __hxcpp_tracy_message_app_info(String info);
#endif

#endif
25 changes: 25 additions & 0 deletions src/hx/TelemetryTracy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,29 @@ void hx::tlmSampleExit(hx::Telemetry* telemetry)
___tracy_emit_zone_end(telemetry->tracyZones.back());

telemetry->tracyZones.pop_back();
}

void __hxcpp_tracy_framemark()
{
::tracy::Profiler::SendFrameMark(0);
}

void __hxcpp_tracy_plot(String name, float val)
{
::tracy::Profiler::PlotData(name.c_str(), val);
}

void __hxcpp_tracy_plot_config(String name, uint8_t format, bool step, bool fill, int color)
{
::tracy::Profiler::ConfigurePlot(name.c_str(),::tracy::PlotFormatType(format), step, fill, color);
}

void __hxcpp_tracy_message(String msg, int color)
{
::tracy::Profiler::MessageColor(msg.c_str(), msg.length, color, 0);
}

void __hxcpp_tracy_message_app_info(String info)
{
::tracy::Profiler::MessageAppInfo(info.c_str(), info.length);
}

0 comments on commit 1377502

Please sign in to comment.