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