1
\$\begingroup\$

I tried to bind a bitmap texture. This bitmap is BGR format, and I'm trying to use glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_BGR, GL_UNSIGNED_BYTE, data), but during compile, error: 'GL_BGR' undeclared appears.

I checked <GLES2/gl2.h> and <GLES2/gl2ext.h>, but there isn't any GL_BGR . Is there any way to upload BGR format?

\$\endgroup\$
1

1 Answer 1

1
\$\begingroup\$

Unfortunately OpenGL ES2.0 does not support BGR texture formats in glTexImage2D.

format determines the composition of each element in data. It can assume one of these symbolic values:

  • GL_ALPHA
  • GL_RGB
  • GL_RGBA
  • GL_LUMINANCE
  • GL_LUMINANCE_ALPHA

Source: https://www.khronos.org/registry/OpenGL-Refpages/es2.0/xhtml/glTexImage2D.xml

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .