Skip to content

Instantly share code, notes, and snippets.

@roxlu
Created September 26, 2013 09:59
Show Gist options
  • Save roxlu/1b6312db9d4d2089ef82 to your computer and use it in GitHub Desktop.
Save roxlu/1b6312db9d4d2089ef82 to your computer and use it in GitHub Desktop.
Check framebuffer status
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
if(status != GL_FRAMEBUFFER_COMPLETE) {
std::string msg;
switch(status) {
case GL_FRAMEBUFFER_UNDEFINED: msg = "GL_FRAMEBUFFER_UNDEFINED"; break;
case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT: msg = "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT"; break;
case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: msg = "GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT"; break;
case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER: msg = "GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER"; break;
case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER: msg = "GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER"; break;
case GL_FRAMEBUFFER_UNSUPPORTED: msg = "GL_FRAMEBUFFER_UNSUPPORTED"; break;
case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: msg = "GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE"; break;
case GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS: msg = "GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS"; break;
default: msg = "unknown"; break;
};
printf("error: framebuffer of resizer is not complete!\n");
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment