package com.view.coverflow;

import java.nio.FloatBuffer;
import java.nio.IntBuffer;

import javax.microedition.khronos.opengles.GL10;

import android.content.Context;
import android.graphics.Bitmap;

public class Test extends GLBase{
	float lightDiffuse[] = new float[] { 1f, 1f, 1f, 1.0f };
	int tex;
	Bitmap bmp;

	float box[] = new float[] { -1.0f, -1.0f, 0.0f, 1.0f, -1.0f, 0.0f, -1.0f,
			0.5f, 0.0f, 1.0f, 0.5f, 0.0f,

	};

	float texCoords[] = new float[] { 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f,
			1.0f,

	};
	int intCoords[] = new int[] { 0, 0, 1, 0, 0, 1, 1, 1,

	};
	FloatBuffer cubeBuff;
	FloatBuffer texBuff;
	IntBuffer inBuff;
	public Test(Context c) {
		super(c,20);
		
	}
	@Override
	protected void init(GL10 gl) {
		step(gl);
		
		
	}
	@Override
	protected void drawFrame(GL10 gl) {
		
	}
	public void step(GL10 gl) {
		float afLightDiffuse[] = new float[] { 0.76f, 0.75f, 0.65f, 1.0f };

		// set some GL-states
		
		gl.glEnable(GL10.GL_TEXTURE_2D);

		// gl.glEnable(GL10.GL_TEXTURE_RECTANGLE_ARB);
		gl.glEnable(GL10.GL_BLEND);
		gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
		gl.glLightModelx(GL10.GL_LIGHT_MODEL_TWO_SIDE, 1);
		
		gl.glEnable(GL10.GL_DEPTH_TEST);
		gl.glDepthFunc(GL10.GL_LEQUAL);
		
		//gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
		gl.glClearColor(1.0f, 0.5f, 0.25f, 1.0f);
		gl.glColor4f(0.25f, 0.5f, 1.0f, 1.0f);
		gl.glClearDepthf(1.0f);
		
		gl.glVertexPointer(3, GL10.GL_FLOAT, 0, cubeBuff);
		gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
		gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, texBuff);
		//gl.glMultiTexCoord4x(GL10.GL_TEXTURE_2D, 0, 0, 3, 1);
		gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);
		
		
		gl.glEnable(GL10.GL_CULL_FACE);
		gl.glShadeModel(GL10.GL_SMOOTH);
	
		gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_DIFFUSE, lightDiffuse, 0);

		// setup "camera" */
		gl.glMatrixMode(GL10.GL_MODELVIEW);
		gl.glLoadIdentity();
		
		//GLU.gluLookAt(gl, 0, 0, Z_NEAR, 0, 0, 0, 0, 1, 0);

		//gl.glTranslatef(0.0f, 0.0f, -Z_NEAR);

	}
}
