Loading a BMP into an OpenGL textures switches the red and blue colors. (C++/Windows)

后端 未结 5 1179
被撕碎了的回忆
被撕碎了的回忆 2021-01-05 07:55

I\'m trying to load a bitmap into an OpenGL texture and display it to the screen, but when I do so, the red and blue values seem to switch (e.g.: a blue image appears orange

5条回答
  •  醉话见心
    2021-01-05 08:40

    You'll normally have a call to glTexImage2D that specifies the external format of the pixels. From the sounds of things, you need to check that and switch from GL_RGB to GL_BGR.

提交回复
热议问题