uniform sampler2D tex;

varying vec4 uv;
varying float state;
varying vec4 color;

void main(void)
{
	if(gl_Vertex.z < 1.0)
	{
		color = vec4(0.0, 0.0, 0.6, 0.75);
		uv = vec4(0.0, 0.0, 0.0, 0.0);
	}
	else {
		color = vec4(0.6, 0.0, 0.0, 0.75);	
		vec4 loc = vec4(gl_Vertex.x/320.0, gl_Vertex.y/320.0, 0.0, 0.0);
		uv = gl_TextureMatrix[0] * loc;
		uv[0] += 0.5;
		uv[1] += 0.5;
		state = 1.0;
	}
	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}
