glTexImage2D failing in GLUT/FreeType example with OpenGL 3 and above

我怕爱的太早我们不能终老 提交于 2019-12-06 14:02:12

GL_ALPHA is not a valid image format in GL 3.2 core, hence the GL_INVALID_ENUM error. If you want a single-channel image format, then you must use a valid single-channel image format. Namely, some from of GL_RED bitdepth. I would suggest GL_R8.

This also means that the pixel transfer format (the third parameter from the end) must also be GL_RED.

Note that those tutorials only work for 3.2+ when you use a compatibility profile. They're not forward compatible, because they have to be compatible with GL ES.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!