yocto/yocto_gl.cpp
bool gl_check_error(bool print) {
    auto ok = glGetError();
    if (ok == GL_NO_ERROR) return true;
    if (!print) return false;
    switch (ok) {
      case GL_NO_ERROR: printf("GL_NO_ERROR\n"); break;
      case GL_INVALID_ENUM: printf("GL_INVALID_ENUM\n"); break;
      case GL_INVALID_VALUE: printf("GL_INVALID_VALUE\n"); break;
      case GL_INVALID_OPERATION: printf("GL_INVALID_OPERATION\n"); break;
      case GL_INVALID_FRAMEBUFFER_OPERATION:
        printf("GL_INVALID_FRAMEBUFFER_OPERATION\n");
        break;
      case GL_OUT_OF_MEMORY: printf("GL_OUT_OF_MEMORY\n"); break;
      default: printf("<UNKNOWN GL ERROR>\n"); break;
    }
    return false;
  }
// Checks for GL error and then prints
Checks for GL error and then prints
Checks for GL error and then prints
bool gl_check_error(bool print) {
    auto ok = glGetError();
    if (ok == GL_NO_ERROR) return true;
    if (!print) return false;
    switch (ok) {
      case GL_NO_ERROR: printf("GL_NO_ERROR\n"); break;
      case GL_INVALID_ENUM: printf("GL_INVALID_ENUM\n"); break;
      case GL_INVALID_VALUE: printf("GL_INVALID_VALUE\n"); break;
      case GL_INVALID_OPERATION: printf("GL_INVALID_OPERATION\n"); break;
      case GL_INVALID_FRAMEBUFFER_OPERATION:
        printf("GL_INVALID_FRAMEBUFFER_OPERATION\n");
        break;
      case GL_OUT_OF_MEMORY: printf("GL_OUT_OF_MEMORY\n"); break;
      default: printf("<UNKNOWN GL ERROR>\n"); break;
    }
    return false;
  }
bool gl_check_error ( bool print ) { auto ok = glGetError ( ) ; if ( ok == GL_NO_ERROR ) return true ; if ( ! print ) return false ; switch ( ok ) { case GL_NO_ERROR : printf ( " \n " ) ; break ; case GL_INVALID_ENUM : printf ( " \n " ) ; break ; case GL_INVALID_VALUE : printf ( " \n " ) ; break ; case GL_INVALID_OPERATION : printf ( " \n " ) ; break ; case GL_INVALID_FRAMEBUFFER_OPERATION : printf ( " \n " ) ; break ; case GL_OUT_OF_MEMORY : printf ( " \n " ) ; break ; default : printf ( " \n " ) ; break ; } return false ; }
Checks for GL error and then prints
Checks for GL error and then prints