Big refactor, shuffling a lot of files around
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
#include "font.h"
|
||||
|
||||
namespace anm2ed::resource
|
||||
{
|
||||
Font::Font() = default;
|
||||
|
||||
Font::Font(void* data, size_t length, int size)
|
||||
{
|
||||
ImFontConfig config;
|
||||
config.FontDataOwnedByAtlas = false;
|
||||
pointer = ImGui::GetIO().Fonts->AddFontFromMemoryTTF(data, length, size, &config);
|
||||
}
|
||||
|
||||
Font::~Font()
|
||||
{
|
||||
if (get()) ImGui::GetIO().Fonts->RemoveFont(pointer);
|
||||
}
|
||||
|
||||
ImFont* Font::get()
|
||||
{
|
||||
return pointer;
|
||||
}
|
||||
|
||||
Font& Font::operator=(Font&& other) noexcept
|
||||
{
|
||||
if (this != &other)
|
||||
{
|
||||
pointer = other.pointer;
|
||||
other.pointer = nullptr;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user