-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
web_gl_dart2js.dart
4183 lines (3002 loc) · 122 KB
/
web_gl_dart2js.dart
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
/**
* 3D programming in the browser.
*
* {@category Web}
*/
library dart.dom.web_gl;
import 'dart:async';
import 'dart:collection' hide LinkedList, LinkedListEntry;
import 'dart:_internal' show FixedLengthListMixin;
import 'dart:html';
import 'dart:html_common';
import 'dart:_native_typed_data';
import 'dart:typed_data';
import 'dart:_js_helper'
show Creates, JSName, Native, Returns, convertDartClosureToJS;
import 'dart:_foreign_helper' show JS;
import 'dart:_interceptors' show JavaScriptObject, JSExtendableArray;
// DO NOT EDIT - unless you are editing documentation as per:
// https://code.google.com/p/dart/wiki/ContributingHTMLDocumentation
// Auto-generated dart:web_gl library.
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Unstable()
@Native("WebGLActiveInfo")
class ActiveInfo extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory ActiveInfo._() {
throw new UnsupportedError("Not supported");
}
String get name native;
int get size native;
int get type native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("ANGLEInstancedArrays,ANGLE_instanced_arrays")
class AngleInstancedArrays extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory AngleInstancedArrays._() {
throw new UnsupportedError("Not supported");
}
static const int VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE = 0x88FE;
@JSName('drawArraysInstancedANGLE')
void drawArraysInstancedAngle(int mode, int first, int count, int primcount)
native;
@JSName('drawElementsInstancedANGLE')
void drawElementsInstancedAngle(
int mode, int count, int type, int offset, int primcount) native;
@JSName('vertexAttribDivisorANGLE')
void vertexAttribDivisorAngle(int index, int divisor) native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Unstable()
@Native("WebGLBuffer")
class Buffer extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory Buffer._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLCanvas")
class Canvas extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory Canvas._() {
throw new UnsupportedError("Not supported");
}
@JSName('canvas')
CanvasElement get canvas native;
@JSName('canvas')
OffscreenCanvas? get offscreenCanvas native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLColorBufferFloat")
class ColorBufferFloat extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory ColorBufferFloat._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLCompressedTextureASTC")
class CompressedTextureAstc extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory CompressedTextureAstc._() {
throw new UnsupportedError("Not supported");
}
static const int COMPRESSED_RGBA_ASTC_10x10_KHR = 0x93BB;
static const int COMPRESSED_RGBA_ASTC_10x5_KHR = 0x93B8;
static const int COMPRESSED_RGBA_ASTC_10x6_KHR = 0x93B9;
static const int COMPRESSED_RGBA_ASTC_10x8_KHR = 0x93BA;
static const int COMPRESSED_RGBA_ASTC_12x10_KHR = 0x93BC;
static const int COMPRESSED_RGBA_ASTC_12x12_KHR = 0x93BD;
static const int COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93B0;
static const int COMPRESSED_RGBA_ASTC_5x4_KHR = 0x93B1;
static const int COMPRESSED_RGBA_ASTC_5x5_KHR = 0x93B2;
static const int COMPRESSED_RGBA_ASTC_6x5_KHR = 0x93B3;
static const int COMPRESSED_RGBA_ASTC_6x6_KHR = 0x93B4;
static const int COMPRESSED_RGBA_ASTC_8x5_KHR = 0x93B5;
static const int COMPRESSED_RGBA_ASTC_8x6_KHR = 0x93B6;
static const int COMPRESSED_RGBA_ASTC_8x8_KHR = 0x93B7;
static const int COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 0x93DB;
static const int COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 0x93D8;
static const int COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 0x93D9;
static const int COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 0x93DA;
static const int COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 0x93DC;
static const int COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 0x93DD;
static const int COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 0x93D0;
static const int COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 0x93D1;
static const int COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 0x93D2;
static const int COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 0x93D3;
static const int COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 0x93D4;
static const int COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 0x93D5;
static const int COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 0x93D6;
static const int COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 0x93D7;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLCompressedTextureATC,WEBGL_compressed_texture_atc")
class CompressedTextureAtc extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory CompressedTextureAtc._() {
throw new UnsupportedError("Not supported");
}
static const int COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL = 0x8C93;
static const int COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL = 0x87EE;
static const int COMPRESSED_RGB_ATC_WEBGL = 0x8C92;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLCompressedTextureETC1,WEBGL_compressed_texture_etc1")
class CompressedTextureETC1 extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory CompressedTextureETC1._() {
throw new UnsupportedError("Not supported");
}
static const int COMPRESSED_RGB_ETC1_WEBGL = 0x8D64;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLCompressedTextureETC")
class CompressedTextureEtc extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory CompressedTextureEtc._() {
throw new UnsupportedError("Not supported");
}
static const int COMPRESSED_R11_EAC = 0x9270;
static const int COMPRESSED_RG11_EAC = 0x9272;
static const int COMPRESSED_RGB8_ETC2 = 0x9274;
static const int COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276;
static const int COMPRESSED_RGBA8_ETC2_EAC = 0x9278;
static const int COMPRESSED_SIGNED_R11_EAC = 0x9271;
static const int COMPRESSED_SIGNED_RG11_EAC = 0x9273;
static const int COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279;
static const int COMPRESSED_SRGB8_ETC2 = 0x9275;
static const int COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLCompressedTexturePVRTC,WEBGL_compressed_texture_pvrtc")
class CompressedTexturePvrtc extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory CompressedTexturePvrtc._() {
throw new UnsupportedError("Not supported");
}
static const int COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8C03;
static const int COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8C02;
static const int COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 0x8C01;
static const int COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8C00;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLCompressedTextureS3TC,WEBGL_compressed_texture_s3tc")
class CompressedTextureS3TC extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory CompressedTextureS3TC._() {
throw new UnsupportedError("Not supported");
}
static const int COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1;
static const int COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2;
static const int COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3;
static const int COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLCompressedTextureS3TCsRGB")
class CompressedTextureS3TCsRgb extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory CompressedTextureS3TCsRgb._() {
throw new UnsupportedError("Not supported");
}
static const int COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 0x8C4D;
static const int COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 0x8C4E;
static const int COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 0x8C4F;
static const int COMPRESSED_SRGB_S3TC_DXT1_EXT = 0x8C4C;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Unstable()
@Native("WebGLContextEvent")
class ContextEvent extends Event {
// To suppress missing implicit constructor warnings.
factory ContextEvent._() {
throw new UnsupportedError("Not supported");
}
factory ContextEvent(String type, [Map? eventInit]) {
if (eventInit != null) {
var eventInit_1 = convertDartToNative_Dictionary(eventInit);
return ContextEvent._create_1(type, eventInit_1);
}
return ContextEvent._create_2(type);
}
static ContextEvent _create_1(type, eventInit) =>
JS('ContextEvent', 'new WebGLContextEvent(#,#)', type, eventInit);
static ContextEvent _create_2(type) =>
JS('ContextEvent', 'new WebGLContextEvent(#)', type);
String get statusMessage native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLDebugRendererInfo,WEBGL_debug_renderer_info")
class DebugRendererInfo extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory DebugRendererInfo._() {
throw new UnsupportedError("Not supported");
}
static const int UNMASKED_RENDERER_WEBGL = 0x9246;
static const int UNMASKED_VENDOR_WEBGL = 0x9245;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLDebugShaders,WEBGL_debug_shaders")
class DebugShaders extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory DebugShaders._() {
throw new UnsupportedError("Not supported");
}
String? getTranslatedShaderSource(Shader shader) native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLDepthTexture,WEBGL_depth_texture")
class DepthTexture extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory DepthTexture._() {
throw new UnsupportedError("Not supported");
}
static const int UNSIGNED_INT_24_8_WEBGL = 0x84FA;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLDrawBuffers,WEBGL_draw_buffers")
class DrawBuffers extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory DrawBuffers._() {
throw new UnsupportedError("Not supported");
}
@JSName('drawBuffersWEBGL')
void drawBuffersWebgl(List<int> buffers) native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("EXTsRGB,EXT_sRGB")
class EXTsRgb extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory EXTsRgb._() {
throw new UnsupportedError("Not supported");
}
static const int FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT = 0x8210;
static const int SRGB8_ALPHA8_EXT = 0x8C43;
static const int SRGB_ALPHA_EXT = 0x8C42;
static const int SRGB_EXT = 0x8C40;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("EXTBlendMinMax,EXT_blend_minmax")
class ExtBlendMinMax extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory ExtBlendMinMax._() {
throw new UnsupportedError("Not supported");
}
static const int MAX_EXT = 0x8008;
static const int MIN_EXT = 0x8007;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("EXTColorBufferFloat")
class ExtColorBufferFloat extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory ExtColorBufferFloat._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("EXTColorBufferHalfFloat")
class ExtColorBufferHalfFloat extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory ExtColorBufferHalfFloat._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("EXTDisjointTimerQuery")
class ExtDisjointTimerQuery extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory ExtDisjointTimerQuery._() {
throw new UnsupportedError("Not supported");
}
static const int CURRENT_QUERY_EXT = 0x8865;
static const int GPU_DISJOINT_EXT = 0x8FBB;
static const int QUERY_COUNTER_BITS_EXT = 0x8864;
static const int QUERY_RESULT_AVAILABLE_EXT = 0x8867;
static const int QUERY_RESULT_EXT = 0x8866;
static const int TIMESTAMP_EXT = 0x8E28;
static const int TIME_ELAPSED_EXT = 0x88BF;
@JSName('beginQueryEXT')
void beginQueryExt(int target, TimerQueryExt query) native;
@JSName('createQueryEXT')
TimerQueryExt createQueryExt() native;
@JSName('deleteQueryEXT')
void deleteQueryExt(TimerQueryExt? query) native;
@JSName('endQueryEXT')
void endQueryExt(int target) native;
@JSName('getQueryEXT')
Object? getQueryExt(int target, int pname) native;
@JSName('getQueryObjectEXT')
Object? getQueryObjectExt(TimerQueryExt query, int pname) native;
@JSName('isQueryEXT')
bool isQueryExt(TimerQueryExt? query) native;
@JSName('queryCounterEXT')
void queryCounterExt(TimerQueryExt query, int target) native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("EXTDisjointTimerQueryWebGL2")
class ExtDisjointTimerQueryWebGL2 extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory ExtDisjointTimerQueryWebGL2._() {
throw new UnsupportedError("Not supported");
}
static const int GPU_DISJOINT_EXT = 0x8FBB;
static const int QUERY_COUNTER_BITS_EXT = 0x8864;
static const int TIMESTAMP_EXT = 0x8E28;
static const int TIME_ELAPSED_EXT = 0x88BF;
@JSName('queryCounterEXT')
void queryCounterExt(Query query, int target) native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("EXTFragDepth,EXT_frag_depth")
class ExtFragDepth extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory ExtFragDepth._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("EXTShaderTextureLOD,EXT_shader_texture_lod")
class ExtShaderTextureLod extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory ExtShaderTextureLod._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("EXTTextureFilterAnisotropic,EXT_texture_filter_anisotropic")
class ExtTextureFilterAnisotropic extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory ExtTextureFilterAnisotropic._() {
throw new UnsupportedError("Not supported");
}
static const int MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF;
static const int TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Unstable()
@Native("WebGLFramebuffer")
class Framebuffer extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory Framebuffer._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLGetBufferSubDataAsync")
class GetBufferSubDataAsync extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory GetBufferSubDataAsync._() {
throw new UnsupportedError("Not supported");
}
Future getBufferSubDataAsync(int target, int srcByteOffset, TypedData dstData,
[int? dstOffset, int? length]) =>
promiseToFuture(JS("", "#.getBufferSubDataAsync(#, #, #, #, #)", this,
target, srcByteOffset, dstData, dstOffset, length));
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLLoseContext,WebGLExtensionLoseContext,WEBGL_lose_context")
class LoseContext extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory LoseContext._() {
throw new UnsupportedError("Not supported");
}
void loseContext() native;
void restoreContext() native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("OESElementIndexUint,OES_element_index_uint")
class OesElementIndexUint extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory OesElementIndexUint._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("OESStandardDerivatives,OES_standard_derivatives")
class OesStandardDerivatives extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory OesStandardDerivatives._() {
throw new UnsupportedError("Not supported");
}
static const int FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8B8B;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("OESTextureFloat,OES_texture_float")
class OesTextureFloat extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory OesTextureFloat._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("OESTextureFloatLinear,OES_texture_float_linear")
class OesTextureFloatLinear extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory OesTextureFloatLinear._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("OESTextureHalfFloat,OES_texture_half_float")
class OesTextureHalfFloat extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory OesTextureHalfFloat._() {
throw new UnsupportedError("Not supported");
}
static const int HALF_FLOAT_OES = 0x8D61;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("OESTextureHalfFloatLinear,OES_texture_half_float_linear")
class OesTextureHalfFloatLinear extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory OesTextureHalfFloatLinear._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("OESVertexArrayObject,OES_vertex_array_object")
class OesVertexArrayObject extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory OesVertexArrayObject._() {
throw new UnsupportedError("Not supported");
}
static const int VERTEX_ARRAY_BINDING_OES = 0x85B5;
@JSName('bindVertexArrayOES')
void bindVertexArray(VertexArrayObjectOes? arrayObject) native;
@JSName('createVertexArrayOES')
VertexArrayObjectOes createVertexArray() native;
@JSName('deleteVertexArrayOES')
void deleteVertexArray(VertexArrayObjectOes? arrayObject) native;
@JSName('isVertexArrayOES')
bool isVertexArray(VertexArrayObjectOes? arrayObject) native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Unstable()
@Native("WebGLProgram")
class Program extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory Program._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLQuery")
class Query extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory Query._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Unstable()
@Native("WebGLRenderbuffer")
class Renderbuffer extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory Renderbuffer._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@Unstable()
@Native("WebGLRenderingContext")
class RenderingContext extends JavaScriptObject
implements CanvasRenderingContext {
// To suppress missing implicit constructor warnings.
factory RenderingContext._() {
throw new UnsupportedError("Not supported");
}
/// Checks if this type is supported on the current platform.
static bool get supported => JS('bool', '!!(window.WebGLRenderingContext)');
CanvasElement get canvas native;
// From WebGLRenderingContextBase
int? get drawingBufferHeight native;
int? get drawingBufferWidth native;
void activeTexture(int texture) native;
void attachShader(Program program, Shader shader) native;
void bindAttribLocation(Program program, int index, String name) native;
void bindBuffer(int target, Buffer? buffer) native;
void bindFramebuffer(int target, Framebuffer? framebuffer) native;
void bindRenderbuffer(int target, Renderbuffer? renderbuffer) native;
void bindTexture(int target, Texture? texture) native;
void blendColor(num red, num green, num blue, num alpha) native;
void blendEquation(int mode) native;
void blendEquationSeparate(int modeRGB, int modeAlpha) native;
void blendFunc(int sfactor, int dfactor) native;
void blendFuncSeparate(int srcRGB, int dstRGB, int srcAlpha, int dstAlpha)
native;
void bufferData(int target, data_OR_size, int usage) native;
void bufferSubData(int target, int offset, data) native;
int checkFramebufferStatus(int target) native;
void clear(int mask) native;
void clearColor(num red, num green, num blue, num alpha) native;
void clearDepth(num depth) native;
void clearStencil(int s) native;
void colorMask(bool red, bool green, bool blue, bool alpha) native;
Future commit() => promiseToFuture(JS("", "#.commit()", this));
void compileShader(Shader shader) native;
void compressedTexImage2D(int target, int level, int internalformat,
int width, int height, int border, TypedData data) native;
void compressedTexSubImage2D(int target, int level, int xoffset, int yoffset,
int width, int height, int format, TypedData data) native;
void copyTexImage2D(int target, int level, int internalformat, int x, int y,
int width, int height, int border) native;
void copyTexSubImage2D(int target, int level, int xoffset, int yoffset, int x,
int y, int width, int height) native;
Buffer createBuffer() native;
Framebuffer createFramebuffer() native;
Program createProgram() native;
Renderbuffer createRenderbuffer() native;
Shader createShader(int type) native;
Texture createTexture() native;
void cullFace(int mode) native;
void deleteBuffer(Buffer? buffer) native;
void deleteFramebuffer(Framebuffer? framebuffer) native;
void deleteProgram(Program? program) native;
void deleteRenderbuffer(Renderbuffer? renderbuffer) native;
void deleteShader(Shader? shader) native;
void deleteTexture(Texture? texture) native;
void depthFunc(int func) native;
void depthMask(bool flag) native;
void depthRange(num zNear, num zFar) native;
void detachShader(Program program, Shader shader) native;
void disable(int cap) native;
void disableVertexAttribArray(int index) native;
void drawArrays(int mode, int first, int count) native;
void drawElements(int mode, int count, int type, int offset) native;
void enable(int cap) native;
void enableVertexAttribArray(int index) native;
void finish() native;
void flush() native;
void framebufferRenderbuffer(int target, int attachment,
int renderbuffertarget, Renderbuffer? renderbuffer) native;
void framebufferTexture2D(int target, int attachment, int textarget,
Texture? texture, int level) native;
void frontFace(int mode) native;
void generateMipmap(int target) native;
ActiveInfo getActiveAttrib(Program program, int index) native;
ActiveInfo getActiveUniform(Program program, int index) native;
List<Shader>? getAttachedShaders(Program program) native;
int getAttribLocation(Program program, String name) native;
@Creates('int|Null')
@Returns('int|Null')
Object? getBufferParameter(int target, int pname) native;
@Creates('ContextAttributes|Null')
Map? getContextAttributes() {
return convertNativeToDart_Dictionary(_getContextAttributes_1());
}
@JSName('getContextAttributes')
@Creates('ContextAttributes|Null')
_getContextAttributes_1() native;
int getError() native;
Object? getExtension(String name) native;
@Creates('int|Renderbuffer|Texture|Null')
@Returns('int|Renderbuffer|Texture|Null')
Object? getFramebufferAttachmentParameter(
int target, int attachment, int pname) native;
@Creates(
'Null|num|String|bool|JSExtendableArray|NativeFloat32List|NativeInt32List|NativeUint32List|Framebuffer|Renderbuffer|Texture')
@Returns(
'Null|num|String|bool|JSExtendableArray|NativeFloat32List|NativeInt32List|NativeUint32List|Framebuffer|Renderbuffer|Texture')
Object? getParameter(int pname) native;
String? getProgramInfoLog(Program program) native;
@Creates('int|bool|Null')
@Returns('int|bool|Null')
Object? getProgramParameter(Program program, int pname) native;
@Creates('int|Null')
@Returns('int|Null')
Object? getRenderbufferParameter(int target, int pname) native;
String? getShaderInfoLog(Shader shader) native;
@Creates('int|bool|Null')
@Returns('int|bool|Null')
Object? getShaderParameter(Shader shader, int pname) native;
ShaderPrecisionFormat getShaderPrecisionFormat(
int shadertype, int precisiontype) native;
String? getShaderSource(Shader shader) native;
List<String>? getSupportedExtensions() native;
@Creates('int|Null')
@Returns('int|Null')
Object? getTexParameter(int target, int pname) native;
@Creates(
'Null|num|String|bool|JSExtendableArray|NativeFloat32List|NativeInt32List|NativeUint32List')
@Returns(
'Null|num|String|bool|JSExtendableArray|NativeFloat32List|NativeInt32List|NativeUint32List')
Object? getUniform(Program program, UniformLocation location) native;
UniformLocation getUniformLocation(Program program, String name) native;
@Creates('Null|num|bool|NativeFloat32List|Buffer')
@Returns('Null|num|bool|NativeFloat32List|Buffer')
Object? getVertexAttrib(int index, int pname) native;
int getVertexAttribOffset(int index, int pname) native;
void hint(int target, int mode) native;
bool isBuffer(Buffer? buffer) native;
bool isContextLost() native;
bool isEnabled(int cap) native;
bool isFramebuffer(Framebuffer? framebuffer) native;
bool isProgram(Program? program) native;
bool isRenderbuffer(Renderbuffer? renderbuffer) native;
bool isShader(Shader? shader) native;
bool isTexture(Texture? texture) native;
void lineWidth(num width) native;
void linkProgram(Program program) native;
void pixelStorei(int pname, int param) native;
void polygonOffset(num factor, num units) native;
@JSName('readPixels')
void _readPixels(int x, int y, int width, int height, int format, int type,
TypedData? pixels) native;
void renderbufferStorage(
int target, int internalformat, int width, int height) native;
void sampleCoverage(num value, bool invert) native;
void scissor(int x, int y, int width, int height) native;
void shaderSource(Shader shader, String string) native;
void stencilFunc(int func, int ref, int mask) native;
void stencilFuncSeparate(int face, int func, int ref, int mask) native;
void stencilMask(int mask) native;
void stencilMaskSeparate(int face, int mask) native;
void stencilOp(int fail, int zfail, int zpass) native;
void stencilOpSeparate(int face, int fail, int zfail, int zpass) native;
void texImage2D(
int target,
int level,
int internalformat,
int format_OR_width,
int height_OR_type,
bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video,
[int? format,
int? type,
TypedData? pixels]) {
if (type != null &&
format != null &&
(bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video is int)) {
_texImage2D_1(
target,
level,
internalformat,
format_OR_width,
height_OR_type,
bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video,
format,