根据http://www.opengl.org/sdk/docs/man/xhtml/glFramebufferTexture.xml,调用glFramebufferTexture
应该类似于:
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, textureId, 0);
如果 API 已经知道textureId
为什么它还需要知道目标 ( GL_TEXTURE_2D
)?这是否意味着应该在此调用之前绑定纹理?即我需要打电话:
glBindTexture(GL_TEXTURE_2D, textureId);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, textureId, 0);
glBindTexture(GL_TEXTURE_2D, 0);
还是会glFramebufferTexture2D
处理一切?