When RenderTexture is created inside member function with big size(5000, 1000) and antialiasing is set it deos not get destoryed correctly, i checked ram usage using Windows Task Manager.
SFML version: 2.5.1
Microsoft Visual Studio Community 2019 - Version 16.7.3
Debug x64
Includes:
#include "SFML/Graphics.hpp"
#include "Windows.h"
Here is test class with 2 tests:
test1 - antialiasing is turned on(4)
test2 - antialiasing is turned off(0)
class TestRenderTexture {
public:
void test1() {
sf::RenderTexture tex;
tex.create(5000, 1000, sf::ContextSettings(0, 0, 4, 1, 1, 0, false));
tex.clear(sf::Color::Transparent);
tex.display();
}
void test2() {
sf::RenderTexture tex;
tex.create(5000, 1000, sf::ContextSettings(0, 0, 0, 1, 1, 0, false));
tex.clear(sf::Color::Transparent);
tex.display();
}
};
My main:
int main() {
TestRenderTexture test;
test.test1(); // run test1 or test2 here
sf::RenderWindow window(sf::VideoMode(1200, 675), "Test");
//loop keeps program open
while (window.isOpen()) {
Sleep(400);
sf::Event ev;
while (window.pollEvent(ev)) {
if (ev.type == sf::Event::Closed) {
window.close();
}
}
}
}
Ram usage results after 30sec:
test1 - 65 Mb
test2 - 28 Mb