| 81 | } |
| 82 | |
| 83 | bool cv::ogl::checkError(const char* file, const int line, const char* func) |
| 84 | { |
| 85 | #ifndef HAVE_OPENGL |
| 86 | (void) file; |
| 87 | (void) line; |
| 88 | (void) func; |
| 89 | return true; |
| 90 | #else |
| 91 | GLenum err = gl::GetError(); |
| 92 | |
| 93 | if (err != gl::NO_ERROR_) |
| 94 | { |
| 95 | const char* msg; |
| 96 | |
| 97 | switch (err) |
| 98 | { |
| 99 | case gl::INVALID_ENUM: |
| 100 | msg = "An unacceptable value is specified for an enumerated argument"; |
| 101 | break; |
| 102 | |
| 103 | case gl::INVALID_VALUE: |
| 104 | msg = "A numeric argument is out of range"; |
| 105 | break; |
| 106 | |
| 107 | case gl::INVALID_OPERATION: |
| 108 | msg = "The specified operation is not allowed in the current state"; |
| 109 | break; |
| 110 | |
| 111 | case gl::OUT_OF_MEMORY: |
| 112 | msg = "There is not enough memory left to execute the command"; |
| 113 | break; |
| 114 | |
| 115 | default: |
| 116 | msg = "Unknown error"; |
| 117 | }; |
| 118 | |
| 119 | cvError(CV_OpenGlApiCallError, func, msg, file, line); |
| 120 | |
| 121 | return false; |
| 122 | } |
| 123 | |
| 124 | return true; |
| 125 | #endif |
| 126 | } |
| 127 | |
| 128 | #ifdef HAVE_OPENGL |
| 129 | namespace |