OpenGL GL_RGB texture format does not work on iOS (GL_RGBA works fine)

Hello desert people :),

Short information. There is a problem with the internal texture format GL_RGB on the iOS platform.

In my application, I am trying to save some memory using GL_RGB instead of GL_RGBA as an internal format. For this, I use the following code snippet. Nothing else has changed.

glTexImage2D(_textureTargetType, 
     0, 
     GL_RGB,            // pixel internalFormat
     texWidth,          // image width
     texHeight,         // image height
     0,             // border
     GL_RGBA,           // pixel format
     GL_UNSIGNED_BYTE,      // pixel data type
     bitmapData);

On MacOS, these changes went freely, no problem. But on iOS, especially 4.3 (OpenGL ES2.0), it gives me GL_INVALID_OPERATION every time I try to display textured polygons with this texture. Since nothing but this format has changed, I think the problem is the incompatibility of the GL_RGB internal format with OpenGL ES2.0. This is just my guess, I'm not a guru.

iPod touch 4- .

.

+3
1

"internalformat format. ". . - Khronos. OpenGL , Mac OS, OpenGL ES iOS.

+6

All Articles