Hi,
I’m still very new to SDL and I’m just learning as I go along. I have some basics set up in my game but I came to a point where I want to include font rendering (initially for debug output to the screen).
Looking at various tutorials and the SDL_ttf library I require clarification on something. The SDL_ttf will give you an SDL_Surface which you can then create a texture from to allow for hardware rendering. The whole process though requires a font file loading. My main query is - Is it safe to leave the font file open until the font is no longer needed (could be exiting the app).
I saw a tutorial which closed the font file immediately after creating the SDL_Texture. My thoughts were if this was used for frequently updated text e.g. a frame rate counter, this would be highly inefficient and it would be better to hold the font file open (assuming there is no negative impact). An the follow up from this would be if the font file is held open, would it be locked so no other font could use it?
Zam