refactor font loading

This commit is contained in:
2019-12-01 18:24:59 +01:00
parent 0905827b8d
commit c8bce21b95
30 changed files with 180 additions and 84 deletions

View File

@@ -142,6 +142,30 @@ Image Texture2D::get_image() const noexcept
return ret;
}
Texture2D::Texture2D(Texture2D&& other) noexcept
{
m_tex = other.m_tex;
m_width = other.m_width;
m_height = other.m_height;
m_format = other.m_format;
m_iformat = other.m_iformat;
auto_destroy = other.auto_destroy;
has_mips = other.has_mips;
other.m_tex = false;
}
void Texture2D::operator=(Texture2D&& other) noexcept
{
m_tex = other.m_tex;
m_width = other.m_width;
m_height = other.m_height;
m_format = other.m_format;
m_iformat = other.m_iformat;
auto_destroy = other.auto_destroy;
has_mips = other.has_mips;
other.m_tex = false;
}
bool Texture2D::create(int width, int height, GLint internal_format, GLint format, const uint8_t* data)
{
App::I->render_task([=]
@@ -247,7 +271,7 @@ glm::vec2 Texture2D::size() const
Texture2D::~Texture2D()
{
if (auto_destroy)
//if (auto_destroy)
{
LOG("Texture2D auto destroy");
destroy();