| 29 | namespace { |
| 30 | |
| 31 | const char* ErrorToString(GLenum error) { |
| 32 | switch (error) { |
| 33 | case GL_INVALID_ENUM: |
| 34 | return "[GL_INVALID_ENUM]: An unacceptable value is specified for an " |
| 35 | "enumerated argument."; |
| 36 | case GL_INVALID_VALUE: |
| 37 | return "[GL_INVALID_VALUE]: A numeric argument is out of range."; |
| 38 | case GL_INVALID_OPERATION: |
| 39 | return "[GL_INVALID_OPERATION]: The specified operation is not allowed " |
| 40 | "in the current state."; |
| 41 | case GL_INVALID_FRAMEBUFFER_OPERATION: |
| 42 | return "[GL_INVALID_FRAMEBUFFER_OPERATION]: The framebuffer object is " |
| 43 | "not complete."; |
| 44 | case GL_OUT_OF_MEMORY: |
| 45 | return "[GL_OUT_OF_MEMORY]: There is not enough memory left to execute " |
| 46 | "the command."; |
| 47 | } |
| 48 | return "[UNKNOWN_GL_ERROR]"; |
| 49 | } |
| 50 | |
| 51 | struct ErrorFormatter { |
| 52 | void operator()(std::string* out, GLenum error) const { |
no outgoing calls
no test coverage detected