1 /*
2  * This document is licensed under the SGI Free Software B License Version
3  * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
4  */
5 
6 #ifndef __glsl_defines_h
7 #define __glsl_defines_h
8 
9 /* OpenGL ES core versions */
10 #define GL_ES_VERSION_2_0                 1
11 
12 /* ClearBufferMask */
13 #define GL_DEPTH_BUFFER_BIT               0x00000100
14 #define GL_STENCIL_BUFFER_BIT             0x00000400
15 #define GL_COLOR_BUFFER_BIT               0x00004000
16 
17 /* Boolean */
18 #define GL_FALSE                          0
19 #define GL_TRUE                           1
20 
21 /* BeginMode */
22 #define GL_POINTS                         0x0000
23 #define GL_LINES                          0x0001
24 #define GL_LINE_LOOP                      0x0002
25 #define GL_LINE_STRIP                     0x0003
26 #define GL_TRIANGLES                      0x0004
27 #define GL_TRIANGLE_STRIP                 0x0005
28 #define GL_TRIANGLE_FAN                   0x0006
29 
30 /* AlphaFunction (not supported in ES20) */
31 /*      GL_NEVER */
32 /*      GL_LESS */
33 /*      GL_EQUAL */
34 /*      GL_LEQUAL */
35 /*      GL_GREATER */
36 /*      GL_NOTEQUAL */
37 /*      GL_GEQUAL */
38 /*      GL_ALWAYS */
39 
40 /* BlendingFactorDest */
41 #define GL_ZERO                           0
42 #define GL_ONE                            1
43 #define GL_SRC_COLOR                      0x0300
44 #define GL_ONE_MINUS_SRC_COLOR            0x0301
45 #define GL_SRC_ALPHA                      0x0302
46 #define GL_ONE_MINUS_SRC_ALPHA            0x0303
47 #define GL_DST_ALPHA                      0x0304
48 #define GL_ONE_MINUS_DST_ALPHA            0x0305
49 
50 /* BlendingFactorSrc */
51 /*      GL_ZERO */
52 /*      GL_ONE */
53 #define GL_DST_COLOR                      0x0306
54 #define GL_ONE_MINUS_DST_COLOR            0x0307
55 #define GL_SRC_ALPHA_SATURATE             0x0308
56 /*      GL_SRC_ALPHA */
57 /*      GL_ONE_MINUS_SRC_ALPHA */
58 /*      GL_DST_ALPHA */
59 /*      GL_ONE_MINUS_DST_ALPHA */
60 
61 /* BlendEquationSeparate */
62 #define GL_FUNC_ADD                       0x8006
63 #define GL_BLEND_EQUATION                 0x8009
64 #define GL_BLEND_EQUATION_RGB             0x8009    /* same as BLEND_EQUATION */
65 #define GL_BLEND_EQUATION_ALPHA           0x883D
66 
67 /* BlendSubtract */
68 #define GL_FUNC_SUBTRACT                  0x800A
69 #define GL_FUNC_REVERSE_SUBTRACT          0x800B
70 
71 /* Separate Blend Functions */
72 #define GL_BLEND_DST_RGB                  0x80C8
73 #define GL_BLEND_SRC_RGB                  0x80C9
74 #define GL_BLEND_DST_ALPHA                0x80CA
75 #define GL_BLEND_SRC_ALPHA                0x80CB
76 #define GL_CONSTANT_COLOR                 0x8001
77 #define GL_ONE_MINUS_CONSTANT_COLOR       0x8002
78 #define GL_CONSTANT_ALPHA                 0x8003
79 #define GL_ONE_MINUS_CONSTANT_ALPHA       0x8004
80 #define GL_BLEND_COLOR                    0x8005
81 
82 /* Buffer Objects */
83 #define GL_ARRAY_BUFFER                   0x8892
84 #define GL_ELEMENT_ARRAY_BUFFER           0x8893
85 #define GL_ARRAY_BUFFER_BINDING           0x8894
86 #define GL_ELEMENT_ARRAY_BUFFER_BINDING   0x8895
87 
88 #define GL_STREAM_DRAW                    0x88E0
89 #define GL_STATIC_DRAW                    0x88E4
90 #define GL_DYNAMIC_DRAW                   0x88E8
91 
92 #define GL_BUFFER_SIZE                    0x8764
93 #define GL_BUFFER_USAGE                   0x8765
94 
95 #define GL_CURRENT_VERTEX_ATTRIB          0x8626
96 
97 /* CullFaceMode */
98 #define GL_FRONT                          0x0404
99 #define GL_BACK                           0x0405
100 #define GL_FRONT_AND_BACK                 0x0408
101 
102 /* DepthFunction */
103 /*      GL_NEVER */
104 /*      GL_LESS */
105 /*      GL_EQUAL */
106 /*      GL_LEQUAL */
107 /*      GL_GREATER */
108 /*      GL_NOTEQUAL */
109 /*      GL_GEQUAL */
110 /*      GL_ALWAYS */
111 
112 /* EnableCap */
113 #define GL_TEXTURE_2D                     0x0DE1
114 #define GL_CULL_FACE                      0x0B44
115 #define GL_BLEND                          0x0BE2
116 #define GL_DITHER                         0x0BD0
117 #define GL_STENCIL_TEST                   0x0B90
118 #define GL_DEPTH_TEST                     0x0B71
119 #define GL_SCISSOR_TEST                   0x0C11
120 #define GL_POLYGON_OFFSET_FILL            0x8037
121 #define GL_SAMPLE_ALPHA_TO_COVERAGE       0x809E
122 #define GL_SAMPLE_COVERAGE                0x80A0
123 
124 /* ErrorCode */
125 #define GL_NO_ERROR                       0
126 #define GL_INVALID_ENUM                   0x0500
127 #define GL_INVALID_VALUE                  0x0501
128 #define GL_INVALID_OPERATION              0x0502
129 #define GL_OUT_OF_MEMORY                  0x0505
130 
131 /* FrontFaceDirection */
132 #define GL_CW                             0x0900
133 #define GL_CCW                            0x0901
134 
135 /* GetPName */
136 #define GL_LINE_WIDTH                     0x0B21
137 #define GL_ALIASED_POINT_SIZE_RANGE       0x846D
138 #define GL_ALIASED_LINE_WIDTH_RANGE       0x846E
139 #define GL_CULL_FACE_MODE                 0x0B45
140 #define GL_FRONT_FACE                     0x0B46
141 #define GL_DEPTH_RANGE                    0x0B70
142 #define GL_DEPTH_WRITEMASK                0x0B72
143 #define GL_DEPTH_CLEAR_VALUE              0x0B73
144 #define GL_DEPTH_FUNC                     0x0B74
145 #define GL_STENCIL_CLEAR_VALUE            0x0B91
146 #define GL_STENCIL_FUNC                   0x0B92
147 #define GL_STENCIL_FAIL                   0x0B94
148 #define GL_STENCIL_PASS_DEPTH_FAIL        0x0B95
149 #define GL_STENCIL_PASS_DEPTH_PASS        0x0B96
150 #define GL_STENCIL_REF                    0x0B97
151 #define GL_STENCIL_VALUE_MASK             0x0B93
152 #define GL_STENCIL_WRITEMASK              0x0B98
153 #define GL_STENCIL_BACK_FUNC              0x8800
154 #define GL_STENCIL_BACK_FAIL              0x8801
155 #define GL_STENCIL_BACK_PASS_DEPTH_FAIL   0x8802
156 #define GL_STENCIL_BACK_PASS_DEPTH_PASS   0x8803
157 #define GL_STENCIL_BACK_REF               0x8CA3
158 #define GL_STENCIL_BACK_VALUE_MASK        0x8CA4
159 #define GL_STENCIL_BACK_WRITEMASK         0x8CA5
160 #define GL_VIEWPORT                       0x0BA2
161 #define GL_SCISSOR_BOX                    0x0C10
162 /*      GL_SCISSOR_TEST */
163 #define GL_COLOR_CLEAR_VALUE              0x0C22
164 #define GL_COLOR_WRITEMASK                0x0C23
165 #define GL_UNPACK_ALIGNMENT               0x0CF5
166 #define GL_PACK_ALIGNMENT                 0x0D05
167 #define GL_MAX_TEXTURE_SIZE               0x0D33
168 #define GL_MAX_VIEWPORT_DIMS              0x0D3A
169 #define GL_SUBPIXEL_BITS                  0x0D50
170 #define GL_RED_BITS                       0x0D52
171 #define GL_GREEN_BITS                     0x0D53
172 #define GL_BLUE_BITS                      0x0D54
173 #define GL_ALPHA_BITS                     0x0D55
174 #define GL_DEPTH_BITS                     0x0D56
175 #define GL_STENCIL_BITS                   0x0D57
176 #define GL_POLYGON_OFFSET_UNITS           0x2A00
177 /*      GL_POLYGON_OFFSET_FILL */
178 #define GL_POLYGON_OFFSET_FACTOR          0x8038
179 #define GL_TEXTURE_BINDING_2D             0x8069
180 #define GL_SAMPLE_BUFFERS                 0x80A8
181 #define GL_SAMPLES                        0x80A9
182 #define GL_SAMPLE_COVERAGE_VALUE          0x80AA
183 #define GL_SAMPLE_COVERAGE_INVERT         0x80AB
184 
185 /* GetTextureParameter */
186 /*      GL_TEXTURE_MAG_FILTER */
187 /*      GL_TEXTURE_MIN_FILTER */
188 /*      GL_TEXTURE_WRAP_S */
189 /*      GL_TEXTURE_WRAP_T */
190 
191 #define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
192 #define GL_COMPRESSED_TEXTURE_FORMATS     0x86A3
193 
194 /* HintMode */
195 #define GL_DONT_CARE                      0x1100
196 #define GL_FASTEST                        0x1101
197 #define GL_NICEST                         0x1102
198 
199 /* HintTarget */
200 #define GL_GENERATE_MIPMAP_HINT            0x8192
201 
202 /* DataType */
203 #define GL_BYTE                           0x1400
204 #define GL_UNSIGNED_BYTE                  0x1401
205 #define GL_SHORT                          0x1402
206 #define GL_UNSIGNED_SHORT                 0x1403
207 #define GL_INT                            0x1404
208 #define GL_UNSIGNED_INT                   0x1405
209 #define GL_FLOAT                          0x1406
210 #define GL_FIXED                          0x140C
211 
212 /* PixelFormat */
213 #define GL_DEPTH_COMPONENT                0x1902
214 #define GL_ALPHA                          0x1906
215 #define GL_RGB                            0x1907
216 #define GL_RGBA                           0x1908
217 #define GL_LUMINANCE                      0x1909
218 #define GL_LUMINANCE_ALPHA                0x190A
219 
220 /* PixelType */
221 /*      GL_UNSIGNED_BYTE */
222 #define GL_UNSIGNED_SHORT_4_4_4_4         0x8033
223 #define GL_UNSIGNED_SHORT_5_5_5_1         0x8034
224 #define GL_UNSIGNED_SHORT_5_6_5           0x8363
225 
226 /* Shaders */
227 #define GL_FRAGMENT_SHADER                  0x8B30
228 #define GL_VERTEX_SHADER                    0x8B31
229 #define GL_MAX_VERTEX_ATTRIBS               0x8869
230 #define GL_MAX_VERTEX_UNIFORM_VECTORS       0x8DFB
231 #define GL_MAX_VARYING_VECTORS              0x8DFC
232 #define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
233 #define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS   0x8B4C
234 #define GL_MAX_TEXTURE_IMAGE_UNITS          0x8872
235 #define GL_MAX_FRAGMENT_UNIFORM_VECTORS     0x8DFD
236 #define GL_SHADER_TYPE                      0x8B4F
237 #define GL_DELETE_STATUS                    0x8B80
238 #define GL_LINK_STATUS                      0x8B82
239 #define GL_VALIDATE_STATUS                  0x8B83
240 #define GL_ATTACHED_SHADERS                 0x8B85
241 #define GL_ACTIVE_UNIFORMS                  0x8B86
242 #define GL_ACTIVE_UNIFORM_MAX_LENGTH        0x8B87
243 #define GL_ACTIVE_ATTRIBUTES                0x8B89
244 #define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH      0x8B8A
245 #define GL_SHADING_LANGUAGE_VERSION         0x8B8C
246 #define GL_CURRENT_PROGRAM                  0x8B8D
247 
248 /* StencilFunction */
249 #define GL_NEVER                          0x0200
250 #define GL_LESS                           0x0201
251 #define GL_EQUAL                          0x0202
252 #define GL_LEQUAL                         0x0203
253 #define GL_GREATER                        0x0204
254 #define GL_NOTEQUAL                       0x0205
255 #define GL_GEQUAL                         0x0206
256 #define GL_ALWAYS                         0x0207
257 
258 /* StencilOp */
259 /*      GL_ZERO */
260 #define GL_KEEP                           0x1E00
261 #define GL_REPLACE                        0x1E01
262 #define GL_INCR                           0x1E02
263 #define GL_DECR                           0x1E03
264 #define GL_INVERT                         0x150A
265 #define GL_INCR_WRAP                      0x8507
266 #define GL_DECR_WRAP                      0x8508
267 
268 /* StringName */
269 #define GL_VENDOR                         0x1F00
270 #define GL_RENDERER                       0x1F01
271 #define GL_VERSION                        0x1F02
272 #define GL_EXTENSIONS                     0x1F03
273 
274 /* TextureMagFilter */
275 #define GL_NEAREST                        0x2600
276 #define GL_LINEAR                         0x2601
277 
278 /* TextureMinFilter */
279 /*      GL_NEAREST */
280 /*      GL_LINEAR */
281 #define GL_NEAREST_MIPMAP_NEAREST         0x2700
282 #define GL_LINEAR_MIPMAP_NEAREST          0x2701
283 #define GL_NEAREST_MIPMAP_LINEAR          0x2702
284 #define GL_LINEAR_MIPMAP_LINEAR           0x2703
285 
286 /* TextureParameterName */
287 #define GL_TEXTURE_MAG_FILTER             0x2800
288 #define GL_TEXTURE_MIN_FILTER             0x2801
289 #define GL_TEXTURE_WRAP_S                 0x2802
290 #define GL_TEXTURE_WRAP_T                 0x2803
291 
292 /* TextureTarget */
293 /*      GL_TEXTURE_2D */
294 #define GL_TEXTURE                        0x1702
295 
296 #define GL_TEXTURE_CUBE_MAP               0x8513
297 #define GL_TEXTURE_BINDING_CUBE_MAP       0x8514
298 #define GL_TEXTURE_CUBE_MAP_POSITIVE_X    0x8515
299 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_X    0x8516
300 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Y    0x8517
301 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y    0x8518
302 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Z    0x8519
303 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z    0x851A
304 #define GL_MAX_CUBE_MAP_TEXTURE_SIZE      0x851C
305 
306 /* TextureUnit */
307 #define GL_TEXTURE0                       0x84C0
308 #define GL_TEXTURE1                       0x84C1
309 #define GL_TEXTURE2                       0x84C2
310 #define GL_TEXTURE3                       0x84C3
311 #define GL_TEXTURE4                       0x84C4
312 #define GL_TEXTURE5                       0x84C5
313 #define GL_TEXTURE6                       0x84C6
314 #define GL_TEXTURE7                       0x84C7
315 #define GL_TEXTURE8                       0x84C8
316 #define GL_TEXTURE9                       0x84C9
317 #define GL_TEXTURE10                      0x84CA
318 #define GL_TEXTURE11                      0x84CB
319 #define GL_TEXTURE12                      0x84CC
320 #define GL_TEXTURE13                      0x84CD
321 #define GL_TEXTURE14                      0x84CE
322 #define GL_TEXTURE15                      0x84CF
323 #define GL_TEXTURE16                      0x84D0
324 #define GL_TEXTURE17                      0x84D1
325 #define GL_TEXTURE18                      0x84D2
326 #define GL_TEXTURE19                      0x84D3
327 #define GL_TEXTURE20                      0x84D4
328 #define GL_TEXTURE21                      0x84D5
329 #define GL_TEXTURE22                      0x84D6
330 #define GL_TEXTURE23                      0x84D7
331 #define GL_TEXTURE24                      0x84D8
332 #define GL_TEXTURE25                      0x84D9
333 #define GL_TEXTURE26                      0x84DA
334 #define GL_TEXTURE27                      0x84DB
335 #define GL_TEXTURE28                      0x84DC
336 #define GL_TEXTURE29                      0x84DD
337 #define GL_TEXTURE30                      0x84DE
338 #define GL_TEXTURE31                      0x84DF
339 #define GL_ACTIVE_TEXTURE                 0x84E0
340 
341 /* TextureWrapMode */
342 #define GL_REPEAT                         0x2901
343 #define GL_CLAMP_TO_EDGE                  0x812F
344 #define GL_MIRRORED_REPEAT                0x8370
345 
346 /* Uniform Types */
347 #define GL_FLOAT_VEC2                     0x8B50
348 #define GL_FLOAT_VEC3                     0x8B51
349 #define GL_FLOAT_VEC4                     0x8B52
350 #define GL_INT_VEC2                       0x8B53
351 #define GL_INT_VEC3                       0x8B54
352 #define GL_INT_VEC4                       0x8B55
353 #define GL_BOOL                           0x8B56
354 #define GL_BOOL_VEC2                      0x8B57
355 #define GL_BOOL_VEC3                      0x8B58
356 #define GL_BOOL_VEC4                      0x8B59
357 #define GL_FLOAT_MAT2                     0x8B5A
358 #define GL_FLOAT_MAT3                     0x8B5B
359 #define GL_FLOAT_MAT4                     0x8B5C
360 #define GL_SAMPLER_2D                     0x8B5E
361 #define GL_SAMPLER_CUBE                   0x8B60
362 
363 /* Vertex Arrays */
364 #define GL_VERTEX_ATTRIB_ARRAY_ENABLED        0x8622
365 #define GL_VERTEX_ATTRIB_ARRAY_SIZE           0x8623
366 #define GL_VERTEX_ATTRIB_ARRAY_STRIDE         0x8624
367 #define GL_VERTEX_ATTRIB_ARRAY_TYPE           0x8625
368 #define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED     0x886A
369 #define GL_VERTEX_ATTRIB_ARRAY_POINTER        0x8645
370 #define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
371 
372 /* Read Format */
373 #define GL_IMPLEMENTATION_COLOR_READ_TYPE   0x8B9A
374 #define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
375 
376 /* Shader Source */
377 #define GL_COMPILE_STATUS                 0x8B81
378 #define GL_INFO_LOG_LENGTH                0x8B84
379 #define GL_SHADER_SOURCE_LENGTH           0x8B88
380 #define GL_SHADER_COMPILER                0x8DFA
381 
382 /* Shader Binary */
383 #define GL_SHADER_BINARY_FORMATS          0x8DF8
384 #define GL_NUM_SHADER_BINARY_FORMATS      0x8DF9
385 
386 /* Shader Precision-Specified Types */
387 #define GL_LOW_FLOAT                      0x8DF0
388 #define GL_MEDIUM_FLOAT                   0x8DF1
389 #define GL_HIGH_FLOAT                     0x8DF2
390 #define GL_LOW_INT                        0x8DF3
391 #define GL_MEDIUM_INT                     0x8DF4
392 #define GL_HIGH_INT                       0x8DF5
393 
394 /* Framebuffer Object. */
395 #define GL_FRAMEBUFFER                    0x8D40
396 #define GL_RENDERBUFFER                   0x8D41
397 
398 #define GL_RGBA4                          0x8056
399 #define GL_RGB5_A1                        0x8057
400 #define GL_RGB565                         0x8D62
401 #define GL_DEPTH_COMPONENT16              0x81A5
402 #define GL_STENCIL_INDEX                  0x1901
403 #define GL_STENCIL_INDEX8                 0x8D48
404 
405 #define GL_RENDERBUFFER_WIDTH             0x8D42
406 #define GL_RENDERBUFFER_HEIGHT            0x8D43
407 #define GL_RENDERBUFFER_INTERNAL_FORMAT   0x8D44
408 #define GL_RENDERBUFFER_RED_SIZE          0x8D50
409 #define GL_RENDERBUFFER_GREEN_SIZE        0x8D51
410 #define GL_RENDERBUFFER_BLUE_SIZE         0x8D52
411 #define GL_RENDERBUFFER_ALPHA_SIZE        0x8D53
412 #define GL_RENDERBUFFER_DEPTH_SIZE        0x8D54
413 #define GL_RENDERBUFFER_STENCIL_SIZE      0x8D55
414 
415 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE           0x8CD0
416 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME           0x8CD1
417 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL         0x8CD2
418 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
419 
420 #define GL_COLOR_ATTACHMENT0              0x8CE0
421 #define GL_DEPTH_ATTACHMENT               0x8D00
422 #define GL_STENCIL_ATTACHMENT             0x8D20
423 
424 #define GL_NONE                           0
425 
426 #define GL_FRAMEBUFFER_COMPLETE                      0x8CD5
427 #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT         0x8CD6
428 #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
429 #define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS         0x8CD9
430 #define GL_FRAMEBUFFER_UNSUPPORTED                   0x8CDD
431 
432 #define GL_FRAMEBUFFER_BINDING            0x8CA6
433 #define GL_RENDERBUFFER_BINDING           0x8CA7
434 #define GL_MAX_RENDERBUFFER_SIZE          0x84E8
435 
436 #define GL_INVALID_FRAMEBUFFER_OPERATION  0x0506
437 
438 #endif//__glsl_defines_h
439