Blitz3D+ Command Reference

FlipCanvas canvas[,vwait]

Parameters

canvas - canvas gadget to present

vwait (optional) - True to wait for vertical sync before presenting; False (default)

Description

Presents a canvas's finished frame on screen.

Requires Extended language mode.

Drawing to a canvas is invisible until you flip it - the same draw-then-present rhythm as Flip for full-screen graphics, but per canvas. Only the canvas you pass is presented; other canvases and their pending frames are untouched.

For a 2D canvas, this shows everything drawn to CanvasBuffer since the last flip. For a canvas attached with Graphics3DCanvas, it submits and presents that canvas's rendered 3D frame with its own CanvasBuffer overlay composed on top. If nothing new was rendered this time, the canvas keeps its last completed 3D frame and composites the current overlay over that clean image - so replacing or clearing overlay content never leaves pixels from an older overlay behind.

With several views, render all of them first, then present: pass False to the earlier FlipCanvas calls and True only to the final one, so one editor frame waits for vertical sync exactly once. A window-resize drag is handled gracefully too - the expensive swap-chain rebuild is deferred to the first FlipCanvas after the drag ends.

See it working in the 2D canvas sample and the embedded Graphics3D sample, then multi-view in the two-view and four-view editor samples and the two-window, two-world sample.

See also: CreateCanvas, CanvasBuffer, Graphics3DCanvas, RenderWorldToCanvas, Flip.

Index