mirror of https://github.com/axmolengine/axmol.git
Fix android compile error [ci build]
This commit is contained in:
parent
705ddf323c
commit
c53038448d
|
@ -70,7 +70,20 @@ static bool checkReallySupportsASTC() {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
// read pixel RGB: should be: 255, 128, 0
|
// read pixel RGB: should be: 255, 128, 0
|
||||||
uint8_t pixels[TEXTURE_DIM * TEXTURE_DIM * 4] = {0};
|
uint8_t pixels[TEXTURE_DIM * TEXTURE_DIM * 4] = {0};
|
||||||
|
|
||||||
|
#if CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID
|
||||||
glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
|
glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
|
||||||
|
#else
|
||||||
|
GLuint fbo = 0;
|
||||||
|
glGenFramebuffers(1, &fbo);
|
||||||
|
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
|
||||||
|
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texID, 0);
|
||||||
|
|
||||||
|
glReadPixels(0, 0, TEXTURE_DIM, TEXTURE_DIM, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
|
||||||
|
|
||||||
|
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||||
|
glDeleteFramebuffers(1, &fbo);
|
||||||
|
#endif
|
||||||
error = glGetError();
|
error = glGetError();
|
||||||
if (error || pixels[0] != 255 || pixels[1] != 128) {
|
if (error || pixels[0] != 255 || pixels[1] != 128) {
|
||||||
error = GL_INVALID_VALUE;
|
error = GL_INVALID_VALUE;
|
||||||
|
|
Loading…
Reference in New Issue