@luma.gl/constants 9.0.0-alpha.8 → 9.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,51 +1,81 @@
1
1
  /* eslint-disable key-spacing, max-len, no-inline-comments, camelcase */
2
2
 
3
3
  /**
4
- * Standard WebGL and WebGL2 constants
5
- * These constants are also defined on the WebGLRenderingContext interface.
4
+ * Standard WebGL, WebGL2 and extension constants (OpenGL constants)
5
+ * @note (Most) of these constants are also defined on the WebGLRenderingContext interface.
6
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants
7
+ * @privateRemarks Locally called `GLEnum` instead of `GL`, because `babel-plugin-inline-webl-constants`
8
+ * both depends on and processes this module, but shouldn't replace these declarations.
6
9
  */
7
- export enum GL {
10
+ enum GLEnum {
8
11
  // Clearing buffers
9
12
  // Constants passed to clear() to clear buffer masks.
10
13
 
14
+ /** Passed to clear to clear the current depth buffer. */
11
15
  DEPTH_BUFFER_BIT = 0x00000100,
16
+ /** Passed to clear to clear the current stencil buffer. */
12
17
  STENCIL_BUFFER_BIT = 0x00000400,
18
+ /** Passed to clear to clear the current color buffer. */
13
19
  COLOR_BUFFER_BIT = 0x00004000,
14
20
 
15
21
  // Rendering primitives
16
22
  // Constants passed to drawElements() or drawArrays() to specify what kind of primitive to render.
17
23
 
24
+ /** Passed to drawElements or drawArrays to draw single points. */
18
25
  POINTS = 0x0000,
26
+ /** Passed to drawElements or drawArrays to draw lines. Each vertex connects to the one after it. */
19
27
  LINES = 0x0001,
28
+ /** Passed to drawElements or drawArrays to draw lines. Each set of two vertices is treated as a separate line segment. */
20
29
  LINE_LOOP = 0x0002,
30
+ /** Passed to drawElements or drawArrays to draw a connected group of line segments from the first vertex to the last. */
21
31
  LINE_STRIP = 0x0003,
32
+ /** Passed to drawElements or drawArrays to draw triangles. Each set of three vertices creates a separate triangle. */
22
33
  TRIANGLES = 0x0004,
34
+ /** Passed to drawElements or drawArrays to draw a connected group of triangles. */
23
35
  TRIANGLE_STRIP = 0x0005,
36
+ /** Passed to drawElements or drawArrays to draw a connected group of triangles. Each vertex connects to the previous and the first vertex in the fan. */
24
37
  TRIANGLE_FAN = 0x0006,
25
38
 
26
39
  // Blending modes
27
40
  // Constants passed to blendFunc() or blendFuncSeparate() to specify the blending mode (for both, RBG and alpha, or separately).
28
-
41
+ /** Passed to blendFunc or blendFuncSeparate to turn off a component. */
29
42
  ZERO = 0,
43
+ /** Passed to blendFunc or blendFuncSeparate to turn on a component. */
30
44
  ONE = 1,
45
+ /** Passed to blendFunc or blendFuncSeparate to multiply a component by the source elements color. */
31
46
  SRC_COLOR = 0x0300,
47
+ /** Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source elements color. */
32
48
  ONE_MINUS_SRC_COLOR = 0x0301,
49
+ /** Passed to blendFunc or blendFuncSeparate to multiply a component by the source's alpha. */
33
50
  SRC_ALPHA = 0x0302,
51
+ /** Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source's alpha. */
34
52
  ONE_MINUS_SRC_ALPHA = 0x0303,
53
+ /** Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's alpha. */
35
54
  DST_ALPHA = 0x0304,
55
+ /** Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's alpha. */
36
56
  ONE_MINUS_DST_ALPHA = 0x0305,
57
+ /** Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's color. */
37
58
  DST_COLOR = 0x0306,
59
+ /** Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's color. */
38
60
  ONE_MINUS_DST_COLOR = 0x0307,
61
+ /** Passed to blendFunc or blendFuncSeparate to multiply a component by the minimum of source's alpha or one minus the destination's alpha. */
39
62
  SRC_ALPHA_SATURATE = 0x0308,
63
+ /** Passed to blendFunc or blendFuncSeparate to specify a constant color blend function. */
40
64
  CONSTANT_COLOR = 0x8001,
65
+ /** Passed to blendFunc or blendFuncSeparate to specify one minus a constant color blend function. */
41
66
  ONE_MINUS_CONSTANT_COLOR = 0x8002,
67
+ /** Passed to blendFunc or blendFuncSeparate to specify a constant alpha blend function. */
42
68
  CONSTANT_ALPHA = 0x8003,
69
+ /** Passed to blendFunc or blendFuncSeparate to specify one minus a constant alpha blend function. */
43
70
  ONE_MINUS_CONSTANT_ALPHA = 0x8004,
44
71
 
45
72
  // Blending equations
46
73
  // Constants passed to blendEquation() or blendEquationSeparate() to control
47
74
  // how the blending is calculated (for both, RBG and alpha, or separately).
48
75
 
76
+ /** Passed to blendEquation or blendEquationSeparate to set an addition blend function. */
77
+ /** Passed to blendEquation or blendEquationSeparate to specify a subtraction blend function (source - destination). */
78
+ /** Passed to blendEquation or blendEquationSeparate to specify a reverse subtraction blend function (destination - source). */
49
79
  FUNC_ADD = 0x8006,
50
80
  FUNC_SUBTRACT = 0x800a,
51
81
  FUNC_REVERSE_SUBTRACT = 0x800b,
@@ -53,30 +83,57 @@ export enum GL {
53
83
  // Getting GL parameter information
54
84
  // Constants passed to getParameter() to specify what information to return.
55
85
 
86
+ /** Passed to getParameter to get the current RGB blend function. */
56
87
  BLEND_EQUATION = 0x8009,
88
+ /** Passed to getParameter to get the current RGB blend function. Same as BLEND_EQUATION */
57
89
  BLEND_EQUATION_RGB = 0x8009,
90
+ /** Passed to getParameter to get the current alpha blend function. Same as BLEND_EQUATION */
58
91
  BLEND_EQUATION_ALPHA = 0x883d,
92
+ /** Passed to getParameter to get the current destination RGB blend function. */
59
93
  BLEND_DST_RGB = 0x80c8,
94
+ /** Passed to getParameter to get the current destination RGB blend function. */
60
95
  BLEND_SRC_RGB = 0x80c9,
96
+ /** Passed to getParameter to get the current destination alpha blend function. */
61
97
  BLEND_DST_ALPHA = 0x80ca,
98
+ /** Passed to getParameter to get the current source alpha blend function. */
62
99
  BLEND_SRC_ALPHA = 0x80cb,
100
+
101
+ /** Passed to getParameter to return a the current blend color. */
63
102
  BLEND_COLOR = 0x8005,
103
+ /** Passed to getParameter to get the array buffer binding. */
64
104
  ARRAY_BUFFER_BINDING = 0x8894,
105
+ /** Passed to getParameter to get the current element array buffer. */
65
106
  ELEMENT_ARRAY_BUFFER_BINDING = 0x8895,
107
+ /** Passed to getParameter to get the current lineWidth (set by the lineWidth method). */
66
108
  LINE_WIDTH = 0x0b21,
109
+ /** Passed to getParameter to get the current size of a point drawn with gl.POINTS */
67
110
  ALIASED_POINT_SIZE_RANGE = 0x846d,
111
+ /** Passed to getParameter to get the range of available widths for a line. Returns a length-2 array with the lo value at 0, and hight at 1. */
68
112
  ALIASED_LINE_WIDTH_RANGE = 0x846e,
113
+ /** Passed to getParameter to get the current value of cullFace. Should return FRONT, BACK, or FRONT_AND_BACK */
69
114
  CULL_FACE_MODE = 0x0b45,
115
+ /** Passed to getParameter to determine the current value of frontFace. Should return CW or CCW. */
70
116
  FRONT_FACE = 0x0b46,
117
+ /** Passed to getParameter to return a length-2 array of floats giving the current depth range. */
71
118
  DEPTH_RANGE = 0x0b70,
119
+ /** Passed to getParameter to determine if the depth write mask is enabled. */
120
+
72
121
  DEPTH_WRITEMASK = 0x0b72,
122
+ /** Passed to getParameter to determine the current depth clear value. */
73
123
  DEPTH_CLEAR_VALUE = 0x0b73,
124
+ /** Passed to getParameter to get the current depth function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL. */
74
125
  DEPTH_FUNC = 0x0b74,
126
+ /** Passed to getParameter to get the value the stencil will be cleared to. */
75
127
  STENCIL_CLEAR_VALUE = 0x0b91,
128
+ /** Passed to getParameter to get the current stencil function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL. */
76
129
  STENCIL_FUNC = 0x0b92,
130
+ /** Passed to getParameter to get the current stencil fail function. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP. */
77
131
  STENCIL_FAIL = 0x0b94,
132
+ /** Passed to getParameter to get the current stencil fail function should the depth buffer test fail. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP. */
78
133
  STENCIL_PASS_DEPTH_FAIL = 0x0b95,
134
+ /** Passed to getParameter to get the current stencil fail function should the depth buffer test pass. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP. */
79
135
  STENCIL_PASS_DEPTH_PASS = 0x0b96,
136
+ /** Passed to getParameter to get the reference value used for stencil tests. */
80
137
  STENCIL_REF = 0x0b97,
81
138
  STENCIL_VALUE_MASK = 0x0b93,
82
139
  STENCIL_WRITEMASK = 0x0b98,
@@ -87,7 +144,10 @@ export enum GL {
87
144
  STENCIL_BACK_REF = 0x8ca3,
88
145
  STENCIL_BACK_VALUE_MASK = 0x8ca4,
89
146
  STENCIL_BACK_WRITEMASK = 0x8ca5,
147
+
148
+ /** An Int32Array with four elements for the current viewport dimensions. */
90
149
  VIEWPORT = 0x0ba2,
150
+ /** An Int32Array with four elements for the current scissor box dimensions. */
91
151
  SCISSOR_BOX = 0x0c10,
92
152
  COLOR_CLEAR_VALUE = 0x0c22,
93
153
  COLOR_WRITEMASK = 0x0c23,
@@ -121,17 +181,25 @@ export enum GL {
121
181
  // Constants passed to bufferData(), bufferSubData(), bindBuffer(), or
122
182
  // getBufferParameter().
123
183
 
184
+ /** Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and not change often. */
124
185
  STATIC_DRAW = 0x88e4,
186
+ /** Passed to bufferData as a hint about whether the contents of the buffer are likely to not be used often. */
125
187
  STREAM_DRAW = 0x88e0,
188
+ /** Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and change often. */
126
189
  DYNAMIC_DRAW = 0x88e8,
190
+ /** Passed to bindBuffer or bufferData to specify the type of buffer being used. */
127
191
  ARRAY_BUFFER = 0x8892,
192
+ /** Passed to bindBuffer or bufferData to specify the type of buffer being used. */
128
193
  ELEMENT_ARRAY_BUFFER = 0x8893,
194
+ /** Passed to getBufferParameter to get a buffer's size. */
129
195
  BUFFER_SIZE = 0x8764,
196
+ /** Passed to getBufferParameter to get the hint for the buffer passed in when it was created. */
130
197
  BUFFER_USAGE = 0x8765,
131
198
 
132
199
  // Vertex attributes
133
200
  // Constants passed to getVertexAttrib().
134
201
 
202
+ /** Passed to getVertexAttrib to read back the current vertex attribute. */
135
203
  CURRENT_VERTEX_ATTRIB = 0x8626,
136
204
  VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622,
137
205
  VERTEX_ATTRIB_ARRAY_SIZE = 0x8623,
@@ -144,45 +212,69 @@ export enum GL {
144
212
  // Culling
145
213
  // Constants passed to cullFace().
146
214
 
215
+ /** Passed to enable/disable to turn on/off culling. Can also be used with getParameter to find the current culling method. */
147
216
  CULL_FACE = 0x0b44,
217
+ /** Passed to cullFace to specify that only front faces should be culled. */
148
218
  FRONT = 0x0404,
219
+ /** Passed to cullFace to specify that only back faces should be culled. */
149
220
  BACK = 0x0405,
221
+ /** Passed to cullFace to specify that front and back faces should be culled. */
150
222
  FRONT_AND_BACK = 0x0408,
151
223
 
152
224
  // Enabling and disabling
153
225
  // Constants passed to enable() or disable().
154
226
 
227
+ /** Passed to enable/disable to turn on/off blending. Can also be used with getParameter to find the current blending method. */
155
228
  BLEND = 0x0be2,
229
+ /** Passed to enable/disable to turn on/off the depth test. Can also be used with getParameter to query the depth test. */
156
230
  DEPTH_TEST = 0x0b71,
231
+ /** Passed to enable/disable to turn on/off dithering. Can also be used with getParameter to find the current dithering method. */
157
232
  DITHER = 0x0bd0,
233
+ /** Passed to enable/disable to turn on/off the polygon offset. Useful for rendering hidden-line images, decals, and or solids with highlighted edges. Can also be used with getParameter to query the scissor test. */
158
234
  POLYGON_OFFSET_FILL = 0x8037,
235
+ /** Passed to enable/disable to turn on/off the alpha to coverage. Used in multi-sampling alpha channels. */
159
236
  SAMPLE_ALPHA_TO_COVERAGE = 0x809e,
237
+ /** Passed to enable/disable to turn on/off the sample coverage. Used in multi-sampling. */
160
238
  SAMPLE_COVERAGE = 0x80a0,
239
+ /** Passed to enable/disable to turn on/off the scissor test. Can also be used with getParameter to query the scissor test. */
161
240
  SCISSOR_TEST = 0x0c11,
241
+ /** Passed to enable/disable to turn on/off the stencil test. Can also be used with getParameter to query the stencil test. */
162
242
  STENCIL_TEST = 0x0b90,
163
243
 
164
244
  // Errors
165
245
  // Constants returned from getError().
166
246
 
247
+ /** Returned from getError(). */
167
248
  NO_ERROR = 0,
249
+ /** Returned from getError(). */
168
250
  INVALID_ENUM = 0x0500,
251
+ /** Returned from getError(). */
169
252
  INVALID_VALUE = 0x0501,
253
+ /** Returned from getError(). */
170
254
  INVALID_OPERATION = 0x0502,
255
+ /** Returned from getError(). */
171
256
  OUT_OF_MEMORY = 0x0505,
257
+ /** Returned from getError(). */
172
258
  CONTEXT_LOST_WEBGL = 0x9242,
173
259
 
174
260
  // Front face directions
175
261
  // Constants passed to frontFace().
176
262
 
263
+ /** Passed to frontFace to specify the front face of a polygon is drawn in the clockwise direction */
177
264
  CW = 0x0900,
265
+ /** Passed to frontFace to specify the front face of a polygon is drawn in the counter clockwise direction */
178
266
  CCW = 0x0901,
179
267
 
180
268
  // Hints
181
269
  // Constants passed to hint()
182
270
 
271
+ /** There is no preference for this behavior. */
183
272
  DONT_CARE = 0x1100,
273
+ /** The most efficient behavior should be used. */
184
274
  FASTEST = 0x1101,
275
+ /** The most correct or the highest quality option should be used. */
185
276
  NICEST = 0x1102,
277
+ /** Hint for the quality of filtering when generating mipmap images with WebGLRenderingContext.generateMipmap(). */
186
278
  GENERATE_MIPMAP_HINT = 0x8192,
187
279
 
188
280
  // Data types
@@ -215,20 +307,31 @@ export enum GL {
215
307
  // Shaders
216
308
  // Constants passed to createShader() or getShaderParameter()
217
309
 
310
+ /** Passed to createShader to define a fragment shader. */
218
311
  FRAGMENT_SHADER = 0x8b30,
312
+ /** Passed to createShader to define a vertex shader */
219
313
  VERTEX_SHADER = 0x8b31,
314
+ /** Passed to getShaderParameter to get the status of the compilation. Returns false if the shader was not compiled. You can then query getShaderInfoLog to find the exact error */
220
315
  COMPILE_STATUS = 0x8b81,
316
+ /** Passed to getShaderParameter to determine if a shader was deleted via deleteShader. Returns true if it was, false otherwise. */
221
317
  DELETE_STATUS = 0x8b80,
318
+ /** Passed to getProgramParameter after calling linkProgram to determine if a program was linked correctly. Returns false if there were errors. Use getProgramInfoLog to find the exact error. */
222
319
  LINK_STATUS = 0x8b82,
320
+ /** Passed to getProgramParameter after calling validateProgram to determine if it is valid. Returns false if errors were found. */
223
321
  VALIDATE_STATUS = 0x8b83,
322
+ /** Passed to getProgramParameter after calling attachShader to determine if the shader was attached correctly. Returns false if errors occurred. */
224
323
  ATTACHED_SHADERS = 0x8b85,
324
+ /** Passed to getProgramParameter to get the number of attributes active in a program. */
225
325
  ACTIVE_ATTRIBUTES = 0x8b89,
326
+ /** Passed to getProgramParameter to get the number of uniforms active in a program. */
226
327
  ACTIVE_UNIFORMS = 0x8b86,
328
+ /** The maximum number of entries possible in the vertex attribute list. */
227
329
  MAX_VERTEX_ATTRIBS = 0x8869,
228
330
  MAX_VERTEX_UNIFORM_VECTORS = 0x8dfb,
229
331
  MAX_VARYING_VECTORS = 0x8dfc,
230
332
  MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8b4d,
231
333
  MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8b4c,
334
+ /** Implementation dependent number of maximum texture units. At least 8. */
232
335
  MAX_TEXTURE_IMAGE_UNITS = 0x8872,
233
336
  MAX_FRAGMENT_UNIFORM_VECTORS = 0x8dfd,
234
337
  SHADER_TYPE = 0x8b4f,
@@ -238,14 +341,22 @@ export enum GL {
238
341
  // Depth or stencil tests
239
342
  // Constants passed to depthFunc() or stencilFunc().
240
343
 
344
+ /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass, i.e., nothing will be drawn. */
241
345
  NEVER = 0x0200,
242
- ALWAYS = 0x0207,
346
+ /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value. */
243
347
  LESS = 0x0201,
348
+ /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value. */
244
349
  EQUAL = 0x0202,
350
+ /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value. */
245
351
  LEQUAL = 0x0203,
352
+ /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value. */
246
353
  GREATER = 0x0204,
247
- GEQUAL = 0x0206,
354
+ /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value. */
248
355
  NOTEQUAL = 0x0205,
356
+ /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value. */
357
+ GEQUAL = 0x0206,
358
+ /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass, i.e., pixels will be drawn in the order they are drawn. */
359
+ ALWAYS = 0x0207,
249
360
 
250
361
  // Stencil actions
251
362
  // Constants passed to stencilOp().
@@ -268,9 +379,13 @@ export enum GL {
268
379
  LINEAR_MIPMAP_NEAREST = 0x2701,
269
380
  NEAREST_MIPMAP_LINEAR = 0x2702,
270
381
  LINEAR_MIPMAP_LINEAR = 0x2703,
382
+ /** The texture magnification function is used when the pixel being textured maps to an area less than or equal to one texture element. It sets the texture magnification function to either GL_NEAREST or GL_LINEAR (see below). GL_NEAREST is generally faster than GL_LINEAR, but it can produce textured images with sharper edges because the transition between texture elements is not as smooth. Default: GL_LINEAR. */
271
383
  TEXTURE_MAG_FILTER = 0x2800,
384
+ /** The texture minifying function is used whenever the pixel being textured maps to an area greater than one texture element. There are six defined minifying functions. Two of them use the nearest one or nearest four texture elements to compute the texture value. The other four use mipmaps. Default: GL_NEAREST_MIPMAP_LINEAR */
272
385
  TEXTURE_MIN_FILTER = 0x2801,
386
+ /** Sets the wrap parameter for texture coordinate to either GL_CLAMP_TO_EDGE, GL_MIRRORED_REPEAT, or GL_REPEAT. G */
273
387
  TEXTURE_WRAP_S = 0x2802,
388
+ /** Sets the wrap parameter for texture coordinate to either GL_CLAMP_TO_EDGE, GL_MIRRORED_REPEAT, or GL_REPEAT. G */
274
389
  TEXTURE_WRAP_T = 0x2803,
275
390
  TEXTURE_2D = 0x0de1,
276
391
  TEXTURE = 0x1702,
@@ -414,6 +529,7 @@ export enum GL {
414
529
  RGBA8 = 0x8058,
415
530
  RGB10_A2 = 0x8059,
416
531
  TEXTURE_3D = 0x806f,
532
+ /** Sets the wrap parameter for texture coordinate to either GL_CLAMP_TO_EDGE, GL_MIRRORED_REPEAT, or GL_REPEAT. G */
417
533
  TEXTURE_WRAP_R = 0x8072,
418
534
  TEXTURE_MIN_LOD = 0x813a,
419
535
  TEXTURE_MAX_LOD = 0x813b,
@@ -699,23 +815,32 @@ export enum GL {
699
815
 
700
816
  // ANGLE_instanced_arrays
701
817
 
818
+ /** Describes the frequency divisor used for instanced rendering. */
702
819
  VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE = 0x88fe,
703
820
 
704
821
  // WEBGL_debug_renderer_info
705
822
 
823
+ /** Passed to getParameter to get the vendor string of the graphics driver. */
706
824
  UNMASKED_VENDOR_WEBGL = 0x9245,
825
+ /** Passed to getParameter to get the renderer string of the graphics driver. */
707
826
  UNMASKED_RENDERER_WEBGL = 0x9246,
708
827
 
709
828
  // EXT_texture_filter_anisotropic
710
829
 
830
+ /** Returns the maximum available anisotropy. */
711
831
  MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84ff,
832
+ /** Passed to texParameter to set the desired maximum anisotropy for a texture. */
712
833
  TEXTURE_MAX_ANISOTROPY_EXT = 0x84fe,
713
834
 
714
835
  // EXT_sRGB
715
836
 
837
+ /** Unsized sRGB format that leaves the precision up to the driver. */
716
838
  SRGB_EXT = 0x8c40,
839
+ /** Unsized sRGB format with unsized alpha component. */
717
840
  SRGB_ALPHA_EXT = 0x8c42,
841
+ /** Sized (8-bit) sRGB and alpha formats. */
718
842
  SRGB8_ALPHA8_EXT = 0x8c43,
843
+ /** Returns the framebuffer color encoding. */
719
844
  FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT = 0x8210,
720
845
 
721
846
  // EXT_texture_norm16 - https://khronos.org/registry/webgl/extensions/EXT_texture_norm16/
@@ -731,9 +856,13 @@ export enum GL {
731
856
 
732
857
  // WEBGL_compressed_texture_s3tc (BC1, BC2, BC3)
733
858
 
859
+ /** A DXT1-compressed image in an RGB image format. */
734
860
  COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83f0,
861
+ /** A DXT1-compressed image in an RGB image format with a simple on/off alpha value. */
735
862
  COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83f1,
863
+ /** A DXT3-compressed image in an RGBA image format. Compared to a 32-bit RGBA texture, it offers 4:1 compression. */
736
864
  COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83f2,
865
+ /** A DXT5-compressed image in an RGBA image format. It also provides a 4:1 compression, but differs to the DXT3 compression in how the alpha compression is done. */
737
866
  COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83f3,
738
867
 
739
868
  // WEBGL_compressed_texture_s3tc_srgb (BC1, BC2, BC3 - SRGB)
@@ -759,26 +888,41 @@ export enum GL {
759
888
 
760
889
  // WEBGL_compressed_texture_es3
761
890
 
891
+ /** One-channel (red) unsigned format compression. */
762
892
  COMPRESSED_R11_EAC = 0x9270,
893
+ /** One-channel (red) signed format compression. */
763
894
  COMPRESSED_SIGNED_R11_EAC = 0x9271,
895
+ /** Two-channel (red and green) unsigned format compression. */
764
896
  COMPRESSED_RG11_EAC = 0x9272,
897
+ /** Two-channel (red and green) signed format compression. */
765
898
  COMPRESSED_SIGNED_RG11_EAC = 0x9273,
899
+ /** Compresses RGB8 data with no alpha channel. */
766
900
  COMPRESSED_RGB8_ETC2 = 0x9274,
901
+ /** Compresses RGBA8 data. The RGB part is encoded the same as RGB_ETC2, but the alpha part is encoded separately. */
767
902
  COMPRESSED_RGBA8_ETC2_EAC = 0x9275,
903
+ /** Compresses sRGB8 data with no alpha channel. */
768
904
  COMPRESSED_SRGB8_ETC2 = 0x9276,
905
+ /** Compresses sRGBA8 data. The sRGB part is encoded the same as SRGB_ETC2, but the alpha part is encoded separately. */
769
906
  COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9277,
907
+ /** Similar to RGB8_ETC, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent. */
770
908
  COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9278,
909
+ /** Similar to SRGB8_ETC, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent. */
771
910
  COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9279,
772
911
 
773
912
  // WEBGL_compressed_texture_pvrtc
774
913
 
914
+ /** RGB compression in 4-bit mode. One block for each 4×4 pixels. */
775
915
  COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8c00,
916
+ /** RGBA compression in 4-bit mode. One block for each 4×4 pixels. */
776
917
  COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8c02,
918
+ /** RGB compression in 2-bit mode. One block for each 8×4 pixels. */
777
919
  COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 0x8c01,
920
+ /** RGBA compression in 2-bit mode. One block for each 8×4 pixels. */
778
921
  COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8c03,
779
922
 
780
923
  // WEBGL_compressed_texture_etc1
781
924
 
925
+ /** Compresses 24-bit RGB data with no alpha channel. */
782
926
  COMPRESSED_RGB_ETC1_WEBGL = 0x8d64,
783
927
 
784
928
  // WEBGL_compressed_texture_atc
@@ -820,26 +964,33 @@ export enum GL {
820
964
 
821
965
  // WEBGL_depth_texture
822
966
 
967
+ /** Unsigned integer type for 24-bit depth texture data. */
823
968
  UNSIGNED_INT_24_8_WEBGL = 0x84fa,
824
969
 
825
970
  // OES_texture_half_float
826
971
 
972
+ /** Half floating-point type (16-bit). */
827
973
  HALF_FLOAT_OES = 0x8d61,
828
974
 
829
975
  // WEBGL_color_buffer_float
830
976
 
977
+ /** RGBA 32-bit floating-point color-renderable format. */
831
978
  RGBA32F_EXT = 0x8814,
979
+ /** RGB 32-bit floating-point color-renderable format. */
832
980
  RGB32F_EXT = 0x8815,
833
981
  FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT = 0x8211,
834
982
  UNSIGNED_NORMALIZED_EXT = 0x8c17,
835
983
 
836
984
  // EXT_blend_minmax
837
985
 
986
+ /** Produces the minimum color components of the source and destination colors. */
838
987
  MIN_EXT = 0x8007,
988
+ /** Produces the maximum color components of the source and destination colors. */
839
989
  MAX_EXT = 0x8008,
840
990
 
841
991
  // OES_standard_derivatives
842
992
 
993
+ /** Indicates the accuracy of the derivative calculation for the GLSL built-in functions: dFdx, dFdy, and fwidth */
843
994
  FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8b8b,
844
995
 
845
996
  // WEBGL_draw_buffers
@@ -876,20 +1027,32 @@ export enum GL {
876
1027
  DRAW_BUFFER13_WEBGL = 0x8832,
877
1028
  DRAW_BUFFER14_WEBGL = 0x8833,
878
1029
  DRAW_BUFFER15_WEBGL = 0x8834,
1030
+ /** Maximum number of framebuffer color attachment points */
879
1031
  MAX_COLOR_ATTACHMENTS_WEBGL = 0x8cdf,
1032
+ /** Maximum number of draw buffers */
880
1033
  MAX_DRAW_BUFFERS_WEBGL = 0x8824,
881
1034
 
882
1035
  // OES_vertex_array_object
883
1036
 
1037
+ /** The bound vertex array object (VAO). */
884
1038
  VERTEX_ARRAY_BINDING_OES = 0x85b5,
885
1039
 
886
1040
  // EXT_disjoint_timer_query
887
1041
 
1042
+ /** The number of bits used to hold the query result for the given target. */
888
1043
  QUERY_COUNTER_BITS_EXT = 0x8864,
1044
+ /** The currently active query. */
889
1045
  CURRENT_QUERY_EXT = 0x8865,
1046
+ /** The query result. */
890
1047
  QUERY_RESULT_EXT = 0x8866,
1048
+ /** A Boolean indicating whether or not a query result is available. */
891
1049
  QUERY_RESULT_AVAILABLE_EXT = 0x8867,
1050
+ /** Elapsed time (in nanoseconds). */
892
1051
  TIME_ELAPSED_EXT = 0x88bf,
1052
+ /** The current time. */
893
1053
  TIMESTAMP_EXT = 0x8e28,
1054
+ /** A Boolean indicating whether or not the GPU performed any disjoint operation. */
894
1055
  GPU_DISJOINT_EXT = 0x8fbb // A Boolean indicating whether or not the GPU performed any disjoint operation.
895
- };
1056
+ }
1057
+
1058
+ export {GLEnum as GL};
package/src/index.ts CHANGED
@@ -1,2 +1,21 @@
1
1
  // WebGL constants
2
- export {GL as default} from './constants-enum';
2
+ export {GL} from './constants-enum';
3
+
4
+ // WebGL types
5
+ export type {
6
+ GLPrimitiveTopology,
7
+ GLPrimitive,
8
+ GLDataType,
9
+ GLPixelType,
10
+ GLUniformType,
11
+ GLSamplerType,
12
+ GLCompositeType,
13
+ GLFunction,
14
+ GLBlendEquation,
15
+ GLBlendFunction,
16
+ GLStencilOp,
17
+ GLSamplerParameters,
18
+ GLValueParameters,
19
+ GLFunctionParameters,
20
+ GLParameters
21
+ } from './webgl-types';