The SDL2 demo was recently changed to show how to use SDL2_ttf. However it was rendering static text on every frame, which is inefficient and probably not a good thing to teach as an example. This PR just fixes it to render the text once to a texture and then render just the texture every frame. I also added examples to unload the font, and textures when you are done with them.
The SDL2 demo was recently changed to show how to use SDL2_ttf. However it was rendering static text on every frame, which is inefficient and probably not a good thing to teach as an example. This PR just fixes it to render the text once to a texture and then render just the texture every frame. I also added examples to unload the font, and textures when you are done with them.