# Command: Flip

Flip [vwait] Definition:

In a double buffering environment, flips the BackBuffer into view.

Parameter Description:

vwait = set to TRUE to wait for vertical blank to finish

Command Description:

When you are double buffering (or doing all drawing operations to the BackBuffer(), at some point, after you've drawn all your elements - you will need to 'flip' that Backbuffer into the visible FrontBuffer() so it can be seen. This command will perform this function. This allows you to draw massive amounts of information quickly, then flip it into view. See BackBuffer() for more info.

Example:

; Flip/Backbuffer()/Rect Example
; Set Graphics Mode
Graphics 640,480
; Go double buffering
SetBuffer BackBuffer()
; Setup initial locations for the box
box_x = -20 ; negative so it will start OFF screen
box_y = 100
While Not KeyHit(1)
Cls ; Always clear screen first
Rect box_x,box_y,20,20,1 ; Draw the box in the current x,y location
Flip ; Flip it into view
box_x = box_x + 1 ; Move the box over one pixel
If box_x = 640 Then box_x=-20 ; If it leaves the Right edge, reset its x location
Wend

Index