Hey guys! I have some troubles with clearing render textures (or may be RenderWindow). And made some investigations. Here's the code:
#include "include/SFML/Graphics.hpp"
int main() {
sf::RenderWindow app(sf::VideoMode(400,400), "test");
sf::RectangleShape a(sf::Vector2f(10,10)), b(sf::Vector2f(1,1));
sf::RenderTexture tex;
sf::Sprite spr;
tex.create(400,400);
tex.setActive();
tex.clear(sf::Color(0,0,0,0));
int pos = 10;
spr.setTexture(tex.getTexture());
while (app.isOpen()) {
sf::Event event;
while (app.pollEvent(event)) {
if (event.type == sf::Event::Closed)
app.close();
}
pos += 1;
a.setPosition(sf::Vector2f(pos, 10));
app.clear();
// Uncomment this to fix
//app.draw(b);
tex.draw(a);
tex.display();
app.draw(spr);
tex.clear();
app.display();
}
}
If there's no draw calls on RenderWindow except the one with drawing RenderTexture it leads to some artifacts.
I attached the image from my game and from the example. As you can see - there's kinda trail, but it is not the same as without "clear" call.
And there were no such issues before High Sierra update.
I tried this patch on sfml 2.4.1 - it doesn't help, everything is the same.
I tried to compile branch bugfix/osx_render_target, but got this on compiling my project (i had no such issue with 2.4.1, that's why tested this patch on this version)
Undefined symbols for architecture x86_64:
"sf::String::String(char const*, std::__1::locale const&)", referenced from:
Used simple "cmake . && make" to compile.