网上找到一个program Simple; uses Graph, Vesa; begin Initialize('c:\bp\bgi'); OutText('Hello'); ReadLn; CloseGraph; end. This program assumes, of course, that you have the VESA unit available on disk and that your BGI drivers are kept in the C:\BP\BGI sub directory. 但我不行。
procedure Initialize(PathToDriver: String); var MaxColor, ErrorCode, GraphMode, GraphDriver: Integer; begin VESA16 := InstallUserDriver('VESA16', DetectVESA16); GraphDriver := Detect; InitGraph(GraphDriver, GraphMode, PathToDriver); ErrorCode := GraphResult; if ErrorCode <> grOK then begin WriteLn('Graphics error: ', GraphErrorMsg(ErrorCode)); ReadLn; Halt; end; MaxX := GetMaxX; MaxY := GetMaxY; MaxColor := GetMaxColor; end; end.
uses
Graph,
Vesa;
begin
Initialize('c:\bp\bgi');
OutText('Hello');
ReadLn;
CloseGraph;
end.
This program assumes, of course, that you have the VESA unit
available on disk and that your BGI drivers are kept in the
C:\BP\BGI sub directory. 但我不行。
var
MaxColor,
ErrorCode,
GraphMode,
GraphDriver: Integer;
begin
VESA16 := InstallUserDriver('VESA16', DetectVESA16);
GraphDriver := Detect;
InitGraph(GraphDriver, GraphMode, PathToDriver);
ErrorCode := GraphResult;
if ErrorCode <> grOK then begin
WriteLn('Graphics error: ', GraphErrorMsg(ErrorCode));
ReadLn;
Halt;
end;
MaxX := GetMaxX;
MaxY := GetMaxY;
MaxColor := GetMaxColor;
end;
end.
这我也不知道。确实近年又出一些能包含更高分辨率的标准,但我想对vesa支持的那些图形模式,它们应该“向下兼容”。
if GraphDriver = grError then
begin
writeln('Could''t load VESA16 driver.');
halt(1);
end;
GraphMode := 0; { 0 - 800x600 1 - 1024x768 2 - 1280x1024 }
InitGraph(GraphDriver, GraphMode, PathToDriver);
...如果还不行的话,应该是DetectVESA16函数写的有问题。