diff --git a/docs/graphex/inigraph2.pp b/docs/graphex/inigraph2.pp index a4f1c54cb6..f89e77c19d 100644 --- a/docs/graphex/inigraph2.pp +++ b/docs/graphex/inigraph2.pp @@ -39,6 +39,7 @@ begin end; end; if not found then + CloseGraph(); begin writeln('640x480x256 is not supported!'); halt(1) diff --git a/docs/graphex/modrange.pp b/docs/graphex/modrange.pp index 43c1338746..e56520565a 100644 --- a/docs/graphex/modrange.pp +++ b/docs/graphex/modrange.pp @@ -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);