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

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

View File

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