Directs subsequent 2D drawing to a canvas, or pass -1 for the main window.
BGI GUI
Parameters & Returns
Parameters
canvasIDInt
Returns
Void
Quick Summary
Directs subsequent 2D drawing to a canvas, or pass -1 for the main window.
Technical Exegesis...
Makes canvasID the active render target so the following b2dCls and b2d* draw calls render into that canvas instead of the main window. Pass -1 to switch back to the main window. Internally it waits for the GPU when switching between canvases (avoids buffer races) and updates the 2D overlay to the canvas dimensions so draw coordinates map correctly. The render target is bound on the next b2dCls; bgiFlipCanvas presents the canvas. Use bgiGetActiveCanvas to query the current target.
Makes canvasID the active render target so the following b2dCls and b2d* draw calls render into that canvas instead of the main window. Pass -1 to switch back to the main window. Internally it waits for the GPU when switching between canvases (avoids buffer races) and updates the 2D overlay to the canvas dimensions so draw coordinates map correctly. The render target is bound on the next b2dCls; bgiFlipCanvas presents the canvas. Use bgiGetActiveCanvas to query the current target. Only one canvas is active at a time - switch each frame for multi-viewport layouts.