0

I am making a game in C++ using SDL2, and in order to make debugging faster/easier i want to display some information (character speed/position) directly on the screen. I learned about SDL2_ttf, i see how i can to that, i need to render the text onto a surface, create a texture from this surface, and RenderCopy the texture on my renderer, and i was wondering (especially since i'll do that every frame) : is it really the most efficient way ? Isn't there a way to just render the text directly to the renderer ?

Since it's just debug text i could very well implement it myself with a big texture containing all the characters i need, but before i do that i wanted to know if there really isn't a way to do it with SDL2_ttf that doesn't require creating and destroying a surface and a texture every frame

TwilCynder
  • 33
  • 6
  • If it's just debug, why not print to console? – Ranoiaetep Nov 14 '21 at 08:51
  • I have other (more situational) things to print to the console, and being able to keep an eye constantly on these informations (the ones i want to view directly on-screen) would be really more practical that having them printed every frame to the console – TwilCynder Nov 14 '21 at 12:20

0 Answers0