I am making a program using SFML on an old laptop, and its task is to print all Unicode characters, just like in this video:
However, after running for a while, the program will show the error:
"Failed to add a new character to the font: the maximum texture size has been reached."
I noticed that Text::setString() caches the textures of the characters rendered in the text into memory to speed up the next use of those textures, but my program clearly does not need this feature.
My current solution is:
Text::setString(character);
if (character % 500 == 0) {
mainFont.loadFromFile(currentFont);
}
This is clumsy and wastes performance and memory.
Is there a solution?
One idea I had was to use FreeType to render the characters directly, but I feel like this would waste SFML's potential.