// by guest(r) - guest.r@gmail.com
// license: GNU-GPL

uniform vec4 OGL2Param;
uniform vec4 OGL2Size;

void main()
{
	float x = (OGL2Size.x / 2048.0) * OGL2Param.x;
	float y = (OGL2Size.y / 1024.0) * OGL2Param.y;

    gl_ClipVertex = gl_ModelViewMatrix * gl_Vertex;
	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
	gl_TexCoord[0] = gl_MultiTexCoord0;
	gl_TexCoord[1] = gl_TexCoord[0];
	gl_TexCoord[2] = gl_TexCoord[0];
	gl_TexCoord[4] = gl_TexCoord[0];
	gl_TexCoord[5] = gl_TexCoord[0];
	gl_TexCoord[1].y -= y;
	gl_TexCoord[2].y += y;
	gl_TexCoord[4].x -= x;
	gl_TexCoord[5].x += x;
}
