switchbrew / switch-examples

Switch examples for devkitA64 and libnx.
https://devkitpro.org/viewforum.php?f=42
559 stars 99 forks source link

Fixed SDL2 demo to not render text on every frame. #81

Closed NicholeMattera closed 4 years ago

NicholeMattera commented 4 years ago

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.