开发者

SFML Releasing Resources

开发者 https://www.devze.com 2022-12-20 04:28 出处:网络
I\'ve recently started using SFML and noti开发者_Go百科ced that there aren\'t any kinds of \"FreeResource\" methods provided. For example, sf::Font has a function called LoadFromFile, but no functions

I've recently started using SFML and noti开发者_Go百科ced that there aren't any kinds of "FreeResource" methods provided. For example, sf::Font has a function called LoadFromFile, but no functions to release the resource.

I thought this was very odd. Am I missing something? Is my only option to create an sf::Font pointer and dynamically allocate and delete it?


sf::Font stores its font data in a std::map called myGlyphs (see the source). When Font's destructor is called, everything in that map will be freed automatically (by the std::map destructor).

0

精彩评论

暂无评论...
验证码 换一张
取 消