All Classes Files Functions Variables Typedefs Pages
GLObject.hpp
1 #pragma once
2 
3 #include "GLTools.hpp"
4 #include "GLException.hpp"
5 #include "../config/BaseProxy.hpp"
6 #include "../config/LConfig.hpp"
7 #include "../util/NotCloneable.hpp"
8 
9 #include <GL/glew.h>
10 #include <sstream>
11 
12 namespace lumina {
13 
14 enum class PrintGL {
15  Error
16 };
17 
19 public:
20  // OpenGL object cannot be copied, just moved.
21  GLContextFreeObject() = default;
22 
23 protected:
24  template <typename... Ts> void checkGLError(Ts...);
25  template <typename... Ts> void checkGLWarning(Ts...);
26  template <typename... Ts> void logThrowGL(Ts...);
27 
28  // short name for PrintGL::Error
29  static constexpr PrintGL GLERR = PrintGL::Error;
30 
31 private:
32  template <typename T> T& translateErrorMsg(GLuint err, T& obj);
33  const char* translateErrorMsg(GLuint err, PrintGL obj);
34 
35 };
36 
37 class GLObject : public GLContextFreeObject {
38 public:
39  GLObject();
40 
41 private:
42  bool isRenderContextCurrent();
43 };
44 
45 
46 }
47 
48 #include "GLObject.tpp"
Definition: SingleBase.hpp:19
Definition: NotCloneable.hpp:5
Definition: GLObject.hpp:37
Definition: GLObject.hpp:18