enables or disables the on-screen profiler ui * Creates and shows or hides and destroys the on-sceen profiler ui * * The profiler is a real-time tool that shows the numbers of milliseconds spent * in each scope per frame as well as counters. The profiler is very useful for * tracking down performance and resource problems. * * @name profiler.enable_ui * @param enabled [type:boolean] true t
| 461 | * ``` |
| 462 | */ |
| 463 | static int EnableProfilerUI(lua_State* L) |
| 464 | { |
| 465 | DM_LUA_STACK_CHECK(L, 0); |
| 466 | |
| 467 | if (!lua_isboolean(L, 1)) |
| 468 | { |
| 469 | return DM_LUA_ERROR("Invalid parameter, expected a boolean but got a %s", lua_typename(L, lua_type(L, 1))) |
| 470 | } |
| 471 | |
| 472 | bool enabled = lua_toboolean(L, 1); |
| 473 | |
| 474 | if (enabled && !gRenderProfile) |
| 475 | { |
| 476 | gRenderProfile = dmProfileRender::NewRenderProfile(gUpdateFrequency); |
| 477 | } |
| 478 | else if (!enabled) |
| 479 | { |
| 480 | DeleteProfilerUI(); |
| 481 | } |
| 482 | |
| 483 | return 0; |
| 484 | } |
| 485 | |
| 486 | /*# sets the the on-screen profiler ui mode |
| 487 | * Set the on-screen profile mode - run, pause, record or show peak frame |
nothing calls this directly
no test coverage detected