~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to docs/graphex/modrange.pp

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Program GetModeRange_Example;
2
 
 
3
 
{ This program demonstrates how to find all available graph modes }
4
 
 
5
 
uses graph;
6
 
 
7
 
const
8
 
  { Currently, only 4, 8, 15 and 16 bit modes are supported
9
 
    but this may  change in the future }
10
 
  gdnames: array[D4bit..D16bit] of string[6] =
11
 
    ('4 bit','6 bit','8 bit','12 bit','15 bit','16 bit');
12
 
 
13
 
var
14
 
  t: text;
15
 
  line : string;
16
 
  gd, c, low, high, res: integer;
17
 
begin
18
 
  assign(t,'modes.txt');
19
 
  rewrite(t);
20
 
  close(t);
21
 
  for gd := D4bit to D16bit do
22
 
    begin
23
 
    { Get the available mode numbers for this driver }
24
 
    getModeRange(gd,low,high);
25
 
    append(t);
26
 
    write(t,gdnames[gd]);
27
 
    Writeln(t,': low modenr = ',low,', high modenr = ',high);
28
 
    close(t);
29
 
    { If high is -1,
30
 
       no resolutions are supported for this bitdepth }
31
 
    if high = -1 then
32
 
      begin
33
 
      append(t);
34
 
      writeln(t,'  No modes supported!');
35
 
      writeln(t);
36
 
      close(t);
37
 
      end
38
 
    else
39
 
      { Enter all supported resolutions for this bitdepth
40
 
        and write their characteristics to the file }
41
 
      for c := low to high do
42
 
        begin
43
 
        append(t);
44
 
        writeln(t,'  testing mode nr ',c);
45
 
        close(t);
46
 
        initgraph(gd,c,'');
47
 
        res := graphresult;
48
 
        append(t);
49
 
        { An error occurred when entering the mode? }
50
 
        if res <> grok then
51
 
          writeln(t,grapherrormsg(res))
52
 
        else
53
 
          begin
54
 
          write(t,'maxx: ',getmaxx,', maxy: ',getmaxy);
55
 
          Writeln(t,', maxcolor: ',getmaxcolor);
56
 
          closegraph;
57
 
          end;
58
 
        writeln(t);
59
 
        close(t);
60
 
        end;
61
 
    append(t);
62
 
    writeln(t);
63
 
    close(t);
64
 
    end;
65
 
  Writeln('All supported modes are listed in modes.txt files');
66
 
end.