Panda3D

gles2gsg.h
Go to the documentation of this file.
1 /**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file gles2gsg.h
10 * @author rdb
11 * @date 2009-06-14
12 */
13
14 #ifndef GLES2GSG_H
15 #define GLES2GSG_H
16
17 // This header file compiles a GSG for the limited subset of OpenGL that is
18 // OpenGL ES 2.
19
20 #include "pandabase.h"
21 #include "config_gles2gsg.h"
22
23 #define GLP(name) gl##name
24
25 #ifndef STDFLOAT_DOUBLE
26 #define GLPf(name) gl ## name ## f
27 #define GLPfv(name) gl ## name ## fv
28 #else // STDFLOAT_DOUBLE
29 #define GLPf(name) gl ## name ## d
30 #define GLPfv(name) gl ## name ## dv
31 #endif // STDFLOAT_DOUBLE
32
33 #define CLP(name) GLES2##name
34 #define GLPREFIX_QUOTED "gl"
35 #define CLASSPREFIX_QUOTED "GLES2"
36 #define GLSYSTEM_NAME "OpenGL ES 2"
37 #define CONFIGOBJ config_gles2gsg
38 #define GLCAT gles2gsg_cat
39 #define EXPCL_GL EXPCL_PANDAGLES2
40 #define EXPTP_GL EXPTP_PANDAGLES2
41 #ifdef OPENGLES_1
42 #error OPENGLES_1 should not be defined!
43 #endif
44 #ifndef OPENGLES
45 #define OPENGLES
46 #endif
47 #ifndef OPENGLES_2
48 #define OPENGLES_2
49 #endif
50
51 // OpenGL ES 2 has no fixed-function pipeline.
52 #undef SUPPORT_FIXED_FUNCTION
53
54 #ifdef BUILD_IPHONE
55 #include <OpenGLES/ES2/gl.h>
56 // #include <OpenGLESES2glext.h>
57 #else
58 #include <GLES2/gl2.h>
59 // #include <GLES2gl2ext.h>
60 #endif
61
62 #include "panda_esgl2ext.h"
63
64 // This helps to keep the source clean of hundreds of ifdefs.
65 typedef char GLchar;
66 #define GL_RENDERBUFFER_EXT GL_RENDERBUFFER
67 #define GL_RENDERBUFFER_RED_SIZE_EXT GL_RENDERBUFFER_RED_SIZE
68 #define GL_RENDERBUFFER_GREEN_SIZE_EXT GL_RENDERBUFFER_GREEN_SIZE
69 #define GL_RENDERBUFFER_BLUE_SIZE_EXT GL_RENDERBUFFER_BLUE_SIZE
70 #define GL_RENDERBUFFER_ALPHA_SIZE_EXT GL_RENDERBUFFER_ALPHA_SIZE
71 #define GL_RENDERBUFFER_DEPTH_SIZE_EXT GL_RENDERBUFFER_DEPTH_SIZE
72 #define GL_RENDERBUFFER_STENCIL_SIZE_EXT GL_RENDERBUFFER_STENCIL_SIZE
73 #define GL_FRAMEBUFFER_EXT GL_FRAMEBUFFER
74 #define GL_DRAW_FRAMEBUFFER_EXT GL_FRAMEBUFFER
75 #define GL_READ_FRAMEBUFFER_EXT GL_FRAMEBUFFER
76 #define GL_FRAMEBUFFER_COMPLETE_EXT GL_FRAMEBUFFER_COMPLETE
77 #define GL_FRAMEBUFFER_UNSUPPORTED_EXT GL_FRAMEBUFFER_UNSUPPORTED
78 #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT
79 #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT
80 #define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS
81 #define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT GL_FRAMEBUFFER_INCOMPLETE_FORMATS
82 #define GL_DEPTH_ATTACHMENT_EXT GL_DEPTH_ATTACHMENT
83 #define GL_STENCIL_ATTACHMENT_EXT GL_STENCIL_ATTACHMENT
84 #define GL_DEPTH_STENCIL GL_DEPTH_STENCIL_OES
85 #define GL_DEPTH_STENCIL_EXT GL_DEPTH_STENCIL_OES
86 #define GL_UNSIGNED_INT_24_8_EXT GL_UNSIGNED_INT_24_8_OES
87 #define GL_DEPTH24_STENCIL8_EXT GL_DEPTH24_STENCIL8_OES
88 #define GL_DEPTH_COMPONENT24 GL_DEPTH_COMPONENT24_OES
89 #define GL_DEPTH_COMPONENT32 GL_DEPTH_COMPONENT32_OES
90 #define GL_MAX_3D_TEXTURE_SIZE GL_MAX_3D_TEXTURE_SIZE_OES
91 #define GL_SAMPLER_3D GL_SAMPLER_3D_OES
92 #define GL_BGRA GL_BGRA_EXT
93 #define GL_RED GL_RED_EXT
94 #define GL_RG GL_RG_EXT
95 #define GL_R16F GL_R16F_EXT
96 #define GL_RG16F GL_RG16F_EXT
97 #define GL_RGB16F GL_RGB16F_EXT
98 #define GL_RGBA16F GL_RGBA16F_EXT
99 #define GL_RGB16F GL_RGB16F_EXT
100 #define GL_RGBA16F GL_RGBA16F_EXT
101 #define GL_RGB32F GL_RGB32F_EXT
102 #define GL_RGBA32F GL_RGBA32F_EXT
103 #define GL_SRGB_ALPHA GL_SRGB_ALPHA_EXT
104 #define GL_RGBA8 GL_RGBA8_OES
105 #define GL_R8 GL_R8_EXT
106 #define GL_RG8 GL_RG8_EXT
107 #define GL_ALPHA8 GL_ALPHA8_OES
108 #define GL_LUMINANCE8 GL_LUMINANCE8_OES
109 #define GL_LUMINANCE8_ALPHA8 GL_LUMINANCE8_ALPHA8_EXT
110 #define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_EXT
111 #define GL_R32F GL_R32F_EXT
112 #define GL_RG32F GL_RG32F_EXT
113 #define GL_RGB8 GL_RGB8_OES
114 #define GL_TEXTURE_COMPARE_FUNC_ARB GL_TEXTURE_COMPARE_FUNC_EXT
115 #define GL_TEXTURE_COMPARE_MODE_ARB GL_TEXTURE_COMPARE_MODE_EXT
116 #define GL_COMPARE_R_TO_TEXTURE_ARB GL_COMPARE_REF_TO_TEXTURE_EXT
117 #define GL_SAMPLER_2D_SHADOW GL_SAMPLER_2D_SHADOW_EXT
118 #define GL_MAX_DRAW_BUFFERS GL_MAX_DRAW_BUFFERS_NV
119 #define GL_SRC1_COLOR GL_SRC1_COLOR_EXT
120 #define GL_ONE_MINUS_SRC1_COLOR GL_ONE_MINUS_SRC1_COLOR_EXT
121 #define GL_SRC1_ALPHA GL_SRC1_ALPHA_EXT
122 #define GL_ONE_MINUS_SRC1_ALPHA GL_ONE_MINUS_SRC1_ALPHA_EXT
123
124 #define GL_DEBUG_OUTPUT_SYNCHRONOUS GL_DEBUG_OUTPUT_SYNCHRONOUS_KHR
125 #define GL_DEBUG_TYPE_PERFORMANCE GL_DEBUG_TYPE_PERFORMANCE_KHR
126 #define GL_DEBUG_SEVERITY_HIGH GL_DEBUG_SEVERITY_HIGH_KHR
127 #define GL_DEBUG_SEVERITY_MEDIUM GL_DEBUG_SEVERITY_MEDIUM_KHR
128 #define GL_DEBUG_SEVERITY_LOW GL_DEBUG_SEVERITY_LOW_KHR
129 #define GL_DEBUG_SEVERITY_NOTIFICATION GL_DEBUG_SEVERITY_NOTIFICATION_KHR
130 #define GL_BUFFER GL_BUFFER_KHR
131 #define GL_SHADER GL_SHADER_KHR
132 #define GL_PROGRAM GL_PROGRAM_KHR
133 #define GL_DEBUG_OUTPUT GL_DEBUG_OUTPUT_KHR
134
135 // For GLES 3 compat - need a better solution for this
136 #define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x1
137 #define GL_ELEMENT_ARRAY_BARRIER_BIT 0x2
138 #define GL_UNIFORM_BARRIER_BIT 0x4
139 #define GL_TEXTURE_FETCH_BARRIER_BIT 0x8
140 #define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x20
141 #define GL_COMMAND_BARRIER_BIT 0x40
142 #define GL_PIXEL_BUFFER_BARRIER_BIT 0x80
143 #define GL_TEXTURE_UPDATE_BARRIER_BIT 0x100
144 #define GL_BUFFER_UPDATE_BARRIER_BIT 0x200
145 #define GL_FRAMEBUFFER_BARRIER_BIT 0x400
146 #define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x800
147 #define GL_ATOMIC_COUNTER_BARRIER_BIT 0x1000
148 #define GL_HALF_FLOAT 0x140B
149 #define GL_COLOR 0x1800
150 #define GL_DEPTH 0x1801
151 #define GL_STENCIL 0x1802
152 #define GL_RGB10_A2 0x8059
153 #define GL_TEXTURE_WRAP_R 0x8072
154 #define GL_TEXTURE_MIN_LOD 0x813A
155 #define GL_TEXTURE_MAX_LOD 0x813B
156 #define GL_TEXTURE_MAX_LEVEL 0x813D
157 #define GL_NUM_EXTENSIONS 0x821D
158 #define GL_RG_INTEGER 0x8228
159 #define GL_R8I 0x8231
160 #define GL_R8UI 0x8232
161 #define GL_R16I 0x8233
162 #define GL_R16UI 0x8234
163 #define GL_R32I 0x8235
164 #define GL_R32UI 0x8236
165 #define GL_RG8I 0x8237
166 #define GL_RG8UI 0x8238
167 #define GL_RG16I 0x8239
168 #define GL_RG16UI 0x823A
169 #define GL_RG32I 0x823B
170 #define GL_RG32UI 0x823C
171 #define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257
172 #define GL_PROGRAM_BINARY_LENGTH 0x8741
173 #define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE
174 #define GL_PROGRAM_BINARY_FORMATS 0x87FF
175 #define GL_READ_ONLY 0x88B8
176 #define GL_WRITE_ONLY 0x88B9
177 #define GL_READ_WRITE 0x88BA
178 #define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF
179 #define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35
180 #define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36
181 #define GL_UNIFORM_TYPE 0x8A37
182 #define GL_UNIFORM_SIZE 0x8A38
183 #define GL_UNIFORM_NAME_LENGTH 0x8A39
184 #define GL_UNIFORM_BLOCK_INDEX 0x8A3A
185 #define GL_UNIFORM_OFFSET 0x8A3B
186 #define GL_UNIFORM_ARRAY_STRIDE 0x8A3C
187 #define GL_UNIFORM_MATRIX_STRIDE 0x8A3D
188 #define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E
189 #define GL_UNIFORM_BLOCK_BINDING 0x8A3F
190 #define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40
191 #define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41
192 #define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42
193 #define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43
194 #define GL_FLOAT_MAT2x3 0x8B65
195 #define GL_FLOAT_MAT2x4 0x8B66
196 #define GL_FLOAT_MAT3x2 0x8B67
197 #define GL_FLOAT_MAT3x4 0x8B68
198 #define GL_FLOAT_MAT4x2 0x8B69
199 #define GL_FLOAT_MAT4x3 0x8B6A
200 #define GL_TEXTURE_2D_ARRAY 0x8C1A
201 #define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D
202 #define GL_R11F_G11F_B10F 0x8C3A
203 #define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
204 #define GL_RGB9_E5 0x8C3D
205 #define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E
206 #define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
207 #define GL_SRGB 0x8C40
208 #define GL_SRGB8 0x8C41
209 #define GL_SRGB8_ALPHA8 0x8C43
210 #define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69
211 #define GL_RGBA32UI 0x8D70
212 #define GL_RGB32UI 0x8D71
213 #define GL_RGBA16UI 0x8D76
214 #define GL_RGB16UI 0x8D77
215 #define GL_RGBA8UI 0x8D7C
216 #define GL_RGB8UI 0x8D7D
217 #define GL_RGBA32I 0x8D82
218 #define GL_RGB32I 0x8D83
219 #define GL_RGBA16I 0x8D88
220 #define GL_RGB16I 0x8D89
221 #define GL_RGBA8I 0x8D8E
222 #define GL_RGB8I 0x8D8F
223 #define GL_RED_INTEGER 0x8D94
224 #define GL_RGB_INTEGER 0x8D98
225 #define GL_RGBA_INTEGER 0x8D99
226 #define GL_SAMPLER_2D_ARRAY 0x8DC1
227 #define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4
228 #define GL_SAMPLER_CUBE_SHADOW 0x8DC5
229 #define GL_UNSIGNED_INT_VEC2 0x8DC6
230 #define GL_UNSIGNED_INT_VEC3 0x8DC7
231 #define GL_UNSIGNED_INT_VEC4 0x8DC8
232 #define GL_INT_SAMPLER_2D 0x8DCA
233 #define GL_INT_SAMPLER_3D 0x8DCB
234 #define GL_INT_SAMPLER_CUBE 0x8DCC
235 #define GL_INT_SAMPLER_2D_ARRAY 0x8DCF
236 #define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2
237 #define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3
238 #define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4
239 #define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7
240 #define GL_MAX_IMAGE_UNITS 0x8F38
241 #define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009
242 #define GL_IMAGE_2D 0x904D
243 #define GL_IMAGE_3D 0x904E
244 #define GL_IMAGE_CUBE 0x9050
245 #define GL_IMAGE_2D_ARRAY 0x9053
246 #define GL_INT_IMAGE_2D 0x9058
247 #define GL_INT_IMAGE_3D 0x9059
248 #define GL_INT_IMAGE_CUBE 0x905B
249 #define GL_INT_IMAGE_2D_ARRAY 0x905E
250 #define GL_UNSIGNED_INT_IMAGE_2D 0x9063
251 #define GL_UNSIGNED_INT_IMAGE_3D 0x9064
252 #define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066
253 #define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069
254 #define GL_COMPUTE_SHADER 0x91B9
255 #define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310
256 #define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311
257 #define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313
258 #define GL_ALL_BARRIER_BITS 0xFFFFFFFF
259 #define GL_COMPRESSED_R11_EAC 0x9270
260 #define GL_COMPRESSED_SIGNED_R11_EAC 0x9271
261 #define GL_COMPRESSED_RG11_EAC 0x9272
262 #define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273
263 #define GL_COMPRESSED_RGB8_ETC2 0x9274
264 #define GL_COMPRESSED_SRGB8_ETC2 0x9275
265 #define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276
266 #define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277
267 #define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278
268 #define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279
269
270 #undef SUPPORT_IMMEDIATE_MODE
271 #define APIENTRY
272 #define APIENTRYP *
273
274 #include "glstuff_src.h"
275
276 #endif // GLES2GSG_H
config_gles2gsg.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pandabase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.