refactor Brush to be used in shared_ptr

This commit is contained in:
2019-01-22 22:49:43 +01:00
parent 9e76cf3194
commit e26fcf1163
22 changed files with 254 additions and 197 deletions

View File

@@ -2,6 +2,7 @@
#include "log.h"
#include "texture.h"
#include "util.h"
#include "app.h"
std::map<uint16_t, Texture2D> TextureManager::m_textures;
@@ -107,6 +108,17 @@ glm::vec2 Texture2D::size() const
return { m_width, m_height };
}
Texture2D::~Texture2D()
{
if (auto_destroy)
{
LOG("Texture2D auto destroy");
App::I.async_start();
destroy();
App::I.async_end();
}
}
bool Sampler::create(GLint filter /*= GL_LINEAR*/, GLint wrap /*= GL_CLAMP_TO_EDGE*/)
{
#if USE_SAMPLER