1
Program GetModeRange_Example;
3
{ This program demonstrates how to find all available graph modes }
9
{ Currently, only 4, 8, 15 and 16 bit modes are supported
10
but this may change in the future }
11
gdnames: array[D4bit..D16bit] of string[6] =
12
('4 bit','6 bit','8 bit','12 bit','15 bit','16 bit');
14
procedure WriteRes(const depth : integer);
19
text := 'Current resolution is '; str(getmaxx+1, v);
20
text := text + v + 'x'; str(getmaxy+1, v);
21
text := text + v + 'x' + gdnames[depth];
22
setTextStyle(defaultFont,horizDir,1);
25
outTextXY((getMaxX - TW) div 2,
26
(getMaxY - TH) div 2,text);
32
gd, c, low, high, res: integer;
34
assign(t,'modes.txt');
37
for gd := D4bit to D16bit do
39
{ Get the available mode numbers for this driver }
40
getModeRange(gd,low,high);
43
Writeln(t,': low modenr = ',low,', high modenr = ',high);
46
no resolutions are supported for this bitdepth }
50
writeln(t,' No modes supported!');
55
{ Enter all supported resolutions for this bitdepth
56
and write their characteristics to the file }
57
for c := low to high do
60
writeln(t,' testing mode nr ',c);
65
{ An error occurred when entering the mode? }
67
writeln(t,grapherrormsg(res))
70
write(t,'maxx: ',getmaxx,', maxy: ',getmaxy);
71
Writeln(t,', maxcolor: ',getmaxcolor);
82
Writeln('All supported modes are listed in modes.txt files');