home *** CD-ROM | disk | FTP | other *** search
-
- /*------------------------------------------------*/
- /* File: qman_graphics.include */
- /* */
- /* Sets up custom screen and window for */
- /* qman routine. The screen will always */
- /* be hi-res with 16 colors, but may or */
- /* may not be interlaced. */
- /*------------------------------------------------*/
-
- void SetUpMandelGraphics()
- {
- topaz_eight.ta_Name = "topaz.font";
- topaz_eight.ta_YSize = 8;
- topaz_eight.ta_Style = 0;
- topaz_eight.ta_Flags = 0;
-
- /* Define properties new screen is to have: */
- ns.LeftEdge = 0;
- ns.TopEdge = 0;
- ns.Width = 640;
- ns.Height = vertical_res;
- ns.Depth = 4;
- ns.DetailPen = 1;
- ns.BlockPen = 2;
-
- ns.ViewModes = HIRES;
- if ( ilace == 1 ) ns.ViewModes = HIRES + LACE;
-
- ns.Type = CUSTOMSCREEN;
- ns.Font = &topaz_eight;
- ns.DefaultTitle = " \0";
- ns.Gadgets = NULL;
- ns.CustomBitMap = NULL;
-
- mandel_screen = (struct Screen *)OpenScreen( &ns );
- if ( mandel_screen == NULL ) exit();
-
- /* Describe new window: */
- nw.LeftEdge = 0;
- nw.TopEdge = 0;
- nw.Width = 640;
- nw.Height = vertical_res;
- nw.DetailPen = -1;
- nw.BlockPen = -1;
- nw.IDCMPFlags = MOUSEBUTTONS | MENUPICK;
- nw.Type = CUSTOMSCREEN;
- nw.Flags = ACTIVATE | NOCAREREFRESH | BORDERLESS | REPORTMOUSE;
- nw.FirstGadget = NULL;
- nw.CheckMark = NULL;
- nw.Screen = mandel_screen;
- nw.Title = NULL;
- nw.BitMap = NULL;
- nw.MinWidth = 0;
- nw.MinHeight = 0;
- nw.MaxWidth = 0;
- nw.MaxHeight = 0;
-
- mandel_window = (struct Window *)OpenWindow( &nw );
- if (mandel_window == NULL) exit();
-
- WindowToFront(mandel_window);
-
- rp = mandel_window -> RPort;
- vp = &mandel_screen -> ViewPort;
-
- /* Set the six colors reserved for menu use: */
- SetRGB4( vp, 0, 0, 0, 0 );
- SetRGB4( vp, 1, 15, 9, 0 );
- SetRGB4( vp, 2, 0, 8, 0 );
- SetRGB4( vp, 13, 10, 10, 10 );
- SetRGB4( vp, 14, 0, 0, 0 );
- SetRGB4( vp, 15, 10, 0, 2 );
-
-
- /* Now set the colors we use for the actual fractals: */
- if ( screen_changed ) /* preserve existing colors */
- for ( i = 3; i < 13; i++) SetRGB4(vp,i, reds[i], greens[i], blues[i] );
-
- else { /* Set up initial color values */
-
- SetRGB4( vp, 3, 4, 0, 2 );
- SetRGB4( vp, 4, 5, 0, 2 );
- SetRGB4( vp, 5, 6, 0, 3 );
- SetRGB4( vp, 6, 7, 0, 3 );
- SetRGB4( vp, 7, 8, 0, 3 );
- SetRGB4( vp, 8, 9, 0, 3 );
- SetRGB4( vp, 9, 10, 0, 3 );
- SetRGB4( vp, 10, 11, 0, 4 );
- SetRGB4( vp, 11, 12, 0, 4 );
- SetRGB4( vp, 12, 13, 0, 4 ); }
-
- }
-