Why is glTexImage2D returning GL_INVALID_OPERATION on iOS?

爷,独闯天下 提交于 2020-01-16 16:48:57

问题


I'm making the following call on iOS using OpenGL ES 3:

glTexImage2D(GL_TEXTURE_2D,         // target
             0,                     // level
             GL_RGBA,               // internalformat
             1024,                  // width
             692,                   // height
             0,                     // border
             GL_RGBA,               // format
             GL_UNSIGNED_BYTE,      // type
             NULL);                 // data

However, it is returning GL_INVALID_OPERATION. There are a slew of reasons that GL_INVALID_OPERATION might be returned. However, I can't spot any that are relevant to my situation.

The weird thing is if I just ignore the error, things seem to work anyway. However, I'd like to understand what's going on here because I don't want it to bite me later.

Can anyone explain why I'm getting an error here and how to avoid it?

来源:https://stackoverflow.com/questions/57104033/why-is-glteximage2d-returning-gl-invalid-operation-on-ios

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