Program Grafik1;
{$path "pascal:include/" }
{$incl "graphics.lib", "intuition/intuition.h" }
Var
  Win: ^Window;
  Rp: ^RastPort; { dieser Typ wird in "graphics/rastport.h" definiert }
  err: boolean;
  Msg: Ptr;
  i: integer;

Begin
  OpenLib(GfxBase, 'graphics.library', 0);

  Win:= Open_Window(0, 0, 640, 200, 1, _CLOSEWINDOW,
        GIMMEZEROZERO+ACTIVATE+WINDOWCLOSE+WINDOWDRAG+WINDOWDEPTH,
        'Grafikdemo', Nil, 640, 200, 640, 200);
  Rp:= Win^.RPort;

  Move(Rp, 5, 40);
  SetAPen(Rp, 1);    { Ausgabe: weiß ... }
  SetBPen(Rp, 3);    { ...auf rot }
  SetDrMd(Rp, 1);    { damit Hintergrundfarbe auch ausgegeben wird }
  err:= Text(Rp, ' Dies ist eine Grafik-Demo. ######', 28);

  SetAPen(Rp, 3);    { rote Linien }
  For i:=0 to 20 Do
    Begin
      Move(Rp, 220+20*i, 5);
      Draw(Rp, 620, 5+9*i)
    End;

  For i:=1 to 10 do
    Begin
      SetAPen(Rp, 1 + i mod 3);    { wechselnde Farben }
      RectFill(Rp, 5*i, 75+2*i, 320-25*i, 180-8*i)
    End;

  Msg:= Wait_Port(Win^.UserPort);  { aufs Schließen warten }
  Msg:= Get_Msg(Win^.Userport);
  Reply_Msg(Msg);

  Close_Window(Win);
End.
