Skip to content

FlipCanvas

Narta Xaymar Dirks edited this page Oct 31, 2026 · 7 revisions
BlitzPlus

FlipCanvas

FlipCanvas:Void canvas:Int32, vwait:Int32=0
Parameter Mode Type Default Description
canvas In Int32 required Handle of a canvas.
vwait In Int32 0 1 waits for the display to be ready, 0 shows it right away. Defaults to 1.

Description

Shows what was drawn to the buffer of a canvas, like Flip does for a window opened with Graphics. Until it is called the canvas keeps showing what it showed before, and Flip has nothing to do with canvases.

Differences

  • The window of the canvas is drawn and handed to the thread that shows it right away, so a program that never waits for events still shows its canvases. With vwait 1 the call returns once the window has shown the picture, at the pace of its display, and after a quarter of a second at the latest where the window cannot show anything (it is covered or minimized); with 0 it returns at once, and a canvas flipped faster than the display shows the newest picture. What was drawn stays in the buffer after the flip.

Examples

Graphics 320, 240, 32, 2
win = CreateWindow("Flip", 20, 20, 240, 150, Desktop(), 3)
cv  = CreateCanvas(10, 10, 200, 100, win)
SetBuffer CanvasBuffer(cv)
Color 255, 0, 0
Rect 0, 0, 200, 100, 1
FlipCanvas cv, 0
Repeat
Until WaitEvent() = $803

Related Commands

CanvasBuffer, CreateCanvas, DesktopBuffer, LockedFormat

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally