OGLplus  (0.59.0) a C++ wrapper for rendering APIs

gl_def.hpp
Go to the documentation of this file.
1 #ifndef OGLPLUS_GL_DEF_HPP
9 #define OGLPLUS_GL_DEF_HPP
10 
11 #include <eagine/diagnostic.hpp>
12 #include <oglplus/config/basic.hpp>
13 
14 #ifdef __clang__
15 EAGINE_DIAG_PUSH()
16 EAGINE_DIAG_OFF(reserved-id-macro)
17 #endif
18 //------------------------------------------------------------------------------
19 #if defined(__gl_glcorearb_h_)
20 #define OGLPLUS_GLCOREARB_DETECTED 1
21 #else
22 #define OGLPLUS_GLCOREARB_DETECTED 0
23 #endif
24 //------------------------------------------------------------------------------
25 #if defined(__glew_h__) || defined(__GLEW_H__)
26 #define OGLPLUS_GLEW_DETECTED 1
27 #else
28 #define OGLPLUS_GLEW_DETECTED 0
29 #endif
30 //------------------------------------------------------------------------------
31 #if OGLPLUS_GLCOREARB_DETECTED || OGLPLUS_GLEW_DETECTED
32 #undef OGLPLUS_USE_GLCOREARB_H
33 #undef OGLPLUS_USE_GLEW
34 #endif
35 //------------------------------------------------------------------------------
36 #ifndef OGLPLUS_USE_GLCOREARB_H
37 #if OGLPLUS_GLEW_DETECTED
38 #define OGLPLUS_USE_GLCOREARB_H 0
39 #else
40 #define OGLPLUS_USE_GLCOREARB_H 1
41 #endif
42 #endif
43 //------------------------------------------------------------------------------
44 #ifndef OGLPLUS_USE_GL3_GL3_H
45 #define OGLPLUS_USE_GL3_GL3_H 0
46 #endif
47 //------------------------------------------------------------------------------
48 #ifndef OGLPLUS_USE_GLES3_GL32_H
49 #define OGLPLUS_USE_GLES3_GL32_H 0
50 #endif
51 //------------------------------------------------------------------------------
52 #ifndef OGLPLUS_USE_GLES3_GL31_H
53 #define OGLPLUS_USE_GLES3_GL31_H 0
54 #endif
55 //------------------------------------------------------------------------------
56 #ifndef OGLPLUS_USE_GLES3_GL3_H
57 #define OGLPLUS_USE_GLES3_GL3_H 0
58 #endif
59 //------------------------------------------------------------------------------
60 #ifndef OGLPLUS_USE_GLEW
61 #if OGLPLUS_GLCOREARB_DETECTED
62 #define OGLPLUS_USE_GLEW 0
63 #else
64 #define OGLPLUS_USE_GLEW 1
65 #endif
66 #endif
67 //------------------------------------------------------------------------------
68 #ifndef OGLPLUS_USE_GL3W
69 #define OGLPLUS_USE_GL3W 0
70 #endif
71 //------------------------------------------------------------------------------
72 #ifndef OGLPLUS_NO_GL
73 //------------------------------------------------------------------------------
74 namespace eagine::oglp {
75 
76 struct api_initializer {
77  ~api_initializer() noexcept = default;
78  api_initializer(const api_initializer&) = delete;
79  api_initializer(api_initializer&&) = delete;
80  auto operator=(const api_initializer&) = delete;
81  auto operator=(api_initializer&&) = delete;
82 
83  explicit api_initializer(int /*gl_ver_major*/ = 3, int /*gl_ver_minor*/ = 3);
84 };
85 
86 } // namespace eagine::oglp
87 //------------------------------------------------------------------------------
88 #if OGLPLUS_USE_GLCOREARB_H
89 #define GLCOREARB_PROTOTYPES
90 #define GL_GLEXT_PROTOTYPES
91 #include <GL/glcorearb.h>
92 #include <GL/glext.h>
93 //------------------------------------------------------------------------------
94 #elif OGLPLUS_USE_GL3_GL3_H
95 #define GL3_PROTOTYPES
96 #ifdef __APPLE__
97 #include <OpenGL/gl3.h>
98 #else
99 #include <GL3/gl3.h>
100 #endif
101 #define __gl_h_
102 #define __gl_h__
103 #define __glext_h_
104 #define __glext_h__
105 //------------------------------------------------------------------------------
106 #elif OGLPLUS_USE_GLES3_GL32_H
107 #define GL3_PROTOTYPES
108 #include <GLES3/gl32.h>
109 //------------------------------------------------------------------------------
110 #elif OGLPLUS_USE_GLES3_GL31_H
111 #define GL3_PROTOTYPES
112 #include <GLES3/gl31.h>
113 //------------------------------------------------------------------------------
114 #elif OGLPLUS_USE_GLES3_GL3_H
115 #define GL3_PROTOTYPES
116 #include <GLES3/gl3.h>
117 //------------------------------------------------------------------------------
118 #elif OGLPLUS_USE_GLEW
119 #include <GL/glew.h>
120 //------------------------------------------------------------------------------
121 #elif OGLPLUS_USE_GL3W
122 #define GL3_PROTOTYPES
123 #include <GL/gl3w.h>
124 //------------------------------------------------------------------------------
125 #else
126 #error "Some library including OpenGL symbols is required!"
127 #endif // OGLPLUS_USE_*
128 //------------------------------------------------------------------------------
129 #endif // OGLPLUS_NO_GL
130 //------------------------------------------------------------------------------
131 #ifdef __clang__
132 EAGINE_DIAG_POP()
133 #endif
134 //------------------------------------------------------------------------------
135 #if !OGLPLUS_LINK_LIBRARY || defined(OGLPLUS_IMPLEMENTING_LIBRARY)
136 #include <oglplus/gl_def.inl>
137 #endif
138 //------------------------------------------------------------------------------
139 #endif // OGLPLUS_GL_DEF_HPP

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).