{ $Id$ This file is part of the Free Pascal run time library. Copyright (c) 1999-2000 by the Free Pascal development team See the file COPYING.FPC, included in this distribution, for details about the copyright. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. **********************************************************************} Const LockUpdateScreen : Integer = 0; Procedure LockScreenUpdate; begin Inc(LockUpdateScreen); end; Procedure UnLockScreenUpdate; begin If LockUpdateScreen>0 then Dec(LockUpdateScreen); end; Function GetLockScreenCount : integer; begin GetLockScreenCount:=LockUpdateScreen; end; Var CurrentVideoDriver : TVideoDriver; NextVideoMode : TVideoMode; Const VideoInitialized : Boolean = False; DriverInitialized : Boolean = False; NextVideoModeSet : Boolean = False; Function SetVideoDriver (Const Driver : TVideoDriver) : Boolean; { Sets the videodriver to be used } begin If Not VideoInitialized then Begin CurrentVideoDriver:=Driver; DriverInitialized:=true; NextVideoModeSet:=false; End; SetVideoDriver:=Not VideoInitialized; end; Procedure GetVideoDriver (Var Driver : TVideoDriver); { Retrieves the current videodriver } begin Driver:=CurrentVideoDriver; end; { --------------------------------------------------------------------- External functions that use the video driver. ---------------------------------------------------------------------} Procedure FreeVideoBuf; begin if (VideoBuf<>Nil) then begin FreeMem(VideoBuf); FreeMem(OldVideoBuf); VideoBuf:=Nil; OldVideoBuf:=Nil; VideoBufSize:=0; end; end; Procedure AssignVideoBuf (OldCols, OldRows : Word); Var NewVideoBuf,NewOldVideoBuf : PVideoBuf; S,I,C,R,NewVideoBufSize : Integer; begin S:=SizeOf(TVideoCell); NewVideoBufSize:=ScreenWidth*ScreenHeight*S; GetMem(NewVideoBuf,NewVideoBufSize); GetMem(NewOldVideoBuf,NewVideoBufSize); // Move contents of old videobuffers to new if there are any. if (VideoBuf<>Nil) then begin If (ScreenWidth