SimpleGL  1.1.0
A framework for platform independent rendering
backend_gl.hpp
Go to the documentation of this file.
1 
8 #ifndef BACKEND_GL_HPP
9 #define BACKEND_GL_HPP
10 
11 #include <SimpleGL_gl/SimpleGL_gl_Export.h>
12 
13 #include <GL/glew.h>
14 
15 namespace sgl {
16 
22  struct SIMPLEGL_GL_EXPORT GLVersion {
23 
25  const int major;
26 
28  const int minor;
29 
31  GLVersion();
32 
34  GLVersion(int major, int minor);
35 
41  bool operator<(const GLVersion& other);
42 
48  bool operator<=(const GLVersion& other);
49 
55  bool operator==(const GLVersion& other);
56 
62  bool operator!=(const GLVersion& other);
63 
69  bool operator>=(const GLVersion& other);
70 
76  bool operator>(const GLVersion& other);
77  };
78 
80  extern SIMPLEGL_GL_EXPORT GLVersion contextVersion;
81 
83  SIMPLEGL_GL_EXPORT void initGL();
84 
92  template<typename E>
93  GLint to_GLint(E e);
94 
102  template<typename E>
103  GLenum to_GLenum(E e);
104 
112  template<typename E>
113  GLbitfield to_GLbitfield(E e);
114 }
115 
116 #include "backend_gl.tcc"
117 
118 #endif /* BACKEND_GL_HPP */
const int major
Constant for the major version.
Definition: backend_gl.hpp:25
const int minor
Constant for the minor version.
Definition: backend_gl.hpp:28
GLenum to_GLenum(E e)
Gets the GLenum value from an enum class.
Definition: backend_gl.tcc:22
Generic namespace for the SimpleGL framework.
Definition: application.hpp:18
GLbitfield to_GLbitfield(E e)
Gets the GLbitfield value from an enum class.
Definition: backend_gl.tcc:27
GLint to_GLint(E e)
Gets the GLint value from an enum class.
Definition: backend_gl.tcc:17
SIMPLEGL_GL_EXPORT GLVersion contextVersion
Stores the OpenGL version structure.
Definition: backend_gl.cpp:19
Structure for saving the OpenGL version.
Definition: backend_gl.hpp:22
SIMPLEGL_GL_EXPORT void initGL()
Initializes the OpenGL backend, this will also check available extensions and should be called after ...
Definition: backend_gl.cpp:55