b2dShowProfiler

Shows or hides the built-in profiler panel. Takes enable (True to show, False to hide).

2D Overlay

Parameters & Returns

Parameters

enable Int

Returns

Void

Quick Summary

Shows or hides the built-in profiler panel. Takes enable (True to show, False to hide).

Technical Exegesis...

Shows a small panel in the top right corner (drawn with IGI, so it sits on top of everything and can be dragged anywhere) with:

- FPS, and the frame time in ms (average, best and worst over the last second)
- a graph of the last 120 frame times, where a stutter shows as a spike
- CPU: the time your program's own code took each frame (from the start of the loop to b2dFlip, not counting time spent waiting for the screen)
- GPU: the time the graphics card took to draw the frame.

Example

Example.bam
b2dShowProfiler(True)          ; switch it on

If inpIsKeyHit(VKEY_F1) Then
    showing = Not showing
    b2dShowProfiler(showing)   ; or toggle it with a key
EndIf