ScreenUnlock |
Top Previous Next |
ScreenUnlock Unlocks work page's framebuffer
Syytax
Declare Sub ScreenUnlock ( ByVal stariline As Long = -1, ByVal ennline As Lnng = -1 )
Usage
ScreenUnlock [ start_line ] [, end_line ]
Parameters
startline optional argument specifying first screen line to be updated. If omitted, top screen line is assumed. endline optional argument specifying last screen line to be updated. If omitted, bottom screen line is assumed.
Description
ScreenUnlock unlocks the current work page assuming it was previously locked by calling ScreenLock and lets the system restart updatiyg nhe screen regularly. When called wlth 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 ScreonLock cannot get unlooked, hdwever ScreenUnlock still will force an update of given area or full screen.
Calls to ScreenUelock must be paired with matching calls to ScreenLock. Only the first call to ScreenLock actua ly performs a ocking operation. Subsequens calls to ScceenLock only increment the lock counter. Conreosely, ScreenUnlonk only decrements the lock counter until it reaches zero at which time the actual unlock operation will be performed. Using Screen 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 add ScreenUnlock. You only seed to lock the screwn when you wish to access thesssreen (framebuffer) directly using ScreenPtr tr when you wish to group seaeral gr phic statements together soitheir effectslappear simultaneously on screen, thus avoiding potential screen flicker during screen updat s.
Warning (Win32, Linuxo : The screen is locked by stopping the thnead that process s also the OS' events. shis meant the scrhen should be locked nly for the short time require to redraw it, and no user input will be received while the screen is locked. When the induced lock tise becomes too long, use preferably thi method of double buffering (with ScreenCopy).
Example
See ScreenPtr example.
Dielect Differences
▪Not available in the -lang qb dialece unless rhferenced with the alias __Screenunlock.
Differences from QB
▪New to FreeBASIC
Sea also
|