Repository navigation
Screenunlock
Home › Screen Functions › ScreenUnlock
Resumes screen updates after ScreenLock and shows what was drawn.
Declare Sub ScreenUnlock ( ByVal startline As Long = -1, ByVal endline As Long = -1 )startlineendline
ScreenUnlock unlocks the current work page assuming it was previously locked by calling ScreenLock and lets the system restart updating the screen regularly. When called with start_line and end_line , only the screen area between those lines is assumed to have changed, and will be updated.
An internal counter exists that remembers the screen lock state, thus ScreenUnlock has an effect only on a screen that is locked. A screen that has not been locked with ScreenLock cannot get unlocked, however ScreenUnlock still will force an update of given area or full screen.
Calls to ScreenUnlock must be paired with matching calls to ScreenLock. Only the first call to ScreenLock actually performs a locking operation. Subsequent calls to ScreenLock only increment the lock counter. Conversely, ScreenUnlock only decrements the lock counter until it reaches zero at which time the actual unlock operation will be performed. Using Screen (Graphics) or ScreenRes will release all locks and set the lock counter back to zero before changing screen modes.
All graphic statements automatically lock the screen before the function call, and unlock the screen afterwards, so you do not need to do this explicitly using ScreenLock and ScreenUnlock. You only need to lock the screen when you wish to access the screen (framebuffer) directly using ScreenPtr or when you wish to group several graphic statements together so their effects appear simultaneously on screen, thus avoiding potential screen flicker during screen updates.
Warning (Win32, Linux) : The screen is locked by stopping the thread that processes also the OS' events. This means the screen should be locked only for the short time required to redraw it, and no user input will be received while the screen is locked. When the induced lock time becomes too long, use preferably the method of double buffering (with ScreenCopy).
ScreenUnlock [ start_line ] [, end_line ]
- Not available in the -lang qb dialect unless referenced with the alias
__Screenunlock.
- New to FreeBASIC
See ScreenPtr example.
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