mirror of https://github.com/axmolengine/axmol.git
For clang-format happy
This commit is contained in:
parent
af68d2e9e2
commit
90f441441e
|
@ -77,14 +77,13 @@ void TextureInfoGL::applySampler(const SamplerDescriptor& descriptor, bool isPow
|
||||||
}
|
}
|
||||||
|
|
||||||
// apply sampler for all internal textures
|
// apply sampler for all internal textures
|
||||||
foreach ([this, target](GLuint texID, int index) {
|
foreachTextures([this, target](GLuint texID, int index) {
|
||||||
glBindTexture(target, textures[index]);
|
glBindTexture(target, textures[index]);
|
||||||
|
|
||||||
setCurrentTexParameters(target);
|
setCurrentTexParameters(target);
|
||||||
|
|
||||||
glBindTexture(target, 0); // unbind
|
glBindTexture(target, 0); // unbind
|
||||||
})
|
});
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextureInfoGL::setCurrentTexParameters(GLenum target)
|
void TextureInfoGL::setCurrentTexParameters(GLenum target)
|
||||||
|
|
|
@ -43,7 +43,7 @@ struct TextureInfoGL
|
||||||
~TextureInfoGL() { destroy(); }
|
~TextureInfoGL() { destroy(); }
|
||||||
|
|
||||||
template <typename _Fty>
|
template <typename _Fty>
|
||||||
void foreach (const _Fty& cb) const
|
void foreachTextures(const _Fty& cb) const
|
||||||
{
|
{
|
||||||
GLuint texID;
|
GLuint texID;
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
|
@ -56,8 +56,7 @@ struct TextureInfoGL
|
||||||
|
|
||||||
void destroy()
|
void destroy()
|
||||||
{
|
{
|
||||||
foreach ([=](GLuint texID, int) { glDeleteTextures(1, &texID); })
|
foreachTextures([=](GLuint texID, int) { glDeleteTextures(1, &texID); });
|
||||||
;
|
|
||||||
textures.fill(0);
|
textures.fill(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue