Geoff Lang | da5777c | 2014-07-11 09:52:58 -0400 | [diff] [blame] | 1 | // |
| 2 | // Copyright (c) 2014 The ANGLE Project Authors. All rights reserved. |
| 3 | // Use of this source code is governed by a BSD-style license that can be |
| 4 | // found in the LICENSE file. |
| 5 | |
| 6 | // Error.h: Defines the gl::Error class which encapsulates an OpenGL error |
| 7 | // and optional error message. |
| 8 | |
| 9 | #ifndef LIBGLESV2_ERROR_H_ |
| 10 | #define LIBGLESV2_ERROR_H_ |
| 11 | |
| 12 | #include "angle_gl.h" |
| 13 | |
| 14 | #include <string> |
| 15 | |
| 16 | namespace gl |
| 17 | { |
| 18 | |
| 19 | class Error |
| 20 | { |
| 21 | public: |
| 22 | explicit Error(GLenum errorCode); |
Shannon Woods | 8e7d7a3 | 2014-09-02 17:09:08 -0400 | [diff] [blame] | 23 | Error(GLenum errorCode, const char *msg, ...); |
Geoff Lang | da5777c | 2014-07-11 09:52:58 -0400 | [diff] [blame] | 24 | Error(const Error &other); |
| 25 | Error &operator=(const Error &other); |
| 26 | |
| 27 | GLenum getCode() const { return mCode; } |
| 28 | bool isError() const { return (mCode != GL_NO_ERROR); } |
| 29 | |
| 30 | const std::string &getMessage() const { return mMessage; } |
| 31 | |
| 32 | private: |
| 33 | GLenum mCode; |
| 34 | std::string mMessage; |
| 35 | }; |
| 36 | |
| 37 | } |
| 38 | |
| 39 | #endif // LIBGLESV2_ERROR_H_ |