When I call the function write from the GameEngine_Font struct I will always create a texture from the text that is set. This always happens even if there have been no changes in the text.
So I propose to change this by storing (in memory only) the generated texture and when the write method gets called it will check if the text is different from the one given for the texture.
This could possibly be implemented as a hash map and could even be a static variable so it could be reused by other fonts (if they have the same font and size of course)
When I call the function write from the GameEngine_Font struct I will always create a texture from the text that is set. This always happens even if there have been no changes in the text.
So I propose to change this by storing (in memory only) the generated texture and when the write method gets called it will check if the text is different from the one given for the texture.
This could possibly be implemented as a hash map and could even be a static variable so it could be reused by other fonts (if they have the same font and size of course)