Skip to content

Instantly share code, notes, and snippets.

@wrl
Created March 8, 2013 00:29
Show Gist options
  • Save wrl/5113212 to your computer and use it in GitHub Desktop.
Save wrl/5113212 to your computer and use it in GitHub Desktop.
tiny helper routine for pretty-printing glCheckFramebufferStatus()
static void fb_status(const char *where)
{
switch (glCheckFramebufferStatus(GL_FRAMEBUFFER)) {
case GL_FRAMEBUFFER_COMPLETE:
printf(" :: GL_FRAMEBUFFER_COMPLETE in %s\n", where);
break;
case GL_FRAMEBUFFER_UNDEFINED:
printf(" :: GL_FRAMEBUFFER_UNDEFINED in %s\n", where);
break;
case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
printf(" :: GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT in %s\n", where);
break;
case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
printf(" :: GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT in %s\n", where);
break;
case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER:
printf(" :: GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER in %s\n", where);
break;
case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER:
printf(" :: GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER in %s\n", where);
break;
case GL_FRAMEBUFFER_UNSUPPORTED:
printf(" :: GL_FRAMEBUFFER_UNSUPPORTED in %s\n", where);
break;
case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:
printf(" :: GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE in %s\n", where);
break;
case GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS:
printf(" :: GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS in %s\n", where);
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment