Add Font::ready()

Now we can check if a Font Object is Ready. ( Font Library Loaded )
This commit is contained in:
Kirigaya Kazuto 2017-03-24 10:46:33 +08:00
parent dcd2d333b8
commit c7c59975ca
2 changed files with 6 additions and 0 deletions

View File

@ -566,6 +566,11 @@ namespace MiniEngine
font.reset(temp, TTF_CloseFont);
return 0;
}
bool Font::isReady()
{
return (font.get() != nullptr);
}
Texture Font::renderText(Renderer rnd, std::string Text, RGBA fg)
{

View File

@ -219,6 +219,7 @@ namespace MiniEngine
Font() = default;
Font(std::string FontFileName, int size) throw(ErrorViewer);
int use(std::string FontFileName, int size);
bool isReady();
Texture renderText(Renderer rnd, std::string Text, RGBA fg);
Texture renderTextWrapped(Renderer rnd, std::string Text, RGBA fg, int WrapLength);
Texture renderTextShaded(Renderer rnd, std::string Text, RGBA fg, RGBA bg);