Code example for GL10

Methods: glEnable, glLightfv, glMaterialfv

0
	float MatDif[] = {0, 1, 0, 1};				// Material - Diffuse Values
	float MatSpc[] = {1, 0, 1, 1};				// Material - Specular Values
	 
	void initLight(GL10 gl){		
 
		gl.glEnable(GL10.GL_LIGHT1);									// Enable Light1
		gl.glEnable(GL10.GL_LIGHTING);									// Enable Lighting
 
		gl.glLightfv(GL10.GL_LIGHT1, GL10.GL_POSITION, LightPos,0);		// Set Light1 Position
		gl.glLightfv(GL10.GL_LIGHT1, GL10.GL_AMBIENT, LightAmb,0);		// Set Light1 Ambience
		gl.glLightfv(GL10.GL_LIGHT1, GL10.GL_DIFFUSE, LightDif,0);		// Set Light1 Diffuse
		gl.glLightfv(GL10.GL_LIGHT1, GL10.GL_SPECULAR, LightSpc,0);		// Set Light1 Specular
 
		gl.glMaterialfv(GL10.GL_FRONT, GL10.GL_AMBIENT, MatAmb,0);		// Set Material Ambience
		gl.glMaterialfv(GL10.GL_FRONT, GL10.GL_DIFFUSE, MatDif,0);		// Set Material Diffuse
		gl.glMaterialfv(GL10.GL_FRONT, GL10.GL_SPECULAR, MatSpc,0);		// Set Material Specular
		 
	} 
	 
	public void onSurfaceChanged(GL10 gl, int w, int h) {
		gl.glViewport(0, 0, w, h);