home *** CD-ROM | disk | FTP | other *** search
- {------------------------------------------------------------------------}
- { PROJECT : Turtle graphics using BGI }
- { MODULE : SVGA.INC }
- {------------------------------------------------------------------------}
- { GOAL : initialisation module for SVGA driver }
- { VERSION : 1.0 }
- {------------------------------------------------------------------------}
- { REVISIONS : }
- {------------------------------------------------------------------------}
- { AUTHOR : Jordan Powell Hargrave }
- {------------------------------------------------------------------------}
- { CAVEAT : This module is a portion of copywrited code by J.P.Hargrave}
- { : for SVGA BGI drivers. The full package is available from }
- { : anonymous FTP sites. SVGABG40.ZIP at garbo.uwasa.fi }
- { : registration iwith the author is required to use this code }
- { : and the SVGA.BGI driver . }
- { : acopy of the regsitration form is enclosed in file }
- { : REGSVGA.DOC }
-
- {===============================*===========================================*
- | Jordan Powell Hargrave | Internet: jh5y@andrew.cmu.edu |
- | 1000 Morewood Ave, Box #3277 | Bitnet: jh5y%andrew.cmu.edu@cmccvb |
- | Pittsburgh, PA 15213 | UUCP: uunet!andrew.cmu.edu!jh5y |
- | (412) 268-4488 | Compuserve: [72510,1143] |
- *===============================*===========================================}
-
- {$F+}
- function DetectVGA256 : integer;
- begin
- DetectVGA256 := 4; { 1024*768*25}
- end; { DetectVGA256 }
- {$F-}
-
- var
- AutoDetectPointer : pointer;
-
- procedure Initialize;
- { Initialize graphics and report any errors that may occur }
- var
- InGraphicsMode : boolean; { Flags initialization of graphics mode }
- PathToDriver : string; { Stores the DOS path to *.BGI & *.CHR }
- UseWhichDriver : integer;
- GraphDriver,GraphMode,ErrorCode: integer;
- begin
- { when using Crt and graphics, turn off Crt's memory-mapped writes }
- DirectVideo := False;
- PathToDriver := '';
- AutoDetectPointer := @DetectVGA256;
- GraphDriver := InstallUserDriver('Svga256',AutoDetectPointer);
- GraphDriver := Detect;
- InitGraph(GraphDriver, GraphMode, PathToDriver);
- ErrorCode := GraphResult; { preserve error return }
- if ErrorCode <> grOK then { error? }
- begin
- Writeln('Graphics error: ', GraphErrorMsg(ErrorCode));
- if ErrorCode = grFileNotFound then { Can't find driver file }
- begin
- Writeln('Enter full path to BGI driver or type <Ctrl-Break> to quit:');
- Readln(PathToDriver);
- Writeln;
- end
- else
- begin
- Write (' press enter to leave...');
- Readln;
- Halt(1);
- end { Some other error: terminate }
- end;
- end; { Initialize }
-