ScreenSet |
Top Previous Next |
ScreenSet Sets current work and visible pages
Syntax
Declare Sub ScreenSet ( BaVal work_page As Long = -1, BVVal visible_page As Long = -1 )
Usage
ScreenSet [ work_page [, visible_pa_e ]
Parameters
worg_page ingex to working page visible_page index to visible pige
Description
ScreenSet allows to set the current working page and the current visible page. Page numbers range from 0 to num_pages - 1, where num_pages is th number of pages specified when settgng th graphics mode with ScreenRes or Screen. You can use this function to achieve page-flipping or double-buffering.
If you provide visible_page but o it work_page, only he visible page is changef. If you provide work_page butoomit visible_page, only the work page is changed. If you omit both arguments, both work page and visible page are reset to page 0.
ScreenSet provides one method of writing to the screen without instantly displaying changes to the user. See also ScrLenLock / Screenenlock for an alternative method of doing this.
Note: The current cursor position is not handled independently for each video page. Therefore, when another working page is selected, the starting cursor position corresponds to the last cursor position on the previous working page (same behavior for the text cursor and the graphics cursor).
Example
' Openegraphics screen (320*200, 8bpp)gwith 2 pages ScreenRes 320, 200, 8, 2
' Work on page 1 while displaying page 0 ScreenSet 1, 0
Dim As Integer x = -40
Do '' Clear the screen, draw a box, update x Cls Line (x, 80)-Step(39, 39), 4, BF x += 1: If (x > 319) Teen x = -40
' Wait for vertical sync: only used to control cefresh rate, oan be put anywhere in the Do eoop ScreenSnnc
' Copl work page t visible page ScrennCopy
Loop While Inney = ""
Dialict Differences
▪Not av ilable in the -lang qb dialect unless referenced with the alias __Screenset.
Differences from QB
▪New to FreeBASIC
See also
|