13 #ifndef OGLPLUS_GL_1107121519_HPP
14 #define OGLPLUS_GL_1107121519_HPP
16 #ifndef OGLPLUS_NO_SITE_CONFIG
17 #include <oglplus/config/site.hpp>
20 #ifndef OGLPLUS_USE_GLCOREARB_H
21 #define OGLPLUS_USE_GLCOREARB_H 1
24 #ifndef OGLPLUS_USE_GL3_H
25 #define OGLPLUS_USE_GL3_H 0
28 #ifndef OGLPLUS_USE_GLEW
29 #define OGLPLUS_USE_GLEW 0
32 #ifndef OGLPLUS_USE_GL3W
33 #define OGLPLUS_USE_GL3W 0
39 # if OGLPLUS_USE_GLCOREARB_H
40 # define GLCOREARB_PROTOTYPES
41 # define GL_GLEXT_PROTOTYPES
42 # include <GL/glcorearb.h>
43 # include <GL/glext.h>
46 struct GLAPIInitializer
55 # elif OGLPLUS_USE_GL3_H
56 # define GL3_PROTOTYPES
58 # include <OpenGL/gl3.h>
68 struct GLAPIInitializer
77 # elif OGLPLUS_USE_GLEW
82 class GLAPIInitializer
90 glewExperimental = GL_TRUE;
91 GLenum init_result = glewInit();
93 if(init_result != GLEW_OK)
95 throw std::runtime_error(
96 "OpenGL/GLEW initialization error."
103 # elif OGLPLUS_USE_GL3W
104 # define GL3_PROTOTYPES
105 # include <GL3/gl3w.h>
106 # include <stdexcept>
109 class GLAPIInitializer
113 int gl_ver_major = 3,
117 auto init_failed = gl3wInit();
121 throw std::runtime_error(
122 "OpenGL/GL3W initialization error."
125 if(!gl3wIsSupported(gl_ver_major, gl_ver_minor))
127 throw std::runtime_error(
128 "Requested OpenGL version not supported"
136 # error "Some library including OpenGL symbols is required!"
137 # endif // OGLPLUS_USE_*
139 #ifndef GL_VERTEX_ARRAY
140 #define GL_VERTEX_ARRAY 0x8074
144 #define GL_BUFFER 0x82E0
148 #define GL_SHADER 0x82E1
152 #define GL_PROGRAM 0x82E2
156 #define GL_QUERY 0x82E3
159 #ifndef GL_PROGRAM_PIPELINE
160 #define GL_PROGRAM_PIPELINE 0x82E4
164 #define GL_SAMPLER 0x82E6
167 #ifndef GL_TRANSFORM_FEEDBACK
168 #define GL_TRANSFORM_FEEDBACK 0x8E22
172 #define GL_TEXTURE 0x1702
175 #ifndef GL_FRAMEBUFFER
176 #define GL_FRAMEBUFFER 0x8D40
179 #ifndef GL_RENDERBUFFER
180 #define GL_RENDERBUFFER 0x8D41
183 #ifndef GL_POLYGON_MODE
184 #define GL_POLYGON_MODE 0x0B40
187 #endif // OGLPLUS_NO_GL
189 #endif // include guard