1 /************************************************************
3 * getwindow.c ......used in rubik.c
8 *************************************************************/
12 struct IntuitionBase
*IntuitionBase
= NULL
;
13 struct GfxBase
*GfxBase
= NULL
;
14 struct IntuiMessage
*MyIntuiMessage
= NULL
;
16 extern struct Screen
*scr1
, *scr2
;
17 extern struct Gadget divegadget
;
18 extern struct TextAttr ta
;
22 0, /* left edge - should be zero */
24 320, /* width - low resolution */
25 200, /* height - non-interlace */
26 3, /* depth - 8 colours will be available */
27 0,7, /* detail pen and block pen specifications */
29 CUSTOMSCREEN
, /* the screen type */
31 NULL
, /* no default title */
32 NULL
, /* no special screen gadgets */
33 NULL
, /* no special custom bitmap */
36 extern struct Window
*wnd1
, *wnd2
;
40 0,0,320,199, /* position and size */
44 MOUSEBUTTONS
, /* IDCMPFlags */
49 &divegadget
, /* gadgets */
50 NULL
, /* no special checkmark */
52 NULL
, /* screen pointer */
54 0,0, /* minimum sizes */
55 320,199, /* maximum sizes */
56 CUSTOMSCREEN
/* type of screen */
59 WORD areabuffer
[25]; /* room for up to a decagon */
75 CloseLibrary((struct Library
*) GfxBase
);
76 if (IntuitionBase
!= NULL
)
77 CloseLibrary((struct Library
*) IntuitionBase
);
82 FreeRaster(tmpras
.RasPtr
,320,199);
88 IntuitionBase
= (struct IntuitionBase
*)OpenLibrary("intuition.library",0);
89 if (IntuitionBase
== NULL
)
95 GfxBase
= (struct GfxBase
*)OpenLibrary("graphics.library",0);
102 scr1
= (struct Screen
*)OpenScreen(&ns
);
109 scr2
= (struct Screen
*)OpenScreen(&ns
);
116 SetRGB4(&(scr1
->ViewPort
),1,14,12,2); /* y */
117 SetRGB4(&(scr1
->ViewPort
),2,13,13,13); /* w */
118 SetRGB4(&(scr1
->ViewPort
),3,0,10,0); /* g */
119 SetRGB4(&(scr1
->ViewPort
),4,2,4,11); /* bu */
120 SetRGB4(&(scr1
->ViewPort
),5,15,5,0); /* o */
121 SetRGB4(&(scr1
->ViewPort
),6,11,3,1); /* bn */
122 SetRGB4(&(scr1
->ViewPort
),7,10,10,10); /* gy */
123 SetRGB4(&(scr1
->ViewPort
),0,0,0,0); /* bk */
125 SetRGB4(&(scr2
->ViewPort
),1,14,12,2); /* y */
126 SetRGB4(&(scr2
->ViewPort
),2,13,13,13); /* w */
127 SetRGB4(&(scr2
->ViewPort
),3,0,10,0); /* g */
128 SetRGB4(&(scr2
->ViewPort
),4,2,4,11); /* bu */
129 SetRGB4(&(scr2
->ViewPort
),5,15,5,0); /* o */
130 SetRGB4(&(scr2
->ViewPort
),6,11,3,1); /* bn */
131 SetRGB4(&(scr2
->ViewPort
),7,10,10,10); /* gy */
132 SetRGB4(&(scr2
->ViewPort
),0,0,0,0); /* bk */
134 nw
.Screen
= scr1
; /* fix the pointer into the struct */
136 wnd1
= (struct Window
*)OpenWindow(&nw
);
143 nw
.Screen
= scr2
; /* fix the pointer into the struct */
145 wnd2
= (struct Window
*)OpenWindow(&nw
);
152 InitArea(&ai
,&(areabuffer
[0]),10);
154 InitTmpRas(&tmpras
,AllocRaster(320,199),RASSIZE(320,199));
156 wnd1
->RPort
->AreaInfo
= &ai
;
158 wnd1
->RPort
->TmpRas
= &tmpras
;
159 wnd2
->RPort
->AreaInfo
= &ai
;
160 wnd2
->RPort
->TmpRas
= wnd1
->RPort
->TmpRas
;
162 SetAPen(wnd2
->RPort
,7);
163 SetDrMd(wnd2
->RPort
,JAM1
);
164 Move(wnd2
->RPort
,197,31);
165 Draw(wnd2
->RPort
,197,23);
166 Draw(wnd2
->RPort
,237,23);
167 Move(wnd2
->RPort
,276,31);
168 Draw(wnd2
->RPort
,276,23);
169 Draw(wnd2
->RPort
,308,23);
170 Move(wnd2
->RPort
,199,90);
171 Draw(wnd2
->RPort
,199,82);
172 Draw(wnd2
->RPort
,248,82);
173 Draw(wnd2
->RPort
,248,90);
174 Move(wnd2
->RPort
,260,90);
175 Draw(wnd2
->RPort
,260,82);
176 Draw(wnd2
->RPort
,309,82);
177 Draw(wnd2
->RPort
,309,90);
178 Move(wnd2
->RPort
,270,115);
179 Draw(wnd2
->RPort
,301,115);
180 Move(wnd2
->RPort
,265,147);
181 Draw(wnd2
->RPort
,265,139);
182 Draw(wnd2
->RPort
,305,139);
184 RectFill(wnd2
->RPort
,206,101,244,112);
185 Move(wnd2
->RPort
,253,137);
186 Draw(wnd2
->RPort
,253,149);
187 Draw(wnd2
->RPort
,197,149);
188 Draw(wnd2
->RPort
,197,137);
189 Draw(wnd2
->RPort
,253,137);
190 Draw(wnd2
->RPort
,253,125);
191 Draw(wnd2
->RPort
,197,125);
192 Draw(wnd2
->RPort
,197,137);
193 Draw(wnd2
->RPort
,197,113);
194 Draw(wnd2
->RPort
,253,113);
195 Draw(wnd2
->RPort
,253,125);
197 Move(wnd2
->RPort
,210,110);
198 SetAPen(wnd2
->RPort
,0);
199 Text(wnd2
->RPort
,"MODE",4);