#version 330 core

uniform mat4 u_MVP;
uniform sampler2D u_tex0;

layout (location = 0) in vec2 in_pos;
layout (location = 3) in vec4 in_color;
layout (location = 8) in vec2 in_texCoords;

out vec2 vTexCoords;
out vec4 vColor;

void main() {

	gl_Position = u_MVP * vec4(in_pos, 0.0f, 1.0f);

	// Texture coordinates are in pixels.
	// Need to convert into UV space before passing to fragment shader.
	vTexCoords = in_texCoords / textureSize(u_tex0, 0);
	vColor = in_color;
}
