Having this simple program, when i use the
shader the setColor() function does not take effect. Without using the
shader the setColor() works just fine. I want to apply the color and the shader only after everything is drawn
Why does this happen and how can i fix it.
sf::RenderWindow window;
sf::RenderTexture screen_tex;
sf::Sprite screen_sprite;
sf::Shader shader;
shader.loadFromFile("shader.vert", "shader.frag");
window.create(sf::VideoMode(800, 600), "very-nice-window", 3);
window.setFramerateLimit(60);
window.setKeyRepeatEnabled(false);
screen_tex.create(800, 600);
screen_sprite = sf::Sprite(screen_tex.getTexture());
screen_tex.clear();
drowSomeStuff(screen_tex);
screen_tex.display();
screen_sprite.setColor({100,0,0});
window.clear();
window.draw(screen_sprite, shader);
window.display();