1
Graphics / Re: sf::RenderTexture.clear() HUGE fps drop
« on: June 02, 2017, 04:05:50 pm »
Yea... But...
With this code:
On windows10 i have 20fps but on linux i have 400fps.
Just test it yourself.
And at windows first calling clear() with RenderTexture (next calling .clear() much less but still noticeable) always take around ~50% fps.
With this code:
int main()
{
sf::RenderWindow window(sf::VideoMode(1280, 720), "SFML works!");
const int size = 50;
sf::RenderTexture render[size];
for (int i = 0; i < size; i++)
render[i].create(i + 1, i + 1);
sf::Clock framerateClock;
while (window.isOpen())
{
std::cout << getFramerate(framerateClock) << "fps\n";
window.clear();
for (int i = 0; i < size; i++)
render[i].clear();
window.display();
}
return 0;
}
{
sf::RenderWindow window(sf::VideoMode(1280, 720), "SFML works!");
const int size = 50;
sf::RenderTexture render[size];
for (int i = 0; i < size; i++)
render[i].create(i + 1, i + 1);
sf::Clock framerateClock;
while (window.isOpen())
{
std::cout << getFramerate(framerateClock) << "fps\n";
window.clear();
for (int i = 0; i < size; i++)
render[i].clear();
window.display();
}
return 0;
}
On windows10 i have 20fps but on linux i have 400fps.
Just test it yourself.
And at windows first calling clear() with RenderTexture (next calling .clear() much less but still noticeable) always take around ~50% fps.