Clean possible GL error

CHECK_GL_ERROR_DEBUG work debug only.
Clean need for correct check glTexImage2D and glCompressedTexImage2D

Release now work: If gl error before any code, initWithMipmaps return
false always
This commit is contained in:
Vladimir Perminov 2015-03-19 11:10:49 +03:00
parent a8471dd507
commit 133be7e57f
1 changed files with 6 additions and 1 deletions

View File

@ -637,7 +637,12 @@ bool Texture2D::initWithMipmaps(MipmapInfo* mipmaps, int mipmapsNum, PixelFormat
}
#endif
CHECK_GL_ERROR_DEBUG(); // clean possible GL error
// clean possible GL error
GLenum err = glGetError();
if (err != GL_NO_ERROR)
{
cocos2d::log("OpenGL error 0x%04X in %s %s %d\n", err, __FILE__, __FUNCTION__, __LINE__);
}
// Specify OpenGL texture image
int width = pixelsWide;