blob: b70b5a531c6cbc069f2c924358df3b0d5ff4dedc [file] [log] [blame]
Geoff Langda5777c2014-07-11 09:52:58 -04001//
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
16namespace gl
17{
18
19class Error
20{
21 public:
22 explicit Error(GLenum errorCode);
Shannon Woods8e7d7a32014-09-02 17:09:08 -040023 Error(GLenum errorCode, const char *msg, ...);
Geoff Langda5777c2014-07-11 09:52:58 -040024 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_