(*
 * -------------------------------------------------------------------------
 *
 *	:Program.	TestAmigaGraphik
 *	:Contents.	Zum Testen des Clippings von Draw und DrawLine.
 *	:Author.	Reiner Nix
 *	:Address.	Geranienhof 2, 5000 Köln 71 Seeberg
 *	:Copyright.	Public Domain
 *	:Language.	Modula-2
 *	:Translator.	M2Amiga A-L V3.3d
 *	:History.	V1.0	21.11.90
 *	:Imports.	Amigagraphik		siehe diese Diskette
 *
 * -------------------------------------------------------------------------
 *)
MODULE TestAmigaGraphik;

FROM SYSTEM		IMPORT	ADR;
FROM Arts		IMPORT	Assert, TermProcedure;
FROM Intuition		IMPORT	WindowPtr;
FROM AmigaGraphik	IMPORT	OpenSimpleWindow, CloseWindow, UseWindow,
				SetAPen, SetClipRegion,
				FillRectangle, Move, Draw, DrawLine;
FROM InOut		IMPORT	Read;


VAR	c	:CHAR;
	i, j	:CARDINAL;
	Fenster :WindowPtr;
	fx, fy	:ARRAY [1..19] OF CARDINAL;


PROCEDURE EndOfModule;

BEGIN
CloseWindow (Fenster)
END EndOfModule;


BEGIN
TermProcedure (EndOfModule);
Fenster := OpenSimpleWindow ();
Assert (Fenster # NIL, ADR ("kein Fenster zu öffnen"));

fx[ 1] := 70;	fy[ 1] := 20;
fx[ 2] :=120;	fy[ 2] := 30;
fx[ 3] :=330;	fy[ 3] := 25;
fx[ 4] :=420;	fy[ 4] := 15;
fx[ 5] :=440;	fy[ 5] := 40;
fx[ 6] :=470;	fy[ 6] := 90;
fx[ 7] :=430;	fy[ 7] :=160;
fx[ 8] :=450;	fy[ 8] :=210;
fx[ 9] :=430;	fy[ 9] :=230;
fx[10] :=250;	fy[10] :=225;
fx[11] := 80;	fy[11] :=230;
fx[12] := 30;	fy[12] :=210;
fx[13] := 60;	fy[13] :=170;
fx[14] := 70;	fy[14] := 90;
fx[15] := 60;	fy[15] := 40;
fx[16] :=240;	fy[16] := 80;
fx[17] :=320;	fy[17] :=110;
fx[18] :=250;	fy[18] :=150;
fx[19] :=180;	fy[19] := 75;

UseWindow (Fenster);
SetClipRegion (100, 50, 400, 200);

FOR i := 1 TO 19 DO
  SetAPen (1); FillRectangle (100, 50, 400, 200);
  SetAPen (2);
  FOR j := 1 TO 19 DO
    Move (fx[i],fy[i]); Draw (fx[j],fy[j])
    END;
  Read (c)
  END;

FOR i := 1 TO 19 DO
  SetAPen (1); FillRectangle (100, 50, 400, 200);
  SetAPen (3);
  FOR j := 1 TO 19 DO
    DrawLine (fx[i],fy[i], fx[j],fy[j])
    END;
  Read (c)
  END

END TestAmigaGraphik.
