Search code examples
androidiosopengl-esopengl-es-2.0glteximage2d

use glTexImage2D draw 63*63 image


In the android,use this code is worked:

glTexImage2D(GL_TEXTURE_2D, 0, GL_BGRA_EXT, content.width, content.height, 0, GL_BGRA_EXT, GL_UNSIGNED_BYTE, content.pixels);

but in the iOS not work, this code only draw 64 *64(power of 2)

glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, content.width, content.height, 0, GL_BGRA_EXT, GL_UNSIGNED_BYTE, content.pixels);

how can i ?

very thankful!!!


Solution

  • The size of texture depends on the GPU and OpenGL ES implementation. On iOS only Power of 2 textures are accepted. And in PVR formate only Square Texture with Power of 2 size is accepted. You need to read their documents before implementing. But for cross-platform it is advisable to use Power of 2 with square texture.