save and restore layers image when context is lost in Android

This commit is contained in:
2017-04-29 21:30:40 +01:00
parent 2e47ccb0c6
commit fa49d9ee09
17 changed files with 210 additions and 69 deletions

View File

@@ -13,7 +13,7 @@ public:
bool create(const ui::Image& img);
void assign(GLuint tex, int w = -1, int h = -1, GLuint internal_format = GL_RGBA8, GLuint format = GL_RGBA);
bool load(std::string filename);
void destroy() { glDeleteTextures(1, &m_tex); }
void destroy() { LOG("TEX destroy %d", m_tex); glDeleteTextures(1, &m_tex); }
void bind() const { glBindTexture(GL_TEXTURE_2D, m_tex); }
void unbind() const { glBindTexture(GL_TEXTURE_2D, 0); }
void update(const uint8_t* data);