Resources for SFML

I recently started using SFML and noticed that no "FreeResource" methods exist. For example, it sf::Fonthas a function called LoadFromFile, but there are no functions to free a resource.

I thought it was very strange. Am I missing something? My only way to create a pointer sf::Fontand dynamically select and delete it?

+3
source share
1 answer

sf::Fontstores its font data in std::mapcalled myGlyphs (see source ). When the font destructor is called, everything on this card will be automatically freed (by the destructor std::map).

+6
source

Source: https://habr.com/ru/post/1733111/


All Articles