mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 17:00:05 +00:00
Buffer texture atlas on more than the first context after change
- Icons now work on all maps
This commit is contained in:
parent
4ff95094a3
commit
0be94c4de3
3 changed files with 11 additions and 10 deletions
|
|
@ -35,6 +35,8 @@ public:
|
|||
|
||||
GLuint textureAtlas_;
|
||||
std::mutex textureMutex_;
|
||||
|
||||
std::uint64_t textureBufferCount_ {};
|
||||
};
|
||||
|
||||
GlContext::GlContext() : p(std::make_unique<Impl>()) {}
|
||||
|
|
@ -79,9 +81,11 @@ GLuint GlContext::GetTextureAtlas()
|
|||
|
||||
auto& textureAtlas = util::TextureAtlas::Instance();
|
||||
|
||||
if (p->textureAtlas_ == GL_INVALID_INDEX || textureAtlas.NeedsBuffered())
|
||||
if (p->textureAtlas_ == GL_INVALID_INDEX ||
|
||||
p->textureBufferCount_ != textureAtlas.BuildCount())
|
||||
{
|
||||
p->textureAtlas_ = textureAtlas.BufferAtlas(p->gl_);
|
||||
p->textureBufferCount_ = textureAtlas.BuildCount();
|
||||
p->textureAtlas_ = textureAtlas.BufferAtlas(p->gl_);
|
||||
}
|
||||
|
||||
return p->textureAtlas_;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue