1

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?

Gnemlock
  • 5,263
  • 5
  • 28
  • 58
  • https://www.opengl.org/discussion_boards/showthread.php/185197-Why-OpenGLES-2-spec-doesn-t-support-BGRA-texture-format – Bálint Mar 16 '17 at 08:47

1 Answers1

1

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

Kromster
  • 10,643
  • 4
  • 53
  • 67