harrand / Topaz

C++23 Game Engine
https://harrand.github.io/Topaz/
MIT License
33 stars 3 forks source link

Feature Request: TZ_PROFZONE in Lua #94

Closed harrand closed 5 days ago

harrand commented 9 months ago

Describe the feature request Currently, adding profiling instrumentation in lua is a pain. Example:

        local obj <close> = tz.profzone_obj:new()
    obj:set_text("Entity Update - " .. ent:get_name())
    obj:set_name("Lua Entity Update")

Macros in lua are not a thing, and this should be way more compact. Ideally: TZ_PROFZONE("Entity Update" .. ent:get_name()) Which emits the above code in the executing lua.