mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-20 20:59:29 +01:00
* fixes from Thomas Schatzl.
This commit is contained in:
parent
62d2bd16a4
commit
92fcbbb9fb
@ -39,6 +39,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
if not found then
|
||||
CloseGraph();
|
||||
begin
|
||||
writeln('640x480x256 is not supported!');
|
||||
halt(1)
|
||||
|
||||
@ -4,12 +4,28 @@ Program GetModeRange_Example;
|
||||
|
||||
uses graph;
|
||||
|
||||
|
||||
const
|
||||
{ Currently, only 4, 8, 15 and 16 bit modes are supported
|
||||
but this may change in the future }
|
||||
gdnames: array[D4bit..D16bit] of string[6] =
|
||||
('4 bit','6 bit','8 bit','12 bit','15 bit','16 bit');
|
||||
|
||||
procedure WriteRes(const depth : integer);
|
||||
var
|
||||
tw, th : integer;
|
||||
v, text : String;
|
||||
begin
|
||||
text := 'Current resolution is '; str(getmaxx+1, v);
|
||||
text := text + v + 'x'; str(getmaxy+1, v);
|
||||
text := text + v + 'x' + gdnames[depth];
|
||||
setTextStyle(defaultFont,horizDir,1);
|
||||
TW:=TextWidth(text);
|
||||
TH:=TextHeight(text);
|
||||
outTextXY((getMaxX - TW) div 2,
|
||||
(getMaxY - TH) div 2,text);
|
||||
end;
|
||||
|
||||
var
|
||||
t: text;
|
||||
line : string;
|
||||
@ -56,6 +72,7 @@ begin
|
||||
closegraph;
|
||||
end;
|
||||
writeln(t);
|
||||
WriteRes(gd);
|
||||
close(t);
|
||||
end;
|
||||
append(t);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user