diff options
Diffstat (limited to 'src/graphics/Font.cpp')
-rw-r--r-- | src/graphics/Font.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/graphics/Font.cpp b/src/graphics/Font.cpp new file mode 100644 index 0000000..7d157ed --- /dev/null +++ b/src/graphics/Font.cpp @@ -0,0 +1,21 @@ +#include "../../include/mglpp/graphics/Font.hpp" +#include <string.h> +namespace mgl { + Font::Font() { + memset(&font, 0, sizeof(font)); + } + + Font::~Font() { + mgl_font_unload(&font); + } + + bool Font::load_from_file(const char *filepath, unsigned int font_size) { + if(font.texture.id) + return false; + return mgl_font_load_from_file(&font, filepath, font_size) == 0; + } + + mgl_font* Font::internal_font() { + return &font; + } +}
\ No newline at end of file |