Code example for GL10

Methods: glEnable, glLightfv, glMaterialf, glMaterialfv

0
         * setupLights - Configures the OpenGL lights which will nicely 
         * illuminate the sphere. 
         *************************************************************/ 
        public void setupLights(GL10 gl) 
        { 
            gl.glLightfv(GL10.GL_LIGHT1, GL10.GL_AMBIENT, mLightAmbient, 0);
            gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_DIFFUSE, mLightDiffuse, 0);
            gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_POSITION, mLightPosition, 0);
            gl.glEnable(GL10.GL_LIGHT0);
            gl.glEnable(GL10.GL_LIGHT1);
            gl.glEnable(GL10.GL_LIGHTING);
             
            gl.glMaterialfv(GL10.GL_FRONT_AND_BACK, GL10.GL_AMBIENT, mMatAmbient);
            gl.glMaterialfv(GL10.GL_FRONT_AND_BACK, GL10.GL_DIFFUSE, mMatDiffuse);
            gl.glMaterialfv(GL10.GL_FRONT_AND_BACK, GL10.GL_SPECULAR, mMatSpecular);
            gl.glMaterialf(GL10.GL_FRONT_AND_BACK, GL10.GL_SHININESS, mMatLowShininess);
        } 
        /************************************************************* 
         * onDrawFrame - Draws, lights, and translates the whole scene. 
         *************************************************************/ 
        @Override