Repository navigation
Screenset
Home › Screen Functions › ScreenSet
Sets which page is drawn on and which page is shown.
Declare Sub ScreenSet ( ByVal work_page As Long = -1, ByVal visible_page As Long = -1 )work_pagevisible_page
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 the number of pages specified when setting the graphics mode with ScreenRes or Screen (Graphics). You can use this function to achieve page-flipping or double-buffering.
If you provide visible_page but omit work_page, only the visible page is changed. If you provide work_page but omit 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 ScreenLock / ScreenUnlock 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).
ScreenSet [ work_page ] [, visible_page ]
- Not available in the -lang qb dialect unless referenced with the alias
__Screenset.
- New to FreeBASIC
' Open graphics screen (320*200, 8bpp) with 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) Then x = -40
' Wait for vertical sync: only used to control refresh rate, can be put anywhere in the Do loop
ScreenSync
' Copy work page to visible page
ScreenCopy
Loop While Inkey = ""Category: Screen Functions
Kind: sub
Reproduced from the FreeBASIC Wiki Manual under the GNU Free Documentation License 1.3 — with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. Copyright © the FreeBASIC project and wiki contributors. See License.
tiko-lang · Home · Feature Index · Keyword Index · License
FreeBASIC manual pages reproduced under the GNU FDL 1.3.
- Generics
- Interfaces
- For Each
- Iterators
- Tuples
- Array Results
- Defer
- Lambdas
- Block Strings
- Partial Types
- String Slices
- Embed
- Typed Variadics
- C Header Import
- Foreign Library Linking
- UString
- Fixed-Width Types
- Nullptr
- String Library
- Format
- Array
- Map
- Set
- LinkedList
- OrderedMap
- OrderedSet
- Sorting
- Optional
- Result
- Smart Pointers
- Date and Time (Chrono)
- Filesystem
- File Streams
- Config (INI and TOML)
- Codec
- Hash
- UUID
- OS
- Process
- Net
- HTTP and TLS
- Math Library
- Finance
- Logging
- Terminal TUI Library
- PsControls
- tkControls
- sys/win
- Goroutines and Channels
- LLVM Backend
- tiko build
- TIKO_COMPILER
- Variable Declarations
- Standard Data Types
- User Defined Types
- Procedures
- Operators
- Control Flow Statements
- Converting Data Types
- Array Functions
- String Functions
- Mathematical Functions
- Bit Manipulation
- Date and Time Functions
- File I/O Functions
- Console Functions
- User Input (Runtime Library)
- User Input Functions (Graphics Library)
- Screen Functions
- 2D Drawing Functions
- Graphics Library Reference
- Graphics Keyword List
- Memory Functions
- Threading Support Functions
- Error Handling Functions
- Operating System Functions
- Preprocessor
- Intrinsic Defines
- Miscellaneous Keywords
- Modularizing