//
//  Shader.vsh
//  NeoGeo
//
//  Created by dotemu on 30/01/12.
//  Copyright 2012 __MyCompanyName__. All rights reserved.
//

#if GL_ES
precision highp float;
#endif

uniform vec2 textureSize;
uniform vec2 sourceSize;
uniform vec2 screenSize;

attribute vec4 position;
attribute vec4 texcoord;

varying vec4 texCoordVarying;
varying vec2 screenPos;

vec2 updatedPos;

void main()
{
    updatedPos = vec2((position.x * 2.0) / screenSize.x - 1.0, ((position.y * 2.0) / screenSize.y - 1.0));
    gl_Position = vec4(updatedPos, 0.0, 1.0);
    texCoordVarying = texcoord;
    screenPos = (((updatedPos.xy + vec2(1.0, 1.0)) * 0.5) * screenSize) + vec2(0.25, 0.25);
}
