Update Font

This commit is contained in:
Kirigaya Kazuto 2017-07-31 00:23:33 +08:00
parent 2f027b7925
commit cced27fc53
2 changed files with 9 additions and 6 deletions

View File

@ -10,12 +10,12 @@ void Font::_set(TTF_Font* p)
// private // private
void Font::_clear() void Font::_clear()
{ {
_font.reset(); _font.release();
} }
// private // private
TTF_Font* Font::_get() const TTF_Font* Font::_get() const
{ {
return _font.get(); return const_cast<TTF_Font*>(_font.get());
} }
Font::Font(const std::string& FontFileName, size_t size) Font::Font(const std::string& FontFileName, size_t size)

View File

@ -8,9 +8,11 @@
#include "Renderer.h" #include "Renderer.h"
#include <vector> #include <vector>
#include "__Plugin.h" #include "__Plugin.h"
#include "__Noncopyable.h"
#include "_handler.h"
namespace MiniEngine namespace MiniEngine
{ {
class Font class Font : public NonCopyable
{ {
public: public:
Font() = default; Font() = default;
@ -116,7 +118,8 @@ private:
void _real_setFontStyle(int); void _real_setFontStyle(int);
int _style_caster(FontStyle); int _style_caster(FontStyle);
std::shared_ptr<TTF_Font> _font; res_ptr<TTF_Font> _font;
void _set(TTF_Font*); void _set(TTF_Font*);
void _clear(); void _clear();
TTF_Font* _get() const; TTF_Font* _get() const;