tests/cuda2.2/sdk/rendercheck_gl.cpp
bool CheckFBO::checkStatus(const char *zfile, int line, bool silent)
{
    GLenum status;
    status = (GLenum) glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
	if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
		printf("<%s : %d> - ", zfile, line);
	}

	switch(status) {
        case GL_FRAMEBUFFER_COMPLETE_EXT:
            break;
        case GL_FRAMEBUFFER_UNSUPPORTED_EXT:
			if (!silent) printf("Unsupported framebuffer format\n");
            return false;
        case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT:
            if (!silent) printf("Framebuffer incomplete, missing attachment\n");
            return false;
        case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT:
            if (!silent) printf("Framebuffer incomplete, duplicate attachment\n");
            return false;
        case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT:
            if (!silent) printf("Framebuffer incomplete, attached images must have same dimensions\n");
            return false;
        case GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT:
            if (!silent) printf("Framebuffer incomplete, attached images must have same format\n");
            return false;
        case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT:
            if (!silent) printf("Framebuffer incomplete, missing draw buffer\n");
            return false;
        case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT:
            if (!silent) printf("Framebuffer incomplete, missing read buffer\n");
            return false;
        default:
            assert(0);
            return false;
    }
    return true;
}
//////////////////////////////////////////////////////////////////////
//  checkStatus of FBO
//
//   Check the framebuffer status to ensure it is a supported
//    config.
//////////////////////////////////////////////////////////////////////
checkStatus of FBO
Check the framebuffer status to ensure it is a supported
config.
checkStatus of FBO Check the framebuffer status to ensure it is a supported config .
bool CheckFBO::checkStatus(const char *zfile, int line, bool silent)
{
    GLenum status;
    status = (GLenum) glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
	if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
		printf("<%s : %d> - ", zfile, line);
	}
	switch(status) {
        case GL_FRAMEBUFFER_COMPLETE_EXT:
            break;
        case GL_FRAMEBUFFER_UNSUPPORTED_EXT:
			if (!silent) printf("Unsupported framebuffer format\n");
            return false;
        case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT:
            if (!silent) printf("Framebuffer incomplete, missing attachment\n");
            return false;
        case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT:
            if (!silent) printf("Framebuffer incomplete, duplicate attachment\n");
            return false;
        case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT:
            if (!silent) printf("Framebuffer incomplete, attached images must have same dimensions\n");
            return false;
        case GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT:
            if (!silent) printf("Framebuffer incomplete, attached images must have same format\n");
            return false;
        case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT:
            if (!silent) printf("Framebuffer incomplete, missing draw buffer\n");
            return false;
        case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT:
            if (!silent) printf("Framebuffer incomplete, missing read buffer\n");
            return false;
        default:
            assert(0);
            return false;
    }
    return true;
}
bool CheckFBO :: checkStatus ( const char * zfile , int line , bool silent ) { GLenum status ; status = ( GLenum ) glCheckFramebufferStatusEXT ( GL_FRAMEBUFFER_EXT ) ; if ( status != GL_FRAMEBUFFER_COMPLETE_EXT ) { printf ( " " , zfile , line ) ; } switch ( status ) { case GL_FRAMEBUFFER_COMPLETE_EXT : break ; case GL_FRAMEBUFFER_UNSUPPORTED_EXT : if ( ! silent ) printf ( " \n " ) ; return false ; case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT : if ( ! silent ) printf ( " \n " ) ; return false ; case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT : if ( ! silent ) printf ( " \n " ) ; return false ; case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT : if ( ! silent ) printf ( " \n " ) ; return false ; case GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT : if ( ! silent ) printf ( " \n " ) ; return false ; case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT : if ( ! silent ) printf ( " \n " ) ; return false ; case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT : if ( ! silent ) printf ( " \n " ) ; return false ; default : assert ( 0 ) ; return false ; } return true ; }
checkStatus of FBO
Check the framebuffer status to ensure it is a supported
config.
checkStatus of FBO Check the framebuffer status to ensure it is a supported config .