So I've just managed to get Texturing via GLSL shaders to work and i can pass a sampler2d textureHandler + my uv coordinates into my shader to specify the texture to be displayed on my Tiles.
Now im Wondering how I could define which tile should get which Texture cause right now I can only put 1 single texture on ALL tiles I have...
My vertex shader:
in vec3 position;
in vec2 vertexUV;
uniform mat4 orthoMatrix;
out vec2 UV;
void main()
{
gl_Position = orthoMatrix * vec4(position, 1.0);
UV = vertexUV;
}
my fragment shader:
in vec2 UV;
out vec4 outColor;
uniform sampler2D myTextureSampler1;
void main()
{
outColor = texture2D(myTextureSampler1, UV);
}
My Texture Loading right now looks like this: http://puu.sh/62MhS.png