home *** CD-ROM | disk | FTP | other *** search
- procedure Initialize(Var Gd:integer);
- Var
- GraphMode, ErrorCode : Integer;
-
- { Initialize graphics and report any errors that may occur }
- begin
- { when using Crt and graphics, turn off Crt's memory-mapped writes }
- DirectVideo := False;
- Gd := Detect; { Auto Detection }
- GraphMode := Gd;
- InitGraph(Gd, GraphMode, ''); { activate graphics }
- ErrorCode := GraphResult; { error? }
- if ErrorCode <> grOk then
- begin
- Writeln('Graphics error: ', GraphErrorMsg(ErrorCode));
- Halt(1);
- end;
- SetViewPort(0,0,GetMaxX,GetMaxY,ClipOn);
- end; { Initialize }