-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
3783 lines (3068 loc) · 79.2 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* The following defined constants and descriptions are directly ported from https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants
*
* Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/
*
* Contributors
*
* See: https://developer.mozilla.org/en-US/profiles/Sheppy
* See: https://developer.mozilla.org/en-US/profiles/fscholz
* See: https://developer.mozilla.org/en-US/profiles/AtiX
* See: https://developer.mozilla.org/en-US/profiles/Sebastianz
*
* These constants are defined on the WebGLRenderingContext / WebGL2RenderingContext interface
*/
// Clearing buffers
// Constants passed to WebGLRenderingContext.clear() to clear buffer masks
/**
* Passed to clear to clear the current depth buffer
* @constant {number}
*/
export const GL_DEPTH_BUFFER_BIT: number = 0x00000100;
/**
* Passed to clear to clear the current stencil buffer
* @constant {number}
*/
export const GL_STENCIL_BUFFER_BIT: number = 0x00000400;
/**
* Passed to clear to clear the current color buffer
* @constant {number}
*/
export const GL_COLOR_BUFFER_BIT: number = 0x00004000;
// Rendering primitives
// Constants passed to WebGLRenderingContext.drawElements() or WebGLRenderingContext.drawArrays() to specify what kind of primitive to render
/**
* Passed to drawElements or drawArrays to draw single points
* @constant {number}
*/
export const GL_POINTS: number = 0x0000;
/**
* Passed to drawElements or drawArrays to draw lines. Each vertex connects to the one after it
* @constant {number}
*/
export const GL_LINES: number = 0x0001;
/**
* Passed to drawElements or drawArrays to draw lines. Each set of two vertices is treated as a separate line segment
* @constant {number}
*/
export const GL_LINE_LOOP: number = 0x0002;
/**
* Passed to drawElements or drawArrays to draw a connected group of line segments from the first vertex to the last
* @constant {number}
*/
export const GL_LINE_STRIP: number = 0x0003;
/**
* Passed to drawElements or drawArrays to draw triangles. Each set of three vertices creates a separate triangle
* @constant {number}
*/
export const GL_TRIANGLES: number = 0x0004;
/**
* Passed to drawElements or drawArrays to draw a connected group of triangles
* @constant {number}
*/
export const GL_TRIANGLE_STRIP: number = 0x0005;
/**
* 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
* @constant {number}
*/
export const GL_TRIANGLE_FAN: number = 0x0006;
// Blending modes
// Constants passed to WebGLRenderingContext.blendFunc() or WebGLRenderingContext.blendFuncSeparate() to specify the blending mode (for both, RBG and alpha, or separately)
/**
* Passed to blendFunc or blendFuncSeparate to turn off a component
* @constant {number}
*/
export const GL_ZERO: number = 0;
/**
* Passed to blendFunc or blendFuncSeparate to turn on a component
* @constant {number}
*/
export const GL_ONE: number = 1;
/**
* Passed to blendFunc or blendFuncSeparate to multiply a component by the source elements color
* @constant {number}
*/
export const GL_SRC_COLOR: number = 0x0300;
/**
* Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source elements color
* @constant {number}
*/
export const GL_ONE_MINUS_SRC_COLOR: number = 0x0301;
/**
* Passed to blendFunc or blendFuncSeparate to multiply a component by the source's alpha
* @constant {number}
*/
export const GL_SRC_ALPHA: number = 0x0302;
/**
* Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source's alpha
* @constant {number}
*/
export const GL_ONE_MINUS_SRC_ALPHA: number = 0x0303;
/**
* Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's alpha
* @constant {number}
*/
export const GL_DST_ALPHA: number = 0x0304;
/**
* Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's alpha
* @constant {number}
*/
export const GL_ONE_MINUS_DST_ALPHA: number = 0x0305;
/**
* Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's color
* @constant {number}
*/
export const GL_DST_COLOR: number = 0x0306;
/**
* Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's color
* @constant {number}
*/
export const GL_ONE_MINUS_DST_COLOR: number = 0x0307;
/**
* Passed to blendFunc or blendFuncSeparate to multiply a component by the minimum of source's alpha or one minus the destination's alpha
* @constant {number}
*/
export const GL_SRC_ALPHA_SATURATE: number = 0x0308;
/**
* Passed to blendFunc or blendFuncSeparate to specify a constant color blend function
* @constant {number}
*/
export const GL_CONSTANT_COLOR: number = 0x8001;
/**
* Passed to blendFunc or blendFuncSeparate to specify one minus a constant color blend function
* @constant {number}
*/
export const GL_ONE_MINUS_CONSTANT_COLOR: number = 0x8002;
/**
* Passed to blendFunc or blendFuncSeparate to specify a constant alpha blend function
* @constant {number}
*/
export const GL_CONSTANT_ALPHA: number = 0x8003;
/**
* Passed to blendFunc or blendFuncSeparate to specify one minus a constant alpha blend function
* @constant {number}
*/
export const GL_ONE_MINUS_CONSTANT_ALPHA: number = 0x8004;
// Blending equations
// Constants passed to WebGLRenderingContext.blendEquation() or WebGLRenderingContext.blendEquationSeparate() to control how the blending is calculated (for both, RBG and alpha, or separately)
/**
* Passed to blendEquation or blendEquationSeparate to set an addition blend function
* @constant {number}
*/
export const GL_FUNC_ADD: number = 0x8006;
/**
* Passed to blendEquation or blendEquationSeparate to specify a subtraction blend function (source - destination)
* @constant {number}
*/
export const GL_FUNC_SUBSTRACT: number = 0x800a;
/**
* Passed to blendEquation or blendEquationSeparate to specify a reverse subtraction blend function (destination - source)
* @constant {number}
*/
export const GL_FUNC_REVERSE_SUBTRACT: number = 0x800b;
// Getting GL parameter information
// Constants passed to WebGLRenderingContext.getParameter() to specify what information to return
/**
* Passed to getParameter to get the current RGB blend function
* @constant {number}
*/
export const GL_BLEND_EQUATION: number = 0x8009;
/**
* Passed to getParameter to get the current RGB blend function. Same as BLEND_EQUATION
* @constant {number}
*/
export const GL_BLEND_EQUATION_RGB: number = 0x8009;
/**
* Passed to getParameter to get the current alpha blend function. Same as BLEND_EQUATION
* @constant {number}
*/
export const GL_BLEND_EQUATION_ALPHA: number = 0x883d;
/**
* Passed to getParameter to get the current destination RGB blend function
* @constant {number}
*/
export const GL_BLEND_DST_RGB: number = 0x80c8;
/**
* Passed to getParameter to get the current source RGB blend function
* @constant {number}
*/
export const GL_BLEND_SRC_RGB: number = 0x80c9;
/**
* Passed to getParameter to get the current destination alpha blend function
* @constant {number}
*/
export const GL_BLEND_DST_ALPHA: number = 0x80ca;
/**
* Passed to getParameter to get the current source alpha blend function
* @constant {number}
*/
export const GL_BLEND_SRC_ALPHA: number = 0x80cb;
/**
* Passed to getParameter to return a the current blend color
* @constant {number}
*/
export const GL_BLEND_COLOR: number = 0x8005;
/**
* Passed to getParameter to get the array buffer binding
* @constant {number}
*/
export const GL_ARRAY_BUFFER_BINDING: number = 0x8894;
/**
* Passed to getParameter to get the current element array buffer
* @constant {number}
*/
export const GL_ELEMENT_ARRAY_BUFFER_BINDING: number = 0x8895;
/**
* Passed to getParameter to get the current lineWidth (set by the lineWidth method)
* @constant {number}
*/
export const GL_LINE_WIDTH: number = 0x0b21;
/**
* Passed to getParameter to get the current size of a point drawn with gl.POINTS
* @constant {number}
*/
export const GL_ALIASED_POINT_SIZE_RANGE: number = 0x846d;
/**
* 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
* @constant {number}
*/
export const GL_ALIASED_LINE_WIDTH_RANGE: number = 0x846e;
/**
* Passed to getParameter to get the current value of cullFace. Should return FRONT, BACK, or FRONT_AND_BACK
* @constant {number}
*/
export const GL_CULL_FACE_MODE: number = 0x0b45;
/**
* Passed to getParameter to determine the current value of frontFace. Should return CW or CCW
* @constant {number}
*/
export const GL_FRONT_FACE: number = 0x0b46;
/**
* Passed to getParameter to return a length-2 array of floats giving the current depth range
* @constant {number}
*/
export const GL_DEPTH_RANGE: number = 0x0b70;
/**
* Passed to getParameter to determine if the depth write mask is enabled
* @constant {number}
*/
export const GL_DEPTH_WRITEMASK: number = 0x0b72;
/**
* Passed to getParameter to determine the current depth clear value
* @constant {number}
*/
export const GL_DEPTH_CLEAR_VALUE: number = 0x0b73;
/**
* Passed to getParameter to get the current depth function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL
* @constant {number}
*/
export const GL_DEPTH_FUNC: number = 0x0b74;
/**
* Passed to getParameter to get the value the stencil will be cleared to
* @constant {number}
*/
export const GL_STENCIL_CLEAR_VALUE: number = 0x0b91;
/**
* Passed to getParameter to get the current stencil function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL
* @constant {number}
*/
export const GL_STENCIL_FUNC: number = 0x0b92;
/**
* Passed to getParameter to get the current stencil fail function. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP
* @constant {number}
*/
export const GL_STENCIL_FAIL: number = 0x0b94;
/**
* 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
* @constant {number}
*/
export const GL_STENCIL_PASS_DEPTH_FAIL: number = 0x0b95;
/**
* 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
* @constant {number}
*/
export const GL_STENCIL_PASS_DEPTH_PASS: number = 0x0b96;
/**
* Passed to getParameter to get the reference value used for stencil tests
* @constant {number}
*/
export const GL_STENCIL_REF: number = 0x0b97;
/**
* @constant {number}
*/
export const GL_STENCIL_VALUE_MASK: number = 0x0b93;
/**
* @constant {number}
*/
export const GL_STENCIL_WRITEMASK: number = 0x0b98;
/**
* @constant {number}
*/
export const GL_STENCIL_BACK_FUNC: number = 0x8800;
/**
* @constant {number}
*/
export const GL_STENCIL_BACK_FAIL: number = 0x8801;
/**
* @constant {number}
*/
export const GL_STENCIL_BACK_PASS_DEPTH_FAIL: number = 0x8802;
/**
* @constant {number}
*/
export const GL_STENCIL_BACK_PASS_DEPTH_PASS: number = 0x8803;
/**
* @constant {number}
*/
export const GL_STENCIL_BACK_REF: number = 0x8ca3;
/**
* @constant {number}
*/
export const GL_STENCIL_BACK_VALUE_MASK: number = 0x8ca4;
/**
* @constant {number}
*/
export const GL_STENCIL_BACK_WRITEMASK: number = 0x8ca5;
/**
* Returns an Int32Array with four elements for the current viewport dimensions
* @constant {number}
*/
export const GL_VIEWPORT: number = 0x0ba2;
/**
* Returns an Int32Array with four elements for the current scissor box dimensions
* @constant {number}
*/
export const GL_SCISSOR_BOX: number = 0x0c10;
/**
* @constant {number}
*/
export const GL_COLOR_CLEAR_VALUE: number = 0x0c22;
/**
* @constant {number}
*/
export const GL_COLOR_WRITEMASK: number = 0x0c23;
/**
* @constant {number}
*/
export const GL_UNPACK_ALIGNMENT: number = 0x0cf5;
/**
* @constant {number}
*/
export const GL_PACK_ALIGNMENT: number = 0x0d05;
/**
* @constant {number}
*/
export const GL_MAX_TEXTURE_SIZE: number = 0x0d33;
/**
* @constant {number}
*/
export const GL_MAX_VIEWPORT_DIMS: number = 0x0d3a;
/**
* @constant {number}
*/
export const GL_SUBPIXEL_BITS: number = 0x0d50;
/**
* @constant {number}
*/
export const GL_RED_BITS: number = 0x0d52;
/**
* @constant {number}
*/
export const GL_GREEN_BITS: number = 0x0d53;
/**
* @constant {number}
*/
export const GL_BLUE_BITS: number = 0x0d54;
/**
* @constant {number}
*/
export const GL_ALPHA_BITS: number = 0x0d55;
/**
* @constant {number}
*/
export const GL_DEPTH_BITS: number = 0x0d56;
/**
* @constant {number}
*/
export const GL_STENCIL_BITS: number = 0x0d57;
/**
* @constant {number}
*/
export const GL_POLYGON_OFFSET_UNITS: number = 0x2a00;
/**
* @constant {number}
*/
export const GL_POLYGON_OFFSET_FACTOR: number = 0x8038;
/**
* @constant {number}
*/
export const GL_TEXTURE_BINDING_2D: number = 0x8069;
/**
* @constant {number}
*/
export const GL_SAMPLE_BUFFERS: number = 0x80a8;
/**
* @constant {number}
*/
export const GL_SAMPLES: number = 0x80a9;
/**
* @constant {number}
*/
export const GL_SAMPLE_COVERAGE_VALUE: number = 0x80aa;
/**
* @constant {number}
*/
export const GL_SAMPLE_COVERAGE_INVERT: number = 0x80ab;
/**
* @constant {number}
*/
export const GL_COMPRESSED_TEXTURE_FORMATS: number = 0x86a3;
/**
* @constant {number}
*/
export const GL_VENDOR: number = 0x1f00;
/**
* @constant {number}
*/
export const GL_RENDERER: number = 0x1f01;
/**
* @constant {number}
*/
export const GL_VERSION: number = 0x1f02;
/**
* @constant {number}
*/
export const GL_IMPLEMENTATION_COLOR_READ_TYPE: number = 0x8b9a;
/**
* @constant {number}
*/
export const GL_IMPLEMENTATION_COLOR_READ_FORMAT: number = 0x8b9b;
/**
* @constant {number}
*/
export const GL_BROWSER_DEFAULT_WEBGL: number = 0x9244;
// Buffers
// Constants passed to WebGLRenderingContext.bufferData(), WebGLRenderingContext.bufferSubData(), WebGLRenderingContext.bindBuffer(), or WebGLRenderingContext.getBufferParameter()
/**
* Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and not change often
* @constant {number}
*/
export const GL_STATIC_DRAW: number = 0x88e4;
/**
* Passed to bufferData as a hint about whether the contents of the buffer are likely to not be used often
* @constant {number}
*/
export const GL_STREAM_DRAW: number = 0x88e0;
/**
* Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and change often
* @constant {number}
*/
export const GL_DYNAMIC_DRAW: number = 0x88e8;
/**
* Passed to bindBuffer or bufferData to specify the type of buffer being used
* @constant {number}
*/
export const GL_ARRAY_BUFFER: number = 0x8892;
/**
* Passed to bindBuffer or bufferData to specify the type of buffer being used
* @constant {number}
*/
export const GL_ELEMENT_ARRAY_BUFFER: number = 0x8893;
/**
* Passed to getBufferParameter to get a buffer's size
* @constant {number}
*/
export const GL_BUFFER_SIZE: number = 0x8764;
/**
* Passed to getBufferParameter to get the hint for the buffer passed in when it was created
* @constant {number}
*/
export const GL_BUFFER_USAGE: number = 0x8765;
// Vertex attributes
// Constants passed to WebGLRenderingContext.getVertexAttrib()
/**
* Passed to getVertexAttrib to read back the current vertex attribute
* @constant {number}
*/
export const GL_CURRENT_VERTEX_ATTRIB: number = 0x8626;
/**
* @constant {number}
*/
export const GL_VERTEX_ATTRIB_ARRAY_ENABLED: number = 0x8622;
/**
* @constant {number}
*/
export const GL_VERTEX_ATTRIB_ARRAY_SIZE: number = 0x8623;
/**
* @constant {number}
*/
export const GL_VERTEX_ATTRIB_ARRAY_STRIDE: number = 0x8624;
/**
* @constant {number}
*/
export const GL_VERTEX_ATTRIB_ARRAY_TYPE: number = 0x8625;
/**
* @constant {number}
*/
export const GL_VERTEX_ATTRIB_ARRAY_NORMALIZED: number = 0x886a;
/**
* @constant {number}
*/
export const GL_VERTEX_ATTRIB_ARRAY_POINTER: number = 0x8645;
/**
* @constant {number}
*/
export const GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number = 0x889f;
// Culling
// Constants passed to WebGLRenderingContext.cullFace()
/**
* Passed to enable/disable to turn on/off culling. Can also be used with getParameter to find the current culling method
* @constant {number}
*/
export const GL_CULL_FACE: number = 0x0b44;
/**
* Passed to cullFace to specify that only front faces should be culled
* @constant {number}
*/
export const GL_FRONT: number = 0x0404;
/**
* Passed to cullFace to specify that only back faces should be culled
* @constant {number}
*/
export const GL_BACK: number = 0x0405;
/**
* Passed to cullFace to specify that front and back faces should be culled
* @constant {number}
*/
export const GL_FRONT_AND_BACK: number = 0x0408;
// Enabling and disabling
// Constants passed to WebGLRenderingContext.enable() or WebGLRenderingContext.disable()
/**
* Passed to enable/disable to turn on/off blending. Can also be used with getParameter to find the current blending method
* @constant {number}
*/
export const GL_BLEND: number = 0x0be2;
/**
* Passed to enable/disable to turn on/off the depth test. Can also be used with getParameter to query the depth test
* @constant {number}
*/
export const GL_DEPTH_TEST: number = 0x0b71;
/**
* Passed to enable/disable to turn on/off dithering. Can also be used with getParameter to find the current dithering method
* @constant {number}
*/
export const GL_DITHER: number = 0x0bd0;
/**
* 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
* @constant {number}
*/
export const GL_POLYGON_OFFSET_FILL: number = 0x8037;
/**
* Passed to enable/disable to turn on/off the alpha to coverage. Used in multi-sampling alpha channels
* @constant {number}
*/
export const GL_SAMPLE_ALPHA_TO_COVERAGE: number = 0x809e;
/**
* Passed to enable/disable to turn on/off the sample coverage. Used in multi-sampling
* @constant {number}
*/
export const GL_SAMPLE_COVERAGE: number = 0x80a0;
/**
* Passed to enable/disable to turn on/off the scissor test. Can also be used with getParameter to query the scissor test
* @constant {number}
*/
export const GL_SCISSOR_TEST: number = 0x0c11;
/**
* Passed to enable/disable to turn on/off the stencil test. Can also be used with getParameter to query the stencil test
* @constant {number}
*/
export const GL_STENCIL_TEST: number = 0x0b90;
// Errors
// Constants returned from WebGLRenderingContext.getError()
/**
* Returned from getError
* @constant {number}
*/
export const GL_NO_ERROR: number = 0;
/**
* Returned from getError
* @constant {number}
*/
export const GL_INVALID_ENUM: number = 0x0500;
/**
* Returned from getError
* @constant {number}
*/
export const GL_INVALID_VALUE: number = 0x0501;
/**
* Returned from getError
* @constant {number}
*/
export const GL_INVALID_OPERATION: number = 0x0502;
/**
* Returned from getError
* @constant {number}
*/
export const GL_OUT_OF_MEMORY: number = 0x0505;
/**
* Returned from getError
* @constant {number}
*/
export const GL_CONTEXT_LOST_WEBGL: number = 0x9242;
// Front face directions
// Constants passed to WebGLRenderingContext.frontFace()
/**
* Passed to frontFace to specify the front face of a polygon is drawn in the clockwise direction,
* @constant {number}
*/
export const GL_CW: number = 0x0900;
/**
* Passed to frontFace to specify the front face of a polygon is drawn in the counter clockwise direction
* @constant {number}
*/
export const GL_CCW: number = 0x0901;
// Hints
// Constants passed to WebGLRenderingContext.hint()
/**
* There is no preference for this behavior
* @constant {number}
*/
export const GL_DONT_CARE: number = 0x1100;
/**
* The most efficient behavior should be used
* @constant {number}
*/
export const GL_FASTEST: number = 0x1101;
/**
* The most correct or the highest quality option should be used
* @constant {number}
*/
export const GL_NICEST: number = 0x1102;
/**
* Hint for the quality of filtering when generating mipmap images with WebGLRenderingContext.generateMipmap()
* @constant {number}
*/
export const GL_GENERATE_MIPMAP_HINT: number = 0x8192;
// Data types
/**
* @constant {number}
*/
export const GL_BYTE: number = 0x1400;
/**
* @constant {number}
*/
export const GL_UNSIGNED_BYTE: number = 0x1401;
/**
* @constant {number}
*/
export const GL_SHORT: number = 0x1402;
/**
* @constant {number}
*/
export const GL_UNSIGNED_SHORT: number = 0x1403;
/**
* @constant {number}
*/
export const GL_INT: number = 0x1404;
/**
* @constant {number}
*/
export const GL_UNSIGNED_INT: number = 0x1405;
/**
* @constant {number}
*/
export const GL_FLOAT: number = 0x1406;
// Pixel formats
/**
* @constant {number}
*/
export const GL_DEPTH_COMPONENT: number = 0x1902;
/**
* @constant {number}
*/
export const GL_ALPHA: number = 0x1906;
/**
* @constant {number}
*/
export const GL_RGB: number = 0x1907;
/**
* @constant {number}
*/
export const GL_RGBA: number = 0x1908;
/**
* @constant {number}
*/
export const GL_LUMINANCE: number = 0x1909;
/**
* @constant {number}
*/
export const GL_LUMINANCE_ALPHA: number = 0x190a;
// Pixel types
/**
* @constant {number}
*/
export const GL_UNSIGNED_SHORT_4_4_4_4: number = 0x8033;
/**
* @constant {number}
*/
export const GL_UNSIGNED_SHORT_5_5_5_1: number = 0x8034;
/**
* @constant {number}
*/
export const GL_UNSIGNED_SHORT_5_6_5: number = 0x8363;
// Shaders
// Constants passed to WebGLRenderingContext.getShaderParameter()
/**
* Passed to createShader to define a fragment shader
* @constant {number}
*/
export const GL_FRAGMENT_SHADER: number = 0x8b30;
/**
* Passed to createShader to define a vertex shader
* @constant {number}
*/
export const GL_VERTEX_SHADER: number = 0x8b31;
/**
* Passed to getShaderParamter 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
* @constant {number}
*/
export const GL_COMPILE_STATUS: number = 0x8b81;
/**
* Passed to getShaderParamter to determine if a shader was deleted via deleteShader. Returns true if it was, false otherwise
* @constant {number}
*/
export const GL_DELETE_STATUS: number = 0x8b80;
/**
* 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
* @constant {number}
*/
export const GL_LINK_STATUS: number = 0x8b82;
/**
* Passed to getProgramParameter after calling validateProgram to determine if it is valid. Returns false if errors were found
* @constant {number}
*/
export const GL_VALIDATE_STATUS: number = 0x8b83;
/**
* Passed to getProgramParameter after calling attachShader to determine if the shader was attached correctly. Returns false if errors occurred
* @constant {number}
*/
export const GL_ATTACHED_SHADERS: number = 0x8b85;
/**
* Passed to getProgramParameter to get the number of attributes active in a program
* @constant {number}
*/
export const GL_ACTIVE_ATTRIBUTES: number = 0x8b89;
/**
* Passed to getProgramParamter to get the number of uniforms active in a program
* @constant {number}
*/
export const GL_ACTIVE_UNIFORMS: number = 0x8b86;
/**
* The maximum number of entries possible in the vertex attribute list
* @constant {number}
*/
export const GL_MAX_VERTEX_ATTRIBS: number = 0x8869;
/**
* @constant {number}
*/
export const GL_MAX_VERTEX_UNIFORM_VECTORS: number = 0x8dfb;
/**
* @constant {number}
*/
export const GL_MAX_VARYING_VECTORS: number = 0x8dfc;
/**
* @constant {number}
*/
export const GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS: number = 0x8b4d;
/**
* @constant {number}
*/
export const GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS: number = 0x8b4c;
/**
* Implementation dependent number of maximum texture units. At least 8
* @constant {number}
*/
export const GL_MAX_TEXTURE_IMAGE_UNITS: number = 0x8872;
/**
* @constant {number}
*/
export const GL_MAX_FRAGMENT_UNIFORM_VECTORS: number = 0x8dfd;
/**
* @constant {number}
*/
export const GL_SHADER_TYPE: number = 0x8b4f;
/**
* @constant {number}
*/
export const GL_SHADING_LANGUAGE_VERSION: number = 0x8b8c;
/**
* @constant {number}
*/
export const GL_CURRENT_PROGRAM: number = 0x8b8d;
// Depth or stencil tests
// Constants passed to WebGLRenderingContext.stencilFunc()
/**
* Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn
* @constant {number}
*/
export const GL_NEVER: number = 0x0200;
/**
* 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
* @constant {number}
*/
export const GL_ALWAYS: number = 0x0207;
/**
* Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value