@nativescript/canvas 2.0.0-alpha.22 → 2.0.0-alpha.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/package.json +1 -1
  2. package/platforms/android/canvas-release.aar +0 -0
  3. package/platforms/ios/src/cpp/ImageAssetImpl.cpp +4 -4
  4. package/platforms/ios/src/cpp/webgl/WebGLActiveInfoImpl.cpp +0 -2
  5. package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.cpp +643 -624
  6. package/platforms/ios/src/cpp/webgl/extensions/ANGLE_instanced_arraysImpl.cpp +14 -14
  7. package/platforms/ios/src/cpp/webgl/extensions/EXT_blend_minmaxImpl.cpp +2 -2
  8. package/platforms/ios/src/cpp/webgl/extensions/EXT_color_buffer_half_floatImpl.cpp +4 -4
  9. package/platforms/ios/src/cpp/webgl/extensions/EXT_disjoint_timer_queryImpl.cpp +58 -71
  10. package/platforms/ios/src/cpp/webgl/extensions/EXT_sRGBImpl.h +4 -4
  11. package/platforms/ios/src/cpp/webgl/extensions/EXT_texture_filter_anisotropicImpl.h +2 -2
  12. package/platforms/ios/src/cpp/webgl/extensions/OES_element_index_uintImpl.h +1 -1
  13. package/platforms/ios/src/cpp/webgl/extensions/OES_standard_derivativesImpl.h +1 -1
  14. package/platforms/ios/src/cpp/webgl/extensions/OES_texture_half_floatImpl.h +1 -1
  15. package/platforms/ios/src/cpp/webgl/extensions/OES_vertex_array_objectImpl.h +1 -1
  16. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_color_buffer_floatImpl.h +4 -4
  17. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_atcImpl.h +3 -3
  18. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etc1Impl.h +1 -1
  19. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etcImpl.h +10 -10
  20. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_pvrtcImpl.h +4 -4
  21. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tcImpl.h +4 -4
  22. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tc_srgbImpl.h +4 -4
  23. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_depth_textureImpl.h +1 -1
  24. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_draw_buffersImpl.cpp +5 -13
  25. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_draw_buffersImpl.h +40 -39
  26. package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.cpp +695 -690
@@ -4,12 +4,12 @@
4
4
 
5
5
  #include "WebGL2RenderingContext.h"
6
6
 
7
- WebGL2RenderingContext::WebGL2RenderingContext(WebGLState* state) : WebGLRenderingContext(
7
+ WebGL2RenderingContext::WebGL2RenderingContext(WebGLState *state) : WebGLRenderingContext(
8
8
  state, WebGLRenderingVersion::V2) {
9
9
  }
10
10
 
11
11
 
12
- WebGL2RenderingContext::WebGL2RenderingContext(WebGLState* state,
12
+ WebGL2RenderingContext::WebGL2RenderingContext(WebGLState *state,
13
13
  WebGLRenderingVersion version)
14
14
  : WebGLRenderingContext(state, version) {
15
15
  }
@@ -61,7 +61,7 @@ void WebGL2RenderingContext::BeginQuery(const v8::FunctionCallbackInfo<v8::Value
61
61
  auto value = args[1];
62
62
  auto type = GetNativeType(isolate, value);
63
63
  if (type == NativeType::WebGLQuery) {
64
- auto target = (uint32_t) args[0]->NumberValue(context).ToChecked();
64
+ auto target = args[0]->Uint32Value(context).ToChecked();
65
65
  auto query = WebGLQuery::GetPointer(value.As<v8::Object>());
66
66
 
67
67
  if (query != nullptr) {
@@ -87,7 +87,7 @@ WebGL2RenderingContext::BeginTransformFeedback(const v8::FunctionCallbackInfo<v8
87
87
  auto value = args[0];
88
88
  if (value->IsNumber()) {
89
89
  canvas_native_webgl2_begin_transform_feedback(
90
- (uint32_t) args[0]->NumberValue(context).ToChecked(),
90
+ args[0]->Uint32Value(context).ToChecked(),
91
91
  ptr->GetState()
92
92
  );
93
93
  }
@@ -106,8 +106,8 @@ void WebGL2RenderingContext::BindBufferBase(const v8::FunctionCallbackInfo<v8::V
106
106
  auto type = GetNativeType(isolate, bufferValue);
107
107
 
108
108
  if (type == NativeType::WebGLBuffer) {
109
- auto target = (uint32_t) args[0]->NumberValue(context).ToChecked();
110
- auto index = (uint32_t) args[1]->NumberValue(context).ToChecked();
109
+ auto target = args[0]->Uint32Value(context).ToChecked();
110
+ auto index = args[1]->Uint32Value(context).ToChecked();
111
111
 
112
112
  auto buffer = WebGLBuffer::GetPointer(bufferValue.As<v8::Object>());
113
113
 
@@ -132,8 +132,8 @@ void WebGL2RenderingContext::BindBufferRange(const v8::FunctionCallbackInfo<v8::
132
132
  auto bufferValue = args[2];
133
133
  auto type = GetNativeType(isolate, bufferValue);
134
134
  if (args.Length() > 4 && type == NativeType::WebGLBuffer) {
135
- auto target = (uint32_t) args[0]->NumberValue(context).ToChecked();
136
- auto index = (uint32_t) args[1]->NumberValue(context).ToChecked();
135
+ auto target = args[0]->Uint32Value(context).ToChecked();
136
+ auto index = args[1]->Uint32Value(context).ToChecked();
137
137
  auto offset = args[3]->NumberValue(context).ToChecked();
138
138
  auto size = args[4]->NumberValue(context).ToChecked();
139
139
  auto buffer = WebGLBuffer::GetPointer(bufferValue.As<v8::Object>());
@@ -160,7 +160,7 @@ void WebGL2RenderingContext::BindSampler(const v8::FunctionCallbackInfo<v8::Valu
160
160
  auto samplerValue = args[1];
161
161
  auto type = GetNativeType(isolate, samplerValue);
162
162
  if (type == NativeType::WebGLSampler) {
163
- auto unit = (uint32_t) args[0]->NumberValue(context).ToChecked();
163
+ auto unit = args[0]->Uint32Value(context).ToChecked();
164
164
  auto sampler = WebGLSampler::GetPointer(samplerValue.As<v8::Object>());
165
165
 
166
166
  canvas_native_webgl2_bind_sampler(
@@ -185,7 +185,7 @@ WebGL2RenderingContext::BindTransformFeedback(const v8::FunctionCallbackInfo<v8:
185
185
  auto type = GetNativeType(isolate, transformFeedbackValue);
186
186
 
187
187
  if (type == NativeType::WebGLTransformFeedback) {
188
- auto target = (uint32_t) args[0]->NumberValue(context).ToChecked();
188
+ auto target = args[0]->Uint32Value(context).ToChecked();
189
189
  auto transformFeedback = WebGLTransformFeedback::GetPointer(
190
190
  transformFeedbackValue.As<v8::Object>());
191
191
 
@@ -237,20 +237,20 @@ void WebGL2RenderingContext::BlitFramebuffer(const v8::FunctionCallbackInfo<v8::
237
237
  auto context = isolate->GetCurrentContext();
238
238
 
239
239
  if (args.Length() > 9) {
240
- auto srcX0 = (int32_t) args[0]->NumberValue(context).ToChecked();
241
- auto srcY0 = (int32_t) args[1]->NumberValue(context).ToChecked();
240
+ auto srcX0 = args[0]->Int32Value(context).ToChecked();
241
+ auto srcY0 = args[1]->Int32Value(context).ToChecked();
242
242
 
243
- auto srcX1 = (int32_t) args[2]->NumberValue(context).ToChecked();
244
- auto srcY1 = (int32_t) args[3]->NumberValue(context).ToChecked();
243
+ auto srcX1 = args[2]->Int32Value(context).ToChecked();
244
+ auto srcY1 = args[3]->Int32Value(context).ToChecked();
245
245
 
246
- auto dstX0 = (int32_t) args[4]->NumberValue(context).ToChecked();
247
- auto dstY0 = (int32_t) args[5]->NumberValue(context).ToChecked();
246
+ auto dstX0 = args[4]->Int32Value(context).ToChecked();
247
+ auto dstY0 = args[5]->Int32Value(context).ToChecked();
248
248
 
249
- auto dstX1 = (int32_t) args[6]->NumberValue(context).ToChecked();
250
- auto dstY1 = (int32_t) args[7]->NumberValue(context).ToChecked();
249
+ auto dstX1 = args[6]->Int32Value(context).ToChecked();
250
+ auto dstY1 = args[7]->Int32Value(context).ToChecked();
251
251
 
252
- auto mask = (uint32_t) args[8]->NumberValue(context).ToChecked();
253
- auto filter = (uint32_t) args[9]->NumberValue(context).ToChecked();
252
+ auto mask = args[8]->Uint32Value(context).ToChecked();
253
+ auto filter = args[9]->Uint32Value(context).ToChecked();
254
254
  canvas_native_webgl2_blit_framebuffer(
255
255
  srcX0,
256
256
  srcY0,
@@ -276,56 +276,46 @@ void WebGL2RenderingContext::ClearBufferfv(const v8::FunctionCallbackInfo<v8::Va
276
276
  auto isolate = args.GetIsolate();
277
277
  auto context = isolate->GetCurrentContext();
278
278
 
279
- auto bufferValue = args[0];
280
- auto type = GetNativeType(isolate, bufferValue);
281
279
  auto values = args[2];
282
- if (args.Length() > 2 && type == NativeType::WebGLBuffer &&
283
- args[1]->IsObject()) {
284
- auto drawbuffer = (int32_t) args[1]->NumberValue(context).ToChecked();
285
- auto buffer = WebGLBuffer::GetPointer(bufferValue.As<v8::Object>());
286
- if (values->IsArray()) {
287
- auto array = values.As<v8::Array>();
288
- auto len = array->Length();
289
- std::vector<float> buf;
290
- buf.reserve(len);
291
- for (int j = 0; j < len; ++j) {
292
- auto item = array->Get(
293
- context, j).ToLocalChecked();
294
- if (!item->IsNumber()) {
295
- buf.push_back(
296
- std::nanf(""));
297
- } else {
298
- buf.push_back(
299
- static_cast<float>(item->NumberValue(context).ToChecked())
300
- );
301
- }
302
- }
303
-
304
- canvas_native_webgl2_clear_bufferfv(
305
- buffer->GetBuffer(),
306
- drawbuffer,
307
- buf.data(),
308
- buf.size(),
309
- ptr->GetState()
280
+ auto buffer = args[0]->Uint32Value(context).ToChecked();
281
+ auto drawbuffer = args[1]->Int32Value(context).ToChecked();
282
+ if (values->IsArray()) {
283
+ auto array = values.As<v8::Array>();
284
+ auto len = array->Length();
285
+ std::vector<float> buf;
286
+ buf.reserve(len);
287
+ for (int j = 0; j < len; ++j) {
288
+ auto item = array->Get(
289
+ context, j).ToLocalChecked();
290
+ buf.push_back(
291
+ static_cast<float>(item->NumberValue(context).ToChecked())
310
292
  );
293
+ }
311
294
 
312
- } else if (values->IsFloat32Array()) {
313
- auto buf = values.As<v8::Float32Array>();
314
- auto array = buf->Buffer();
315
- auto offset = buf->ByteOffset();
316
- auto size = buf->Length();
317
- auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
318
- auto data = static_cast<float *>((void*) data_ptr);
295
+ canvas_native_webgl2_clear_bufferfv(
296
+ buffer,
297
+ drawbuffer,
298
+ buf.data(),
299
+ buf.size(),
300
+ ptr->GetState()
301
+ );
319
302
 
303
+ } else if (values->IsFloat32Array()) {
304
+ auto buf = values.As<v8::Float32Array>();
305
+ auto array = buf->Buffer();
306
+ auto offset = buf->ByteOffset();
307
+ auto size = buf->Length();
308
+ auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
309
+ auto data = static_cast<float *>((void *) data_ptr);
320
310
 
321
- canvas_native_webgl2_clear_bufferfv(
322
- buffer->GetBuffer(),
323
- drawbuffer,
324
- data,
325
- size,
326
- ptr->GetState()
327
- );
328
- }
311
+
312
+ canvas_native_webgl2_clear_bufferfv(
313
+ buffer,
314
+ drawbuffer,
315
+ data,
316
+ size,
317
+ ptr->GetState()
318
+ );
329
319
  }
330
320
  }
331
321
 
@@ -338,55 +328,49 @@ void WebGL2RenderingContext::ClearBufferiv(const v8::FunctionCallbackInfo<v8::Va
338
328
  auto isolate = args.GetIsolate();
339
329
  auto context = isolate->GetCurrentContext();
340
330
 
341
- auto bufferValue = args[0];
342
- auto type = GetNativeType(isolate, bufferValue);
343
331
  auto values = args[2];
344
- if (args.Length() > 2 && type == NativeType::WebGLBuffer &&
345
- args[1]->IsObject()) {
346
- auto drawbuffer = (int32_t) args[1]->NumberValue(context).ToChecked();
347
- auto buffer = WebGLBuffer::GetPointer(bufferValue.As<v8::Object>());
348
- if (values->IsArray()) {
349
- auto array = values.As<v8::Array>();
350
- auto len = array->Length();
351
- std::vector<int32_t> buf;
352
- buf.reserve(len);
353
- for (int j = 0; j < len; ++j) {
354
- auto item = array->Get(
355
- context, j).ToLocalChecked();
356
- buf.push_back(
357
- static_cast<int32_t>(item->NumberValue(context).ToChecked())
358
- );
359
- }
360
332
 
361
-
362
- canvas_native_webgl2_clear_bufferiv(
363
- buffer->GetBuffer(),
364
- drawbuffer,
365
- buf.data(),
366
- buf.size(),
367
- ptr->GetState()
333
+ auto buffer = args[0]->Uint32Value(context).ToChecked();
334
+ auto drawbuffer = args[1]->Int32Value(context).ToChecked();
335
+ if (values->IsArray()) {
336
+ auto array = values.As<v8::Array>();
337
+ auto len = array->Length();
338
+ std::vector<int32_t> buf;
339
+ buf.reserve(len);
340
+ for (int j = 0; j < len; ++j) {
341
+ auto item = array->Get(
342
+ context, j).ToLocalChecked();
343
+ buf.push_back(
344
+ item->Int32Value(context).ToChecked()
368
345
  );
346
+ }
369
347
 
370
- } else if (values->IsInt32Array()) {
371
- auto buf = values.As<v8::Int32Array>();
372
348
 
373
- auto array = buf->Buffer();
374
- auto offset = buf->ByteOffset();
375
- auto size = buf->Length();
376
- auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
377
- auto data = static_cast<int32_t *>((void*) data_ptr);
349
+ canvas_native_webgl2_clear_bufferiv(
350
+ buffer,
351
+ drawbuffer,
352
+ buf.data(),
353
+ buf.size(),
354
+ ptr->GetState()
355
+ );
378
356
 
357
+ } else if (values->IsInt32Array()) {
358
+ auto buf = values.As<v8::Int32Array>();
379
359
 
360
+ auto array = buf->Buffer();
361
+ auto offset = buf->ByteOffset();
362
+ auto size = buf->Length();
363
+ auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
364
+ auto data = static_cast<int32_t *>((void *) data_ptr);
380
365
 
381
366
 
382
- canvas_native_webgl2_clear_bufferiv(
383
- buffer->GetBuffer(),
384
- drawbuffer,
385
- data,
386
- size,
387
- ptr->GetState()
388
- );
389
- }
367
+ canvas_native_webgl2_clear_bufferiv(
368
+ buffer,
369
+ drawbuffer,
370
+ data,
371
+ size,
372
+ ptr->GetState()
373
+ );
390
374
  }
391
375
  }
392
376
 
@@ -399,23 +383,17 @@ void WebGL2RenderingContext::ClearBufferfi(const v8::FunctionCallbackInfo<v8::Va
399
383
  auto isolate = args.GetIsolate();
400
384
  auto context = isolate->GetCurrentContext();
401
385
 
402
- auto bufferValue = args[0];
403
- auto type = GetNativeType(isolate, bufferValue);
404
- if (args.Length() > 3 && type == NativeType::WebGLBuffer) {
405
- auto buffer = WebGLBuffer::GetPointer(bufferValue.As<v8::Object>());
406
- if (buffer != nullptr) {
407
- auto drawbuffer = (int32_t) args[1]->NumberValue(context).ToChecked();
408
- auto depth = args[2]->NumberValue(context).ToChecked();
409
- auto stencil = (int32_t) args[3]->NumberValue(context).ToChecked();
410
- canvas_native_webgl2_clear_bufferfi(
411
- buffer->GetBuffer(),
412
- drawbuffer,
413
- static_cast<float>(depth),
414
- stencil,
415
- ptr->GetState()
416
- );
417
- }
418
- }
386
+ auto buffer = args[0]->Uint32Value(context).ToChecked();
387
+ auto drawbuffer = args[1]->Int32Value(context).ToChecked();
388
+ auto depth = args[2]->NumberValue(context).ToChecked();
389
+ auto stencil = args[3]->Int32Value(context).ToChecked();
390
+ canvas_native_webgl2_clear_bufferfi(
391
+ buffer,
392
+ drawbuffer,
393
+ static_cast<float>(depth),
394
+ stencil,
395
+ ptr->GetState()
396
+ );
419
397
  }
420
398
 
421
399
  void WebGL2RenderingContext::ClearBufferuiv(const v8::FunctionCallbackInfo<v8::Value> &args) {
@@ -427,52 +405,48 @@ void WebGL2RenderingContext::ClearBufferuiv(const v8::FunctionCallbackInfo<v8::V
427
405
  auto isolate = args.GetIsolate();
428
406
  auto context = isolate->GetCurrentContext();
429
407
 
430
- auto bufferValue = args[0];
431
- auto type = GetNativeType(isolate, bufferValue);
432
- auto values = args[2];
433
- if (args.Length() > 2 && type == NativeType::WebGLBuffer &&
434
- args[1]->IsObject()) {
435
- auto drawbuffer = (int32_t) args[1]->NumberValue(context).ToChecked();
436
- auto buffer = WebGLBuffer::GetPointer(bufferValue.As<v8::Object>());
437
- if (values->IsArray()) {
438
- auto array = values.As<v8::Array>();
439
- auto len = array->Length();
440
- std::vector<uint32_t> buf;
441
- buf.reserve(len);
442
- for (int j = 0; j < len; ++j) {
443
- auto item = array->Get(
444
- context, j).ToLocalChecked();
445
- buf.push_back(
446
- static_cast<uint32_t>(item->NumberValue(context).ToChecked())
447
- );
448
- }
449
408
 
409
+ auto values = args[2];
450
410
 
451
- canvas_native_webgl2_clear_bufferuiv(
452
- buffer->GetBuffer(),
453
- drawbuffer,
454
- buf.data(),
455
- buf.size(),
456
- ptr->GetState()
411
+ auto buffer = args[0]->Uint32Value(context).ToChecked();
412
+ auto drawbuffer = args[1]->Int32Value(context).ToChecked();
413
+ if (values->IsArray()) {
414
+ auto array = values.As<v8::Array>();
415
+ auto len = array->Length();
416
+ std::vector<uint32_t> buf;
417
+ buf.reserve(len);
418
+ for (int j = 0; j < len; ++j) {
419
+ auto item = array->Get(
420
+ context, j).ToLocalChecked();
421
+ buf.push_back(
422
+ item->Uint32Value(context).ToChecked()
457
423
  );
424
+ }
458
425
 
459
- } else if (values->IsUint32Array()) {
460
- auto buf = values.As<v8::Uint32Array>();
461
- auto array = buf->Buffer();
462
- auto offset = buf->ByteOffset();
463
- auto size = buf->Length();
464
- auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
465
- auto data = static_cast<uint32_t *>((void*) data_ptr);
466
426
 
427
+ canvas_native_webgl2_clear_bufferuiv(
428
+ buffer,
429
+ drawbuffer,
430
+ buf.data(),
431
+ buf.size(),
432
+ ptr->GetState()
433
+ );
434
+
435
+ } else if (values->IsUint32Array()) {
436
+ auto buf = values.As<v8::Uint32Array>();
437
+ auto array = buf->Buffer();
438
+ auto offset = buf->ByteOffset();
439
+ auto size = buf->Length();
440
+ auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
441
+ auto data = static_cast<uint32_t *>((void *) data_ptr);
467
442
 
468
443
 
469
- canvas_native_webgl2_clear_bufferuiv(
470
- buffer->GetBuffer(),
471
- drawbuffer,
472
- data, size,
473
- ptr->GetState()
474
- );
475
- }
444
+ canvas_native_webgl2_clear_bufferuiv(
445
+ buffer,
446
+ drawbuffer,
447
+ data, size,
448
+ ptr->GetState()
449
+ );
476
450
  }
477
451
  }
478
452
 
@@ -490,7 +464,7 @@ void WebGL2RenderingContext::ClientWaitSync(const v8::FunctionCallbackInfo<v8::V
490
464
  if (args.Length() > 2 && type == NativeType::WebGLSync) {
491
465
  auto sync = WebGLSyncImpl::GetPointer(syncValue.As<v8::Object>());
492
466
  if (sync != nullptr) {
493
- auto flags = (uint32_t) args[1]->NumberValue(context).ToChecked();
467
+ auto flags = args[1]->Uint32Value(context).ToChecked();
494
468
  auto timeout = args[2]->NumberValue(context).ToChecked();
495
469
  auto ret = canvas_native_webgl2_client_wait_sync(
496
470
  sync->GetSync(),
@@ -499,7 +473,7 @@ void WebGL2RenderingContext::ClientWaitSync(const v8::FunctionCallbackInfo<v8::V
499
473
  ptr->GetState()
500
474
  );
501
475
 
502
- args.GetReturnValue().Set((int32_t) ret);
476
+ args.GetReturnValue().Set(ret);
503
477
  return;
504
478
  }
505
479
  }
@@ -518,15 +492,15 @@ WebGL2RenderingContext::CompressedTexSubImage3D(const v8::FunctionCallbackInfo<v
518
492
  auto context = isolate->GetCurrentContext();
519
493
 
520
494
  if (args.Length() > 8) {
521
- auto target = (uint32_t) args[0]->NumberValue(context).ToChecked();
522
- auto level = (int32_t) args[1]->NumberValue(context).ToChecked();
523
- auto xoffset = (int32_t) args[2]->NumberValue(context).ToChecked();
524
- auto yoffset = (int32_t) args[3]->NumberValue(context).ToChecked();
525
- auto zoffset = (int32_t) args[4]->NumberValue(context).ToChecked();
526
- auto width = (int32_t) args[5]->NumberValue(context).ToChecked();
527
- auto height = (int32_t) args[6]->NumberValue(context).ToChecked();
528
- auto depth = (int32_t) args[7]->NumberValue(context).ToChecked();
529
- auto format = (uint32_t) args[8]->NumberValue(context).ToChecked();
495
+ auto target = args[0]->Uint32Value(context).ToChecked();
496
+ auto level = args[1]->Int32Value(context).ToChecked();
497
+ auto xoffset = args[2]->Int32Value(context).ToChecked();
498
+ auto yoffset = args[3]->Int32Value(context).ToChecked();
499
+ auto zoffset = args[4]->Int32Value(context).ToChecked();
500
+ auto width = args[5]->Int32Value(context).ToChecked();
501
+ auto height = args[6]->Int32Value(context).ToChecked();
502
+ auto depth = args[7]->Int32Value(context).ToChecked();
503
+ auto format = args[8]->Uint32Value(context).ToChecked();
530
504
 
531
505
  auto imageSizeOrBufValue = args[0];
532
506
  if (args[9]->IsObject()) {
@@ -535,8 +509,8 @@ WebGL2RenderingContext::CompressedTexSubImage3D(const v8::FunctionCallbackInfo<v
535
509
  auto array = buf->Buffer();
536
510
  auto offset = buf->ByteOffset();
537
511
  auto size = buf->ByteLength();
538
- auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
539
- auto data = static_cast<uint8_t *>((void*) data_ptr);
512
+ auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
513
+ auto data = static_cast<uint8_t *>((void *) data_ptr);
540
514
 
541
515
  size_t srcOffset = 0;
542
516
  if (args[10]->IsNumber()) {
@@ -567,10 +541,10 @@ WebGL2RenderingContext::CompressedTexSubImage3D(const v8::FunctionCallbackInfo<v
567
541
  );
568
542
  }
569
543
  } else {
570
- auto imageSizeOrBuf = (int32_t) imageSizeOrBufValue->NumberValue(context).ToChecked();
544
+ auto imageSizeOrBuf = imageSizeOrBufValue->Int32Value(context).ToChecked();
571
545
  auto offset = 0;
572
546
  if (args[10]->IsNumber()) {
573
- offset = (int32_t) args[10]->NumberValue(context).ToChecked();
547
+ offset = args[10]->Int32Value(context).ToChecked();
574
548
  }
575
549
  canvas_native_webgl2_compressed_tex_sub_image3d_none(
576
550
  target,
@@ -600,8 +574,8 @@ void WebGL2RenderingContext::CopyBufferSubData(const v8::FunctionCallbackInfo<v8
600
574
  auto context = isolate->GetCurrentContext();
601
575
 
602
576
  if (args.Length() > 4) {
603
- auto readTarget = (uint32_t) args[0]->NumberValue(context).ToChecked();
604
- auto writeTarget = (uint32_t) args[1]->NumberValue(context).ToChecked();
577
+ auto readTarget = args[0]->Uint32Value(context).ToChecked();
578
+ auto writeTarget = args[1]->Uint32Value(context).ToChecked();
605
579
  auto readOffset = args[2]->NumberValue(context).ToChecked();
606
580
  auto writeOffset = args[3]->NumberValue(context).ToChecked();
607
581
  auto size = args[4]->NumberValue(context).ToChecked();
@@ -626,15 +600,15 @@ void WebGL2RenderingContext::CopyTexSubImage3D(const v8::FunctionCallbackInfo<v8
626
600
  auto context = isolate->GetCurrentContext();
627
601
 
628
602
  if (args.Length() > 8) {
629
- auto target = (uint32_t) args[0]->NumberValue(context).ToChecked();
630
- auto level = (int32_t) args[1]->NumberValue(context).ToChecked();
631
- auto xoffset = (int32_t) args[2]->NumberValue(context).ToChecked();
632
- auto yoffset = (int32_t) args[3]->NumberValue(context).ToChecked();
633
- auto zoffset = (int32_t) args[4]->NumberValue(context).ToChecked();
634
- auto x = (int32_t) args[5]->NumberValue(context).ToChecked();
635
- auto y = (int32_t) args[6]->NumberValue(context).ToChecked();
636
- auto width = (int32_t) args[7]->NumberValue(context).ToChecked();
637
- auto height = (int32_t) args[8]->NumberValue(context).ToChecked();
603
+ auto target = args[0]->Uint32Value(context).ToChecked();
604
+ auto level = args[1]->Int32Value(context).ToChecked();
605
+ auto xoffset = args[2]->Int32Value(context).ToChecked();
606
+ auto yoffset = args[3]->Int32Value(context).ToChecked();
607
+ auto zoffset = args[4]->Int32Value(context).ToChecked();
608
+ auto x = args[5]->Int32Value(context).ToChecked();
609
+ auto y = args[6]->Int32Value(context).ToChecked();
610
+ auto width = args[7]->Int32Value(context).ToChecked();
611
+ auto height = args[8]->Int32Value(context).ToChecked();
638
612
  canvas_native_webgl2_copy_tex_sub_image3d(
639
613
  target,
640
614
  level,
@@ -845,10 +819,10 @@ void WebGL2RenderingContext::DrawArraysInstanced(const v8::FunctionCallbackInfo<
845
819
  auto isolate = args.GetIsolate();
846
820
  auto context = isolate->GetCurrentContext();
847
821
 
848
- auto mode = (uint32_t) args[0]->NumberValue(context).ToChecked();
849
- auto first = (int32_t) args[1]->NumberValue(context).ToChecked();
850
- auto count_ = (int32_t) args[2]->NumberValue(context).ToChecked();
851
- auto instanceCount = (int32_t) args[3]->NumberValue(context).ToChecked();
822
+ auto mode = args[0]->Uint32Value(context).ToChecked();
823
+ auto first = args[1]->Int32Value(context).ToChecked();
824
+ auto count_ = args[2]->Int32Value(context).ToChecked();
825
+ auto instanceCount = args[3]->Int32Value(context).ToChecked();
852
826
  canvas_native_webgl2_draw_arrays_instanced(
853
827
  mode,
854
828
  first,
@@ -878,12 +852,11 @@ void WebGL2RenderingContext::DrawBuffers(const v8::FunctionCallbackInfo<v8::Valu
878
852
  for (int j = 0; j < len; ++j) {
879
853
  auto item = array->Get(
880
854
  context, j).ToLocalChecked();
881
- buf.emplace_back(
882
- (uint32_t) item->NumberValue(context).ToChecked());
855
+ buf.emplace_back(item->Uint32Value(context).ToChecked());
883
856
  }
884
857
 
885
858
  canvas_native_webgl2_draw_buffers(
886
- buf.data(), buf.size(),
859
+ buf.data(), buf.size(),
887
860
  ptr->GetState());
888
861
  }
889
862
  }
@@ -898,11 +871,11 @@ WebGL2RenderingContext::DrawElementsInstanced(const v8::FunctionCallbackInfo<v8:
898
871
  auto isolate = args.GetIsolate();
899
872
  auto context = isolate->GetCurrentContext();
900
873
 
901
- auto mode = (uint32_t) args[0]->NumberValue(context).ToChecked();
902
- auto count_ = (int32_t) args[1]->NumberValue(context).ToChecked();
903
- auto type = (uint32_t) args[2]->NumberValue(context).ToChecked();
874
+ auto mode = args[0]->Uint32Value(context).ToChecked();
875
+ auto count_ = args[1]->Int32Value(context).ToChecked();
876
+ auto type = args[2]->Uint32Value(context).ToChecked();
904
877
  auto offset = args[3]->NumberValue(context).ToChecked();
905
- auto instanceCount = (int32_t) args[4]->NumberValue(context).ToChecked();
878
+ auto instanceCount = args[4]->Int32Value(context).ToChecked();
906
879
  canvas_native_webgl2_draw_elements_instanced(
907
880
  mode,
908
881
  count_,
@@ -924,11 +897,11 @@ void WebGL2RenderingContext::DrawRangeElements(const v8::FunctionCallbackInfo<v8
924
897
  auto isolate = args.GetIsolate();
925
898
  auto context = isolate->GetCurrentContext();
926
899
 
927
- auto mode = (uint32_t) args[0]->NumberValue(context).ToChecked();
928
- auto start = (uint32_t) args[1]->NumberValue(context).ToChecked();
929
- auto end = (uint32_t) args[2]->NumberValue(context).ToChecked();
930
- auto count_ = (int32_t) args[3]->NumberValue(context).ToChecked();
931
- auto type = (uint32_t) args[4]->NumberValue(context).ToChecked();
900
+ auto mode = args[0]->Uint32Value(context).ToChecked();
901
+ auto start = args[1]->Uint32Value(context).ToChecked();
902
+ auto end = args[2]->Uint32Value(context).ToChecked();
903
+ auto count_ = args[3]->Int32Value(context).ToChecked();
904
+ auto type = args[4]->Uint32Value(context).ToChecked();
932
905
  auto offset = args[5]->NumberValue(context).ToChecked();
933
906
  canvas_native_webgl2_draw_range_elements(
934
907
  mode,
@@ -953,7 +926,7 @@ void WebGL2RenderingContext::EndQuery(const v8::FunctionCallbackInfo<v8::Value>
953
926
  auto context = isolate->GetCurrentContext();
954
927
 
955
928
  if (args[0]->IsNumber()) {
956
- auto target = (uint32_t) args[0]->NumberValue(context).ToChecked();
929
+ auto target = args[0]->Uint32Value(context).ToChecked();
957
930
  canvas_native_webgl2_end_query(target,
958
931
  ptr->GetState());
959
932
  }
@@ -982,8 +955,8 @@ void WebGL2RenderingContext::FenceSync(const v8::FunctionCallbackInfo<v8::Value>
982
955
  auto isolate = args.GetIsolate();
983
956
  auto context = isolate->GetCurrentContext();
984
957
 
985
- auto condition = (uint32_t) args[0]->NumberValue(context).ToChecked();
986
- auto flags = (uint32_t) args[1]->NumberValue(context).ToChecked();
958
+ auto condition = args[0]->Uint32Value(context).ToChecked();
959
+ auto flags = args[1]->Uint32Value(context).ToChecked();
987
960
  auto sync = canvas_native_webgl2_fence_sync(
988
961
  condition,
989
962
  flags,
@@ -1009,11 +982,11 @@ WebGL2RenderingContext::FramebufferTextureLayer(const v8::FunctionCallbackInfo<v
1009
982
  auto textureValue = args[2];
1010
983
  auto type = GetNativeType(isolate, textureValue);
1011
984
  if (type == NativeType::WebGLTexture) {
1012
- auto target = (uint32_t) args[0]->NumberValue(context).ToChecked();
1013
- auto attachment = (uint32_t) args[1]->NumberValue(context).ToChecked();
985
+ auto target = args[0]->Uint32Value(context).ToChecked();
986
+ auto attachment = args[1]->Uint32Value(context).ToChecked();
1014
987
  auto texture = WebGLTexture::GetPointer(textureValue.As<v8::Object>());
1015
- auto level = (int32_t) args[3]->NumberValue(context).ToChecked();
1016
- auto layer = (int32_t) args[4]->NumberValue(context).ToChecked();
988
+ auto level = args[3]->Int32Value(context).ToChecked();
989
+ auto layer = args[4]->Int32Value(context).ToChecked();
1017
990
  if (texture != nullptr) {
1018
991
  canvas_native_webgl2_framebuffer_texture_layer(
1019
992
  target,
@@ -1044,13 +1017,13 @@ WebGL2RenderingContext::GetActiveUniformBlockName(const v8::FunctionCallbackInfo
1044
1017
  if (type == NativeType::WebGLProgram) {
1045
1018
  auto program = WebGLProgram::GetPointer(programValue.As<v8::Object>());
1046
1019
  if (program != nullptr) {
1047
- auto uniformBlockIndex = (uint32_t) args[1]->NumberValue(context).ToChecked();
1020
+ auto uniformBlockIndex = args[1]->Uint32Value(context).ToChecked();
1048
1021
  auto name = canvas_native_webgl2_get_active_uniform_block_name(
1049
1022
  program->GetProgram(),
1050
1023
  uniformBlockIndex,
1051
1024
  ptr->GetState()
1052
1025
  );
1053
- args.GetReturnValue().Set(ConvertToV8OneByteString(isolate, (char*)name));
1026
+ args.GetReturnValue().Set(ConvertToV8OneByteString(isolate, (char *) name));
1054
1027
  return;
1055
1028
  }
1056
1029
 
@@ -1077,8 +1050,8 @@ void WebGL2RenderingContext::GetActiveUniformBlockParameter(
1077
1050
  auto program = WebGLProgram::GetPointer(programValue.As<v8::Object>());
1078
1051
 
1079
1052
  if (program != nullptr) {
1080
- auto uniformBlockIndex = (uint32_t) args[1]->NumberValue(context).ToChecked();
1081
- auto pname = (uint32_t) args[2]->NumberValue(context).ToChecked();
1053
+ auto uniformBlockIndex = args[1]->Uint32Value(context).ToChecked();
1054
+ auto pname = args[2]->Uint32Value(context).ToChecked();
1082
1055
  auto ret = canvas_native_webgl2_get_active_uniform_block_parameter(
1083
1056
  program->GetProgram(),
1084
1057
  uniformBlockIndex,
@@ -1098,7 +1071,7 @@ void WebGL2RenderingContext::GetActiveUniformBlockParameter(
1098
1071
  auto value = canvas_native_webgl_result_get_u32_array(
1099
1072
  ret);
1100
1073
 
1101
- auto buf = (uint8_t*)canvas_native_u32_buffer_get_bytes(value);
1074
+ auto buf = (uint8_t *) canvas_native_u32_buffer_get_bytes(value);
1102
1075
  auto size = canvas_native_u32_buffer_get_length(value);
1103
1076
  auto bytes_size = size * sizeof(uint32_t);
1104
1077
 
@@ -1106,7 +1079,8 @@ void WebGL2RenderingContext::GetActiveUniformBlockParameter(
1106
1079
  [](void *data, size_t length,
1107
1080
  void *deleter_data) {
1108
1081
  if (deleter_data != nullptr) {
1109
- canvas_native_u32_buffer_destroy((U32Buffer *) deleter_data);
1082
+ canvas_native_u32_buffer_destroy(
1083
+ (U32Buffer *) deleter_data);
1110
1084
  }
1111
1085
  },
1112
1086
  value);
@@ -1150,7 +1124,7 @@ void WebGL2RenderingContext::GetActiveUniforms(const v8::FunctionCallbackInfo<v8
1150
1124
 
1151
1125
  auto program = WebGLProgram::GetPointer(programValue.As<v8::Object>());
1152
1126
  auto uniformIndicesObject = args[1];
1153
- auto pname = (uint32_t) args[2]->NumberValue(context).ToChecked();
1127
+ auto pname = args[2]->Uint32Value(context).ToChecked();
1154
1128
 
1155
1129
  if (uniformIndicesObject->IsArray()) {
1156
1130
  auto uniformIndices = uniformIndicesObject.As<v8::Array>();
@@ -1158,14 +1132,14 @@ void WebGL2RenderingContext::GetActiveUniforms(const v8::FunctionCallbackInfo<v8
1158
1132
  std::vector<uint32_t> buf;
1159
1133
  buf.reserve(size);
1160
1134
  for (int j = 0; j < size; j++) {
1161
- auto item = (uint32_t) uniformIndices->Get(
1162
- context, j).ToLocalChecked()->NumberValue(context).ToChecked();
1135
+ auto item = uniformIndices->Get(
1136
+ context, j).ToLocalChecked()->Uint32Value(context).ToChecked();
1163
1137
  buf.emplace_back(item);
1164
1138
  }
1165
1139
 
1166
1140
  auto ret = canvas_native_webgl2_get_active_uniforms(
1167
1141
  program->GetProgram(),
1168
- buf.data(), buf.size(),
1142
+ buf.data(), buf.size(),
1169
1143
  pname,
1170
1144
  ptr->GetState()
1171
1145
  );
@@ -1186,7 +1160,7 @@ void WebGL2RenderingContext::GetActiveUniforms(const v8::FunctionCallbackInfo<v8
1186
1160
  auto item = buffer[j];
1187
1161
  array->Set(
1188
1162
  context, j,
1189
- v8::Number::New(isolate, (double) item));
1163
+ v8::Integer::NewFromUnsigned(isolate, item));
1190
1164
  }
1191
1165
  args.GetReturnValue().Set(array);
1192
1166
  canvas_native_u32_buffer_destroy(value);
@@ -1208,8 +1182,7 @@ void WebGL2RenderingContext::GetActiveUniforms(const v8::FunctionCallbackInfo<v8
1208
1182
  auto item = buffer[j];
1209
1183
  array->Set(
1210
1184
  context, j,
1211
- v8::Number::New(isolate,
1212
- (double) item));
1185
+ v8::Integer::New(isolate, item));
1213
1186
  }
1214
1187
  args.GetReturnValue().Set(array);
1215
1188
  canvas_native_i32_buffer_destroy(value);
@@ -1260,7 +1233,7 @@ void WebGL2RenderingContext::GetBufferSubData(const v8::FunctionCallbackInfo<v8:
1260
1233
 
1261
1234
  auto dstDataObject = args[2];
1262
1235
  if (dstDataObject->IsArrayBufferView()) {
1263
- auto target = (uint32_t) args[0]->NumberValue(context).ToChecked();
1236
+ auto target = args[0]->Uint32Value(context).ToChecked();
1264
1237
  auto srcByteOffset = args[1]->NumberValue(context).ToChecked();
1265
1238
 
1266
1239
  auto array = dstDataObject.As<v8::ArrayBufferView>();
@@ -1271,7 +1244,6 @@ void WebGL2RenderingContext::GetBufferSubData(const v8::FunctionCallbackInfo<v8:
1271
1244
  auto data = reinterpret_cast<uint8_t *>(buf->GetBackingStore()->Data()) + offset;
1272
1245
 
1273
1246
 
1274
-
1275
1247
  auto BYTES_PER_ELEMENT = (ssize_t) array->Get(
1276
1248
  context,
1277
1249
  ConvertToV8String(isolate, "BYTES_PER_ELEMENT")).ToLocalChecked()->NumberValue(
@@ -1345,8 +1317,8 @@ void WebGL2RenderingContext::GetIndexedParameter(const v8::FunctionCallbackInfo<
1345
1317
  auto isolate = args.GetIsolate();
1346
1318
  auto context = isolate->GetCurrentContext();
1347
1319
 
1348
- auto target = (uint32_t) args[0]->NumberValue(context).ToChecked();
1349
- auto index = (uint32_t) args[1]->NumberValue(context).ToChecked();
1320
+ auto target = args[0]->Uint32Value(context).ToChecked();
1321
+ auto index = args[1]->Uint32Value(context).ToChecked();
1350
1322
  auto ret = canvas_native_webgl2_get_indexed_parameter(
1351
1323
  target,
1352
1324
  index,
@@ -1390,9 +1362,9 @@ void WebGL2RenderingContext::GetInternalformatParameter(
1390
1362
  auto isolate = args.GetIsolate();
1391
1363
  auto context = isolate->GetCurrentContext();
1392
1364
 
1393
- auto target = (uint32_t) args[0]->NumberValue(context).ToChecked();
1394
- auto internalformat = (uint32_t) args[1]->NumberValue(context).ToChecked();
1395
- auto pname = (uint32_t) args[2]->NumberValue(context).ToChecked();
1365
+ auto target = args[0]->Uint32Value(context).ToChecked();
1366
+ auto internalformat = args[1]->Uint32Value(context).ToChecked();
1367
+ auto pname = args[2]->Uint32Value(context).ToChecked();
1396
1368
  switch (internalformat) {
1397
1369
  case GL_RGB:
1398
1370
  case GL_RGBA:
@@ -1461,7 +1433,7 @@ void WebGL2RenderingContext::GetInternalformatParameter(
1461
1433
  if (pname == GL_SAMPLES) {
1462
1434
  auto value = canvas_native_webgl_result_get_i32_array(ret);
1463
1435
 
1464
- auto buf = (uint8_t*)canvas_native_i32_buffer_get_bytes(value);
1436
+ auto buf = (uint8_t *) canvas_native_i32_buffer_get_bytes(value);
1465
1437
  auto size = canvas_native_i32_buffer_get_length(value);
1466
1438
  auto bytes_size = size * sizeof(int32_t);
1467
1439
 
@@ -1469,7 +1441,8 @@ void WebGL2RenderingContext::GetInternalformatParameter(
1469
1441
  [](void *data, size_t length,
1470
1442
  void *deleter_data) {
1471
1443
  if (deleter_data != nullptr) {
1472
- canvas_native_i32_buffer_destroy((I32Buffer *) deleter_data);
1444
+ canvas_native_i32_buffer_destroy(
1445
+ (I32Buffer *) deleter_data);
1473
1446
  }
1474
1447
  },
1475
1448
  value);
@@ -1495,7 +1468,7 @@ void WebGL2RenderingContext::GetParameter(const v8::FunctionCallbackInfo<v8::Val
1495
1468
  auto isolate = args.GetIsolate();
1496
1469
  auto context = isolate->GetCurrentContext();
1497
1470
 
1498
- auto pname = (uint32_t) args[0]->NumberValue(context).ToChecked();
1471
+ auto pname = args[0]->Uint32Value(context).ToChecked();
1499
1472
  auto result = canvas_native_webgl2_get_parameter(
1500
1473
  pname,
1501
1474
  ptr->GetState());
@@ -1510,7 +1483,7 @@ void WebGL2RenderingContext::GetParameter(const v8::FunctionCallbackInfo<v8::Val
1510
1483
  return;
1511
1484
  default: {
1512
1485
  auto ret = ptr->GetParameterInternal(
1513
- isolate, pname,result);
1486
+ isolate, pname, result);
1514
1487
 
1515
1488
  canvas_native_webgl_WebGLResult_destroy(result);
1516
1489
 
@@ -1535,7 +1508,7 @@ void WebGL2RenderingContext::GetQueryParameter(const v8::FunctionCallbackInfo<v8
1535
1508
  if (type == NativeType::WebGLQuery) {
1536
1509
  auto query = WebGLQuery::GetPointer(queryValue.As<v8::Object>());
1537
1510
  if (query != nullptr) {
1538
- auto pname = (uint32_t) args[1]->NumberValue(context).ToChecked();
1511
+ auto pname = args[1]->Uint32Value(context).ToChecked();
1539
1512
 
1540
1513
 
1541
1514
  auto ret = canvas_native_webgl2_get_query_parameter(
@@ -1549,7 +1522,7 @@ void WebGL2RenderingContext::GetQueryParameter(const v8::FunctionCallbackInfo<v8
1549
1522
  return;
1550
1523
  } else if (pname ==
1551
1524
  GL_QUERY_RESULT_AVAILABLE) {
1552
- args.GetReturnValue().Set((int32_t) canvas_native_webgl_result_get_u32(
1525
+ args.GetReturnValue().Set(canvas_native_webgl_result_get_u32(
1553
1526
  ret));
1554
1527
  canvas_native_webgl_WebGLResult_destroy(ret);
1555
1528
  return;
@@ -1573,8 +1546,8 @@ void WebGL2RenderingContext::GetQuery(const v8::FunctionCallbackInfo<v8::Value>
1573
1546
  auto isolate = args.GetIsolate();
1574
1547
  auto context = isolate->GetCurrentContext();
1575
1548
 
1576
- auto target = (uint32_t) args[0]->NumberValue(context).ToChecked();
1577
- auto pname = (uint32_t) args[1]->NumberValue(context).ToChecked();
1549
+ auto target = args[0]->Uint32Value(context).ToChecked();
1550
+ auto pname = args[1]->Uint32Value(context).ToChecked();
1578
1551
  auto ret = canvas_native_webgl2_get_query(
1579
1552
  target,
1580
1553
  pname,
@@ -1604,7 +1577,7 @@ void WebGL2RenderingContext::GetSamplerParameter(const v8::FunctionCallbackInfo<
1604
1577
  if (type == NativeType::WebGLSampler) {
1605
1578
  auto sampler = WebGLSampler::GetPointer(samplerValue.As<v8::Object>());
1606
1579
  if (sampler != nullptr) {
1607
- auto pname = (uint32_t) args[1]->NumberValue(context).ToChecked();
1580
+ auto pname = args[1]->Uint32Value(context).ToChecked();
1608
1581
  auto ret = canvas_native_webgl2_get_sampler_parameter(
1609
1582
  sampler->GetSampler(),
1610
1583
  pname,
@@ -1653,7 +1626,7 @@ void WebGL2RenderingContext::GetSyncParameter(const v8::FunctionCallbackInfo<v8:
1653
1626
  auto syncValue = args[0];
1654
1627
  auto sync = WebGLSyncImpl::GetPointer(syncValue.As<v8::Object>());
1655
1628
  if (sync != nullptr) {
1656
- auto pname = (uint32_t) args[1]->NumberValue(context).ToChecked();
1629
+ auto pname = args[1]->Uint32Value(context).ToChecked();
1657
1630
  auto ret = canvas_native_webgl2_get_sync_parameter(
1658
1631
  sync->GetSync(),
1659
1632
  pname,
@@ -1693,7 +1666,7 @@ void WebGL2RenderingContext::GetTransformFeedbackVarying(
1693
1666
  auto type = GetNativeType(isolate, programValue);
1694
1667
  if (type == NativeType::WebGLProgram) {
1695
1668
  auto program = WebGLProgram::GetPointer(programValue.As<v8::Object>());
1696
- auto index = (uint32_t) args[1]->NumberValue(context).ToChecked();
1669
+ auto index = args[1]->Uint32Value(context).ToChecked();
1697
1670
  if (program != nullptr) {
1698
1671
  auto ret = canvas_native_webgl2_get_transform_feedback_varying(
1699
1672
  program->GetProgram(),
@@ -1776,7 +1749,7 @@ void WebGL2RenderingContext::GetUniformIndices(const v8::FunctionCallbackInfo<v8
1776
1749
  }
1777
1750
 
1778
1751
 
1779
- const char* cStrings[store.size()];
1752
+ const char *cStrings[store.size()];
1780
1753
  for (size_t i = 0; i < store.size(); ++i) {
1781
1754
  cStrings[i] = store[i].c_str();
1782
1755
  }
@@ -1796,8 +1769,7 @@ void WebGL2RenderingContext::GetUniformIndices(const v8::FunctionCallbackInfo<v8
1796
1769
  auto item = buf[j];
1797
1770
  result->Set(context,
1798
1771
  j,
1799
- v8::Number::New(isolate,
1800
- (int32_t) item));
1772
+ v8::Integer::NewFromUnsigned(isolate, item));
1801
1773
  }
1802
1774
 
1803
1775
  args.GetReturnValue().Set(result);
@@ -1820,7 +1792,7 @@ WebGL2RenderingContext::InvalidateFramebuffer(const v8::FunctionCallbackInfo<v8:
1820
1792
  auto context = isolate->GetCurrentContext();
1821
1793
 
1822
1794
  auto attachments = args[1];
1823
- auto target = (uint32_t) args[0]->NumberValue(context).ToChecked();
1795
+ auto target = args[0]->Uint32Value(context).ToChecked();
1824
1796
 
1825
1797
  if (attachments->IsArray()) {
1826
1798
  auto array = attachments.As<v8::Array>();
@@ -1828,8 +1800,8 @@ WebGL2RenderingContext::InvalidateFramebuffer(const v8::FunctionCallbackInfo<v8:
1828
1800
  std::vector<uint32_t> buf;
1829
1801
  buf.reserve(len);
1830
1802
  for (int j = 0; j < len; ++j) {
1831
- auto item = (uint32_t) array->Get(
1832
- context, j).ToLocalChecked()->NumberValue(context).ToChecked();
1803
+ auto item = array->Get(
1804
+ context, j).ToLocalChecked()->Uint32Value(context).ToChecked();
1833
1805
  buf.push_back(item);
1834
1806
  }
1835
1807
 
@@ -1851,19 +1823,19 @@ WebGL2RenderingContext::InvalidateSubFramebuffer(const v8::FunctionCallbackInfo<
1851
1823
 
1852
1824
  auto attachments = args[1];
1853
1825
  if (attachments->IsArray()) {
1854
- auto target = (uint32_t) args[0]->NumberValue(context).ToChecked();
1855
- auto x = (int32_t) args[2]->NumberValue(context).ToChecked();
1856
- auto y = (int32_t) args[3]->NumberValue(context).ToChecked();
1857
- auto width = (int32_t) args[4]->NumberValue(context).ToChecked();
1858
- auto height = (int32_t) args[5]->NumberValue(context).ToChecked();
1826
+ auto target = args[0]->Uint32Value(context).ToChecked();
1827
+ auto x = args[2]->Int32Value(context).ToChecked();
1828
+ auto y = args[3]->Int32Value(context).ToChecked();
1829
+ auto width = args[4]->Int32Value(context).ToChecked();
1830
+ auto height = args[5]->Int32Value(context).ToChecked();
1859
1831
 
1860
1832
  auto array = attachments.As<v8::Array>();
1861
1833
  auto len = array->Length();
1862
1834
  std::vector<uint32_t> buf;
1863
1835
  buf.reserve(len);
1864
1836
  for (int j = 0; j < len; ++j) {
1865
- auto item = (uint32_t) array->Get(
1866
- context, j).ToLocalChecked()->NumberValue(context).ToChecked();
1837
+ auto item = array->Get(
1838
+ context, j).ToLocalChecked()->Uint32Value(context).ToChecked();
1867
1839
  buf.push_back(item);
1868
1840
  }
1869
1841
 
@@ -2022,7 +1994,7 @@ void WebGL2RenderingContext::ReadBuffer(const v8::FunctionCallbackInfo<v8::Value
2022
1994
  auto isolate = args.GetIsolate();
2023
1995
  auto context = isolate->GetCurrentContext();
2024
1996
 
2025
- auto src = (uint32_t) args[0]->NumberValue(context).ToChecked();
1997
+ auto src = args[0]->Uint32Value(context).ToChecked();
2026
1998
  canvas_native_webgl2_read_buffer(
2027
1999
  src,
2028
2000
  ptr->GetState()
@@ -2039,11 +2011,11 @@ void WebGL2RenderingContext::RenderbufferStorageMultisample(
2039
2011
  auto isolate = args.GetIsolate();
2040
2012
  auto context = isolate->GetCurrentContext();
2041
2013
 
2042
- auto target = (uint32_t) args[0]->NumberValue(context).ToChecked();
2043
- auto samples = (int32_t) args[1]->NumberValue(context).ToChecked();
2044
- auto internalFormat = (uint32_t) args[2]->NumberValue(context).ToChecked();
2045
- auto width = (int32_t) args[3]->NumberValue(context).ToChecked();
2046
- auto height = (int32_t) args[4]->NumberValue(context).ToChecked();
2014
+ auto target = args[0]->Uint32Value(context).ToChecked();
2015
+ auto samples = args[1]->Int32Value(context).ToChecked();
2016
+ auto internalFormat = args[2]->Uint32Value(context).ToChecked();
2017
+ auto width = args[3]->Int32Value(context).ToChecked();
2018
+ auto height = args[4]->Int32Value(context).ToChecked();
2047
2019
  canvas_native_webgl2_renderbuffer_storage_multisample(
2048
2020
  target,
2049
2021
  samples,
@@ -2078,7 +2050,7 @@ void WebGL2RenderingContext::SamplerParameterf(const v8::FunctionCallbackInfo<v8
2078
2050
  auto type = GetNativeType(isolate, samplerValue);
2079
2051
  if (type == NativeType::WebGLSampler) {
2080
2052
  auto sampler = WebGLSampler::GetPointer(samplerValue.As<v8::Object>());
2081
- auto pname = (uint32_t) args[1]->NumberValue(context).ToChecked();
2053
+ auto pname = args[1]->Uint32Value(context).ToChecked();
2082
2054
  auto param = args[2]->NumberValue(context).ToChecked();
2083
2055
  if (sampler != nullptr) {
2084
2056
  canvas_native_webgl2_sampler_parameterf(
@@ -2104,8 +2076,8 @@ void WebGL2RenderingContext::SamplerParameteri(const v8::FunctionCallbackInfo<v8
2104
2076
  auto type = GetNativeType(isolate, samplerValue);
2105
2077
  if (type == NativeType::WebGLSampler) {
2106
2078
  auto sampler = WebGLSampler::GetPointer(samplerValue.As<v8::Object>());
2107
- auto pname = (uint32_t) args[1]->NumberValue(context).ToChecked();
2108
- auto param = (int32_t) args[2]->NumberValue(context).ToChecked();
2079
+ auto pname = args[1]->Uint32Value(context).ToChecked();
2080
+ auto param = args[2]->Int32Value(context).ToChecked();
2109
2081
  if (sampler != nullptr) {
2110
2082
  canvas_native_webgl2_sampler_parameteri(
2111
2083
  sampler->GetSampler(),
@@ -2130,23 +2102,23 @@ void WebGL2RenderingContext::TexImage3D(const v8::FunctionCallbackInfo<v8::Value
2130
2102
 
2131
2103
 
2132
2104
  if (count == 10) {
2133
- auto target = (int32_t) args[0]->NumberValue(
2105
+ auto target = args[0]->Int32Value(
2134
2106
  context).ToChecked();
2135
- auto level = (int32_t) args[1]->NumberValue(
2107
+ auto level = args[1]->Int32Value(
2136
2108
  context).ToChecked();
2137
- auto internalformat = (int32_t) args[2]->NumberValue(
2109
+ auto internalformat = args[2]->Int32Value(
2138
2110
  context).ToChecked();
2139
- auto width = (int32_t) args[3]->NumberValue(
2111
+ auto width = args[3]->Int32Value(
2140
2112
  context).ToChecked();
2141
- auto height = (int32_t) args[4]->NumberValue(
2113
+ auto height = args[4]->Int32Value(
2142
2114
  context).ToChecked();
2143
- auto depth = (int32_t) args[5]->NumberValue(
2115
+ auto depth = args[5]->Int32Value(
2144
2116
  context).ToChecked();
2145
- auto border = (int32_t) args[6]->NumberValue(
2117
+ auto border = args[6]->Int32Value(
2146
2118
  context).ToChecked();
2147
- auto format = (int32_t) args[7]->NumberValue(
2119
+ auto format = args[7]->Int32Value(
2148
2120
  context).ToChecked();
2149
- auto type = (uint32_t) args[8]->NumberValue(
2121
+ auto type = args[8]->Uint32Value(
2150
2122
  context).ToChecked();
2151
2123
 
2152
2124
  auto imageOrPixelsOrOffset = args[9];
@@ -2177,8 +2149,8 @@ void WebGL2RenderingContext::TexImage3D(const v8::FunctionCallbackInfo<v8::Value
2177
2149
  auto array = buf->Buffer();
2178
2150
  auto offset = buf->ByteOffset();
2179
2151
  auto size = buf->ByteLength();
2180
- auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
2181
- auto data = static_cast<uint8_t *>((void*) data_ptr);
2152
+ auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
2153
+ auto data = static_cast<uint8_t *>((void *) data_ptr);
2182
2154
 
2183
2155
 
2184
2156
  canvas_native_webgl2_tex_image3d(
@@ -2250,23 +2222,23 @@ void WebGL2RenderingContext::TexImage3D(const v8::FunctionCallbackInfo<v8::Value
2250
2222
  }
2251
2223
  } else if (args.Length() > 10) {
2252
2224
 
2253
- auto target = (int32_t) args[0]->NumberValue(
2225
+ auto target = args[0]->Int32Value(
2254
2226
  context).ToChecked();
2255
- auto level = (int32_t) args[1]->NumberValue(
2227
+ auto level = args[1]->Int32Value(
2256
2228
  context).ToChecked();
2257
- auto internalformat = (int32_t) args[2]->NumberValue(
2229
+ auto internalformat = args[2]->Int32Value(
2258
2230
  context).ToChecked();
2259
- auto width = (int32_t) args[3]->NumberValue(
2231
+ auto width = args[3]->Int32Value(
2260
2232
  context).ToChecked();
2261
- auto height = (int32_t) args[4]->NumberValue(
2233
+ auto height = args[4]->Int32Value(
2262
2234
  context).ToChecked();
2263
- auto depth = (int32_t) args[5]->NumberValue(
2235
+ auto depth = args[5]->Int32Value(
2264
2236
  context).ToChecked();
2265
- auto border = (int32_t) args[6]->NumberValue(
2237
+ auto border = args[6]->Int32Value(
2266
2238
  context).ToChecked();
2267
- auto format = (int32_t) args[7]->NumberValue(
2239
+ auto format = args[7]->Int32Value(
2268
2240
  context).ToChecked();
2269
- auto type = (uint32_t) args[8]->NumberValue(
2241
+ auto type = args[8]->Uint32Value(
2270
2242
  context).ToChecked();
2271
2243
 
2272
2244
  auto imageOrPixelsOrOffset = args[9];
@@ -2283,8 +2255,8 @@ void WebGL2RenderingContext::TexImage3D(const v8::FunctionCallbackInfo<v8::Value
2283
2255
  auto array = buf->Buffer();
2284
2256
  auto offset = buf->ByteOffset();
2285
2257
  auto size = buf->ByteLength();
2286
- auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
2287
- auto data = static_cast<uint8_t *>((void*) data_ptr);
2258
+ auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
2259
+ auto data = static_cast<uint8_t *>((void *) data_ptr);
2288
2260
 
2289
2261
  srcOffsetValue =
2290
2262
  srcOffsetValue * size;
@@ -2322,15 +2294,15 @@ void WebGL2RenderingContext::TexStorage2D(const v8::FunctionCallbackInfo<v8::Val
2322
2294
  auto isolate = args.GetIsolate();
2323
2295
  auto context = isolate->GetCurrentContext();
2324
2296
 
2325
- auto target = (uint32_t) args[0]->NumberValue(
2297
+ auto target = args[0]->Uint32Value(
2326
2298
  context).ToChecked();
2327
- auto levels = (int32_t) args[1]->NumberValue(
2299
+ auto levels = args[1]->Int32Value(
2328
2300
  context).ToChecked();
2329
- auto internalFormat = (uint32_t) args[2]->NumberValue(
2301
+ auto internalFormat = args[2]->Uint32Value(
2330
2302
  context).ToChecked();
2331
- auto width = (int32_t) args[3]->NumberValue(
2303
+ auto width = args[3]->Int32Value(
2332
2304
  context).ToChecked();
2333
- auto height = (int32_t) args[4]->NumberValue(
2305
+ auto height = args[4]->Int32Value(
2334
2306
  context).ToChecked();
2335
2307
  canvas_native_webgl2_tex_storage2d(
2336
2308
  target,
@@ -2351,17 +2323,17 @@ void WebGL2RenderingContext::TexStorage3D(const v8::FunctionCallbackInfo<v8::Val
2351
2323
  auto isolate = args.GetIsolate();
2352
2324
  auto context = isolate->GetCurrentContext();
2353
2325
 
2354
- auto target = (uint32_t) args[0]->NumberValue(
2326
+ auto target = args[0]->Uint32Value(
2355
2327
  context).ToChecked();
2356
- auto levels = (int32_t) args[1]->NumberValue(
2328
+ auto levels = args[1]->Int32Value(
2357
2329
  context).ToChecked();
2358
- auto internalFormat = (uint32_t) args[2]->NumberValue(
2330
+ auto internalFormat = args[2]->Uint32Value(
2359
2331
  context).ToChecked();
2360
- auto width = (int32_t) args[3]->NumberValue(
2332
+ auto width = args[3]->Int32Value(
2361
2333
  context).ToChecked();
2362
- auto height = (int32_t) args[4]->NumberValue(
2334
+ auto height = args[4]->Int32Value(
2363
2335
  context).ToChecked();
2364
- auto depth = (int32_t) args[5]->NumberValue(
2336
+ auto depth = args[5]->Int32Value(
2365
2337
  context).ToChecked();
2366
2338
  canvas_native_webgl2_tex_storage3d(
2367
2339
  target,
@@ -2385,25 +2357,25 @@ void WebGL2RenderingContext::TexSubImage3D(const v8::FunctionCallbackInfo<v8::Va
2385
2357
 
2386
2358
  auto count = args.Length();
2387
2359
  if (count == 11) {
2388
- auto target = (uint32_t) args[0]->NumberValue(
2360
+ auto target = args[0]->Uint32Value(
2389
2361
  context).ToChecked();
2390
- auto level = (int32_t) args[1]->NumberValue(
2362
+ auto level = args[1]->Int32Value(
2391
2363
  context).ToChecked();
2392
- auto xoffset = (int32_t) args[2]->NumberValue(
2364
+ auto xoffset = args[2]->Int32Value(
2393
2365
  context).ToChecked();
2394
- auto yoffset = (int32_t) args[3]->NumberValue(
2366
+ auto yoffset = args[3]->Int32Value(
2395
2367
  context).ToChecked();
2396
- auto zoffset = (int32_t) args[4]->NumberValue(
2368
+ auto zoffset = args[4]->Int32Value(
2397
2369
  context).ToChecked();
2398
- auto width = (int32_t) args[5]->NumberValue(
2370
+ auto width = args[5]->Int32Value(
2399
2371
  context).ToChecked();
2400
- auto height = (int32_t) args[6]->NumberValue(
2372
+ auto height = args[6]->Int32Value(
2401
2373
  context).ToChecked();
2402
- auto depth = (int32_t) args[7]->NumberValue(
2374
+ auto depth = args[7]->Int32Value(
2403
2375
  context).ToChecked();
2404
- auto format = (uint32_t) args[8]->NumberValue(
2376
+ auto format = args[8]->Uint32Value(
2405
2377
  context).ToChecked();
2406
- auto type = (int32_t) args[9]->NumberValue(
2378
+ auto type = args[9]->Uint32Value(
2407
2379
  context).ToChecked();
2408
2380
 
2409
2381
  if (args[10]->IsNumber()) {
@@ -2434,9 +2406,8 @@ void WebGL2RenderingContext::TexSubImage3D(const v8::FunctionCallbackInfo<v8::Va
2434
2406
  auto array = buf->Buffer();
2435
2407
  auto offset = buf->ByteOffset();
2436
2408
  auto size = buf->ByteLength();
2437
- auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
2438
- auto data = static_cast<uint8_t *>((void*) data_ptr);
2439
-
2409
+ auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
2410
+ auto data = static_cast<uint8_t *>((void *) data_ptr);
2440
2411
 
2441
2412
 
2442
2413
  canvas_native_webgl2_tex_sub_image3d(
@@ -2482,25 +2453,25 @@ void WebGL2RenderingContext::TexSubImage3D(const v8::FunctionCallbackInfo<v8::Va
2482
2453
  }
2483
2454
 
2484
2455
  } else if (count > 11) {
2485
- auto target = (uint32_t) args[0]->NumberValue(
2456
+ auto target = args[0]->Uint32Value(
2486
2457
  context).ToChecked();
2487
- auto level = (int32_t) args[1]->NumberValue(
2458
+ auto level = args[1]->Int32Value(
2488
2459
  context).ToChecked();
2489
- auto xoffset = (int32_t) args[2]->NumberValue(
2460
+ auto xoffset = args[2]->Int32Value(
2490
2461
  context).ToChecked();
2491
- auto yoffset = (int32_t) args[3]->NumberValue(
2462
+ auto yoffset = args[3]->Int32Value(
2492
2463
  context).ToChecked();
2493
- auto zoffset = (int32_t) args[4]->NumberValue(
2464
+ auto zoffset = args[4]->Int32Value(
2494
2465
  context).ToChecked();
2495
- auto width = (int32_t) args[5]->NumberValue(
2466
+ auto width = args[5]->Int32Value(
2496
2467
  context).ToChecked();
2497
- auto height = (int32_t) args[6]->NumberValue(
2468
+ auto height = args[6]->Int32Value(
2498
2469
  context).ToChecked();
2499
- auto depth = (int32_t) args[7]->NumberValue(
2470
+ auto depth = args[7]->Int32Value(
2500
2471
  context).ToChecked();
2501
- auto format = (uint32_t) args[8]->NumberValue(
2472
+ auto format = args[8]->Uint32Value(
2502
2473
  context).ToChecked();
2503
- auto type = (uint32_t) args[9]->NumberValue(
2474
+ auto type = args[9]->Uint32Value(
2504
2475
  context).ToChecked();
2505
2476
 
2506
2477
  size_t srcOffsetValue = 0;
@@ -2519,8 +2490,8 @@ void WebGL2RenderingContext::TexSubImage3D(const v8::FunctionCallbackInfo<v8::Va
2519
2490
  auto array = buf->Buffer();
2520
2491
  auto offset = buf->ByteOffset();
2521
2492
  auto size = buf->ByteLength();
2522
- auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
2523
- auto data = static_cast<uint8_t *>((void*) data_ptr);
2493
+ auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
2494
+ auto data = static_cast<uint8_t *>((void *) data_ptr);
2524
2495
 
2525
2496
 
2526
2497
  srcOffsetValue =
@@ -2564,7 +2535,7 @@ WebGL2RenderingContext::TransformFeedbackVaryings(const v8::FunctionCallbackInfo
2564
2535
  if (type == NativeType::WebGLProgram) {
2565
2536
  auto program = WebGLProgram::GetPointer(programValue.As<v8::Object>());
2566
2537
  auto varyingsObject = args[1];
2567
- auto bufferMode = (uint32_t) args[2]->NumberValue(
2538
+ auto bufferMode = args[2]->Uint32Value(
2568
2539
  context).ToChecked();
2569
2540
 
2570
2541
  if (program != nullptr &&
@@ -2584,10 +2555,10 @@ WebGL2RenderingContext::TransformFeedbackVaryings(const v8::FunctionCallbackInfo
2584
2555
  }
2585
2556
 
2586
2557
 
2587
- const char* cStrings[store.size()];
2588
- for (size_t i = 0; i < store.size(); ++i) {
2589
- cStrings[i] = store[i].c_str();
2590
- }
2558
+ const char *cStrings[store.size()];
2559
+ for (size_t i = 0; i < store.size(); ++i) {
2560
+ cStrings[i] = store[i].c_str();
2561
+ }
2591
2562
 
2592
2563
  canvas_native_webgl2_transform_feedback_varyings(
2593
2564
  program->GetProgram(),
@@ -2616,7 +2587,7 @@ void WebGL2RenderingContext::Uniform1ui(const v8::FunctionCallbackInfo<v8::Value
2616
2587
  if (type == NativeType::WebGLUniformLocation) {
2617
2588
 
2618
2589
  auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
2619
- auto v0 = (uint32_t) v0Value->NumberValue(
2590
+ auto v0 = v0Value->Uint32Value(
2620
2591
  context).ToChecked();
2621
2592
 
2622
2593
  if (location != nullptr) {
@@ -2645,9 +2616,9 @@ void WebGL2RenderingContext::Uniform2ui(const v8::FunctionCallbackInfo<v8::Value
2645
2616
  if (type == NativeType::WebGLUniformLocation) {
2646
2617
 
2647
2618
  auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
2648
- auto v0 = (uint32_t) args[1]->NumberValue(
2619
+ auto v0 = args[1]->Uint32Value(
2649
2620
  context).ToChecked();
2650
- auto v1 = (uint32_t) args[2]->NumberValue(
2621
+ auto v1 = args[2]->Uint32Value(
2651
2622
  context).ToChecked();
2652
2623
 
2653
2624
  if (location != nullptr) {
@@ -2677,13 +2648,13 @@ void WebGL2RenderingContext::Uniform3ui(const v8::FunctionCallbackInfo<v8::Value
2677
2648
  if (type == NativeType::WebGLUniformLocation) {
2678
2649
 
2679
2650
  auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
2680
- auto v0 = (uint32_t) args[1]->NumberValue(
2651
+ auto v0 = args[1]->Uint32Value(
2681
2652
  context).ToChecked();
2682
2653
 
2683
- auto v1 = (uint32_t) args[2]->NumberValue(
2654
+ auto v1 = args[2]->Uint32Value(
2684
2655
  context).ToChecked();
2685
2656
 
2686
- auto v2 = (uint32_t) args[3]->NumberValue(
2657
+ auto v2 = args[3]->Uint32Value(
2687
2658
  context).ToChecked();
2688
2659
 
2689
2660
  if (location != nullptr) {
@@ -2714,15 +2685,15 @@ void WebGL2RenderingContext::Uniform4ui(const v8::FunctionCallbackInfo<v8::Value
2714
2685
  if (type == NativeType::WebGLUniformLocation) {
2715
2686
 
2716
2687
  auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
2717
- auto v0 = (uint32_t) args[1]->NumberValue(
2688
+ auto v0 = args[1]->Uint32Value(
2718
2689
  context).ToChecked();
2719
2690
 
2720
- auto v1 = (uint32_t) args[2]->NumberValue(
2691
+ auto v1 = args[2]->Uint32Value(
2721
2692
  context).ToChecked();
2722
2693
 
2723
- auto v2 = (uint32_t) args[3]->NumberValue(
2694
+ auto v2 = args[3]->Uint32Value(
2724
2695
  context).ToChecked();
2725
- auto v3 = (uint32_t) args[4]->NumberValue(
2696
+ auto v3 = args[4]->Uint32Value(
2726
2697
  context).ToChecked();
2727
2698
 
2728
2699
 
@@ -2758,13 +2729,13 @@ void WebGL2RenderingContext::Uniform1uiv(const v8::FunctionCallbackInfo<v8::Valu
2758
2729
  auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
2759
2730
  auto dataValue = args[1];
2760
2731
  if (location != nullptr &&
2761
- dataValue->IsUint32Array()) {
2732
+ dataValue->IsUint32Array()) {
2762
2733
  auto buf = dataValue.As<v8::Uint32Array>();
2763
2734
  auto array = buf->Buffer();
2764
2735
  auto offset = buf->ByteOffset();
2765
2736
  auto size = buf->Length();
2766
- auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
2767
- auto data = static_cast<uint32_t *>((void*) data_ptr);
2737
+ auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
2738
+ auto data = static_cast<uint32_t *>((void *) data_ptr);
2768
2739
 
2769
2740
 
2770
2741
  canvas_native_webgl2_uniform1uiv(
@@ -2778,9 +2749,9 @@ void WebGL2RenderingContext::Uniform1uiv(const v8::FunctionCallbackInfo<v8::Valu
2778
2749
  auto len = array->Length();
2779
2750
  buf.reserve(len);
2780
2751
  for (int i = 0; i < len; i++) {
2781
- auto item = (uint32_t) array->Get(
2752
+ auto item = array->Get(
2782
2753
  context,
2783
- i).ToLocalChecked()->NumberValue(
2754
+ i).ToLocalChecked()->Uint32Value(
2784
2755
  context).ToChecked();
2785
2756
  buf.push_back(item);
2786
2757
  }
@@ -2815,14 +2786,13 @@ void WebGL2RenderingContext::Uniform2uiv(const v8::FunctionCallbackInfo<v8::Valu
2815
2786
  auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
2816
2787
  auto dataValue = args[1];
2817
2788
  if (location != nullptr &&
2818
- dataValue->IsUint32Array()) {
2789
+ dataValue->IsUint32Array()) {
2819
2790
  auto buf = dataValue.As<v8::Uint32Array>();
2820
2791
  auto array = buf->Buffer();
2821
2792
  auto offset = buf->ByteOffset();
2822
2793
  auto size = buf->Length();
2823
- auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
2824
- auto data = static_cast<uint32_t *>((void*) data_ptr);
2825
-
2794
+ auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
2795
+ auto data = static_cast<uint32_t *>((void *) data_ptr);
2826
2796
 
2827
2797
 
2828
2798
  canvas_native_webgl2_uniform2uiv(
@@ -2836,9 +2806,9 @@ void WebGL2RenderingContext::Uniform2uiv(const v8::FunctionCallbackInfo<v8::Valu
2836
2806
  auto len = array->Length();
2837
2807
  buf.reserve(len);
2838
2808
  for (int i = 0; i < len; i++) {
2839
- auto item = (uint32_t) array->Get(
2809
+ auto item = array->Get(
2840
2810
  context,
2841
- i).ToLocalChecked()->NumberValue(
2811
+ i).ToLocalChecked()->Uint32Value(
2842
2812
  context).ToChecked();
2843
2813
  buf.push_back(item);
2844
2814
  }
@@ -2872,14 +2842,14 @@ void WebGL2RenderingContext::Uniform3uiv(const v8::FunctionCallbackInfo<v8::Valu
2872
2842
  auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
2873
2843
  auto dataValue = args[1];
2874
2844
  if (location != nullptr &&
2875
- dataValue->IsUint32Array()) {
2845
+ dataValue->IsUint32Array()) {
2876
2846
  auto buf = dataValue.As<v8::Uint32Array>();
2877
2847
 
2878
2848
  auto array = buf->Buffer();
2879
2849
  auto offset = buf->ByteOffset();
2880
2850
  auto size = buf->Length();
2881
- auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
2882
- auto data = static_cast<uint32_t *>((void*) data_ptr);
2851
+ auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
2852
+ auto data = static_cast<uint32_t *>((void *) data_ptr);
2883
2853
 
2884
2854
 
2885
2855
  canvas_native_webgl2_uniform3uiv(
@@ -2893,9 +2863,9 @@ void WebGL2RenderingContext::Uniform3uiv(const v8::FunctionCallbackInfo<v8::Valu
2893
2863
  auto len = array->Length();
2894
2864
  buf.reserve(len);
2895
2865
  for (int i = 0; i < len; i++) {
2896
- auto item = (uint32_t) array->Get(
2866
+ auto item = array->Get(
2897
2867
  context,
2898
- i).ToLocalChecked()->NumberValue(
2868
+ i).ToLocalChecked()->Uint32Value(
2899
2869
  context).ToChecked();
2900
2870
  buf.push_back(item);
2901
2871
  }
@@ -2929,14 +2899,14 @@ void WebGL2RenderingContext::Uniform4uiv(const v8::FunctionCallbackInfo<v8::Valu
2929
2899
  auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
2930
2900
  auto dataValue = args[1];
2931
2901
  if (location != nullptr &&
2932
- dataValue->IsUint32Array()) {
2902
+ dataValue->IsUint32Array()) {
2933
2903
  auto buf = dataValue.As<v8::Uint32Array>();
2934
2904
 
2935
2905
  auto array = buf->Buffer();
2936
2906
  auto offset = buf->ByteOffset();
2937
2907
  auto size = buf->Length();
2938
- auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
2939
- auto data = static_cast<uint32_t *>((void*) data_ptr);
2908
+ auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
2909
+ auto data = static_cast<uint32_t *>((void *) data_ptr);
2940
2910
 
2941
2911
 
2942
2912
  canvas_native_webgl2_uniform4uiv(
@@ -2950,9 +2920,9 @@ void WebGL2RenderingContext::Uniform4uiv(const v8::FunctionCallbackInfo<v8::Valu
2950
2920
  auto len = array->Length();
2951
2921
  buf.reserve(len);
2952
2922
  for (int i = 0; i < len; i++) {
2953
- auto item = (uint32_t) array->Get(
2923
+ auto item = array->Get(
2954
2924
  context,
2955
- i).ToLocalChecked()->NumberValue(
2925
+ i).ToLocalChecked()->Uint32Value(
2956
2926
  context).ToChecked();
2957
2927
  buf.push_back(item);
2958
2928
  }
@@ -2983,16 +2953,16 @@ void WebGL2RenderingContext::UniformBlockBinding(const v8::FunctionCallbackInfo<
2983
2953
  if (type == NativeType::WebGLProgram) {
2984
2954
 
2985
2955
  auto program = WebGLProgram::GetPointer(programValue.As<v8::Object>());
2986
- auto uniformBlockIndex = args[1]->NumberValue(
2956
+ auto uniformBlockIndex = args[1]->Uint32Value(
2987
2957
  context).ToChecked();
2988
- auto uniformBlockBinding = args[2]->NumberValue(
2958
+ auto uniformBlockBinding = args[2]->Uint32Value(
2989
2959
  context).ToChecked();
2990
2960
 
2991
2961
  if (program != nullptr) {
2992
2962
  canvas_native_webgl2_uniform_block_binding(
2993
2963
  program->GetProgram(),
2994
- (uint32_t) uniformBlockIndex,
2995
- (uint32_t) uniformBlockBinding,
2964
+ uniformBlockIndex,
2965
+ uniformBlockBinding,
2996
2966
  ptr->GetState()
2997
2967
  );
2998
2968
  }
@@ -3023,8 +2993,8 @@ void WebGL2RenderingContext::UniformMatrix2x3fv(const v8::FunctionCallbackInfo<v
3023
2993
  auto array = buf->Buffer();
3024
2994
  auto offset = buf->ByteOffset();
3025
2995
  auto size = buf->Length();
3026
- auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
3027
- auto data = static_cast<float *>((void*) data_ptr);
2996
+ auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
2997
+ auto data = static_cast<float *>((void *) data_ptr);
3028
2998
 
3029
2999
 
3030
3000
  canvas_native_webgl2_uniform_matrix2x3fv(
@@ -3080,8 +3050,8 @@ void WebGL2RenderingContext::UniformMatrix2x4fv(const v8::FunctionCallbackInfo<v
3080
3050
  auto array = buf->Buffer();
3081
3051
  auto offset = buf->ByteOffset();
3082
3052
  auto size = buf->Length();
3083
- auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
3084
- auto data = static_cast<float *>((void*) data_ptr);
3053
+ auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
3054
+ auto data = static_cast<float *>((void *) data_ptr);
3085
3055
 
3086
3056
 
3087
3057
  canvas_native_webgl2_uniform_matrix2x4fv(
@@ -3103,7 +3073,6 @@ void WebGL2RenderingContext::UniformMatrix2x4fv(const v8::FunctionCallbackInfo<v
3103
3073
  }
3104
3074
 
3105
3075
 
3106
-
3107
3076
  canvas_native_webgl2_uniform_matrix2x4fv(
3108
3077
  location->GetUniformLocation(),
3109
3078
  transpose,
@@ -3139,8 +3108,8 @@ void WebGL2RenderingContext::UniformMatrix3x2fv(const v8::FunctionCallbackInfo<v
3139
3108
  auto array = buf->Buffer();
3140
3109
  auto offset = buf->ByteOffset();
3141
3110
  auto size = buf->Length();
3142
- auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
3143
- auto data = static_cast<float *>((void*) data_ptr);
3111
+ auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
3112
+ auto data = static_cast<float *>((void *) data_ptr);
3144
3113
 
3145
3114
 
3146
3115
  canvas_native_webgl2_uniform_matrix3x2fv(
@@ -3162,7 +3131,6 @@ void WebGL2RenderingContext::UniformMatrix3x2fv(const v8::FunctionCallbackInfo<v
3162
3131
  }
3163
3132
 
3164
3133
 
3165
-
3166
3134
  canvas_native_webgl2_uniform_matrix3x2fv(
3167
3135
  location->GetUniformLocation(),
3168
3136
  transpose,
@@ -3196,8 +3164,8 @@ void WebGL2RenderingContext::UniformMatrix3x4fv(const v8::FunctionCallbackInfo<v
3196
3164
  auto array = buf->Buffer();
3197
3165
  auto offset = buf->ByteOffset();
3198
3166
  auto size = buf->Length();
3199
- auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
3200
- auto data = static_cast<float *>((void*) data_ptr);
3167
+ auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
3168
+ auto data = static_cast<float *>((void *) data_ptr);
3201
3169
 
3202
3170
 
3203
3171
  canvas_native_webgl2_uniform_matrix3x4fv(
@@ -3219,7 +3187,6 @@ void WebGL2RenderingContext::UniformMatrix3x4fv(const v8::FunctionCallbackInfo<v
3219
3187
  }
3220
3188
 
3221
3189
 
3222
-
3223
3190
  canvas_native_webgl2_uniform_matrix3x4fv(
3224
3191
  location->GetUniformLocation(),
3225
3192
  transpose,
@@ -3254,8 +3221,8 @@ void WebGL2RenderingContext::UniformMatrix4x2fv(const v8::FunctionCallbackInfo<v
3254
3221
  auto array = buf->Buffer();
3255
3222
  auto offset = buf->ByteOffset();
3256
3223
  auto size = buf->Length();
3257
- auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
3258
- auto data = static_cast<float *>((void*) data_ptr);
3224
+ auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
3225
+ auto data = static_cast<float *>((void *) data_ptr);
3259
3226
 
3260
3227
  canvas_native_webgl2_uniform_matrix4x2fv(
3261
3228
  location->GetUniformLocation(),
@@ -3276,7 +3243,6 @@ void WebGL2RenderingContext::UniformMatrix4x2fv(const v8::FunctionCallbackInfo<v
3276
3243
  }
3277
3244
 
3278
3245
 
3279
-
3280
3246
  canvas_native_webgl2_uniform_matrix4x2fv(
3281
3247
  location->GetUniformLocation(),
3282
3248
  transpose,
@@ -3310,8 +3276,8 @@ void WebGL2RenderingContext::UniformMatrix4x3fv(const v8::FunctionCallbackInfo<v
3310
3276
  auto array = buf->Buffer();
3311
3277
  auto offset = buf->ByteOffset();
3312
3278
  auto size = buf->Length();
3313
- auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
3314
- auto data = static_cast<float *>((void*) data_ptr);
3279
+ auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
3280
+ auto data = static_cast<float *>((void *) data_ptr);
3315
3281
 
3316
3282
  canvas_native_webgl2_uniform_matrix4x3fv(
3317
3283
  location->GetUniformLocation(),
@@ -3353,13 +3319,13 @@ void WebGL2RenderingContext::VertexAttribDivisor(const v8::FunctionCallbackInfo<
3353
3319
  auto context = isolate->GetCurrentContext();
3354
3320
 
3355
3321
 
3356
- auto index = args[0]->NumberValue(
3322
+ auto index = args[0]->Uint32Value(
3357
3323
  context).ToChecked();
3358
- auto divisor = args[1]->NumberValue(
3324
+ auto divisor = args[1]->Uint32Value(
3359
3325
  context).ToChecked();
3360
3326
  canvas_native_webgl2_vertex_attrib_divisor(
3361
- (uint32_t) index,
3362
- (uint32_t) divisor,
3327
+ index,
3328
+ divisor,
3363
3329
  ptr->GetState()
3364
3330
  );
3365
3331
 
@@ -3375,22 +3341,22 @@ void WebGL2RenderingContext::VertexAttribI4i(const v8::FunctionCallbackInfo<v8::
3375
3341
  auto context = isolate->GetCurrentContext();
3376
3342
 
3377
3343
 
3378
- auto index = args[0]->NumberValue(
3344
+ auto index = args[0]->Int32Value(
3379
3345
  context).ToChecked();
3380
- auto v0 = args[1]->NumberValue(
3346
+ auto v0 = args[1]->Int32Value(
3381
3347
  context).ToChecked();
3382
- auto v1 = args[2]->NumberValue(
3348
+ auto v1 = args[2]->Int32Value(
3383
3349
  context).ToChecked();
3384
- auto v2 = args[3]->NumberValue(
3350
+ auto v2 = args[3]->Int32Value(
3385
3351
  context).ToChecked();
3386
- auto v3 = args[4]->NumberValue(
3352
+ auto v3 = args[4]->Int32Value(
3387
3353
  context).ToChecked();
3388
3354
  canvas_native_webgl2_vertex_attrib_i4i(
3389
- (uint32_t) index,
3390
- (int32_t) v0,
3391
- (int32_t) v1,
3392
- (int32_t) v2,
3393
- (int32_t) v3,
3355
+ index,
3356
+ v0,
3357
+ v1,
3358
+ v2,
3359
+ v3,
3394
3360
  ptr->GetState()
3395
3361
  );
3396
3362
 
@@ -3406,7 +3372,7 @@ void WebGL2RenderingContext::VertexAttribI4iv(const v8::FunctionCallbackInfo<v8:
3406
3372
  auto context = isolate->GetCurrentContext();
3407
3373
 
3408
3374
 
3409
- auto index = (uint32_t) args[0]->NumberValue(
3375
+ auto index = args[0]->Uint32Value(
3410
3376
  context).ToChecked();
3411
3377
  auto value = args[1];
3412
3378
  if (value->IsInt32Array()) {
@@ -3415,8 +3381,8 @@ void WebGL2RenderingContext::VertexAttribI4iv(const v8::FunctionCallbackInfo<v8:
3415
3381
  auto array = buf->Buffer();
3416
3382
  auto offset = buf->ByteOffset();
3417
3383
  auto size = buf->Length();
3418
- auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
3419
- auto data = static_cast<int32_t *>((void*) data_ptr);
3384
+ auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
3385
+ auto data = static_cast<int32_t *>((void *) data_ptr);
3420
3386
 
3421
3387
 
3422
3388
  canvas_native_webgl2_vertex_attrib_i4iv(
@@ -3430,9 +3396,9 @@ void WebGL2RenderingContext::VertexAttribI4iv(const v8::FunctionCallbackInfo<v8:
3430
3396
  std::vector<int32_t> buf;
3431
3397
  buf.reserve(len);
3432
3398
  for (int i = 0; i < len; i++) {
3433
- auto item = (int32_t) array->Get(
3399
+ auto item = array->Get(
3434
3400
  context,
3435
- i).ToLocalChecked()->NumberValue(
3401
+ i).ToLocalChecked()->Int32Value(
3436
3402
  context).ToChecked();
3437
3403
  buf.push_back(item);
3438
3404
  }
@@ -3457,15 +3423,15 @@ void WebGL2RenderingContext::VertexAttribI4ui(const v8::FunctionCallbackInfo<v8:
3457
3423
  auto context = isolate->GetCurrentContext();
3458
3424
 
3459
3425
 
3460
- auto index = (uint32_t) args[0]->NumberValue(
3426
+ auto index = args[0]->Uint32Value(
3461
3427
  context).ToChecked();
3462
- auto v0 = (uint32_t) args[1]->NumberValue(
3428
+ auto v0 = args[1]->Uint32Value(
3463
3429
  context).ToChecked();
3464
- auto v1 = (uint32_t) args[2]->NumberValue(
3430
+ auto v1 = args[2]->Uint32Value(
3465
3431
  context).ToChecked();
3466
- auto v2 = (uint32_t) args[3]->NumberValue(
3432
+ auto v2 = args[3]->Uint32Value(
3467
3433
  context).ToChecked();
3468
- auto v3 = (uint32_t) args[4]->NumberValue(
3434
+ auto v3 = args[4]->Uint32Value(
3469
3435
  context).ToChecked();
3470
3436
 
3471
3437
  canvas_native_webgl2_vertex_attrib_i4ui(
@@ -3488,7 +3454,7 @@ void WebGL2RenderingContext::VertexAttribI4uiv(const v8::FunctionCallbackInfo<v8
3488
3454
  auto isolate = args.GetIsolate();
3489
3455
  auto context = isolate->GetCurrentContext();
3490
3456
 
3491
- auto index = (uint32_t) args[0]->NumberValue(
3457
+ auto index = args[0]->Uint32Value(
3492
3458
  context).ToChecked();
3493
3459
  auto value = args[1];
3494
3460
  if (value->IsUint32Array()) {
@@ -3496,8 +3462,8 @@ void WebGL2RenderingContext::VertexAttribI4uiv(const v8::FunctionCallbackInfo<v8
3496
3462
  auto array = buf->Buffer();
3497
3463
  auto offset = buf->ByteOffset();
3498
3464
  auto size = buf->Length();
3499
- auto data_ptr = static_cast<uint8_t*>(array->GetBackingStore()->Data()) + offset;
3500
- auto data = static_cast<uint32_t *>((void*) data_ptr);
3465
+ auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
3466
+ auto data = static_cast<uint32_t *>((void *) data_ptr);
3501
3467
 
3502
3468
 
3503
3469
  canvas_native_webgl2_vertex_attrib_i4uiv(
@@ -3511,9 +3477,9 @@ void WebGL2RenderingContext::VertexAttribI4uiv(const v8::FunctionCallbackInfo<v8
3511
3477
  std::vector<uint32_t> buf;
3512
3478
  buf.reserve(len);
3513
3479
  for (int i = 0; i < len; i++) {
3514
- auto item = (uint32_t) array->Get(
3480
+ auto item = array->Get(
3515
3481
  context,
3516
- i).ToLocalChecked()->NumberValue(
3482
+ i).ToLocalChecked()->Uint32Value(
3517
3483
  context).ToChecked();
3518
3484
  buf.push_back(item);
3519
3485
  }
@@ -3532,392 +3498,431 @@ void WebGL2RenderingContext::SetConstants(v8::Isolate *isolate,
3532
3498
  const v8::Local<v8::ObjectTemplate> &tmpl) {
3533
3499
  /* Getting GL parameter information */
3534
3500
 
3535
- tmpl->Set(isolate, "READ_BUFFER", v8::Uint32::New(isolate, 0x0C02));
3536
-
3537
- tmpl->Set(isolate, "UNPACK_ROW_LENGTH", v8::Uint32::New(isolate, 0x0CF2));
3501
+ tmpl->Set(isolate, "READ_BUFFER", v8::Integer::NewFromUnsigned(isolate, 0x0C02));
3538
3502
 
3539
- tmpl->Set(isolate, "UNPACK_SKIP_ROWS", v8::Uint32::New(isolate, 0x0CF3));
3503
+ tmpl->Set(isolate, "UNPACK_ROW_LENGTH", v8::Integer::NewFromUnsigned(isolate, 0x0CF2));
3540
3504
 
3541
- tmpl->Set(isolate, "UNPACK_SKIP_PIXELS", v8::Uint32::New(isolate, 0x0CF4));
3505
+ tmpl->Set(isolate, "UNPACK_SKIP_ROWS", v8::Integer::NewFromUnsigned(isolate, 0x0CF3));
3542
3506
 
3543
- tmpl->Set(isolate, "PACK_ROW_LENGTH", v8::Uint32::New(isolate, 0x0D02));
3507
+ tmpl->Set(isolate, "UNPACK_SKIP_PIXELS", v8::Integer::NewFromUnsigned(isolate, 0x0CF4));
3544
3508
 
3545
- tmpl->Set(isolate, "PACK_SKIP_ROWS", v8::Uint32::New(isolate, 0x0D03));
3509
+ tmpl->Set(isolate, "PACK_ROW_LENGTH", v8::Integer::NewFromUnsigned(isolate, 0x0D02));
3546
3510
 
3547
- tmpl->Set(isolate, "PACK_SKIP_PIXELS", v8::Uint32::New(isolate, 0x0D04));
3511
+ tmpl->Set(isolate, "PACK_SKIP_ROWS", v8::Integer::NewFromUnsigned(isolate, 0x0D03));
3548
3512
 
3549
- tmpl->Set(isolate, "TEXTURE_BINDING_3D", v8::Uint32::New(isolate, 0x806A));
3513
+ tmpl->Set(isolate, "PACK_SKIP_PIXELS", v8::Integer::NewFromUnsigned(isolate, 0x0D04));
3550
3514
 
3551
- tmpl->Set(isolate, "UNPACK_SKIP_IMAGES", v8::Uint32::New(isolate, 0x806D));
3515
+ tmpl->Set(isolate, "TEXTURE_BINDING_3D", v8::Integer::NewFromUnsigned(isolate, 0x806A));
3552
3516
 
3553
- tmpl->Set(isolate, "UNPACK_IMAGE_HEIGHT", v8::Uint32::New(isolate, 0x806E));
3517
+ tmpl->Set(isolate, "UNPACK_SKIP_IMAGES", v8::Integer::NewFromUnsigned(isolate, 0x806D));
3554
3518
 
3555
- tmpl->Set(isolate, "MAX_3D_TEXTURE_SIZE", v8::Uint32::New(isolate, 0x8073));
3519
+ tmpl->Set(isolate, "UNPACK_IMAGE_HEIGHT", v8::Integer::NewFromUnsigned(isolate, 0x806E));
3556
3520
 
3557
- tmpl->Set(isolate, "MAX_ELEMENTS_VERTICES", v8::Uint32::New(isolate, 0x80E8));
3521
+ tmpl->Set(isolate, "MAX_3D_TEXTURE_SIZE", v8::Integer::NewFromUnsigned(isolate, 0x8073));
3558
3522
 
3559
- tmpl->Set(isolate, "MAX_ELEMENTS_INDICES", v8::Uint32::New(isolate, 0x80E9));
3523
+ tmpl->Set(isolate, "MAX_ELEMENTS_VERTICES", v8::Integer::NewFromUnsigned(isolate, 0x80E8));
3560
3524
 
3561
- tmpl->Set(isolate, "MAX_TEXTURE_LOD_BIAS", v8::Uint32::New(isolate, 0x84FD));
3525
+ tmpl->Set(isolate, "MAX_ELEMENTS_INDICES", v8::Integer::NewFromUnsigned(isolate, 0x80E9));
3562
3526
 
3563
- tmpl->Set(isolate, "MAX_FRAGMENT_UNIFORM_COMPONENTS", v8::Uint32::New(isolate, 0x8B49));
3527
+ tmpl->Set(isolate, "MAX_TEXTURE_LOD_BIAS", v8::Integer::NewFromUnsigned(isolate, 0x84FD));
3564
3528
 
3565
- tmpl->Set(isolate, "MAX_VERTEX_UNIFORM_COMPONENTS", v8::Uint32::New(isolate, 0x8B4A));
3529
+ tmpl->Set(isolate, "MAX_FRAGMENT_UNIFORM_COMPONENTS",
3530
+ v8::Integer::NewFromUnsigned(isolate, 0x8B49));
3566
3531
 
3567
- tmpl->Set(isolate, "MAX_ARRAY_TEXTURE_LAYERS", v8::Uint32::New(isolate, 0x88FF));
3532
+ tmpl->Set(isolate, "MAX_VERTEX_UNIFORM_COMPONENTS",
3533
+ v8::Integer::NewFromUnsigned(isolate, 0x8B4A));
3568
3534
 
3569
- tmpl->Set(isolate, "MIN_PROGRAM_TEXEL_OFFSET", v8::Uint32::New(isolate, 0x8904));
3535
+ tmpl->Set(isolate, "MAX_ARRAY_TEXTURE_LAYERS", v8::Integer::NewFromUnsigned(isolate, 0x88FF));
3570
3536
 
3571
- tmpl->Set(isolate, "MAX_PROGRAM_TEXEL_OFFSET", v8::Uint32::New(isolate, 0x8905));
3537
+ tmpl->Set(isolate, "MIN_PROGRAM_TEXEL_OFFSET", v8::Integer::NewFromUnsigned(isolate, 0x8904));
3572
3538
 
3573
- tmpl->Set(isolate, "MAX_VARYING_COMPONENTS", v8::Uint32::New(isolate, 0x8B4B));
3539
+ tmpl->Set(isolate, "MAX_PROGRAM_TEXEL_OFFSET", v8::Integer::NewFromUnsigned(isolate, 0x8905));
3574
3540
 
3575
- tmpl->Set(isolate, "FRAGMENT_SHADER_DERIVATIVE_HINT", v8::Uint32::New(isolate, 0x8B8B));
3541
+ tmpl->Set(isolate, "MAX_VARYING_COMPONENTS", v8::Integer::NewFromUnsigned(isolate, 0x8B4B));
3576
3542
 
3577
- tmpl->Set(isolate, "RASTERIZER_DISCARD", v8::Uint32::New(isolate, 0x8C89));
3543
+ tmpl->Set(isolate, "FRAGMENT_SHADER_DERIVATIVE_HINT",
3544
+ v8::Integer::NewFromUnsigned(isolate, 0x8B8B));
3578
3545
 
3579
- tmpl->Set(isolate, "VERTEX_ARRAY_BINDING", v8::Uint32::New(isolate, 0x85B5));
3580
- tmpl->Set(isolate, "MAX_VERTEX_OUTPUT_COMPONENTS", v8::Uint32::New(isolate, 0x9122));
3581
- tmpl->Set(isolate, "MAX_FRAGMENT_INPUT_COMPONENTS", v8::Uint32::New(isolate, 0x9125));
3582
- tmpl->Set(isolate, "MAX_SERVER_WAIT_TIMEOUT", v8::Uint32::New(isolate, 0x9111));
3583
- tmpl->Set(isolate, "MAX_ELEMENT_INDEX", v8::Uint32::New(isolate, 0x8D6B));
3546
+ tmpl->Set(isolate, "RASTERIZER_DISCARD", v8::Integer::NewFromUnsigned(isolate, 0x8C89));
3584
3547
 
3585
- tmpl->Set(isolate, "RED", v8::Uint32::New(isolate, 0x1903));
3586
- tmpl->Set(isolate, "RGB8", v8::Uint32::New(isolate, 0x8051));
3587
- tmpl->Set(isolate, "RGBA8", v8::Uint32::New(isolate, 0x8058));
3588
- tmpl->Set(isolate, "RGB10_A2", v8::Uint32::New(isolate, 0x8059));
3589
- tmpl->Set(isolate, "TEXTURE_3D", v8::Uint32::New(isolate, 0x806F));
3548
+ tmpl->Set(isolate, "VERTEX_ARRAY_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x85B5));
3549
+ tmpl->Set(isolate, "MAX_VERTEX_OUTPUT_COMPONENTS",
3550
+ v8::Integer::NewFromUnsigned(isolate, 0x9122));
3551
+ tmpl->Set(isolate, "MAX_FRAGMENT_INPUT_COMPONENTS",
3552
+ v8::Integer::NewFromUnsigned(isolate, 0x9125));
3553
+ tmpl->Set(isolate, "MAX_SERVER_WAIT_TIMEOUT", v8::Integer::NewFromUnsigned(isolate, 0x9111));
3554
+ tmpl->Set(isolate, "MAX_ELEMENT_INDEX", v8::Integer::NewFromUnsigned(isolate, 0x8D6B));
3590
3555
 
3591
- tmpl->Set(isolate, "TEXTURE_WRAP_R", v8::Uint32::New(isolate, 0x8072));
3592
- tmpl->Set(isolate, "TEXTURE_MIN_LOD", v8::Uint32::New(isolate, 0x813A));
3593
- tmpl->Set(isolate, "TEXTURE_MAX_LOD", v8::Uint32::New(isolate, 0x813B));
3594
- tmpl->Set(isolate, "TEXTURE_BASE_LEVEL", v8::Uint32::New(isolate, 0x813C));
3595
- tmpl->Set(isolate, "TEXTURE_MAX_LEVEL", v8::Uint32::New(isolate, 0x813D));
3556
+ tmpl->Set(isolate, "RED", v8::Integer::NewFromUnsigned(isolate, 0x1903));
3557
+ tmpl->Set(isolate, "RGB8", v8::Integer::NewFromUnsigned(isolate, 0x8051));
3558
+ tmpl->Set(isolate, "RGBA8", v8::Integer::NewFromUnsigned(isolate, 0x8058));
3559
+ tmpl->Set(isolate, "RGB10_A2", v8::Integer::NewFromUnsigned(isolate, 0x8059));
3560
+ tmpl->Set(isolate, "TEXTURE_3D", v8::Integer::NewFromUnsigned(isolate, 0x806F));
3596
3561
 
3562
+ tmpl->Set(isolate, "TEXTURE_WRAP_R", v8::Integer::NewFromUnsigned(isolate, 0x8072));
3563
+ tmpl->Set(isolate, "TEXTURE_MIN_LOD", v8::Integer::NewFromUnsigned(isolate, 0x813A));
3564
+ tmpl->Set(isolate, "TEXTURE_MAX_LOD", v8::Integer::NewFromUnsigned(isolate, 0x813B));
3565
+ tmpl->Set(isolate, "TEXTURE_BASE_LEVEL", v8::Integer::NewFromUnsigned(isolate, 0x813C));
3566
+ tmpl->Set(isolate, "TEXTURE_MAX_LEVEL", v8::Integer::NewFromUnsigned(isolate, 0x813D));
3597
3567
 
3598
- tmpl->Set(isolate, "TEXTURE_COMPARE_MODE", v8::Uint32::New(isolate, 0x884C));
3599
- tmpl->Set(isolate, "TEXTURE_COMPARE_FUNC", v8::Uint32::New(isolate, 0x884D));
3600
- tmpl->Set(isolate, "SRGB", v8::Uint32::New(isolate, 0x8C40));
3601
- tmpl->Set(isolate, "SRGB8", v8::Uint32::New(isolate, 0x8C41));
3602
- tmpl->Set(isolate, "SRGB8_ALPHA8", v8::Uint32::New(isolate, 0x8C43));
3603
3568
 
3604
- tmpl->Set(isolate, "COMPARE_REF_TO_TEXTURE", v8::Uint32::New(isolate, 0x884E));
3605
- tmpl->Set(isolate, "RGBA32F", v8::Uint32::New(isolate, 0x8814));
3606
- tmpl->Set(isolate, "RGB32F", v8::Uint32::New(isolate, 0x8815));
3607
- tmpl->Set(isolate, "RGBA16F", v8::Uint32::New(isolate, 0x881A));
3608
- tmpl->Set(isolate, "RGB16F", v8::Uint32::New(isolate, 0x881B));
3569
+ tmpl->Set(isolate, "TEXTURE_COMPARE_MODE", v8::Integer::NewFromUnsigned(isolate, 0x884C));
3570
+ tmpl->Set(isolate, "TEXTURE_COMPARE_FUNC", v8::Integer::NewFromUnsigned(isolate, 0x884D));
3571
+ tmpl->Set(isolate, "SRGB", v8::Integer::NewFromUnsigned(isolate, 0x8C40));
3572
+ tmpl->Set(isolate, "SRGB8", v8::Integer::NewFromUnsigned(isolate, 0x8C41));
3573
+ tmpl->Set(isolate, "SRGB8_ALPHA8", v8::Integer::NewFromUnsigned(isolate, 0x8C43));
3609
3574
 
3610
- tmpl->Set(isolate, "TEXTURE_2D_ARRAY", v8::Uint32::New(isolate, 0x8C1A));
3611
- tmpl->Set(isolate, "TEXTURE_BINDING_2D_ARRAY", v8::Uint32::New(isolate, 0x8C1D));
3612
- tmpl->Set(isolate, "R11F_G11F_B10F", v8::Uint32::New(isolate, 0x8C3A));
3613
- tmpl->Set(isolate, "RGB9_E5", v8::Uint32::New(isolate, 0x8C3D));
3614
- tmpl->Set(isolate, "RGBA32UI", v8::Uint32::New(isolate, 0x8D70));
3575
+ tmpl->Set(isolate, "COMPARE_REF_TO_TEXTURE", v8::Integer::NewFromUnsigned(isolate, 0x884E));
3576
+ tmpl->Set(isolate, "RGBA32F", v8::Integer::NewFromUnsigned(isolate, 0x8814));
3577
+ tmpl->Set(isolate, "RGB32F", v8::Integer::NewFromUnsigned(isolate, 0x8815));
3578
+ tmpl->Set(isolate, "RGBA16F", v8::Integer::NewFromUnsigned(isolate, 0x881A));
3579
+ tmpl->Set(isolate, "RGB16F", v8::Integer::NewFromUnsigned(isolate, 0x881B));
3615
3580
 
3581
+ tmpl->Set(isolate, "TEXTURE_2D_ARRAY", v8::Integer::NewFromUnsigned(isolate, 0x8C1A));
3582
+ tmpl->Set(isolate, "TEXTURE_BINDING_2D_ARRAY", v8::Integer::NewFromUnsigned(isolate, 0x8C1D));
3583
+ tmpl->Set(isolate, "R11F_G11F_B10F", v8::Integer::NewFromUnsigned(isolate, 0x8C3A));
3584
+ tmpl->Set(isolate, "RGB9_E5", v8::Integer::NewFromUnsigned(isolate, 0x8C3D));
3585
+ tmpl->Set(isolate, "RGBA32UI", v8::Integer::NewFromUnsigned(isolate, 0x8D70));
3616
3586
 
3617
- tmpl->Set(isolate, "RGB32UI", v8::Uint32::New(isolate, 0x8D71));
3618
- tmpl->Set(isolate, "RGBA16UI", v8::Uint32::New(isolate, 0x8D76));
3619
- tmpl->Set(isolate, "RGB16UI", v8::Uint32::New(isolate, 0x8D77));
3620
- tmpl->Set(isolate, "RGBA8UI", v8::Uint32::New(isolate, 0x8D7C));
3621
- tmpl->Set(isolate, "RGB8UI", v8::Uint32::New(isolate, 0x8D7D));
3622
3587
 
3588
+ tmpl->Set(isolate, "RGB32UI", v8::Integer::NewFromUnsigned(isolate, 0x8D71));
3589
+ tmpl->Set(isolate, "RGBA16UI", v8::Integer::NewFromUnsigned(isolate, 0x8D76));
3590
+ tmpl->Set(isolate, "RGB16UI", v8::Integer::NewFromUnsigned(isolate, 0x8D77));
3591
+ tmpl->Set(isolate, "RGBA8UI", v8::Integer::NewFromUnsigned(isolate, 0x8D7C));
3592
+ tmpl->Set(isolate, "RGB8UI", v8::Integer::NewFromUnsigned(isolate, 0x8D7D));
3623
3593
 
3624
- tmpl->Set(isolate, "RGBA32I", v8::Uint32::New(isolate, 0x8D82));
3625
- tmpl->Set(isolate, "RGB32I", v8::Uint32::New(isolate, 0x8D83));
3626
- tmpl->Set(isolate, "RGBA16I", v8::Uint32::New(isolate, 0x8D88));
3627
- tmpl->Set(isolate, "RGB16I", v8::Uint32::New(isolate, 0x8D89));
3628
- tmpl->Set(isolate, "RGBA8I", v8::Uint32::New(isolate, 0x8D8E));
3629
3594
 
3595
+ tmpl->Set(isolate, "RGBA32I", v8::Integer::NewFromUnsigned(isolate, 0x8D82));
3596
+ tmpl->Set(isolate, "RGB32I", v8::Integer::NewFromUnsigned(isolate, 0x8D83));
3597
+ tmpl->Set(isolate, "RGBA16I", v8::Integer::NewFromUnsigned(isolate, 0x8D88));
3598
+ tmpl->Set(isolate, "RGB16I", v8::Integer::NewFromUnsigned(isolate, 0x8D89));
3599
+ tmpl->Set(isolate, "RGBA8I", v8::Integer::NewFromUnsigned(isolate, 0x8D8E));
3630
3600
 
3631
- tmpl->Set(isolate, "RGB8I", v8::Uint32::New(isolate, 0x8D8F));
3632
- tmpl->Set(isolate, "RED_INTEGER", v8::Uint32::New(isolate, 0x8D94));
3633
- tmpl->Set(isolate, "RGB_INTEGER", v8::Uint32::New(isolate, 0x8D98));
3634
- tmpl->Set(isolate, "RGBA_INTEGER", v8::Uint32::New(isolate, 0x8D99));
3635
- tmpl->Set(isolate, "R8", v8::Uint32::New(isolate, 0x8229));
3636
3601
 
3602
+ tmpl->Set(isolate, "RGB8I", v8::Integer::NewFromUnsigned(isolate, 0x8D8F));
3603
+ tmpl->Set(isolate, "RED_INTEGER", v8::Integer::NewFromUnsigned(isolate, 0x8D94));
3604
+ tmpl->Set(isolate, "RGB_INTEGER", v8::Integer::NewFromUnsigned(isolate, 0x8D98));
3605
+ tmpl->Set(isolate, "RGBA_INTEGER", v8::Integer::NewFromUnsigned(isolate, 0x8D99));
3606
+ tmpl->Set(isolate, "R8", v8::Integer::NewFromUnsigned(isolate, 0x8229));
3637
3607
 
3638
- tmpl->Set(isolate, "RG8", v8::Uint32::New(isolate, 0x822B));
3639
- tmpl->Set(isolate, "R16F", v8::Uint32::New(isolate, 0x822D));
3640
- tmpl->Set(isolate, "R32F", v8::Uint32::New(isolate, 0x822E));
3641
- tmpl->Set(isolate, "RG16F", v8::Uint32::New(isolate, 0x822F));
3642
- tmpl->Set(isolate, "RG32F", v8::Uint32::New(isolate, 0x8230));
3643
3608
 
3609
+ tmpl->Set(isolate, "RG8", v8::Integer::NewFromUnsigned(isolate, 0x822B));
3610
+ tmpl->Set(isolate, "R16F", v8::Integer::NewFromUnsigned(isolate, 0x822D));
3611
+ tmpl->Set(isolate, "R32F", v8::Integer::NewFromUnsigned(isolate, 0x822E));
3612
+ tmpl->Set(isolate, "RG16F", v8::Integer::NewFromUnsigned(isolate, 0x822F));
3613
+ tmpl->Set(isolate, "RG32F", v8::Integer::NewFromUnsigned(isolate, 0x8230));
3644
3614
 
3645
- tmpl->Set(isolate, "R8I", v8::Uint32::New(isolate, 0x8231));
3646
- tmpl->Set(isolate, "R8UI", v8::Uint32::New(isolate, 0x8232));
3647
- tmpl->Set(isolate, "R16I", v8::Uint32::New(isolate, 0x8233));
3648
- tmpl->Set(isolate, "R16UI", v8::Uint32::New(isolate, 0x8234));
3649
- tmpl->Set(isolate, "R32I", v8::Uint32::New(isolate, 0x8235));
3650
3615
 
3616
+ tmpl->Set(isolate, "R8I", v8::Integer::NewFromUnsigned(isolate, 0x8231));
3617
+ tmpl->Set(isolate, "R8UI", v8::Integer::NewFromUnsigned(isolate, 0x8232));
3618
+ tmpl->Set(isolate, "R16I", v8::Integer::NewFromUnsigned(isolate, 0x8233));
3619
+ tmpl->Set(isolate, "R16UI", v8::Integer::NewFromUnsigned(isolate, 0x8234));
3620
+ tmpl->Set(isolate, "R32I", v8::Integer::NewFromUnsigned(isolate, 0x8235));
3651
3621
 
3652
- tmpl->Set(isolate, "R32UI", v8::Uint32::New(isolate, 0x8236));
3653
- tmpl->Set(isolate, "RG8I", v8::Uint32::New(isolate, 0x8237));
3654
- tmpl->Set(isolate, "RG8UI", v8::Uint32::New(isolate, 0x8238));
3655
- tmpl->Set(isolate, "RG16I", v8::Uint32::New(isolate, 0x8239));
3656
- tmpl->Set(isolate, "RG16UI", v8::Uint32::New(isolate, 0x823A));
3657
3622
 
3658
- tmpl->Set(isolate, "RG32I", v8::Uint32::New(isolate, 0x823B));
3659
- tmpl->Set(isolate, "RG32UI", v8::Uint32::New(isolate, 0x823C));
3660
- tmpl->Set(isolate, "R8_SNORM", v8::Uint32::New(isolate, 0x8F94));
3661
- tmpl->Set(isolate, "RG8_SNORM", v8::Uint32::New(isolate, 0x8F95));
3662
- tmpl->Set(isolate, "RGB8_SNORM", v8::Uint32::New(isolate, 0x8F96));
3623
+ tmpl->Set(isolate, "R32UI", v8::Integer::NewFromUnsigned(isolate, 0x8236));
3624
+ tmpl->Set(isolate, "RG8I", v8::Integer::NewFromUnsigned(isolate, 0x8237));
3625
+ tmpl->Set(isolate, "RG8UI", v8::Integer::NewFromUnsigned(isolate, 0x8238));
3626
+ tmpl->Set(isolate, "RG16I", v8::Integer::NewFromUnsigned(isolate, 0x8239));
3627
+ tmpl->Set(isolate, "RG16UI", v8::Integer::NewFromUnsigned(isolate, 0x823A));
3663
3628
 
3629
+ tmpl->Set(isolate, "RG32I", v8::Integer::NewFromUnsigned(isolate, 0x823B));
3630
+ tmpl->Set(isolate, "RG32UI", v8::Integer::NewFromUnsigned(isolate, 0x823C));
3631
+ tmpl->Set(isolate, "R8_SNORM", v8::Integer::NewFromUnsigned(isolate, 0x8F94));
3632
+ tmpl->Set(isolate, "RG8_SNORM", v8::Integer::NewFromUnsigned(isolate, 0x8F95));
3633
+ tmpl->Set(isolate, "RGB8_SNORM", v8::Integer::NewFromUnsigned(isolate, 0x8F96));
3664
3634
 
3665
- tmpl->Set(isolate, "RGBA8_SNORM", v8::Uint32::New(isolate, 0x8F97));
3666
- tmpl->Set(isolate, "RGB10_A2UI", v8::Uint32::New(isolate, 0x906F));
3667
- tmpl->Set(isolate, "TEXTURE_IMMUTABLE_FORMAT", v8::Uint32::New(isolate, 0x912F));
3668
- tmpl->Set(isolate, "TEXTURE_IMMUTABLE_LEVELS", v8::Uint32::New(isolate, 0x82DF));
3669
- tmpl->Set(isolate, "UNSIGNED_INT_2_10_10_10_REV", v8::Uint32::New(isolate, 0x8368));
3670
3635
 
3671
-
3672
- tmpl->Set(isolate, "UNSIGNED_INT_10F_11F_11F_REV", v8::Uint32::New(isolate, 0x8C3B));
3673
- tmpl->Set(isolate, "UNSIGNED_INT_5_9_9_9_REV", v8::Uint32::New(isolate, 0x8C3E));
3674
- tmpl->Set(isolate, "FLOAT_32_UNSIGNED_INT_24_8_REV", v8::Uint32::New(isolate, 0x8DAD));
3675
- tmpl->Set(isolate, "UNSIGNED_INT_24_8", v8::Uint32::New(isolate, 0x84FA));
3676
- tmpl->Set(isolate, "HALF_FLOAT", v8::Uint32::New(isolate, 0x140B));
3677
-
3678
-
3679
- tmpl->Set(isolate, "RG", v8::Uint32::New(isolate, 0x8227));
3680
- tmpl->Set(isolate, "RG_INTEGER", v8::Uint32::New(isolate, 0x8228));
3681
- tmpl->Set(isolate, "INT_2_10_10_10_REV", v8::Uint32::New(isolate, 0x8D9F));
3682
- tmpl->Set(isolate, "QUERY_RESULT_AVAILABLE", v8::Uint32::New(isolate, 0x8865));
3683
- tmpl->Set(isolate, "QUERY_RESULT", v8::Uint32::New(isolate, 0x8866));
3684
-
3685
-
3686
- tmpl->Set(isolate, "CURRENT_QUERY", v8::Uint32::New(isolate, 0x8867));
3687
- tmpl->Set(isolate, "ANY_SAMPLES_PASSED", v8::Uint32::New(isolate, 0x8C2F));
3688
- tmpl->Set(isolate, "ANY_SAMPLES_PASSED_CONSERVATIVE", v8::Uint32::New(isolate, 0x8D6A));
3689
- tmpl->Set(isolate, "MAX_DRAW_BUFFERS", v8::Uint32::New(isolate, 0x8824));
3690
-
3691
- tmpl->Set(isolate, "DRAW_BUFFER0", v8::Uint32::New(isolate, 0x8825));
3692
- tmpl->Set(isolate, "DRAW_BUFFER1", v8::Uint32::New(isolate, 0x8826));
3693
- tmpl->Set(isolate, "DRAW_BUFFER2", v8::Uint32::New(isolate, 0x8827));
3694
- tmpl->Set(isolate, "DRAW_BUFFER3", v8::Uint32::New(isolate, 0x8828));
3695
- tmpl->Set(isolate, "DRAW_BUFFER4", v8::Uint32::New(isolate, 0x8829));
3696
- tmpl->Set(isolate, "DRAW_BUFFER5", v8::Uint32::New(isolate, 0x882A));
3697
- tmpl->Set(isolate, "DRAW_BUFFER6", v8::Uint32::New(isolate, 0x882B));
3698
- tmpl->Set(isolate, "DRAW_BUFFER7", v8::Uint32::New(isolate, 0x882C));
3699
- tmpl->Set(isolate, "DRAW_BUFFER8", v8::Uint32::New(isolate, 0x882D));
3700
- tmpl->Set(isolate, "DRAW_BUFFER9", v8::Uint32::New(isolate, 0x882E));
3701
- tmpl->Set(isolate, "DRAW_BUFFER10", v8::Uint32::New(isolate, 0x882F));
3636
+ tmpl->Set(isolate, "RGBA8_SNORM", v8::Integer::NewFromUnsigned(isolate, 0x8F97));
3637
+ tmpl->Set(isolate, "RGB10_A2UI", v8::Integer::NewFromUnsigned(isolate, 0x906F));
3638
+ tmpl->Set(isolate, "TEXTURE_IMMUTABLE_FORMAT", v8::Integer::NewFromUnsigned(isolate, 0x912F));
3639
+ tmpl->Set(isolate, "TEXTURE_IMMUTABLE_LEVELS", v8::Integer::NewFromUnsigned(isolate, 0x82DF));
3640
+ tmpl->Set(isolate, "UNSIGNED_INT_2_10_10_10_REV",
3641
+ v8::Integer::NewFromUnsigned(isolate, 0x8368));
3642
+
3643
+
3644
+ tmpl->Set(isolate, "UNSIGNED_INT_10F_11F_11F_REV",
3645
+ v8::Integer::NewFromUnsigned(isolate, 0x8C3B));
3646
+ tmpl->Set(isolate, "UNSIGNED_INT_5_9_9_9_REV", v8::Integer::NewFromUnsigned(isolate, 0x8C3E));
3647
+ tmpl->Set(isolate, "FLOAT_32_UNSIGNED_INT_24_8_REV",
3648
+ v8::Integer::NewFromUnsigned(isolate, 0x8DAD));
3649
+ tmpl->Set(isolate, "UNSIGNED_INT_24_8", v8::Integer::NewFromUnsigned(isolate, 0x84FA));
3650
+ tmpl->Set(isolate, "HALF_FLOAT", v8::Integer::NewFromUnsigned(isolate, 0x140B));
3651
+
3652
+
3653
+ tmpl->Set(isolate, "RG", v8::Integer::NewFromUnsigned(isolate, 0x8227));
3654
+ tmpl->Set(isolate, "RG_INTEGER", v8::Integer::NewFromUnsigned(isolate, 0x8228));
3655
+ tmpl->Set(isolate, "INT_2_10_10_10_REV", v8::Integer::NewFromUnsigned(isolate, 0x8D9F));
3656
+ tmpl->Set(isolate, "QUERY_RESULT_AVAILABLE", v8::Integer::NewFromUnsigned(isolate, 0x8865));
3657
+ tmpl->Set(isolate, "QUERY_RESULT", v8::Integer::NewFromUnsigned(isolate, 0x8866));
3658
+
3659
+
3660
+ tmpl->Set(isolate, "CURRENT_QUERY", v8::Integer::NewFromUnsigned(isolate, 0x8867));
3661
+ tmpl->Set(isolate, "ANY_SAMPLES_PASSED", v8::Integer::NewFromUnsigned(isolate, 0x8C2F));
3662
+ tmpl->Set(isolate, "ANY_SAMPLES_PASSED_CONSERVATIVE",
3663
+ v8::Integer::NewFromUnsigned(isolate, 0x8D6A));
3664
+ tmpl->Set(isolate, "MAX_DRAW_BUFFERS", v8::Integer::NewFromUnsigned(isolate, 0x8824));
3665
+
3666
+ tmpl->Set(isolate, "DRAW_BUFFER0", v8::Integer::NewFromUnsigned(isolate, 0x8825));
3667
+ tmpl->Set(isolate, "DRAW_BUFFER1", v8::Integer::NewFromUnsigned(isolate, 0x8826));
3668
+ tmpl->Set(isolate, "DRAW_BUFFER2", v8::Integer::NewFromUnsigned(isolate, 0x8827));
3669
+ tmpl->Set(isolate, "DRAW_BUFFER3", v8::Integer::NewFromUnsigned(isolate, 0x8828));
3670
+ tmpl->Set(isolate, "DRAW_BUFFER4", v8::Integer::NewFromUnsigned(isolate, 0x8829));
3671
+ tmpl->Set(isolate, "DRAW_BUFFER5", v8::Integer::NewFromUnsigned(isolate, 0x882A));
3672
+ tmpl->Set(isolate, "DRAW_BUFFER6", v8::Integer::NewFromUnsigned(isolate, 0x882B));
3673
+ tmpl->Set(isolate, "DRAW_BUFFER7", v8::Integer::NewFromUnsigned(isolate, 0x882C));
3674
+ tmpl->Set(isolate, "DRAW_BUFFER8", v8::Integer::NewFromUnsigned(isolate, 0x882D));
3675
+ tmpl->Set(isolate, "DRAW_BUFFER9", v8::Integer::NewFromUnsigned(isolate, 0x882E));
3676
+ tmpl->Set(isolate, "DRAW_BUFFER10", v8::Integer::NewFromUnsigned(isolate, 0x882F));
3702
3677
 
3703
3678
  /* Getting GL parameter information */
3704
3679
 
3705
3680
  /* Textures */
3706
3681
 
3707
- tmpl->Set(isolate, "DRAW_BUFFER11", v8::Uint32::New(isolate, 0x8830));
3708
- tmpl->Set(isolate, "DRAW_BUFFER12", v8::Uint32::New(isolate, 0x8831));
3709
- tmpl->Set(isolate, "DRAW_BUFFER13", v8::Uint32::New(isolate, 0x8832));
3710
- tmpl->Set(isolate, "DRAW_BUFFER14", v8::Uint32::New(isolate, 0x8833));
3711
- tmpl->Set(isolate, "DRAW_BUFFER15", v8::Uint32::New(isolate, 0x8834));
3712
-
3713
- tmpl->Set(isolate, "MAX_COLOR_ATTACHMENTS", v8::Uint32::New(isolate, 0x8CDF));
3714
- tmpl->Set(isolate, "COLOR_ATTACHMENT1", v8::Uint32::New(isolate, 0x8CE1));
3715
- tmpl->Set(isolate, "COLOR_ATTACHMENT2", v8::Uint32::New(isolate, 0x8CE2));
3716
- tmpl->Set(isolate, "COLOR_ATTACHMENT3", v8::Uint32::New(isolate, 0x8CE3));
3717
- tmpl->Set(isolate, "COLOR_ATTACHMENT4", v8::Uint32::New(isolate, 0x8CE4));
3718
- tmpl->Set(isolate, "COLOR_ATTACHMENT5", v8::Uint32::New(isolate, 0x8CE5));
3719
- tmpl->Set(isolate, "COLOR_ATTACHMENT6", v8::Uint32::New(isolate, 0x8CE6));
3720
- tmpl->Set(isolate, "COLOR_ATTACHMENT7", v8::Uint32::New(isolate, 0x8CE7));
3721
- tmpl->Set(isolate, "COLOR_ATTACHMENT8", v8::Uint32::New(isolate, 0x8CE8));
3722
- tmpl->Set(isolate, "COLOR_ATTACHMENT9", v8::Uint32::New(isolate, 0x8CE9));
3723
- tmpl->Set(isolate, "COLOR_ATTACHMENT10", v8::Uint32::New(isolate, 0x8CEA));
3724
- tmpl->Set(isolate, "COLOR_ATTACHMENT11", v8::Uint32::New(isolate, 0x8CEB));
3725
- tmpl->Set(isolate, "COLOR_ATTACHMENT12", v8::Uint32::New(isolate, 0x8CEC));
3726
- tmpl->Set(isolate, "COLOR_ATTACHMENT13", v8::Uint32::New(isolate, 0x8CED));
3727
- tmpl->Set(isolate, "COLOR_ATTACHMENT14", v8::Uint32::New(isolate, 0x8CEE));
3728
- tmpl->Set(isolate, "COLOR_ATTACHMENT15", v8::Uint32::New(isolate, 0x8CEF));
3729
-
3730
- tmpl->Set(isolate, "SAMPLER_3D", v8::Uint32::New(isolate, 0x8B5F));
3731
- tmpl->Set(isolate, "SAMPLER_2D_SHADOW", v8::Uint32::New(isolate, 0x8B62));
3732
- tmpl->Set(isolate, "SAMPLER_2D_ARRAY", v8::Uint32::New(isolate, 0x8DC1));
3733
- tmpl->Set(isolate, "SAMPLER_2D_ARRAY_SHADOW", v8::Uint32::New(isolate, 0x8DC4));
3734
- tmpl->Set(isolate, "SAMPLER_CUBE_SHADOW", v8::Uint32::New(isolate, 0x8DC5));
3735
-
3736
- tmpl->Set(isolate, "INT_SAMPLER_2D", v8::Uint32::New(isolate, 0x8DCA));
3737
- tmpl->Set(isolate, "INT_SAMPLER_3D", v8::Uint32::New(isolate, 0x8DCB));
3738
- tmpl->Set(isolate, "INT_SAMPLER_CUBE", v8::Uint32::New(isolate, 0x8DCC));
3739
- tmpl->Set(isolate, "INT_SAMPLER_2D_ARRAY", v8::Uint32::New(isolate, 0x8DCF));
3740
- tmpl->Set(isolate, "UNSIGNED_INT_SAMPLER_2D", v8::Uint32::New(isolate, 0x8DD2));
3741
-
3742
- tmpl->Set(isolate, "UNSIGNED_INT_SAMPLER_3D", v8::Uint32::New(isolate, 0x8DD3));
3743
- tmpl->Set(isolate, "UNSIGNED_INT_SAMPLER_CUBE", v8::Uint32::New(isolate, 0x8DD4));
3744
- tmpl->Set(isolate, "UNSIGNED_INT_SAMPLER_2D_ARRAY", v8::Uint32::New(isolate, 0x8DD7));
3745
- tmpl->Set(isolate, "MAX_SAMPLES", v8::Uint32::New(isolate, 0x8D57));
3746
- tmpl->Set(isolate, "SAMPLER_BINDING", v8::Uint32::New(isolate, 0x8919));
3747
-
3748
- tmpl->Set(isolate, "PIXEL_PACK_BUFFER", v8::Uint32::New(isolate, 0x88EB));
3749
- tmpl->Set(isolate, "PIXEL_UNPACK_BUFFER", v8::Uint32::New(isolate, 0x88EC));
3750
- tmpl->Set(isolate, "PIXEL_PACK_BUFFER_BINDING", v8::Uint32::New(isolate, 0x88ED));
3751
- tmpl->Set(isolate, "PIXEL_UNPACK_BUFFER_BINDING", v8::Uint32::New(isolate, 0x88EF));
3752
- tmpl->Set(isolate, "COPY_READ_BUFFER", v8::Uint32::New(isolate, 0x8F36));
3753
-
3754
- tmpl->Set(isolate, "COPY_WRITE_BUFFER", v8::Uint32::New(isolate, 0x8F37));
3755
- tmpl->Set(isolate, "COPY_READ_BUFFER_BINDING", v8::Uint32::New(isolate, 0x8F36));
3756
- tmpl->Set(isolate, "COPY_WRITE_BUFFER_BINDING", v8::Uint32::New(isolate, 0x8F37));
3757
- tmpl->Set(isolate, "FLOAT_MAT2x3", v8::Uint32::New(isolate, 0x8B65));
3758
- tmpl->Set(isolate, "FLOAT_MAT2x4", v8::Uint32::New(isolate, 0x8B66));
3759
-
3760
- tmpl->Set(isolate, "FLOAT_MAT3x2", v8::Uint32::New(isolate, 0x8B67));
3761
- tmpl->Set(isolate, "FLOAT_MAT3x4", v8::Uint32::New(isolate, 0x8B68));
3762
- tmpl->Set(isolate, "FLOAT_MAT4x2", v8::Uint32::New(isolate, 0x8B69));
3763
- tmpl->Set(isolate, "FLOAT_MAT4x3", v8::Uint32::New(isolate, 0x8B6A));
3764
- tmpl->Set(isolate, "UNSIGNED_INT_VEC2", v8::Uint32::New(isolate, 0x8DC6));
3765
-
3766
- tmpl->Set(isolate, "UNSIGNED_INT_VEC3", v8::Uint32::New(isolate, 0x8DC7));
3767
- tmpl->Set(isolate, "UNSIGNED_INT_VEC4", v8::Uint32::New(isolate, 0x8DC8));
3768
- tmpl->Set(isolate, "UNSIGNED_NORMALIZED", v8::Uint32::New(isolate, 0x8C17));
3769
- tmpl->Set(isolate, "SIGNED_NORMALIZED", v8::Uint32::New(isolate, 0x8F9C));
3682
+ tmpl->Set(isolate, "DRAW_BUFFER11", v8::Integer::NewFromUnsigned(isolate, 0x8830));
3683
+ tmpl->Set(isolate, "DRAW_BUFFER12", v8::Integer::NewFromUnsigned(isolate, 0x8831));
3684
+ tmpl->Set(isolate, "DRAW_BUFFER13", v8::Integer::NewFromUnsigned(isolate, 0x8832));
3685
+ tmpl->Set(isolate, "DRAW_BUFFER14", v8::Integer::NewFromUnsigned(isolate, 0x8833));
3686
+ tmpl->Set(isolate, "DRAW_BUFFER15", v8::Integer::NewFromUnsigned(isolate, 0x8834));
3687
+
3688
+ tmpl->Set(isolate, "MAX_COLOR_ATTACHMENTS", v8::Integer::NewFromUnsigned(isolate, 0x8CDF));
3689
+ tmpl->Set(isolate, "COLOR_ATTACHMENT1", v8::Integer::NewFromUnsigned(isolate, 0x8CE1));
3690
+ tmpl->Set(isolate, "COLOR_ATTACHMENT2", v8::Integer::NewFromUnsigned(isolate, 0x8CE2));
3691
+ tmpl->Set(isolate, "COLOR_ATTACHMENT3", v8::Integer::NewFromUnsigned(isolate, 0x8CE3));
3692
+ tmpl->Set(isolate, "COLOR_ATTACHMENT4", v8::Integer::NewFromUnsigned(isolate, 0x8CE4));
3693
+ tmpl->Set(isolate, "COLOR_ATTACHMENT5", v8::Integer::NewFromUnsigned(isolate, 0x8CE5));
3694
+ tmpl->Set(isolate, "COLOR_ATTACHMENT6", v8::Integer::NewFromUnsigned(isolate, 0x8CE6));
3695
+ tmpl->Set(isolate, "COLOR_ATTACHMENT7", v8::Integer::NewFromUnsigned(isolate, 0x8CE7));
3696
+ tmpl->Set(isolate, "COLOR_ATTACHMENT8", v8::Integer::NewFromUnsigned(isolate, 0x8CE8));
3697
+ tmpl->Set(isolate, "COLOR_ATTACHMENT9", v8::Integer::NewFromUnsigned(isolate, 0x8CE9));
3698
+ tmpl->Set(isolate, "COLOR_ATTACHMENT10", v8::Integer::NewFromUnsigned(isolate, 0x8CEA));
3699
+ tmpl->Set(isolate, "COLOR_ATTACHMENT11", v8::Integer::NewFromUnsigned(isolate, 0x8CEB));
3700
+ tmpl->Set(isolate, "COLOR_ATTACHMENT12", v8::Integer::NewFromUnsigned(isolate, 0x8CEC));
3701
+ tmpl->Set(isolate, "COLOR_ATTACHMENT13", v8::Integer::NewFromUnsigned(isolate, 0x8CED));
3702
+ tmpl->Set(isolate, "COLOR_ATTACHMENT14", v8::Integer::NewFromUnsigned(isolate, 0x8CEE));
3703
+ tmpl->Set(isolate, "COLOR_ATTACHMENT15", v8::Integer::NewFromUnsigned(isolate, 0x8CEF));
3704
+
3705
+ tmpl->Set(isolate, "SAMPLER_3D", v8::Integer::NewFromUnsigned(isolate, 0x8B5F));
3706
+ tmpl->Set(isolate, "SAMPLER_2D_SHADOW", v8::Integer::NewFromUnsigned(isolate, 0x8B62));
3707
+ tmpl->Set(isolate, "SAMPLER_2D_ARRAY", v8::Integer::NewFromUnsigned(isolate, 0x8DC1));
3708
+ tmpl->Set(isolate, "SAMPLER_2D_ARRAY_SHADOW", v8::Integer::NewFromUnsigned(isolate, 0x8DC4));
3709
+ tmpl->Set(isolate, "SAMPLER_CUBE_SHADOW", v8::Integer::NewFromUnsigned(isolate, 0x8DC5));
3710
+
3711
+ tmpl->Set(isolate, "INT_SAMPLER_2D", v8::Integer::NewFromUnsigned(isolate, 0x8DCA));
3712
+ tmpl->Set(isolate, "INT_SAMPLER_3D", v8::Integer::NewFromUnsigned(isolate, 0x8DCB));
3713
+ tmpl->Set(isolate, "INT_SAMPLER_CUBE", v8::Integer::NewFromUnsigned(isolate, 0x8DCC));
3714
+ tmpl->Set(isolate, "INT_SAMPLER_2D_ARRAY", v8::Integer::NewFromUnsigned(isolate, 0x8DCF));
3715
+ tmpl->Set(isolate, "UNSIGNED_INT_SAMPLER_2D", v8::Integer::NewFromUnsigned(isolate, 0x8DD2));
3716
+
3717
+ tmpl->Set(isolate, "UNSIGNED_INT_SAMPLER_3D", v8::Integer::NewFromUnsigned(isolate, 0x8DD3));
3718
+ tmpl->Set(isolate, "UNSIGNED_INT_SAMPLER_CUBE", v8::Integer::NewFromUnsigned(isolate, 0x8DD4));
3719
+ tmpl->Set(isolate, "UNSIGNED_INT_SAMPLER_2D_ARRAY",
3720
+ v8::Integer::NewFromUnsigned(isolate, 0x8DD7));
3721
+ tmpl->Set(isolate, "MAX_SAMPLES", v8::Integer::NewFromUnsigned(isolate, 0x8D57));
3722
+ tmpl->Set(isolate, "SAMPLER_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8919));
3723
+
3724
+ tmpl->Set(isolate, "PIXEL_PACK_BUFFER", v8::Integer::NewFromUnsigned(isolate, 0x88EB));
3725
+ tmpl->Set(isolate, "PIXEL_UNPACK_BUFFER", v8::Integer::NewFromUnsigned(isolate, 0x88EC));
3726
+ tmpl->Set(isolate, "PIXEL_PACK_BUFFER_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x88ED));
3727
+ tmpl->Set(isolate, "PIXEL_UNPACK_BUFFER_BINDING",
3728
+ v8::Integer::NewFromUnsigned(isolate, 0x88EF));
3729
+ tmpl->Set(isolate, "COPY_READ_BUFFER", v8::Integer::NewFromUnsigned(isolate, 0x8F36));
3730
+
3731
+ tmpl->Set(isolate, "COPY_WRITE_BUFFER", v8::Integer::NewFromUnsigned(isolate, 0x8F37));
3732
+ tmpl->Set(isolate, "COPY_READ_BUFFER_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8F36));
3733
+ tmpl->Set(isolate, "COPY_WRITE_BUFFER_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8F37));
3734
+ tmpl->Set(isolate, "FLOAT_MAT2x3", v8::Integer::NewFromUnsigned(isolate, 0x8B65));
3735
+ tmpl->Set(isolate, "FLOAT_MAT2x4", v8::Integer::NewFromUnsigned(isolate, 0x8B66));
3736
+
3737
+ tmpl->Set(isolate, "FLOAT_MAT3x2", v8::Integer::NewFromUnsigned(isolate, 0x8B67));
3738
+ tmpl->Set(isolate, "FLOAT_MAT3x4", v8::Integer::NewFromUnsigned(isolate, 0x8B68));
3739
+ tmpl->Set(isolate, "FLOAT_MAT4x2", v8::Integer::NewFromUnsigned(isolate, 0x8B69));
3740
+ tmpl->Set(isolate, "FLOAT_MAT4x3", v8::Integer::NewFromUnsigned(isolate, 0x8B6A));
3741
+ tmpl->Set(isolate, "UNSIGNED_INT_VEC2", v8::Integer::NewFromUnsigned(isolate, 0x8DC6));
3742
+
3743
+ tmpl->Set(isolate, "UNSIGNED_INT_VEC3", v8::Integer::NewFromUnsigned(isolate, 0x8DC7));
3744
+ tmpl->Set(isolate, "UNSIGNED_INT_VEC4", v8::Integer::NewFromUnsigned(isolate, 0x8DC8));
3745
+ tmpl->Set(isolate, "UNSIGNED_NORMALIZED", v8::Integer::NewFromUnsigned(isolate, 0x8C17));
3746
+ tmpl->Set(isolate, "SIGNED_NORMALIZED", v8::Integer::NewFromUnsigned(isolate, 0x8F9C));
3770
3747
 
3771
3748
  /* Vertex attributes */
3772
3749
 
3773
- tmpl->Set(isolate, "VERTEX_ATTRIB_ARRAY_INTEGER", v8::Uint32::New(isolate, 0x88FD));
3774
- tmpl->Set(isolate, "VERTEX_ATTRIB_ARRAY_DIVISOR", v8::Uint32::New(isolate, 0x88FE));
3775
- tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BUFFER_MODE", v8::Uint32::New(isolate, 0x8C7F));
3750
+ tmpl->Set(isolate, "VERTEX_ATTRIB_ARRAY_INTEGER",
3751
+ v8::Integer::NewFromUnsigned(isolate, 0x88FD));
3752
+ tmpl->Set(isolate, "VERTEX_ATTRIB_ARRAY_DIVISOR",
3753
+ v8::Integer::NewFromUnsigned(isolate, 0x88FE));
3754
+ tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BUFFER_MODE",
3755
+ v8::Integer::NewFromUnsigned(isolate, 0x8C7F));
3776
3756
  tmpl->Set(isolate, "MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",
3777
- v8::Uint32::New(isolate, 0x8C80));
3778
- tmpl->Set(isolate, "TRANSFORM_FEEDBACK_VARYINGS", v8::Uint32::New(isolate, 0x8C83));
3779
-
3780
- tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BUFFER_START", v8::Uint32::New(isolate, 0x8C84));
3781
- tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BUFFER_SIZE", v8::Uint32::New(isolate, 0x8C85));
3782
- tmpl->Set(isolate, "TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN", v8::Uint32::New(isolate, 0x8C88));
3757
+ v8::Integer::NewFromUnsigned(isolate, 0x8C80));
3758
+ tmpl->Set(isolate, "TRANSFORM_FEEDBACK_VARYINGS",
3759
+ v8::Integer::NewFromUnsigned(isolate, 0x8C83));
3760
+
3761
+ tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BUFFER_START",
3762
+ v8::Integer::NewFromUnsigned(isolate, 0x8C84));
3763
+ tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BUFFER_SIZE",
3764
+ v8::Integer::NewFromUnsigned(isolate, 0x8C85));
3765
+ tmpl->Set(isolate, "TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",
3766
+ v8::Integer::NewFromUnsigned(isolate, 0x8C88));
3783
3767
  tmpl->Set(isolate, "MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",
3784
- v8::Uint32::New(isolate, 0x8C8A));
3768
+ v8::Integer::NewFromUnsigned(isolate, 0x8C8A));
3785
3769
 
3786
3770
  /* Textures */
3787
3771
 
3788
3772
  /* Pixel types */
3789
3773
 
3790
- tmpl->Set(isolate, "MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS", v8::Uint32::New(isolate, 0x8C8B));
3791
- tmpl->Set(isolate, "INTERLEAVED_ATTRIBS", v8::Uint32::New(isolate, 0x8C8C));
3792
- tmpl->Set(isolate, "SEPARATE_ATTRIBS", v8::Uint32::New(isolate, 0x8C8D));
3793
- tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BUFFER", v8::Uint32::New(isolate, 0x8C8E));
3794
- tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BUFFER_BINDING", v8::Uint32::New(isolate, 0x8C8F));
3774
+ tmpl->Set(isolate, "MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",
3775
+ v8::Integer::NewFromUnsigned(isolate, 0x8C8B));
3776
+ tmpl->Set(isolate, "INTERLEAVED_ATTRIBS", v8::Integer::NewFromUnsigned(isolate, 0x8C8C));
3777
+ tmpl->Set(isolate, "SEPARATE_ATTRIBS", v8::Integer::NewFromUnsigned(isolate, 0x8C8D));
3778
+ tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BUFFER", v8::Integer::NewFromUnsigned(isolate, 0x8C8E));
3779
+ tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BUFFER_BINDING",
3780
+ v8::Integer::NewFromUnsigned(isolate, 0x8C8F));
3795
3781
 
3796
- tmpl->Set(isolate, "TRANSFORM_FEEDBACK", v8::Uint32::New(isolate, 0x8E22));
3797
- tmpl->Set(isolate, "TRANSFORM_FEEDBACK_PAUSED", v8::Uint32::New(isolate, 0x8E23));
3798
- tmpl->Set(isolate, "TRANSFORM_FEEDBACK_ACTIVE", v8::Uint32::New(isolate, 0x8E24));
3799
- tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BINDING", v8::Uint32::New(isolate, 0x8E25));
3782
+ tmpl->Set(isolate, "TRANSFORM_FEEDBACK", v8::Integer::NewFromUnsigned(isolate, 0x8E22));
3783
+ tmpl->Set(isolate, "TRANSFORM_FEEDBACK_PAUSED", v8::Integer::NewFromUnsigned(isolate, 0x8E23));
3784
+ tmpl->Set(isolate, "TRANSFORM_FEEDBACK_ACTIVE", v8::Integer::NewFromUnsigned(isolate, 0x8E24));
3785
+ tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8E25));
3800
3786
 
3801
3787
  /* Pixel types */
3802
3788
 
3803
3789
  /* Queries */
3804
3790
 
3805
- tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING", v8::Uint32::New(isolate, 0x8210));
3806
- tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE", v8::Uint32::New(isolate, 0x8211));
3807
- tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_RED_SIZE", v8::Uint32::New(isolate, 0x8212));
3808
- tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_GREEN_SIZE", v8::Uint32::New(isolate, 0x8213));
3809
- tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_BLUE_SIZE", v8::Uint32::New(isolate, 0x8214));
3791
+ tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",
3792
+ v8::Integer::NewFromUnsigned(isolate, 0x8210));
3793
+ tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",
3794
+ v8::Integer::NewFromUnsigned(isolate, 0x8211));
3795
+ tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_RED_SIZE",
3796
+ v8::Integer::NewFromUnsigned(isolate, 0x8212));
3797
+ tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",
3798
+ v8::Integer::NewFromUnsigned(isolate, 0x8213));
3799
+ tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",
3800
+ v8::Integer::NewFromUnsigned(isolate, 0x8214));
3810
3801
 
3811
3802
  /* Queries */
3812
3803
 
3813
3804
  /* Draw buffers */
3814
3805
 
3815
- tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE", v8::Uint32::New(isolate, 0x8215));
3816
- tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE", v8::Uint32::New(isolate, 0x8216));
3817
- tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE", v8::Uint32::New(isolate, 0x8217));
3818
- tmpl->Set(isolate, "FRAMEBUFFER_DEFAULT", v8::Uint32::New(isolate, 0x8218));
3819
- tmpl->Set(isolate, "DEPTH_STENCIL_ATTACHMENT", v8::Uint32::New(isolate, 0x821A));
3820
-
3821
- tmpl->Set(isolate, "DEPTH_STENCIL", v8::Uint32::New(isolate, 0x84F9));
3822
- tmpl->Set(isolate, "DEPTH24_STENCIL8", v8::Uint32::New(isolate, 0x88F0));
3823
- tmpl->Set(isolate, "DRAW_FRAMEBUFFER_BINDING", v8::Uint32::New(isolate, 0x8CA6));
3824
- tmpl->Set(isolate, "READ_FRAMEBUFFER", v8::Uint32::New(isolate, 0x8CA8));
3825
- tmpl->Set(isolate, "DRAW_FRAMEBUFFER", v8::Uint32::New(isolate, 0x8CA9));
3826
-
3827
- tmpl->Set(isolate, "READ_FRAMEBUFFER_BINDING", v8::Uint32::New(isolate, 0x8CAA));
3828
- tmpl->Set(isolate, "RENDERBUFFER_SAMPLES", v8::Uint32::New(isolate, 0x8CAB));
3829
- tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER", v8::Uint32::New(isolate, 0x8CD4));
3830
- tmpl->Set(isolate, "FRAMEBUFFER_INCOMPLETE_MULTISAMPLE", v8::Uint32::New(isolate, 0x8D56));
3831
- tmpl->Set(isolate, "UNIFORM_BUFFER", v8::Uint32::New(isolate, 0x8A11));
3832
-
3833
- tmpl->Set(isolate, "UNIFORM_BUFFER_BINDING", v8::Uint32::New(isolate, 0x8A28));
3834
- tmpl->Set(isolate, "UNIFORM_BUFFER_START", v8::Uint32::New(isolate, 0x8A29));
3835
- tmpl->Set(isolate, "UNIFORM_BUFFER_SIZE", v8::Uint32::New(isolate, 0x8A2A));
3836
- tmpl->Set(isolate, "MAX_VERTEX_UNIFORM_BLOCKS", v8::Uint32::New(isolate, 0x8A2B));
3837
- tmpl->Set(isolate, "MAX_FRAGMENT_UNIFORM_BLOCKS", v8::Uint32::New(isolate, 0x8A2D));
3838
-
3839
- tmpl->Set(isolate, "MAX_COMBINED_UNIFORM_BLOCKS", v8::Uint32::New(isolate, 0x8A2E));
3840
- tmpl->Set(isolate, "MAX_UNIFORM_BUFFER_BINDINGS", v8::Uint32::New(isolate, 0x8A2F));
3841
- tmpl->Set(isolate, "MAX_UNIFORM_BLOCK_SIZE", v8::Uint32::New(isolate, 0x8A30));
3842
- tmpl->Set(isolate, "MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS", v8::Uint32::New(isolate, 0x8A31));
3806
+ tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",
3807
+ v8::Integer::NewFromUnsigned(isolate, 0x8215));
3808
+ tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",
3809
+ v8::Integer::NewFromUnsigned(isolate, 0x8216));
3810
+ tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",
3811
+ v8::Integer::NewFromUnsigned(isolate, 0x8217));
3812
+ tmpl->Set(isolate, "FRAMEBUFFER_DEFAULT", v8::Integer::NewFromUnsigned(isolate, 0x8218));
3813
+ tmpl->Set(isolate, "DEPTH_STENCIL_ATTACHMENT", v8::Integer::NewFromUnsigned(isolate, 0x821A));
3814
+
3815
+ tmpl->Set(isolate, "DEPTH_STENCIL", v8::Integer::NewFromUnsigned(isolate, 0x84F9));
3816
+ tmpl->Set(isolate, "DEPTH24_STENCIL8", v8::Integer::NewFromUnsigned(isolate, 0x88F0));
3817
+ tmpl->Set(isolate, "DRAW_FRAMEBUFFER_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8CA6));
3818
+ tmpl->Set(isolate, "READ_FRAMEBUFFER", v8::Integer::NewFromUnsigned(isolate, 0x8CA8));
3819
+ tmpl->Set(isolate, "DRAW_FRAMEBUFFER", v8::Integer::NewFromUnsigned(isolate, 0x8CA9));
3820
+
3821
+ tmpl->Set(isolate, "READ_FRAMEBUFFER_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8CAA));
3822
+ tmpl->Set(isolate, "RENDERBUFFER_SAMPLES", v8::Integer::NewFromUnsigned(isolate, 0x8CAB));
3823
+ tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",
3824
+ v8::Integer::NewFromUnsigned(isolate, 0x8CD4));
3825
+ tmpl->Set(isolate, "FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",
3826
+ v8::Integer::NewFromUnsigned(isolate, 0x8D56));
3827
+ tmpl->Set(isolate, "UNIFORM_BUFFER", v8::Integer::NewFromUnsigned(isolate, 0x8A11));
3828
+
3829
+ tmpl->Set(isolate, "UNIFORM_BUFFER_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8A28));
3830
+ tmpl->Set(isolate, "UNIFORM_BUFFER_START", v8::Integer::NewFromUnsigned(isolate, 0x8A29));
3831
+ tmpl->Set(isolate, "UNIFORM_BUFFER_SIZE", v8::Integer::NewFromUnsigned(isolate, 0x8A2A));
3832
+ tmpl->Set(isolate, "MAX_VERTEX_UNIFORM_BLOCKS", v8::Integer::NewFromUnsigned(isolate, 0x8A2B));
3833
+ tmpl->Set(isolate, "MAX_FRAGMENT_UNIFORM_BLOCKS",
3834
+ v8::Integer::NewFromUnsigned(isolate, 0x8A2D));
3835
+
3836
+ tmpl->Set(isolate, "MAX_COMBINED_UNIFORM_BLOCKS",
3837
+ v8::Integer::NewFromUnsigned(isolate, 0x8A2E));
3838
+ tmpl->Set(isolate, "MAX_UNIFORM_BUFFER_BINDINGS",
3839
+ v8::Integer::NewFromUnsigned(isolate, 0x8A2F));
3840
+ tmpl->Set(isolate, "MAX_UNIFORM_BLOCK_SIZE", v8::Integer::NewFromUnsigned(isolate, 0x8A30));
3841
+ tmpl->Set(isolate, "MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",
3842
+ v8::Integer::NewFromUnsigned(isolate, 0x8A31));
3843
3843
  tmpl->Set(isolate, "MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",
3844
- v8::Uint32::New(isolate, 0x8A33));
3844
+ v8::Integer::NewFromUnsigned(isolate, 0x8A33));
3845
3845
 
3846
- tmpl->Set(isolate, "UNIFORM_BUFFER_OFFSET_ALIGNMENT", v8::Uint32::New(isolate, 0x8A34));
3847
- tmpl->Set(isolate, "ACTIVE_UNIFORM_BLOCKS", v8::Uint32::New(isolate, 0x8A36));
3848
- tmpl->Set(isolate, "UNIFORM_TYPE", v8::Uint32::New(isolate, 0x8A37));
3849
- tmpl->Set(isolate, "UNIFORM_SIZE", v8::Uint32::New(isolate, 0x8A38));
3850
- tmpl->Set(isolate, "UNIFORM_BLOCK_INDEX", v8::Uint32::New(isolate, 0x8A3A));
3846
+ tmpl->Set(isolate, "UNIFORM_BUFFER_OFFSET_ALIGNMENT",
3847
+ v8::Integer::NewFromUnsigned(isolate, 0x8A34));
3848
+ tmpl->Set(isolate, "ACTIVE_UNIFORM_BLOCKS", v8::Integer::NewFromUnsigned(isolate, 0x8A36));
3849
+ tmpl->Set(isolate, "UNIFORM_TYPE", v8::Integer::NewFromUnsigned(isolate, 0x8A37));
3850
+ tmpl->Set(isolate, "UNIFORM_SIZE", v8::Integer::NewFromUnsigned(isolate, 0x8A38));
3851
+ tmpl->Set(isolate, "UNIFORM_BLOCK_INDEX", v8::Integer::NewFromUnsigned(isolate, 0x8A3A));
3851
3852
 
3852
- tmpl->Set(isolate, "UNIFORM_OFFSET", v8::Uint32::New(isolate, 0x8A3B));
3853
- tmpl->Set(isolate, "UNIFORM_ARRAY_STRIDE", v8::Uint32::New(isolate, 0x8A3C));
3854
- tmpl->Set(isolate, "UNIFORM_MATRIX_STRIDE", v8::Uint32::New(isolate, 0x8A3D));
3853
+ tmpl->Set(isolate, "UNIFORM_OFFSET", v8::Integer::NewFromUnsigned(isolate, 0x8A3B));
3854
+ tmpl->Set(isolate, "UNIFORM_ARRAY_STRIDE", v8::Integer::NewFromUnsigned(isolate, 0x8A3C));
3855
+ tmpl->Set(isolate, "UNIFORM_MATRIX_STRIDE", v8::Integer::NewFromUnsigned(isolate, 0x8A3D));
3855
3856
 
3856
3857
  /* Draw buffers */
3857
3858
 
3858
3859
  /* Samplers */
3859
3860
 
3860
- tmpl->Set(isolate, "UNIFORM_IS_ROW_MAJOR", v8::Uint32::New(isolate, 0x8A3E));
3861
- tmpl->Set(isolate, "UNIFORM_BLOCK_BINDING", v8::Uint32::New(isolate, 0x8A3F));
3862
- tmpl->Set(isolate, "UNIFORM_BLOCK_DATA_SIZE", v8::Uint32::New(isolate, 0x8A40));
3863
- tmpl->Set(isolate, "UNIFORM_BLOCK_ACTIVE_UNIFORMS", v8::Uint32::New(isolate, 0x8A42));
3864
- tmpl->Set(isolate, "UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES", v8::Uint32::New(isolate, 0x8A43));
3861
+ tmpl->Set(isolate, "UNIFORM_IS_ROW_MAJOR", v8::Integer::NewFromUnsigned(isolate, 0x8A3E));
3862
+ tmpl->Set(isolate, "UNIFORM_BLOCK_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8A3F));
3863
+ tmpl->Set(isolate, "UNIFORM_BLOCK_DATA_SIZE", v8::Integer::NewFromUnsigned(isolate, 0x8A40));
3864
+ tmpl->Set(isolate, "UNIFORM_BLOCK_ACTIVE_UNIFORMS",
3865
+ v8::Integer::NewFromUnsigned(isolate, 0x8A42));
3866
+ tmpl->Set(isolate, "UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",
3867
+ v8::Integer::NewFromUnsigned(isolate, 0x8A43));
3865
3868
 
3866
3869
  tmpl->Set(isolate, "UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",
3867
- v8::Uint32::New(isolate, 0x8A44));
3870
+ v8::Integer::NewFromUnsigned(isolate, 0x8A44));
3868
3871
  tmpl->Set(isolate, "UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",
3869
- v8::Uint32::New(isolate, 0x8A46));
3870
- tmpl->Set(isolate, "OBJECT_TYPE", v8::Uint32::New(isolate, 0x9112));
3871
- tmpl->Set(isolate, "SYNC_CONDITION", v8::Uint32::New(isolate, 0x9113));
3872
- tmpl->Set(isolate, "SYNC_STATUS", v8::Uint32::New(isolate, 0x9114));
3872
+ v8::Integer::NewFromUnsigned(isolate, 0x8A46));
3873
+ tmpl->Set(isolate, "OBJECT_TYPE", v8::Integer::NewFromUnsigned(isolate, 0x9112));
3874
+ tmpl->Set(isolate, "SYNC_CONDITION", v8::Integer::NewFromUnsigned(isolate, 0x9113));
3875
+ tmpl->Set(isolate, "SYNC_STATUS", v8::Integer::NewFromUnsigned(isolate, 0x9114));
3873
3876
 
3874
- tmpl->Set(isolate, "SYNC_FLAGS", v8::Uint32::New(isolate, 0x9115));
3875
- tmpl->Set(isolate, "SYNC_FENCE", v8::Uint32::New(isolate, 0x9116));
3876
- tmpl->Set(isolate, "SYNC_GPU_COMMANDS_COMPLETE", v8::Uint32::New(isolate, 0x9117));
3877
- tmpl->Set(isolate, "UNSIGNALED", v8::Uint32::New(isolate, 0x9118));
3878
- tmpl->Set(isolate, "SIGNALED", v8::Uint32::New(isolate, 0x9119));
3877
+ tmpl->Set(isolate, "SYNC_FLAGS", v8::Integer::NewFromUnsigned(isolate, 0x9115));
3878
+ tmpl->Set(isolate, "SYNC_FENCE", v8::Integer::NewFromUnsigned(isolate, 0x9116));
3879
+ tmpl->Set(isolate, "SYNC_GPU_COMMANDS_COMPLETE", v8::Integer::NewFromUnsigned(isolate, 0x9117));
3880
+ tmpl->Set(isolate, "UNSIGNALED", v8::Integer::NewFromUnsigned(isolate, 0x9118));
3881
+ tmpl->Set(isolate, "SIGNALED", v8::Integer::NewFromUnsigned(isolate, 0x9119));
3879
3882
 
3880
3883
  /* Samplers */
3881
3884
 
3882
3885
  /* Buffers */
3883
3886
 
3884
- tmpl->Set(isolate, "ALREADY_SIGNALED", v8::Uint32::New(isolate, 0x911A));
3885
- tmpl->Set(isolate, "TIMEOUT_EXPIRED", v8::Uint32::New(isolate, 0x911B));
3886
- tmpl->Set(isolate, "CONDITION_SATISFIED", v8::Uint32::New(isolate, 0x911C));
3887
- tmpl->Set(isolate, "WAIT_FAILED", v8::Uint32::New(isolate, 0x911D));
3888
- tmpl->Set(isolate, "SYNC_FLUSH_COMMANDS_BIT", v8::Uint32::New(isolate, 0x00000001));
3887
+ tmpl->Set(isolate, "ALREADY_SIGNALED", v8::Integer::NewFromUnsigned(isolate, 0x911A));
3888
+ tmpl->Set(isolate, "TIMEOUT_EXPIRED", v8::Integer::NewFromUnsigned(isolate, 0x911B));
3889
+ tmpl->Set(isolate, "CONDITION_SATISFIED", v8::Integer::NewFromUnsigned(isolate, 0x911C));
3890
+ tmpl->Set(isolate, "WAIT_FAILED", v8::Integer::NewFromUnsigned(isolate, 0x911D));
3891
+ tmpl->Set(isolate, "SYNC_FLUSH_COMMANDS_BIT",
3892
+ v8::Integer::NewFromUnsigned(isolate, 0x00000001));
3889
3893
 
3890
- tmpl->Set(isolate, "COLOR", v8::Uint32::New(isolate, 0x1800));
3891
- tmpl->Set(isolate, "DEPTH", v8::Uint32::New(isolate, 0x1801));
3892
- tmpl->Set(isolate, "STENCIL", v8::Uint32::New(isolate, 0x1802));
3894
+ tmpl->Set(isolate, "COLOR", v8::Integer::NewFromUnsigned(isolate, 0x1800));
3895
+ tmpl->Set(isolate, "DEPTH", v8::Integer::NewFromUnsigned(isolate, 0x1801));
3896
+ tmpl->Set(isolate, "STENCIL", v8::Integer::NewFromUnsigned(isolate, 0x1802));
3893
3897
 
3894
3898
  /* Buffers */
3895
3899
 
3896
3900
  /* Data types */
3897
3901
 
3898
- tmpl->Set(isolate, "MIN", v8::Uint32::New(isolate, 0x8007));
3899
- tmpl->Set(isolate, "MAX", v8::Uint32::New(isolate, 0x8008));
3900
- tmpl->Set(isolate, "DEPTH_COMPONENT24", v8::Uint32::New(isolate, 0x81A6));
3901
- tmpl->Set(isolate, "STREAM_READ", v8::Uint32::New(isolate, 0x88E1));
3902
- tmpl->Set(isolate, "STREAM_COPY", v8::Uint32::New(isolate, 0x88E2));
3902
+ tmpl->Set(isolate, "MIN", v8::Integer::NewFromUnsigned(isolate, 0x8007));
3903
+ tmpl->Set(isolate, "MAX", v8::Integer::NewFromUnsigned(isolate, 0x8008));
3904
+ tmpl->Set(isolate, "DEPTH_COMPONENT24", v8::Integer::NewFromUnsigned(isolate, 0x81A6));
3905
+ tmpl->Set(isolate, "STREAM_READ", v8::Integer::NewFromUnsigned(isolate, 0x88E1));
3906
+ tmpl->Set(isolate, "STREAM_COPY", v8::Integer::NewFromUnsigned(isolate, 0x88E2));
3903
3907
 
3904
- tmpl->Set(isolate, "STATIC_READ", v8::Uint32::New(isolate, 0x88E5));
3905
- tmpl->Set(isolate, "STATIC_COPY", v8::Uint32::New(isolate, 0x88E6));
3906
- tmpl->Set(isolate, "DYNAMIC_READ", v8::Uint32::New(isolate, 0x88E9));
3907
- tmpl->Set(isolate, "DYNAMIC_COPY", v8::Uint32::New(isolate, 0x88EA));
3908
- tmpl->Set(isolate, "DEPTH_COMPONENT32F", v8::Uint32::New(isolate, 0x8CAC));
3909
- tmpl->Set(isolate, "DEPTH32F_STENCIL8", v8::Uint32::New(isolate, 0x8CAD));
3908
+ tmpl->Set(isolate, "STATIC_READ", v8::Integer::NewFromUnsigned(isolate, 0x88E5));
3909
+ tmpl->Set(isolate, "STATIC_COPY", v8::Integer::NewFromUnsigned(isolate, 0x88E6));
3910
+ tmpl->Set(isolate, "DYNAMIC_READ", v8::Integer::NewFromUnsigned(isolate, 0x88E9));
3911
+ tmpl->Set(isolate, "DYNAMIC_COPY", v8::Integer::NewFromUnsigned(isolate, 0x88EA));
3912
+ tmpl->Set(isolate, "DEPTH_COMPONENT32F", v8::Integer::NewFromUnsigned(isolate, 0x8CAC));
3913
+ tmpl->Set(isolate, "DEPTH32F_STENCIL8", v8::Integer::NewFromUnsigned(isolate, 0x8CAD));
3910
3914
 
3911
3915
  /* Data types */
3912
3916
 
3913
- tmpl->Set(isolate, "INVALID_INDEX", v8::Number::New(isolate, (double) 0xFFFFFFFF));
3917
+ tmpl->Set(isolate, "INVALID_INDEX", v8::Integer::NewFromUnsigned(isolate, 0xFFFFFFFF));
3914
3918
  tmpl->Set(isolate, "TIMEOUT_IGNORED", v8::Int32::New(isolate, -1));
3915
3919
 
3916
3920
  /* Vertex attributes */
3917
3921
 
3918
3922
  /* Transform feedback */
3919
3923
 
3920
- tmpl->Set(isolate, "MAX_CLIENT_WAIT_TIMEOUT_WEBGL", v8::Uint32::New(isolate, 0x9247));
3924
+ tmpl->Set(isolate, "MAX_CLIENT_WAIT_TIMEOUT_WEBGL",
3925
+ v8::Integer::NewFromUnsigned(isolate, 0x9247));
3921
3926
 
3922
3927
  /* Transform feedback */
3923
3928