当我尝试使用glTexImage2DMultisample时,OpenGL会生成无效的操作错误。我试图以与http://www.opengl.org/wiki/Multisampling相同的方式执行此操作。
glGenFramebuffers(1,&fbo);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo);
glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo);
auto GLuint colorRenderBuffer;
glGenTextures(1,&colorRenderBuffer);
glBindTexture(GL_TEXTURE_2D_MULTISAMPLE,colorRenderBuffer);
glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE,4,GL_RGBA,2048,2048,GL_TRUE);
glFramebufferTexture2D(GL_FRAMEBUFFER,GL_COLOR_ATTACHMENT0,GL_TEXTURE_2D_MULTISAMPLE,colorRenderBuffer,0);