~ubuntu-branches/ubuntu/feisty/fpc/feisty

« back to all changes in this revision

Viewing changes to fpcdocs/graphex/inigraph1.pp

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2007-01-27 20:08:50 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070127200850-9mrptaqqjsx9nwa7
Tags: 2.0.4-5
* Fixed Build-Depends.
* Add myself to Uploaders in debian/control.
* Make sure that the sources are really patched before building them.
* Build unit 'libc' on powerpc too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Program inigraph1;
 
2
 
 
3
{ Program to demonstrate static graphics mode selection }
 
4
 
 
5
uses graph;
 
6
 
 
7
 
 
8
const
 
9
  TheLine = 'We are now in 640 x 480 x 256 colors!'+
 
10
            ' (press <Return> to continue)';
 
11
 
 
12
var
 
13
  gd, gm, lo, hi, error,tw,th: integer;
 
14
  found: boolean;
 
15
 
 
16
begin
 
17
  { We want an 8 bit mode }
 
18
  gd := D8bit;
 
19
  gm := m640x480;
 
20
  initgraph(gd,gm,'');
 
21
  { Make sure you always check graphresult! }
 
22
  error := graphResult;
 
23
  if (error <> grOk) Then
 
24
    begin
 
25
    writeln('640x480x256 is not supported!');
 
26
    halt(1)
 
27
    end;
 
28
  { We are now in 640x480x256 }
 
29
  setColor(cyan);
 
30
  rectangle(0,0,getmaxx,getmaxy);
 
31
  { Write a nice message in the center of the screen }
 
32
  setTextStyle(defaultFont,horizDir,1);
 
33
  tw:=TextWidth(TheLine);
 
34
  th:=TextHeight(TheLine);
 
35
  outTextXY((getMaxX - TW) div 2,
 
36
            (getMaxY - TH) div 2,TheLine);
 
37
  { Wait for return }
 
38
  readln;
 
39
  { Back to text mode }
 
40
  closegraph;
 
41
end.