Category: 2D Overlay
Syntax:
b2dGetDrawCalls:Int()
None.
Int
Returns how many draw calls the last frame used.
Takes no parameters.
The runtime batches 2D drawing together, so thousands of rectangles or images can go to the GPU in one draw call. Changing image, shader or blend state starts a new batch. This returns how many draw calls a frame needed (updated once a second): a sudden jump means something is breaking the batching, for example alternating between two images on every draw.
View detailed documentation online
Print "Draw calls: " & ToString(b2dGetDrawCalls())
BambooBasic © 2026 Michael Denathorn