(*
	This module initializes the window and screen for
	the trails program.

	Created: 5/24/86 by Richie Bielak

	Adapted: 9/8/87 - jr
        Note: compiled with AMIGA Modula-2 System by AMSoft
                            ---------------------

	Copyright (c) 1986 by Richard Bielak

	This program maybe freely copied. But please
	leave my name in. Thanks.....Richie

*)
IMPLEMENTATION MODULE TrailsScreen;
(*$ LargeVars:=FALSE StackParms:=FALSE Volatile:=FALSE *)

FROM SYSTEM	IMPORT	ADR,CAST,ASSEMBLE;
FROM IntuitionD	IMPORT	customScreen, stdScreenHeight, IDCMPFlags,
			IDCMPFlagSet, NewWindow, NewWindowPtr,
			NewScreen, NewScreenPtr, ScreenPtr,
			WindowFlags, WindowFlagSet, WindowPtr;
FROM IntuitionL	IMPORT	OpenWindow, OpenScreen;
FROM GraphicsD	IMPORT	ViewModes, ViewModeSet;


VAR
  newScr:=NewScreen{ (* dies würde auch als Konstante gehen *)
	leftEdge: 0, topEdge: 0,
	width: 640, height: stdScreenHeight,
	depth: 2,
	detailPen: 0, blockPen: 1,
	viewModes: ViewModeSet{hires},
	type: customScreen,
	font: NIL,
	defaultTitle: ADR("Trails!"),
  };

  newWin:=NewWindow{ (* dies muß eine Variable sein wg. des Screen *)
	leftEdge: 0, topEdge: 0,
	width: 640,
	detailPen: 0, blockPen: 1,
	idcmpFlags: IDCMPFlagSet{closeWindow, menuPick,
			 reqClear,gadgetUp,gadgetDown,mouseButtons,mouseMove},
	flags: WindowFlagSet{activate, borderless, backDrop},
	(* screen und height werden noch eingetragen *)
	type: customScreen
  };

PROCEDURE SetUpScreen(VAR wp: WindowPtr; VAR sp: ScreenPtr);
BEGIN
  sp:=OpenScreen(newScr);
  IF sp#NIL THEN
    newWin.screen:=sp;
    newWin.height:=sp^.height;
    wp:=OpenWindow(newWin);
  ELSE
    wp:=NIL
  END;
END SetUpScreen;

END TrailsScreen.mod
