-
Notifications
You must be signed in to change notification settings - Fork 0
/
glv8.cc
2390 lines (2230 loc) · 119 KB
/
glv8.cc
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
#include <stdlib.h>
#if defined(__APPLE__)
#define GL_SILENCE_DEPRECATION
#include <OpenGL/gl.h>
#endif
#if defined(_WIN32)
#include <EGL/egl.h>
#include <GLES2/gl2.h>
#endif
#include "v8.h"
#include "util.h"
using namespace v8;
extern bool sonic_gl_error_check;
#define GL_STENCIL_INDEX 0x1901
static void glActiveTexture_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
if (!(arg_0->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
glActiveTexture(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glAttachShader_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
if (!(arg_0->IsInt32() && arg_1->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
glAttachShader(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_1->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glBindAttribLocation_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
Local<Value> arg_2 = args[2];
if (!(arg_0->IsInt32() && arg_1->IsInt32() && arg_2->IsString())) {
ParameterCheckFailed(isolate)
return;
}
String::Utf8Value _utf0(isolate, arg_2);
glBindAttribLocation(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_1->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), *_utf0);
THROW_ON_GL_ERROR(isolate)
}
static void glBindBuffer_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
if (!(arg_0->IsInt32() && arg_1->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
glBindBuffer(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_1->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glBindFramebuffer_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
if (!(arg_0->IsInt32() && arg_1->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
glBindFramebuffer(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_1->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glBindRenderbuffer_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
if (!(arg_0->IsInt32() && arg_1->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
glBindRenderbuffer(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_1->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glBindTexture_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
if (!(arg_0->IsInt32() && arg_1->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
glBindTexture(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_1->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glBlendColor_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
Local<Value> arg_2 = args[2];
Local<Value> arg_3 = args[3];
if (!(arg_0->IsNumber() && arg_1->IsNumber() && arg_2->IsNumber() && arg_3->IsNumber())) {
ParameterCheckFailed(isolate)
return;
}
glBlendColor((float) arg_0->NumberValue(args.GetIsolate()->GetCurrentContext()).FromJust(), (float) arg_1->NumberValue(args.GetIsolate()->GetCurrentContext()).FromJust(), (float) arg_2->NumberValue(args.GetIsolate()->GetCurrentContext()).FromJust(), (float) arg_3->NumberValue(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glBlendEquation_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
if (!(arg_0->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
glBlendEquation(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glBlendEquationSeparate_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
if (!(arg_0->IsInt32() && arg_1->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
glBlendEquationSeparate(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_1->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glBlendFunc_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
if (!(arg_0->IsInt32() && arg_1->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
glBlendFunc(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_1->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glBlendFuncSeparate_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
Local<Value> arg_2 = args[2];
Local<Value> arg_3 = args[3];
if (!(arg_0->IsInt32() && arg_1->IsInt32() && arg_2->IsInt32() && arg_3->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
glBlendFuncSeparate(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_1->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_2->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_3->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glBufferData_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
Local<Value> arg_2 = args[2];
Local<Value> arg_3 = args[3];
if (!(arg_0->IsInt32() && arg_1->IsInt32() && arg_2->IsTypedArray() && arg_3->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
ArrayBuffer::Contents contents1 = Local<TypedArray>::Cast(arg_2)->Buffer()->GetContents();
glBufferData(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_1->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), (GLvoid*) contents1.Data(), arg_3->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glBufferSubData_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
Local<Value> arg_2 = args[2];
Local<Value> arg_3 = args[3];
if (!(arg_0->IsInt32() && arg_1->IsInt32() && arg_2->IsInt32() && arg_3->IsTypedArray())) {
ParameterCheckFailed(isolate)
return;
}
ArrayBuffer::Contents contents2 = Local<TypedArray>::Cast(arg_3)->Buffer()->GetContents();
glBufferSubData(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_1->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_2->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), (GLvoid*) contents2.Data());
THROW_ON_GL_ERROR(isolate)
}
static void glCheckFramebufferStatus_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
if (!(arg_0->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
args.GetReturnValue().Set(Integer::New(isolate, glCheckFramebufferStatus(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust())));
THROW_ON_GL_ERROR(isolate)
}
static void glClear_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
if (!(arg_0->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
glClear(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glClearColor_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
Local<Value> arg_2 = args[2];
Local<Value> arg_3 = args[3];
if (!(arg_0->IsNumber() && arg_1->IsNumber() && arg_2->IsNumber() && arg_3->IsNumber())) {
ParameterCheckFailed(isolate)
return;
}
glClearColor((float) arg_0->NumberValue(args.GetIsolate()->GetCurrentContext()).FromJust(), (float) arg_1->NumberValue(args.GetIsolate()->GetCurrentContext()).FromJust(), (float) arg_2->NumberValue(args.GetIsolate()->GetCurrentContext()).FromJust(), (float) arg_3->NumberValue(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glClearDepthf_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
if (!(arg_0->IsNumber())) {
ParameterCheckFailed(isolate)
return;
}
#if defined(_WIN32)
glClearDepthf((float) arg_0->NumberValue(args.GetIsolate()->GetCurrentContext()).FromJust());
#endif
#if defined(__APPLE__)
glClearDepth((float) arg_0->NumberValue(args.GetIsolate()->GetCurrentContext()).FromJust());
#endif
THROW_ON_GL_ERROR(isolate)
}
static void glClearStencil_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
if (!(arg_0->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
glClearStencil(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glColorMask_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
Local<Value> arg_2 = args[2];
Local<Value> arg_3 = args[3];
if (!(arg_0->IsBoolean() && arg_1->IsBoolean() && arg_2->IsBoolean() && arg_3->IsBoolean())) {
ParameterCheckFailed(isolate)
return;
}
glColorMask(arg_0->BooleanValue(args.GetIsolate()), arg_1->BooleanValue(args.GetIsolate()), arg_2->BooleanValue(args.GetIsolate()), arg_3->BooleanValue(args.GetIsolate()));
THROW_ON_GL_ERROR(isolate)
}
static void glCompileShader_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
if (!(arg_0->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
glCompileShader(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glCompressedTexImage2D_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
Local<Value> arg_2 = args[2];
Local<Value> arg_3 = args[3];
Local<Value> arg_4 = args[4];
Local<Value> arg_5 = args[5];
Local<Value> arg_6 = args[6];
Local<Value> arg_7 = args[7];
if (!(arg_0->IsInt32() && arg_1->IsInt32() && arg_2->IsInt32() && arg_3->IsInt32() && arg_4->IsInt32() && arg_5->IsInt32() && arg_6->IsInt32() && arg_7->IsTypedArray())) {
ParameterCheckFailed(isolate)
return;
}
ArrayBuffer::Contents contents3 = Local<TypedArray>::Cast(arg_7)->Buffer()->GetContents();
glCompressedTexImage2D(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_1->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_2->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_3->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_4->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_5->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_6->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), (GLvoid*) contents3.Data());
THROW_ON_GL_ERROR(isolate)
}
static void glCompressedTexSubImage2D_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
Local<Value> arg_2 = args[2];
Local<Value> arg_3 = args[3];
Local<Value> arg_4 = args[4];
Local<Value> arg_5 = args[5];
Local<Value> arg_6 = args[6];
Local<Value> arg_7 = args[7];
Local<Value> arg_8 = args[8];
if (!(arg_0->IsInt32() && arg_1->IsInt32() && arg_2->IsInt32() && arg_3->IsInt32() && arg_4->IsInt32() && arg_5->IsInt32() && arg_6->IsInt32() && arg_7->IsInt32() && arg_8->IsTypedArray())) {
ParameterCheckFailed(isolate)
return;
}
ArrayBuffer::Contents contents4 = Local<TypedArray>::Cast(arg_8)->Buffer()->GetContents();
glCompressedTexSubImage2D(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_1->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_2->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_3->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_4->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_5->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_6->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_7->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), (GLvoid*) contents4.Data());
THROW_ON_GL_ERROR(isolate)
}
static void glCopyTexImage2D_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
Local<Value> arg_2 = args[2];
Local<Value> arg_3 = args[3];
Local<Value> arg_4 = args[4];
Local<Value> arg_5 = args[5];
Local<Value> arg_6 = args[6];
Local<Value> arg_7 = args[7];
if (!(arg_0->IsInt32() && arg_1->IsInt32() && arg_2->IsInt32() && arg_3->IsInt32() && arg_4->IsInt32() && arg_5->IsInt32() && arg_6->IsInt32() && arg_7->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
glCopyTexImage2D(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_1->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_2->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_3->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_4->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_5->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_6->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_7->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glCopyTexSubImage2D_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
Local<Value> arg_2 = args[2];
Local<Value> arg_3 = args[3];
Local<Value> arg_4 = args[4];
Local<Value> arg_5 = args[5];
Local<Value> arg_6 = args[6];
Local<Value> arg_7 = args[7];
if (!(arg_0->IsInt32() && arg_1->IsInt32() && arg_2->IsInt32() && arg_3->IsInt32() && arg_4->IsInt32() && arg_5->IsInt32() && arg_6->IsInt32() && arg_7->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
glCopyTexSubImage2D(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_1->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_2->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_3->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_4->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_5->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_6->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_7->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glCreateProgram_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
args.GetReturnValue().Set(Integer::New(isolate, glCreateProgram()));
THROW_ON_GL_ERROR(isolate)
}
static void glCreateShader_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
if (!(arg_0->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
args.GetReturnValue().Set(Integer::New(isolate, glCreateShader(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust())));
THROW_ON_GL_ERROR(isolate)
}
static void glCullFace_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
if (!(arg_0->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
glCullFace(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glDeleteBuffers_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
if (!(arg_0->IsInt32() && arg_1->IsTypedArray())) {
ParameterCheckFailed(isolate)
return;
}
ArrayBuffer::Contents contents5 = Local<TypedArray>::Cast(arg_1)->Buffer()->GetContents();
glDeleteBuffers(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), (GLuint*) contents5.Data());
THROW_ON_GL_ERROR(isolate)
}
static void glDeleteFramebuffers_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
if (!(arg_0->IsInt32() && arg_1->IsTypedArray())) {
ParameterCheckFailed(isolate)
return;
}
ArrayBuffer::Contents contents6 = Local<TypedArray>::Cast(arg_1)->Buffer()->GetContents();
glDeleteFramebuffers(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), (GLuint*) contents6.Data());
THROW_ON_GL_ERROR(isolate)
}
static void glDeleteProgram_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
if (!(arg_0->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
glDeleteProgram(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glDeleteRenderbuffers_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
if (!(arg_0->IsInt32() && arg_1->IsTypedArray())) {
ParameterCheckFailed(isolate)
return;
}
ArrayBuffer::Contents contents7 = Local<TypedArray>::Cast(arg_1)->Buffer()->GetContents();
glDeleteRenderbuffers(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), (GLuint*) contents7.Data());
THROW_ON_GL_ERROR(isolate)
}
static void glDeleteShader_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
if (!(arg_0->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
glDeleteShader(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glDeleteTextures_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
if (!(arg_0->IsInt32() && arg_1->IsTypedArray())) {
ParameterCheckFailed(isolate)
return;
}
ArrayBuffer::Contents contents8 = Local<TypedArray>::Cast(arg_1)->Buffer()->GetContents();
glDeleteTextures(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), (GLuint*) contents8.Data());
THROW_ON_GL_ERROR(isolate)
}
static void glDepthFunc_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
if (!(arg_0->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
glDepthFunc(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glDepthMask_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
if (!(arg_0->IsBoolean())) {
ParameterCheckFailed(isolate)
return;
}
glDepthMask(arg_0->BooleanValue(args.GetIsolate()));
THROW_ON_GL_ERROR(isolate)
}
static void glDepthRangef_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
if (!(arg_0->IsNumber() && arg_1->IsNumber())) {
ParameterCheckFailed(isolate)
return;
}
#if defined(_WIN32)
glDepthRangef((float) arg_0->NumberValue(args.GetIsolate()->GetCurrentContext()).FromJust(), (float) arg_1->NumberValue(args.GetIsolate()->GetCurrentContext()).FromJust());
#endif
#if defined(__APPLE__)
glDepthRange((float) arg_0->NumberValue(args.GetIsolate()->GetCurrentContext()).FromJust(), (float) arg_1->NumberValue(args.GetIsolate()->GetCurrentContext()).FromJust());
#endif
THROW_ON_GL_ERROR(isolate)
}
static void glDetachShader_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
if (!(arg_0->IsInt32() && arg_1->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
glDetachShader(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_1->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glDisable_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
if (!(arg_0->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
glDisable(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glDisableVertexAttribArray_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
if (!(arg_0->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
glDisableVertexAttribArray(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glDrawArrays_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
Local<Value> arg_2 = args[2];
if (!(arg_0->IsInt32() && arg_1->IsInt32() && arg_2->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
glDrawArrays(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_1->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_2->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glDrawElements_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
Local<Value> arg_2 = args[2];
Local<Value> arg_3 = args[3];
if (!(arg_0->IsInt32() && arg_1->IsInt32() && arg_2->IsInt32() && arg_3->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
glDrawElements(args[0]->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), args[1]->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), args[2]->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), (GLvoid *) (size_t) args[3]->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glEnable_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
if (!(arg_0->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
glEnable(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glEnableVertexAttribArray_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
if (!(arg_0->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
glEnableVertexAttribArray(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glFinish_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
glFinish();
THROW_ON_GL_ERROR(isolate)
}
static void glFlush_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
glFlush();
THROW_ON_GL_ERROR(isolate)
}
static void glFramebufferRenderbuffer_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
Local<Value> arg_2 = args[2];
Local<Value> arg_3 = args[3];
if (!(arg_0->IsInt32() && arg_1->IsInt32() && arg_2->IsInt32() && arg_3->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
glFramebufferRenderbuffer(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_1->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_2->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_3->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glFramebufferTexture2D_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
Local<Value> arg_2 = args[2];
Local<Value> arg_3 = args[3];
Local<Value> arg_4 = args[4];
if (!(arg_0->IsInt32() && arg_1->IsInt32() && arg_2->IsInt32() && arg_3->IsInt32() && arg_4->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
glFramebufferTexture2D(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_1->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_2->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_3->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_4->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glFrontFace_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
if (!(arg_0->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
glFrontFace(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glGenBuffers_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
if (!(arg_0->IsInt32() && arg_1->IsTypedArray())) {
ParameterCheckFailed(isolate)
return;
}
ArrayBuffer::Contents contents9 = Local<TypedArray>::Cast(arg_1)->Buffer()->GetContents();
glGenBuffers(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), (GLuint*) contents9.Data());
THROW_ON_GL_ERROR(isolate)
}
static void glGenerateMipmap_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
if (!(arg_0->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
glGenerateMipmap(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust());
THROW_ON_GL_ERROR(isolate)
}
static void glGenFramebuffers_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
if (!(arg_0->IsInt32() && arg_1->IsTypedArray())) {
ParameterCheckFailed(isolate)
return;
}
ArrayBuffer::Contents contents10 = Local<TypedArray>::Cast(arg_1)->Buffer()->GetContents();
glGenFramebuffers(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), (GLuint*) contents10.Data());
THROW_ON_GL_ERROR(isolate)
}
static void glGenRenderbuffers_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
if (!(arg_0->IsInt32() && arg_1->IsTypedArray())) {
ParameterCheckFailed(isolate)
return;
}
ArrayBuffer::Contents contents11 = Local<TypedArray>::Cast(arg_1)->Buffer()->GetContents();
glGenRenderbuffers(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), (GLuint*) contents11.Data());
THROW_ON_GL_ERROR(isolate)
}
static void glGenTextures_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
if (!(arg_0->IsInt32() && arg_1->IsTypedArray())) {
ParameterCheckFailed(isolate)
return;
}
ArrayBuffer::Contents contents12 = Local<TypedArray>::Cast(arg_1)->Buffer()->GetContents();
glGenTextures(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), (GLuint*) contents12.Data());
THROW_ON_GL_ERROR(isolate)
}
static void glGetActiveAttrib_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
Local<Value> arg_2 = args[2];
Local<Value> arg_3 = args[3];
Local<Value> arg_4 = args[4];
Local<Value> arg_5 = args[5];
Local<Value> arg_6 = args[6];
if (!(arg_0->IsInt32() && arg_1->IsInt32() && arg_2->IsInt32() && arg_3->IsTypedArray() && arg_4->IsTypedArray() && arg_5->IsTypedArray() && arg_6->IsString())) {
ParameterCheckFailed(isolate)
return;
}
ArrayBuffer::Contents contents13 = Local<TypedArray>::Cast(arg_3)->Buffer()->GetContents();
ArrayBuffer::Contents contents14 = Local<TypedArray>::Cast(arg_4)->Buffer()->GetContents();
ArrayBuffer::Contents contents15 = Local<TypedArray>::Cast(arg_5)->Buffer()->GetContents();
String::Utf8Value _utf16(isolate, arg_6);
glGetActiveAttrib(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_1->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_2->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), (GLsizei*) contents13.Data(), (GLint*) contents14.Data(), (GLenum*) contents15.Data(), *_utf16);
THROW_ON_GL_ERROR(isolate)
}
static void glGetActiveUniform_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
Local<Value> arg_2 = args[2];
Local<Value> arg_3 = args[3];
Local<Value> arg_4 = args[4];
Local<Value> arg_5 = args[5];
Local<Value> arg_6 = args[6];
if (!(arg_0->IsInt32() && arg_1->IsInt32() && arg_2->IsInt32() && arg_3->IsTypedArray() && arg_4->IsTypedArray() && arg_5->IsTypedArray() && arg_6->IsString())) {
ParameterCheckFailed(isolate)
return;
}
ArrayBuffer::Contents contents17 = Local<TypedArray>::Cast(arg_3)->Buffer()->GetContents();
ArrayBuffer::Contents contents18 = Local<TypedArray>::Cast(arg_4)->Buffer()->GetContents();
ArrayBuffer::Contents contents19 = Local<TypedArray>::Cast(arg_5)->Buffer()->GetContents();
String::Utf8Value _utf20(isolate, arg_6);
glGetActiveUniform(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_1->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_2->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), (GLsizei*) contents17.Data(), (GLint*) contents18.Data(), (GLenum*) contents19.Data(), *_utf20);
THROW_ON_GL_ERROR(isolate)
}
static void glGetAttachedShaders_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
Local<Value> arg_2 = args[2];
Local<Value> arg_3 = args[3];
if (!(arg_0->IsInt32() && arg_1->IsInt32() && arg_2->IsTypedArray() && arg_3->IsTypedArray())) {
ParameterCheckFailed(isolate)
return;
}
ArrayBuffer::Contents contents21 = Local<TypedArray>::Cast(arg_2)->Buffer()->GetContents();
ArrayBuffer::Contents contents22 = Local<TypedArray>::Cast(arg_3)->Buffer()->GetContents();
glGetAttachedShaders(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_1->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), (GLsizei*) contents21.Data(), (GLuint*) contents22.Data());
THROW_ON_GL_ERROR(isolate)
}
static void glGetAttribLocation_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
if (!(arg_0->IsInt32() && arg_1->IsString())) {
ParameterCheckFailed(isolate)
return;
}
String::Utf8Value _utf23(isolate, arg_1);
args.GetReturnValue().Set(Integer::New(isolate, glGetAttribLocation(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), *_utf23)));
THROW_ON_GL_ERROR(isolate)
}
static void glGetBooleanv_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
if (!(arg_0->IsInt32() && arg_1->IsTypedArray())) {
ParameterCheckFailed(isolate)
return;
}
ArrayBuffer::Contents contents24 = Local<TypedArray>::Cast(arg_1)->Buffer()->GetContents();
glGetBooleanv(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), (GLboolean*) contents24.Data());
THROW_ON_GL_ERROR(isolate)
}
static void glGetBufferParameteriv_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
Local<Value> arg_2 = args[2];
if (!(arg_0->IsInt32() && arg_1->IsInt32() && arg_2->IsTypedArray())) {
ParameterCheckFailed(isolate)
return;
}
ArrayBuffer::Contents contents25 = Local<TypedArray>::Cast(arg_2)->Buffer()->GetContents();
glGetBufferParameteriv(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_1->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), (GLint*) contents25.Data());
THROW_ON_GL_ERROR(isolate)
}
static void glGetError_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
args.GetReturnValue().Set(Integer::New(isolate, glGetError()));
THROW_ON_GL_ERROR(isolate)
}
static void glGetFloatv_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
if (!(arg_0->IsInt32() && arg_1->IsTypedArray())) {
ParameterCheckFailed(isolate)
return;
}
ArrayBuffer::Contents contents26 = Local<TypedArray>::Cast(arg_1)->Buffer()->GetContents();
glGetFloatv(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), (GLfloat*) contents26.Data());
THROW_ON_GL_ERROR(isolate)
}
static void glGetFramebufferAttachmentParameteriv_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
Local<Value> arg_2 = args[2];
Local<Value> arg_3 = args[3];
if (!(arg_0->IsInt32() && arg_1->IsInt32() && arg_2->IsInt32() && arg_3->IsTypedArray())) {
ParameterCheckFailed(isolate)
return;
}
ArrayBuffer::Contents contents27 = Local<TypedArray>::Cast(arg_3)->Buffer()->GetContents();
glGetFramebufferAttachmentParameteriv(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_1->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_2->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), (GLint*) contents27.Data());
THROW_ON_GL_ERROR(isolate)
}
static void glGetIntegerv_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
if (!(arg_0->IsInt32() && arg_1->IsTypedArray())) {
ParameterCheckFailed(isolate)
return;
}
ArrayBuffer::Contents contents28 = Local<TypedArray>::Cast(arg_1)->Buffer()->GetContents();
glGetIntegerv(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), (GLint*) contents28.Data());
THROW_ON_GL_ERROR(isolate)
}
static void glGetProgramiv_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
Local<Value> arg_2 = args[2];
if (!(arg_0->IsInt32() && arg_1->IsInt32() && arg_2->IsTypedArray())) {
ParameterCheckFailed(isolate)
return;
}
ArrayBuffer::Contents contents29 = Local<TypedArray>::Cast(arg_2)->Buffer()->GetContents();
glGetProgramiv(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_1->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), (GLint*) contents29.Data());
THROW_ON_GL_ERROR(isolate)
}
static void glGetProgramInfoLog_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
Local<Value> arg_2 = args[2];
Local<Value> arg_3 = args[3];
if (!(arg_0->IsInt32() && arg_1->IsInt32() && arg_2->IsTypedArray() && arg_3->IsString())) {
ParameterCheckFailed(isolate)
return;
}
ArrayBuffer::Contents contents30 = Local<TypedArray>::Cast(arg_2)->Buffer()->GetContents();
String::Utf8Value _utf31(isolate, arg_3);
glGetProgramInfoLog(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_1->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), (GLsizei*) contents30.Data(), *_utf31);
THROW_ON_GL_ERROR(isolate)
}
static void glGetRenderbufferParameteriv_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
Local<Value> arg_2 = args[2];
if (!(arg_0->IsInt32() && arg_1->IsInt32() && arg_2->IsTypedArray())) {
ParameterCheckFailed(isolate)
return;
}
ArrayBuffer::Contents contents32 = Local<TypedArray>::Cast(arg_2)->Buffer()->GetContents();
glGetRenderbufferParameteriv(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_1->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), (GLint*) contents32.Data());
THROW_ON_GL_ERROR(isolate)
}
static void glGetShaderiv_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
Local<Value> arg_2 = args[2];
if (!(arg_0->IsInt32() && arg_1->IsInt32() && arg_2->IsTypedArray())) {
ParameterCheckFailed(isolate)
return;
}
ArrayBuffer::Contents contents33 = Local<TypedArray>::Cast(arg_2)->Buffer()->GetContents();
glGetShaderiv(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_1->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), (GLint*) contents33.Data());
THROW_ON_GL_ERROR(isolate)
}
/**
* This function is totally wrong.
* It will make some games wrong to fix it.
*/
static void glGetShaderInfoLog_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
Local<Value> arg_2 = args[2];
Local<Value> arg_3 = args[3];
if (!(arg_0->IsInt32() && arg_1->IsInt32() && arg_2->IsTypedArray() && arg_3->IsString())) {
ParameterCheckFailed(isolate)
return;
}
ArrayBuffer::Contents contents34 = Local<TypedArray>::Cast(arg_2)->Buffer()->GetContents();
String::Utf8Value _utf35(isolate, arg_3);
glGetShaderInfoLog(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_1->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), (GLsizei *) contents34.Data(),
*_utf35);
THROW_ON_GL_ERROR(isolate)
}
static void glGetShaderInfoLogValid_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
char buff[256];
GLint len;
glGetShaderInfoLog(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), 256, &len, buff);
buff[len]= 0;
v8::Local<v8::String> ret = v8::String::NewFromUtf8(args.GetIsolate(), buff).ToLocalChecked();
args.GetReturnValue().Set(ret);
if (len>0) {
// LOGV("SHADERINFOLOG: %s",buff);
}
THROW_ON_GL_ERROR(isolate)
}
static void glGetShaderSource_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
Local<Value> arg_2 = args[2];
Local<Value> arg_3 = args[3];
if (!(arg_0->IsInt32() && arg_1->IsInt32() && arg_2->IsTypedArray() && arg_3->IsString())) {
ParameterCheckFailed(isolate)
return;
}
ArrayBuffer::Contents contents38 = Local<TypedArray>::Cast(arg_2)->Buffer()->GetContents();
String::Utf8Value _utf39(isolate, arg_3);
glGetShaderSource(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_1->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), (GLsizei*) contents38.Data(), *_utf39);
THROW_ON_GL_ERROR(isolate)
}
static void glGetString_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
if (!(arg_0->IsInt32())) {
ParameterCheckFailed(isolate)
return;
}
args.GetReturnValue().Set(
String::NewFromUtf8(
isolate,
(const char *) glGetString(
(unsigned)arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust())).ToLocalChecked());
THROW_ON_GL_ERROR(isolate)
}
static void glGetTexParameterfv_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
Local<Value> arg_2 = args[2];
if (!(arg_0->IsInt32() && arg_1->IsInt32() && arg_2->IsTypedArray())) {
ParameterCheckFailed(isolate)
return;
}
ArrayBuffer::Contents contents40 = Local<TypedArray>::Cast(arg_2)->Buffer()->GetContents();
glGetTexParameterfv(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_1->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), (GLfloat*) contents40.Data());
THROW_ON_GL_ERROR(isolate)
}
static void glGetTexParameteriv_binder(const FunctionCallbackInfo<Value>& args) {
Isolate *isolate = args.GetIsolate();
Local<Value> arg_0 = args[0];
Local<Value> arg_1 = args[1];
Local<Value> arg_2 = args[2];
if (!(arg_0->IsInt32() && arg_1->IsInt32() && arg_2->IsTypedArray())) {
ParameterCheckFailed(isolate)
return;
}
ArrayBuffer::Contents contents41 = Local<TypedArray>::Cast(arg_2)->Buffer()->GetContents();
glGetTexParameteriv(arg_0->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), arg_1->Int32Value(args.GetIsolate()->GetCurrentContext()).FromJust(), (GLint*) contents41.Data());