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 GL_SRGB_EXT
104 #define GL_SRGB_ALPHA GL_SRGB_ALPHA_EXT
105 #define GL_SRGB8_ALPHA8 GL_SRGB8_ALPHA8_EXT
106 #define GL_RGBA8 GL_RGBA8_OES
107 #define GL_R8 GL_R8_EXT
108 #define GL_RG8 GL_RG8_EXT
109 #define GL_ALPHA8 GL_ALPHA8_OES
110 #define GL_LUMINANCE8 GL_LUMINANCE8_OES
111 #define GL_LUMINANCE8_ALPHA8 GL_LUMINANCE8_ALPHA8_EXT
112 #define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_EXT
113 #define GL_R32F GL_R32F_EXT
114 #define GL_RG32F GL_RG32F_EXT
115 #define GL_RGB8 GL_RGB8_OES
116 #define GL_TEXTURE_COMPARE_FUNC_ARB GL_TEXTURE_COMPARE_FUNC_EXT
117 #define GL_TEXTURE_COMPARE_MODE_ARB GL_TEXTURE_COMPARE_MODE_EXT
118 #define GL_COMPARE_R_TO_TEXTURE_ARB GL_COMPARE_REF_TO_TEXTURE_EXT
119 #define GL_SAMPLER_2D_SHADOW GL_SAMPLER_2D_SHADOW_EXT
120 #define GL_MAX_DRAW_BUFFERS GL_MAX_DRAW_BUFFERS_NV
121 #define GL_SRC1_COLOR GL_SRC1_COLOR_EXT
122 #define GL_ONE_MINUS_SRC1_COLOR GL_ONE_MINUS_SRC1_COLOR_EXT
123 #define GL_SRC1_ALPHA GL_SRC1_ALPHA_EXT
124 #define GL_ONE_MINUS_SRC1_ALPHA GL_ONE_MINUS_SRC1_ALPHA_EXT
125 
126 #define GL_DEBUG_OUTPUT_SYNCHRONOUS GL_DEBUG_OUTPUT_SYNCHRONOUS_KHR
127 #define GL_DEBUG_TYPE_PERFORMANCE GL_DEBUG_TYPE_PERFORMANCE_KHR
128 #define GL_DEBUG_SEVERITY_HIGH GL_DEBUG_SEVERITY_HIGH_KHR
129 #define GL_DEBUG_SEVERITY_MEDIUM GL_DEBUG_SEVERITY_MEDIUM_KHR
130 #define GL_DEBUG_SEVERITY_LOW GL_DEBUG_SEVERITY_LOW_KHR
131 #define GL_DEBUG_SEVERITY_NOTIFICATION GL_DEBUG_SEVERITY_NOTIFICATION_KHR
132 #define GL_BUFFER GL_BUFFER_KHR
133 #define GL_SHADER GL_SHADER_KHR
134 #define GL_PROGRAM GL_PROGRAM_KHR
135 #define GL_DEBUG_OUTPUT GL_DEBUG_OUTPUT_KHR
136 
137 // For GLES 3 compat - need a better solution for this
138 #define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x1
139 #define GL_ELEMENT_ARRAY_BARRIER_BIT 0x2
140 #define GL_UNIFORM_BARRIER_BIT 0x4
141 #define GL_TEXTURE_FETCH_BARRIER_BIT 0x8
142 #define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x20
143 #define GL_COMMAND_BARRIER_BIT 0x40
144 #define GL_PIXEL_BUFFER_BARRIER_BIT 0x80
145 #define GL_TEXTURE_UPDATE_BARRIER_BIT 0x100
146 #define GL_BUFFER_UPDATE_BARRIER_BIT 0x200
147 #define GL_FRAMEBUFFER_BARRIER_BIT 0x400
148 #define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x800
149 #define GL_ATOMIC_COUNTER_BARRIER_BIT 0x1000
150 #define GL_HALF_FLOAT 0x140B
151 #define GL_COLOR 0x1800
152 #define GL_DEPTH 0x1801
153 #define GL_STENCIL 0x1802
154 #define GL_RGB10_A2 0x8059
155 #define GL_TEXTURE_WRAP_R 0x8072
156 #define GL_TEXTURE_MIN_LOD 0x813A
157 #define GL_TEXTURE_MAX_LOD 0x813B
158 #define GL_TEXTURE_MAX_LEVEL 0x813D
159 #define GL_NUM_EXTENSIONS 0x821D
160 #define GL_RG_INTEGER 0x8228
161 #define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257
162 #define GL_PROGRAM_BINARY_LENGTH 0x8741
163 #define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE
164 #define GL_PROGRAM_BINARY_FORMATS 0x87FF
165 #define GL_READ_ONLY 0x88B8
166 #define GL_WRITE_ONLY 0x88B9
167 #define GL_READ_WRITE 0x88BA
168 #define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF
169 #define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35
170 #define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36
171 #define GL_UNIFORM_TYPE 0x8A37
172 #define GL_UNIFORM_SIZE 0x8A38
173 #define GL_UNIFORM_NAME_LENGTH 0x8A39
174 #define GL_UNIFORM_BLOCK_INDEX 0x8A3A
175 #define GL_UNIFORM_OFFSET 0x8A3B
176 #define GL_UNIFORM_ARRAY_STRIDE 0x8A3C
177 #define GL_UNIFORM_MATRIX_STRIDE 0x8A3D
178 #define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E
179 #define GL_UNIFORM_BLOCK_BINDING 0x8A3F
180 #define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40
181 #define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41
182 #define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42
183 #define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43
184 #define GL_FLOAT_MAT2x3 0x8B65
185 #define GL_FLOAT_MAT2x4 0x8B66
186 #define GL_FLOAT_MAT3x2 0x8B67
187 #define GL_FLOAT_MAT3x4 0x8B68
188 #define GL_FLOAT_MAT4x2 0x8B69
189 #define GL_FLOAT_MAT4x3 0x8B6A
190 #define GL_TEXTURE_2D_ARRAY 0x8C1A
191 #define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D
192 #define GL_R11F_G11F_B10F 0x8C3A
193 #define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
194 #define GL_RGB9_E5 0x8C3D
195 #define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E
196 #define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
197 #define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69
198 #define GL_RED_INTEGER 0x8D94
199 #define GL_RGB_INTEGER 0x8D98
200 #define GL_RGBA_INTEGER 0x8D99
201 #define GL_SAMPLER_2D_ARRAY 0x8DC1
202 #define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4
203 #define GL_SAMPLER_CUBE_SHADOW 0x8DC5
204 #define GL_UNSIGNED_INT_VEC2 0x8DC6
205 #define GL_UNSIGNED_INT_VEC3 0x8DC7
206 #define GL_UNSIGNED_INT_VEC4 0x8DC8
207 #define GL_INT_SAMPLER_2D 0x8DCA
208 #define GL_INT_SAMPLER_3D 0x8DCB
209 #define GL_INT_SAMPLER_CUBE 0x8DCC
210 #define GL_INT_SAMPLER_2D_ARRAY 0x8DCF
211 #define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2
212 #define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3
213 #define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4
214 #define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7
215 #define GL_MAX_IMAGE_UNITS 0x8F38
216 #define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009
217 #define GL_IMAGE_2D 0x904D
218 #define GL_IMAGE_3D 0x904E
219 #define GL_IMAGE_CUBE 0x9050
220 #define GL_IMAGE_2D_ARRAY 0x9053
221 #define GL_INT_IMAGE_2D 0x9058
222 #define GL_INT_IMAGE_3D 0x9059
223 #define GL_INT_IMAGE_CUBE 0x905B
224 #define GL_INT_IMAGE_2D_ARRAY 0x905E
225 #define GL_UNSIGNED_INT_IMAGE_2D 0x9063
226 #define GL_UNSIGNED_INT_IMAGE_3D 0x9064
227 #define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066
228 #define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069
229 #define GL_COMPUTE_SHADER 0x91B9
230 #define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310
231 #define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311
232 #define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313
233 #define GL_ALL_BARRIER_BITS 0xFFFFFFFF
234 #define GL_COMPRESSED_R11_EAC 0x9270
235 #define GL_COMPRESSED_SIGNED_R11_EAC 0x9271
236 #define GL_COMPRESSED_RG11_EAC 0x9272
237 #define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273
238 #define GL_COMPRESSED_RGB8_ETC2 0x9274
239 #define GL_COMPRESSED_SRGB8_ETC2 0x9275
240 #define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276
241 #define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277
242 #define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278
243 #define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279
244 
245 #undef SUPPORT_IMMEDIATE_MODE
246 #define APIENTRY
247 #define APIENTRYP *
248 
249 #include "glstuff_src.h"
250 
251 #endif // GLES2GSG_H
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.