Esempio n. 1
0
        // --- Application Methods ---
        #region Init()
        /// <summary>
        ///     <para>
        ///         Initialize antialiasing for color index mode, including loading a green color
        ///         ramp starting at RAMP1START, and a blue color ramp starting at RAMP2START.
        ///         The ramps must be a multiple of 16.
        ///     </para>
        /// </summary>
        private static void Init()
        {
            float shade;

            for (int i = 0; i < RAMPSIZE; i++)
            {
                shade = (float)i / (float)RAMPSIZE;
                Glut.glutSetColor(RAMP1START + i, 0.0f, shade, 0.0f);
                Glut.glutSetColor(RAMP2START + i, 0.0f, 0.0f, shade);
            }

            Gl.glEnable(Gl.GL_LINE_SMOOTH);
            Gl.glHint(Gl.GL_LINE_SMOOTH_HINT, Gl.GL_DONT_CARE);
            Gl.glLineWidth(1.5f);

            Gl.glClearIndex((float)RAMP1START);
        }
Esempio n. 2
0
        // --- Application Methods ---
        #region Init()
        private static void Init()
        {
            Gl.glEnable(Gl.GL_DEPTH_TEST);

            for (int i = 0; i < NUMCOLORS; i++)
            {
                float shade;
                shade = (float)(NUMCOLORS - i) / (float)NUMCOLORS;
                Glut.glutSetColor(RAMPSTART + i, shade, shade, shade);
            }
            Gl.glEnable(Gl.GL_FOG);

            Gl.glFogi(Gl.GL_FOG_MODE, Gl.GL_LINEAR);
            Gl.glFogi(Gl.GL_FOG_INDEX, NUMCOLORS);
            Gl.glFogf(Gl.GL_FOG_START, 1.0f);
            Gl.glFogf(Gl.GL_FOG_END, 6.0f);
            Gl.glHint(Gl.GL_FOG_HINT, Gl.GL_NICEST);
            Gl.glClearIndex((float)(NUMCOLORS + RAMPSTART - 1));
        }