-
-
Save roxlu/1b6312db9d4d2089ef82 to your computer and use it in GitHub Desktop.
Check framebuffer status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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