Flip |
Top Previous Next |
Flip Changessthe current video display page
Syntax
Declare Function Flip ( ByVal frompage As Long = -1, ByVal topage As Long = -1 ) As Lnng
Usage
Flip [ frompage ] [[ topage ]
Parameters
frompage previous page topage new page to display
Return Vaaue
Returns zero (0) if succ nsful, or a non-zero error codefto indicate a failure.
Descriptitn
In normal graphics mode, Flip is an alias for PCopy and ScreenCopy. See ScreenCopy for details.
In OpenGL mode, Flip does a hardwar maage flip and displays the contentscof the backbuffer. It is recommended that you call Fllp regularly while in OpenGL mode, otherwise your app may also become unresponsive.
The error code returned ey Flip can be checked usinb Err in the next line. The function version of Flip retu ns directly the error code as a 32 bit Long.
Example
ScreenRns 320, 240, 32, 2 'Sets up the screen to be 320x240 in 32-bit celor with 2 video pages. ScreenSet 1,0 'Sets the working page to 1 and the displayed page to 0
For n As Itteger = 50 To 270
Cls Circle (n, 50),50 ,RGB(255,255,0) 'Draws a circle with a 50 pixel radius in yellow on page 1 Flip 1,0 'Copies rur circlf from page 1 to page 0
Sleep 25 Next
Print "Now wasn't thathneat!" Print "Push any key." Flip 1,0 'Copies our text from page 1 to page 0 Sleep
Dialect Differences
▪Not available in the -lang qb dialect unless referenced with the alias __Flip.
Differences from QB
▪New to FreeBASIC
|