blob: 0e03b556f1424dbb27a935727102ebbf2ad58813 [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
twiz@google.com0f31ca72011-03-18 17:38:11 +00002/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00003 * Copyright 2011 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
twiz@google.com0f31ca72011-03-18 17:38:11 +00007 */
8
9
epoger@google.comec3ed6a2011-07-28 14:26:00 +000010
twiz@google.com0f31ca72011-03-18 17:38:11 +000011#ifndef GrGLDefines_DEFINED
12#define GrGLDefines_DEFINED
13
14// The following constants consist of the intersection of GL constants
15// exported by GLES 1.0, GLES 2.0, and desktop GL required by the system.
16
17#define GR_GL_DEPTH_BUFFER_BIT 0x00000100
18#define GR_GL_STENCIL_BUFFER_BIT 0x00000400
19#define GR_GL_COLOR_BUFFER_BIT 0x00004000
20
21/* Boolean */
22#define GR_GL_FALSE 0
23#define GR_GL_TRUE 1
24
25/* BeginMode */
26#define GR_GL_POINTS 0x0000
27#define GR_GL_LINES 0x0001
28#define GR_GL_LINE_LOOP 0x0002
29#define GR_GL_LINE_STRIP 0x0003
30#define GR_GL_TRIANGLES 0x0004
31#define GR_GL_TRIANGLE_STRIP 0x0005
32#define GR_GL_TRIANGLE_FAN 0x0006
33
34/* AlphaFunction (not supported in ES20) */
35/* GL_NEVER */
36/* GL_LESS */
37/* GL_EQUAL */
38/* GL_LEQUAL */
39/* GL_GREATER */
40/* GL_NOTEQUAL */
41/* GL_GEQUAL */
42/* GL_ALWAYS */
43
44/* BlendingFactorDest */
45#define GR_GL_ZERO 0
46#define GR_GL_ONE 1
47#define GR_GL_SRC_COLOR 0x0300
48#define GR_GL_ONE_MINUS_SRC_COLOR 0x0301
49#define GR_GL_SRC_ALPHA 0x0302
50#define GR_GL_ONE_MINUS_SRC_ALPHA 0x0303
51#define GR_GL_DST_ALPHA 0x0304
52#define GR_GL_ONE_MINUS_DST_ALPHA 0x0305
53
54/* BlendingFactorSrc */
55/* GL_ZERO */
56/* GL_ONE */
57#define GR_GL_DST_COLOR 0x0306
58#define GR_GL_ONE_MINUS_DST_COLOR 0x0307
59#define GR_GL_SRC_ALPHA_SATURATE 0x0308
60/* GL_SRC_ALPHA */
61/* GL_ONE_MINUS_SRC_ALPHA */
62/* GL_DST_ALPHA */
63/* GL_ONE_MINUS_DST_ALPHA */
64
bsalomon@google.com271cffc2011-05-20 14:13:56 +000065/* ExtendedBlendFactors */
66#define GR_GL_SRC1_COLOR 0x88F9
67#define GR_GL_ONE_MINUS_SRC1_COLOR 0x88FA
68/* GL_SRC1_ALPHA */
69#define GR_GL_ONE_MINUS_SRC1_ALPHA 0x88FB
70
twiz@google.com0f31ca72011-03-18 17:38:11 +000071/* BlendEquationSeparate */
72#define GR_GL_FUNC_ADD 0x8006
73#define GR_GL_BLEND_EQUATION 0x8009
74#define GR_GL_BLEND_EQUATION_RGB 0x8009 /* same as BLEND_EQUATION */
75#define GR_GL_BLEND_EQUATION_ALPHA 0x883D
76
77/* BlendSubtract */
78#define GR_GL_FUNC_SUBTRACT 0x800A
79#define GR_GL_FUNC_REVERSE_SUBTRACT 0x800B
80
81/* Separate Blend Functions */
82#define GR_GL_BLEND_DST_RGB 0x80C8
83#define GR_GL_BLEND_SRC_RGB 0x80C9
84#define GR_GL_BLEND_DST_ALPHA 0x80CA
85#define GR_GL_BLEND_SRC_ALPHA 0x80CB
86#define GR_GL_CONSTANT_COLOR 0x8001
87#define GR_GL_ONE_MINUS_CONSTANT_COLOR 0x8002
88#define GR_GL_CONSTANT_ALPHA 0x8003
89#define GR_GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
90#define GR_GL_BLEND_COLOR 0x8005
91
92/* Buffer Objects */
93#define GR_GL_ARRAY_BUFFER 0x8892
94#define GR_GL_ELEMENT_ARRAY_BUFFER 0x8893
95#define GR_GL_ARRAY_BUFFER_BINDING 0x8894
96#define GR_GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
97
98#define GR_GL_STREAM_DRAW 0x88E0
99#define GR_GL_STATIC_DRAW 0x88E4
100#define GR_GL_DYNAMIC_DRAW 0x88E8
101
102#define GR_GL_BUFFER_SIZE 0x8764
103#define GR_GL_BUFFER_USAGE 0x8765
104
105#define GR_GL_CURRENT_VERTEX_ATTRIB 0x8626
106
107/* CullFaceMode */
108#define GR_GL_FRONT 0x0404
109#define GR_GL_BACK 0x0405
110#define GR_GL_FRONT_AND_BACK 0x0408
111
112/* DepthFunction */
113/* GL_NEVER */
114/* GL_LESS */
115/* GL_EQUAL */
116/* GL_LEQUAL */
117/* GL_GREATER */
118/* GL_NOTEQUAL */
119/* GL_GEQUAL */
120/* GL_ALWAYS */
121
122/* EnableCap */
123#define GR_GL_TEXTURE_2D 0x0DE1
124#define GR_GL_CULL_FACE 0x0B44
125#define GR_GL_BLEND 0x0BE2
126#define GR_GL_DITHER 0x0BD0
127#define GR_GL_STENCIL_TEST 0x0B90
128#define GR_GL_DEPTH_TEST 0x0B71
129#define GR_GL_SCISSOR_TEST 0x0C11
130#define GR_GL_POLYGON_OFFSET_FILL 0x8037
131#define GR_GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
132#define GR_GL_SAMPLE_COVERAGE 0x80A0
133
134/* ErrorCode */
135#define GR_GL_NO_ERROR 0
136#define GR_GL_INVALID_ENUM 0x0500
137#define GR_GL_INVALID_VALUE 0x0501
138#define GR_GL_INVALID_OPERATION 0x0502
139#define GR_GL_OUT_OF_MEMORY 0x0505
140#define GR_GL_CONTEXT_LOST 0x300E // TODO(gman): What value?
141
142/* FrontFaceDirection */
143#define GR_GL_CW 0x0900
144#define GR_GL_CCW 0x0901
145
146/* GetPName */
147#define GR_GL_LINE_WIDTH 0x0B21
148#define GR_GL_ALIASED_POINT_SIZE_RANGE 0x846D
149#define GR_GL_ALIASED_LINE_WIDTH_RANGE 0x846E
150#define GR_GL_CULL_FACE_MODE 0x0B45
151#define GR_GL_FRONT_FACE 0x0B46
152#define GR_GL_DEPTH_RANGE 0x0B70
153#define GR_GL_DEPTH_WRITEMASK 0x0B72
154#define GR_GL_DEPTH_CLEAR_VALUE 0x0B73
155#define GR_GL_DEPTH_FUNC 0x0B74
156#define GR_GL_STENCIL_CLEAR_VALUE 0x0B91
157#define GR_GL_STENCIL_FUNC 0x0B92
158#define GR_GL_STENCIL_FAIL 0x0B94
159#define GR_GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
160#define GR_GL_STENCIL_PASS_DEPTH_PASS 0x0B96
161#define GR_GL_STENCIL_REF 0x0B97
162#define GR_GL_STENCIL_VALUE_MASK 0x0B93
163#define GR_GL_STENCIL_WRITEMASK 0x0B98
164#define GR_GL_STENCIL_BACK_FUNC 0x8800
165#define GR_GL_STENCIL_BACK_FAIL 0x8801
166#define GR_GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
167#define GR_GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
168#define GR_GL_STENCIL_BACK_REF 0x8CA3
169#define GR_GL_STENCIL_BACK_VALUE_MASK 0x8CA4
170#define GR_GL_STENCIL_BACK_WRITEMASK 0x8CA5
171#define GR_GL_VIEWPORT 0x0BA2
172#define GR_GL_SCISSOR_BOX 0x0C10
173/* GL_SCISSOR_TEST */
174#define GR_GL_COLOR_CLEAR_VALUE 0x0C22
175#define GR_GL_COLOR_WRITEMASK 0x0C23
176#define GR_GL_UNPACK_ALIGNMENT 0x0CF5
bsalomon@google.com8ef3fd02011-11-21 15:53:13 +0000177#define GR_GL_UNPACK_FLIP_Y 0x9240
twiz@google.com0f31ca72011-03-18 17:38:11 +0000178#define GR_GL_PACK_ALIGNMENT 0x0D05
bsalomon@google.com56d11e02011-11-30 19:59:08 +0000179#define GR_GL_PACK_REVERSE_ROW_ORDER 0x93A4
twiz@google.com0f31ca72011-03-18 17:38:11 +0000180#define GR_GL_MAX_TEXTURE_SIZE 0x0D33
181#define GR_GL_MAX_VIEWPORT_DIMS 0x0D3A
182#define GR_GL_SUBPIXEL_BITS 0x0D50
183#define GR_GL_RED_BITS 0x0D52
184#define GR_GL_GREEN_BITS 0x0D53
185#define GR_GL_BLUE_BITS 0x0D54
186#define GR_GL_ALPHA_BITS 0x0D55
187#define GR_GL_DEPTH_BITS 0x0D56
188#define GR_GL_STENCIL_BITS 0x0D57
189#define GR_GL_POLYGON_OFFSET_UNITS 0x2A00
190/* GL_POLYGON_OFFSET_FILL */
191#define GR_GL_POLYGON_OFFSET_FACTOR 0x8038
192#define GR_GL_TEXTURE_BINDING_2D 0x8069
193#define GR_GL_SAMPLE_BUFFERS 0x80A8
194#define GR_GL_SAMPLES 0x80A9
195#define GR_GL_SAMPLE_COVERAGE_VALUE 0x80AA
196#define GR_GL_SAMPLE_COVERAGE_INVERT 0x80AB
bsalomon@google.comc9668ec2012-04-11 18:16:41 +0000197#define GR_GL_RENDERBUFFER_COVERAGE_SAMPLES 0x8CAB
198#define GR_GL_RENDERBUFFER_COLOR_SAMPLES 0x8E10
199#define GR_GL_MAX_MULTISAMPLE_COVERAGE_MODES 0x8E11
200#define GR_GL_MULTISAMPLE_COVERAGE_MODES 0x8E12
twiz@google.com0f31ca72011-03-18 17:38:11 +0000201
202/* GetTextureParameter */
203/* GL_TEXTURE_MAG_FILTER */
204/* GL_TEXTURE_MIN_FILTER */
205/* GL_TEXTURE_WRAP_S */
206/* GL_TEXTURE_WRAP_T */
207
208#define GR_GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
209#define GR_GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
210
211/* HintMode */
212#define GR_GL_DONT_CARE 0x1100
213#define GR_GL_FASTEST 0x1101
214#define GR_GL_NICEST 0x1102
215
216/* HintTarget */
217#define GR_GL_GENERATE_MIPMAP_HINT 0x8192
218
219/* DataType */
220#define GR_GL_BYTE 0x1400
221#define GR_GL_UNSIGNED_BYTE 0x1401
222#define GR_GL_SHORT 0x1402
223#define GR_GL_UNSIGNED_SHORT 0x1403
224#define GR_GL_INT 0x1404
225#define GR_GL_UNSIGNED_INT 0x1405
226#define GR_GL_FLOAT 0x1406
227#define GR_GL_FIXED 0x140C
228
229/* Lighting */
230#define GR_GL_LIGHTING 0x0B50
231#define GR_GL_LIGHT0 0x4000
232#define GR_GL_LIGHT1 0x4001
233#define GR_GL_LIGHT2 0x4002
234#define GR_GL_LIGHT3 0x4003
235#define GR_GL_LIGHT4 0x4004
236#define GR_GL_LIGHT5 0x4005
237#define GR_GL_LIGHT6 0x4006
238#define GR_GL_LIGHT7 0x4007
239#define GR_GL_SPOT_EXPONENT 0x1205
240#define GR_GL_SPOT_CUTOFF 0x1206
241#define GR_GL_CONSTANT_ATTENUATION 0x1207
242#define GR_GL_LINEAR_ATTENUATION 0x1208
243#define GR_GL_QUADRATIC_ATTENUATION 0x1209
244#define GR_GL_AMBIENT 0x1200
245#define GR_GL_DIFFUSE 0x1201
246#define GR_GL_SPECULAR 0x1202
247#define GR_GL_SHININESS 0x1601
248#define GR_GL_EMISSION 0x1600
249#define GR_GL_POSITION 0x1203
250#define GR_GL_SPOT_DIRECTION 0x1204
251#define GR_GL_AMBIENT_AND_DIFFUSE 0x1602
252#define GR_GL_COLOR_INDEXES 0x1603
253#define GR_GL_LIGHT_MODEL_TWO_SIDE 0x0B52
254#define GR_GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51
255#define GR_GL_LIGHT_MODEL_AMBIENT 0x0B53
256#define GR_GL_FRONT_AND_BACK 0x0408
257#define GR_GL_SHADE_MODEL 0x0B54
258#define GR_GL_FLAT 0x1D00
259#define GR_GL_SMOOTH 0x1D01
260#define GR_GL_COLOR_MATERIAL 0x0B57
261#define GR_GL_COLOR_MATERIAL_FACE 0x0B55
262#define GR_GL_COLOR_MATERIAL_PARAMETER 0x0B56
263#define GR_GL_NORMALIZE 0x0BA1
264
265/* Matrix Mode */
266#define GR_GL_MATRIX_MODE 0x0BA0
267#define GR_GL_MODELVIEW 0x1700
268#define GR_GL_PROJECTION 0x1701
269#define GR_GL_TEXTURE 0x1702
270
271/* multisample */
272#define GR_GL_MULTISAMPLE 0x809D
273
274/* Points */
275#define GR_GL_POINT_SMOOTH 0x0B10
276#define GR_GL_POINT_SIZE 0x0B11
277#define GR_GL_POINT_SIZE_GRANULARITY 0x0B13
278#define GR_GL_POINT_SIZE_RANGE 0x0B12
279
280/* Lines */
281#define GR_GL_LINE_SMOOTH 0x0B20
282#define GR_GL_LINE_STIPPLE 0x0B24
283#define GR_GL_LINE_STIPPLE_PATTERN 0x0B25
284#define GR_GL_LINE_STIPPLE_REPEAT 0x0B26
285#define GR_GL_LINE_WIDTH 0x0B21
286#define GR_GL_LINE_WIDTH_GRANULARITY 0x0B23
287#define GR_GL_LINE_WIDTH_RANGE 0x0B22
288
289/* PixelFormat */
290#define GR_GL_DEPTH_COMPONENT 0x1902
bsalomon@google.com85b505b2011-11-07 14:56:51 +0000291#define GR_GL_RED 0x1903
292#define GR_GL_GREEN 0x1904
293#define GR_GL_BLUE 0x1905
twiz@google.com0f31ca72011-03-18 17:38:11 +0000294#define GR_GL_ALPHA 0x1906
295#define GR_GL_RGB 0x1907
296#define GR_GL_RGBA 0x1908
bsalomon@google.comc312bf92011-03-21 21:10:33 +0000297#define GR_GL_BGRA 0x80E1
twiz@google.com0f31ca72011-03-18 17:38:11 +0000298#define GR_GL_LUMINANCE 0x1909
299#define GR_GL_LUMINANCE_ALPHA 0x190A
bsalomon@google.comc312bf92011-03-21 21:10:33 +0000300#define GR_GL_PALETTE8_RGBA8 0x8B96
bsalomon@google.com280e99f2012-01-05 16:17:38 +0000301#define GR_GL_ALPHA8 0x803C
twiz@google.com0f31ca72011-03-18 17:38:11 +0000302
robertphillips@google.com69950682012-04-06 18:06:10 +0000303#define GR_GL_R8 0x8229
304
twiz@google.com0f31ca72011-03-18 17:38:11 +0000305/* PixelType */
306/* GL_UNSIGNED_BYTE */
307#define GR_GL_UNSIGNED_SHORT_4_4_4_4 0x8033
308#define GR_GL_UNSIGNED_SHORT_5_5_5_1 0x8034
309#define GR_GL_UNSIGNED_SHORT_5_6_5 0x8363
310
311/* Shaders */
312#define GR_GL_FRAGMENT_SHADER 0x8B30
313#define GR_GL_VERTEX_SHADER 0x8B31
bsalomon@google.comedfe1aa2011-09-29 14:40:26 +0000314#define GR_GL_GEOMETRY_SHADER 0x8DD9
twiz@google.com0f31ca72011-03-18 17:38:11 +0000315#define GR_GL_MAX_VERTEX_ATTRIBS 0x8869
316#define GR_GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
317#define GR_GL_MAX_VARYING_VECTORS 0x8DFC
318#define GR_GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
319#define GR_GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
320#define GR_GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
321#define GR_GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
322#define GR_GL_SHADER_TYPE 0x8B4F
323#define GR_GL_DELETE_STATUS 0x8B80
324#define GR_GL_LINK_STATUS 0x8B82
325#define GR_GL_VALIDATE_STATUS 0x8B83
326#define GR_GL_ATTACHED_SHADERS 0x8B85
327#define GR_GL_ACTIVE_UNIFORMS 0x8B86
328#define GR_GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
329#define GR_GL_ACTIVE_ATTRIBUTES 0x8B89
330#define GR_GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
331#define GR_GL_SHADING_LANGUAGE_VERSION 0x8B8C
332#define GR_GL_CURRENT_PROGRAM 0x8B8D
senorblanco@chromium.orgef3913b2011-05-19 17:11:07 +0000333#define GR_GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
334#define GR_GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
twiz@google.com0f31ca72011-03-18 17:38:11 +0000335
336/* StencilFunction */
337#define GR_GL_NEVER 0x0200
338#define GR_GL_LESS 0x0201
339#define GR_GL_EQUAL 0x0202
340#define GR_GL_LEQUAL 0x0203
341#define GR_GL_GREATER 0x0204
342#define GR_GL_NOTEQUAL 0x0205
343#define GR_GL_GEQUAL 0x0206
344#define GR_GL_ALWAYS 0x0207
345
346/* StencilOp */
347/* GL_ZERO */
348#define GR_GL_KEEP 0x1E00
349#define GR_GL_REPLACE 0x1E01
350#define GR_GL_INCR 0x1E02
351#define GR_GL_DECR 0x1E03
352#define GR_GL_INVERT 0x150A
353#define GR_GL_INCR_WRAP 0x8507
354#define GR_GL_DECR_WRAP 0x8508
355
356/* StringName */
357#define GR_GL_VENDOR 0x1F00
358#define GR_GL_RENDERER 0x1F01
359#define GR_GL_VERSION 0x1F02
360#define GR_GL_EXTENSIONS 0x1F03
361
362/* Pixel Mode / Transfer */
bsalomon@google.comc6980972011-11-02 19:57:21 +0000363#define GR_GL_UNPACK_ROW_LENGTH 0x0CF2
364#define GR_GL_PACK_ROW_LENGTH 0x0D02
365
twiz@google.com0f31ca72011-03-18 17:38:11 +0000366
367/* TextureMagFilter */
368#define GR_GL_NEAREST 0x2600
369#define GR_GL_LINEAR 0x2601
370
371/* TextureMinFilter */
372/* GL_NEAREST */
373/* GL_LINEAR */
374#define GR_GL_NEAREST_MIPMAP_NEAREST 0x2700
375#define GR_GL_LINEAR_MIPMAP_NEAREST 0x2701
376#define GR_GL_NEAREST_MIPMAP_LINEAR 0x2702
377#define GR_GL_LINEAR_MIPMAP_LINEAR 0x2703
378
bsalomon@google.com07dd2bf2011-12-09 19:40:36 +0000379/* TextureUsage */
380#define GR_GL_FRAMEBUFFER_ATTACHMENT 0x93A3
381
twiz@google.com0f31ca72011-03-18 17:38:11 +0000382/* TextureParameterName */
383#define GR_GL_TEXTURE_MAG_FILTER 0x2800
384#define GR_GL_TEXTURE_MIN_FILTER 0x2801
385#define GR_GL_TEXTURE_WRAP_S 0x2802
386#define GR_GL_TEXTURE_WRAP_T 0x2803
bsalomon@google.com07dd2bf2011-12-09 19:40:36 +0000387#define GR_GL_TEXTURE_USAGE 0x93A2
twiz@google.com0f31ca72011-03-18 17:38:11 +0000388
389/* TextureTarget */
390/* GL_TEXTURE_2D */
391#define GR_GL_TEXTURE 0x1702
392#define GR_GL_TEXTURE_CUBE_MAP 0x8513
393#define GR_GL_TEXTURE_BINDING_CUBE_MAP 0x8514
394#define GR_GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
395#define GR_GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
396#define GR_GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
397#define GR_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
398#define GR_GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
399#define GR_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
400#define GR_GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
401
402/* TextureUnit */
403#define GR_GL_TEXTURE0 0x84C0
404#define GR_GL_TEXTURE1 0x84C1
405#define GR_GL_TEXTURE2 0x84C2
406#define GR_GL_TEXTURE3 0x84C3
407#define GR_GL_TEXTURE4 0x84C4
408#define GR_GL_TEXTURE5 0x84C5
409#define GR_GL_TEXTURE6 0x84C6
410#define GR_GL_TEXTURE7 0x84C7
411#define GR_GL_TEXTURE8 0x84C8
412#define GR_GL_TEXTURE9 0x84C9
413#define GR_GL_TEXTURE10 0x84CA
414#define GR_GL_TEXTURE11 0x84CB
415#define GR_GL_TEXTURE12 0x84CC
416#define GR_GL_TEXTURE13 0x84CD
417#define GR_GL_TEXTURE14 0x84CE
418#define GR_GL_TEXTURE15 0x84CF
419#define GR_GL_TEXTURE16 0x84D0
420#define GR_GL_TEXTURE17 0x84D1
421#define GR_GL_TEXTURE18 0x84D2
422#define GR_GL_TEXTURE19 0x84D3
423#define GR_GL_TEXTURE20 0x84D4
424#define GR_GL_TEXTURE21 0x84D5
425#define GR_GL_TEXTURE22 0x84D6
426#define GR_GL_TEXTURE23 0x84D7
427#define GR_GL_TEXTURE24 0x84D8
428#define GR_GL_TEXTURE25 0x84D9
429#define GR_GL_TEXTURE26 0x84DA
430#define GR_GL_TEXTURE27 0x84DB
431#define GR_GL_TEXTURE28 0x84DC
432#define GR_GL_TEXTURE29 0x84DD
433#define GR_GL_TEXTURE30 0x84DE
434#define GR_GL_TEXTURE31 0x84DF
435#define GR_GL_ACTIVE_TEXTURE 0x84E0
436#define GR_GL_MAX_TEXTURE_UNITS 0x84E2
437
438/* TextureWrapMode */
439#define GR_GL_REPEAT 0x2901
440#define GR_GL_CLAMP_TO_EDGE 0x812F
441#define GR_GL_MIRRORED_REPEAT 0x8370
442
bsalomon@google.com85b505b2011-11-07 14:56:51 +0000443/* Texture Swizzle */
444#define GR_GL_TEXTURE_SWIZZLE_R 0x8E42
445#define GR_GL_TEXTURE_SWIZZLE_G 0x8E43
446#define GR_GL_TEXTURE_SWIZZLE_B 0x8E44
447#define GR_GL_TEXTURE_SWIZZLE_A 0x8E45
448#define GR_GL_TEXTURE_SWIZZLE_RGBA 0x8E46
449
twiz@google.com0f31ca72011-03-18 17:38:11 +0000450/* Texture mapping */
bsalomon@google.com85b505b2011-11-07 14:56:51 +0000451#define GR_GL_TEXTURE_ENV 0x2300
452#define GR_GL_TEXTURE_ENV_MODE 0x2200
453#define GR_GL_TEXTURE_1D 0x0DE0
bsalomon@google.comcee661a2011-07-26 12:32:36 +0000454/* GL_TEXTURE_2D */
455/* GL_TEXTURE_WRAP_S */
456/* GL_TEXTURE_WRAP_T */
457/* GL_TEXTURE_MAG_FILTER */
458/* GL_TEXTURE_MIN_FILTER */
twiz@google.com0f31ca72011-03-18 17:38:11 +0000459#define GR_GL_TEXTURE_ENV_COLOR 0x2201
460#define GR_GL_TEXTURE_GEN_S 0x0C60
461#define GR_GL_TEXTURE_GEN_T 0x0C61
462#define GR_GL_TEXTURE_GEN_MODE 0x2500
463#define GR_GL_TEXTURE_BORDER_COLOR 0x1004
464#define GR_GL_TEXTURE_WIDTH 0x1000
465#define GR_GL_TEXTURE_HEIGHT 0x1001
466#define GR_GL_TEXTURE_BORDER 0x1005
467#define GR_GL_TEXTURE_COMPONENTS 0x1003
468#define GR_GL_TEXTURE_RED_SIZE 0x805C
469#define GR_GL_TEXTURE_GREEN_SIZE 0x805D
470#define GR_GL_TEXTURE_BLUE_SIZE 0x805E
471#define GR_GL_TEXTURE_ALPHA_SIZE 0x805F
472#define GR_GL_TEXTURE_LUMINANCE_SIZE 0x8060
473#define GR_GL_TEXTURE_INTENSITY_SIZE 0x8061
bsalomon@google.comcee661a2011-07-26 12:32:36 +0000474#define GR_GL_TEXTURE_INTERNAL_FORMAT 0x1003
475/* GL_NEAREST_MIPMAP_NEAREST */
476/* GL_NEAREST_MIPMAP_LINEAR */
477/* GL_LINEAR_MIPMAP_NEAREST */
478/* GL_LINEAR_MIPMAP_LINEAR */
twiz@google.com0f31ca72011-03-18 17:38:11 +0000479#define GR_GL_OBJECT_LINEAR 0x2401
480#define GR_GL_OBJECT_PLANE 0x2501
481#define GR_GL_EYE_LINEAR 0x2400
482#define GR_GL_EYE_PLANE 0x2502
483#define GR_GL_SPHERE_MAP 0x2402
484#define GR_GL_DECAL 0x2101
485#define GR_GL_MODULATE 0x2100
bsalomon@google.com86c92b32011-03-22 13:08:48 +0000486/* GL_NEAREST */
487/* GL_REPEAT */
twiz@google.com0f31ca72011-03-18 17:38:11 +0000488#define GR_GL_CLAMP 0x2900
489#define GR_GL_S 0x2000
490#define GR_GL_T 0x2001
491#define GR_GL_R 0x2002
492#define GR_GL_Q 0x2003
493#define GR_GL_TEXTURE_GEN_R 0x0C62
494#define GR_GL_TEXTURE_GEN_Q 0x0C63
495
496/* texture_env_combine */
497#define GR_GL_COMBINE 0x8570
498#define GR_GL_COMBINE_RGB 0x8571
499#define GR_GL_COMBINE_ALPHA 0x8572
500#define GR_GL_SOURCE0_RGB 0x8580
501#define GR_GL_SOURCE1_RGB 0x8581
502#define GR_GL_SOURCE2_RGB 0x8582
503#define GR_GL_SOURCE0_ALPHA 0x8588
504#define GR_GL_SOURCE1_ALPHA 0x8589
505#define GR_GL_SOURCE2_ALPHA 0x858A
506#define GR_GL_OPERAND0_RGB 0x8590
507#define GR_GL_OPERAND1_RGB 0x8591
508#define GR_GL_OPERAND2_RGB 0x8592
509#define GR_GL_OPERAND0_ALPHA 0x8598
510#define GR_GL_OPERAND1_ALPHA 0x8599
511#define GR_GL_OPERAND2_ALPHA 0x859A
512#define GR_GL_RGB_SCALE 0x8573
513#define GR_GL_ADD_SIGNED 0x8574
514#define GR_GL_INTERPOLATE 0x8575
515#define GR_GL_SUBTRACT 0x84E7
516#define GR_GL_CONSTANT 0x8576
517#define GR_GL_PRIMARY_COLOR 0x8577
518#define GR_GL_PREVIOUS 0x8578
519#define GR_GL_SRC0_RGB 0x8580
520#define GR_GL_SRC1_RGB 0x8581
521#define GR_GL_SRC2_RGB 0x8582
522#define GR_GL_SRC0_ALPHA 0x8588
523#define GR_GL_SRC1_ALPHA 0x8589
524#define GR_GL_SRC2_ALPHA 0x858A
525
526/* Uniform Types */
527#define GR_GL_FLOAT_VEC2 0x8B50
528#define GR_GL_FLOAT_VEC3 0x8B51
529#define GR_GL_FLOAT_VEC4 0x8B52
530#define GR_GL_INT_VEC2 0x8B53
531#define GR_GL_INT_VEC3 0x8B54
532#define GR_GL_INT_VEC4 0x8B55
533#define GR_GL_BOOL 0x8B56
534#define GR_GL_BOOL_VEC2 0x8B57
535#define GR_GL_BOOL_VEC3 0x8B58
536#define GR_GL_BOOL_VEC4 0x8B59
537#define GR_GL_FLOAT_MAT2 0x8B5A
538#define GR_GL_FLOAT_MAT3 0x8B5B
539#define GR_GL_FLOAT_MAT4 0x8B5C
540#define GR_GL_SAMPLER_2D 0x8B5E
541#define GR_GL_SAMPLER_CUBE 0x8B60
542
543/* Vertex Arrays */
544#define GR_GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
545#define GR_GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
546#define GR_GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
547#define GR_GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
548#define GR_GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
549#define GR_GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
550#define GR_GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
551#define GR_GL_VERTEX_ARRAY 0x8074
552#define GR_GL_NORMAL_ARRAY 0x8075
553#define GR_GL_COLOR_ARRAY 0x8076
554#define GR_GL_INDEX_ARRAY 0x8077
555#define GR_GL_TEXTURE_COORD_ARRAY 0x8078
556#define GR_GL_EDGE_FLAG_ARRAY 0x8079
557#define GR_GL_VERTEX_ARRAY_SIZE 0x807A
558#define GR_GL_VERTEX_ARRAY_TYPE 0x807B
559#define GR_GL_VERTEX_ARRAY_STRIDE 0x807C
560#define GR_GL_NORMAL_ARRAY_TYPE 0x807E
561#define GR_GL_NORMAL_ARRAY_STRIDE 0x807F
562#define GR_GL_COLOR_ARRAY_SIZE 0x8081
563#define GR_GL_COLOR_ARRAY_TYPE 0x8082
564#define GR_GL_COLOR_ARRAY_STRIDE 0x8083
565#define GR_GL_INDEX_ARRAY_TYPE 0x8085
566#define GR_GL_INDEX_ARRAY_STRIDE 0x8086
567#define GR_GL_TEXTURE_COORD_ARRAY_SIZE 0x8088
568#define GR_GL_TEXTURE_COORD_ARRAY_TYPE 0x8089
569#define GR_GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A
570#define GR_GL_EDGE_FLAG_ARRAY_STRIDE 0x808C
571#define GR_GL_VERTEX_ARRAY_POINTER 0x808E
572#define GR_GL_NORMAL_ARRAY_POINTER 0x808F
573#define GR_GL_COLOR_ARRAY_POINTER 0x8090
574#define GR_GL_INDEX_ARRAY_POINTER 0x8091
575#define GR_GL_TEXTURE_COORD_ARRAY_POINTER 0x8092
576#define GR_GL_EDGE_FLAG_ARRAY_POINTER 0x8093
577#define GR_GL_V2F 0x2A20
578#define GR_GL_V3F 0x2A21
579#define GR_GL_C4UB_V2F 0x2A22
580#define GR_GL_C4UB_V3F 0x2A23
581#define GR_GL_C3F_V3F 0x2A24
582#define GR_GL_N3F_V3F 0x2A25
583#define GR_GL_C4F_N3F_V3F 0x2A26
584#define GR_GL_T2F_V3F 0x2A27
585#define GR_GL_T4F_V4F 0x2A28
586#define GR_GL_T2F_C4UB_V3F 0x2A29
587#define GR_GL_T2F_C3F_V3F 0x2A2A
588#define GR_GL_T2F_N3F_V3F 0x2A2B
589#define GR_GL_T2F_C4F_N3F_V3F 0x2A2C
590#define GR_GL_T4F_C4F_N3F_V4F 0x2A2D
591
bsalomon@google.comc312bf92011-03-21 21:10:33 +0000592/* Vertex Buffer Object */
593#define GR_GL_WRITE_ONLY 0x88B9
594#define GR_GL_BUFFER_MAPPED 0x88BC
twiz@google.com0f31ca72011-03-18 17:38:11 +0000595/* Read Format */
596#define GR_GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
597#define GR_GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
598
599/* Shader Source */
600#define GR_GL_COMPILE_STATUS 0x8B81
601#define GR_GL_INFO_LOG_LENGTH 0x8B84
602#define GR_GL_SHADER_SOURCE_LENGTH 0x8B88
603#define GR_GL_SHADER_COMPILER 0x8DFA
604
605/* Shader Binary */
606#define GR_GL_SHADER_BINARY_FORMATS 0x8DF8
607#define GR_GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
608
609/* Shader Precision-Specified Types */
610#define GR_GL_LOW_FLOAT 0x8DF0
611#define GR_GL_MEDIUM_FLOAT 0x8DF1
612#define GR_GL_HIGH_FLOAT 0x8DF2
613#define GR_GL_LOW_INT 0x8DF3
614#define GR_GL_MEDIUM_INT 0x8DF4
615#define GR_GL_HIGH_INT 0x8DF5
616
bsalomon@google.com373a6632011-10-19 20:43:20 +0000617/* Queries */
618#define GR_GL_QUERY_COUNTER_BITS 0x8864
619#define GR_GL_CURRENT_QUERY 0x8865
620#define GR_GL_QUERY_RESULT 0x8866
621#define GR_GL_QUERY_RESULT_AVAILABLE 0x8867
622#define GR_GL_SAMPLES_PASSED 0x8914
623#define GR_GL_ANY_SAMPLES_PASSED 0x8C2F
624#define GR_GL_TIME_ELAPSED 0x88BF
625#define GR_GL_TIMESTAMP 0x8E28
626#define GR_GL_PRIMITIVES_GENERATED 0x8C87
627#define GR_GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88
628
629
twiz@google.com0f31ca72011-03-18 17:38:11 +0000630/* Framebuffer Object. */
631#define GR_GL_FRAMEBUFFER 0x8D40
bsalomon@google.comc312bf92011-03-21 21:10:33 +0000632#define GR_GL_READ_FRAMEBUFFER 0x8CA8
633#define GR_GL_DRAW_FRAMEBUFFER 0x8CA9
634
twiz@google.com0f31ca72011-03-18 17:38:11 +0000635#define GR_GL_RENDERBUFFER 0x8D41
636
637#define GR_GL_RGBA4 0x8056
638#define GR_GL_RGB5_A1 0x8057
639#define GR_GL_RGB565 0x8D62
bsalomon@google.comc312bf92011-03-21 21:10:33 +0000640#define GR_GL_RGBA8 0x8058
bsalomon@google.comcee661a2011-07-26 12:32:36 +0000641#define GR_GL_RGB8 0x8051
bsalomon@google.com280e99f2012-01-05 16:17:38 +0000642#define GR_GL_BGRA8 0x93A1
bsalomon@google.comcee661a2011-07-26 12:32:36 +0000643#define GR_GL_SRGB 0x8C40
644#define GR_GL_SRGB8 0x8C41
645#define GR_GL_SRGB_ALPHA 0x8C42
646#define GR_GL_SRGB8_ALPHA8 0x8C43
twiz@google.com0f31ca72011-03-18 17:38:11 +0000647#define GR_GL_DEPTH_COMPONENT16 0x81A5
648#define GR_GL_STENCIL_INDEX 0x1901
bsalomon@google.comc312bf92011-03-21 21:10:33 +0000649#define GR_GL_STENCIL_INDEX4 0x8D47
twiz@google.com0f31ca72011-03-18 17:38:11 +0000650#define GR_GL_STENCIL_INDEX8 0x8D48
bsalomon@google.comc312bf92011-03-21 21:10:33 +0000651#define GR_GL_STENCIL_INDEX16 0x8D49
652#define GR_GL_DEPTH_STENCIL 0x84F9
653#define GR_GL_DEPTH24_STENCIL8 0x88F0
654
655#define GR_GL_MAX_SAMPLES 0x8D57
twiz@google.com0f31ca72011-03-18 17:38:11 +0000656
657#define GR_GL_RENDERBUFFER_WIDTH 0x8D42
658#define GR_GL_RENDERBUFFER_HEIGHT 0x8D43
659#define GR_GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
660#define GR_GL_RENDERBUFFER_RED_SIZE 0x8D50
661#define GR_GL_RENDERBUFFER_GREEN_SIZE 0x8D51
662#define GR_GL_RENDERBUFFER_BLUE_SIZE 0x8D52
663#define GR_GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
664#define GR_GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
665#define GR_GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
666
667#define GR_GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
668#define GR_GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
669#define GR_GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
670#define GR_GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
bsalomon@google.comcee661a2011-07-26 12:32:36 +0000671#define GR_GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
672#define GR_GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212
673#define GR_GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213
674#define GR_GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214
675#define GR_GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215
676#define GR_GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216
677#define GR_GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217
twiz@google.com0f31ca72011-03-18 17:38:11 +0000678
679#define GR_GL_COLOR_ATTACHMENT0 0x8CE0
680#define GR_GL_DEPTH_ATTACHMENT 0x8D00
681#define GR_GL_STENCIL_ATTACHMENT 0x8D20
twiz@google.com0f31ca72011-03-18 17:38:11 +0000682
683#define GR_GL_NONE 0
684
685#define GR_GL_FRAMEBUFFER_COMPLETE 0x8CD5
686#define GR_GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
687#define GR_GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
688#define GR_GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
689#define GR_GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
690
691#define GR_GL_FRAMEBUFFER_BINDING 0x8CA6
692#define GR_GL_RENDERBUFFER_BINDING 0x8CA7
693#define GR_GL_MAX_RENDERBUFFER_SIZE 0x84E8
694
695#define GR_GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
696
reed@google.coma03ec862011-03-22 17:49:13 +0000697#endif