I have managed to grasp a bit shaders and textures.
if I want to draw Vertex array and use a texture on its triangles I write
Texture my_texture;
// load my texture here
RenderState rs;
rs.texture = &my_texture;
VertexArray my_vertexArray;
// initialize my vertex value here
...
my_window.draw(my_vertexArray, rs);
It draws the triangles with the texture as intended.
if I want to draw Vertex array and use a shader effect on its triangles I write
Shader my_shader;
// load and compile my shader here
RenderState rs;
rs.shader = my_shader;
VertexArray my_vertexArray;
// initialize my vertex value here
...
my_window.draw(my_vertexArray, rs);
it also works as intended.
But when I combine the two and make the shader effect work on the texturized triangles -
...
RenderState rs;
rs.shader = my_shader;
rs.texture = &my_texture;
...
The program acts as I only used the shader and it doesnt seem to texture the triangles.
What am I doing wrong?
I tried-
1) to go throw the tutorial in learnOpenGl about shaders. it seems as they bind textures there differently then in SFML and I dont quite get it.
2) tweak the shader code, send texture to the shader (using Sampler2D), it didnt seem to work.
3) read the documentation about shaders and GLSL