diff --git a/packages/canvas-babylon/package.json b/packages/canvas-babylon/package.json index 47101d7df..f1c30609f 100644 --- a/packages/canvas-babylon/package.json +++ b/packages/canvas-babylon/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/canvas-babylon", - "version": "2.0.0-alpha.22", + "version": "2.0.0-alpha.23", "description": "", "main": "index", "typings": "index.d.ts", diff --git a/packages/canvas-chartjs/package.json b/packages/canvas-chartjs/package.json index de5b28064..4b1db1753 100644 --- a/packages/canvas-chartjs/package.json +++ b/packages/canvas-chartjs/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/canvas-chartjs", - "version": "2.0.0-alpha.22", + "version": "2.0.0-alpha.23", "description": "ChartJS", "main": "index", "typings": "index.d.ts", diff --git a/packages/canvas-media/package.json b/packages/canvas-media/package.json index 7662097cc..9871283ad 100644 --- a/packages/canvas-media/package.json +++ b/packages/canvas-media/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/canvas-media", - "version": "2.0.0-alpha.22", + "version": "2.0.0-alpha.23", "description": "Canvas media", "main": "index", "typings": "index.d.ts", diff --git a/packages/canvas-phaser-ce/package.json b/packages/canvas-phaser-ce/package.json index 496f56d8f..c024d4abc 100644 --- a/packages/canvas-phaser-ce/package.json +++ b/packages/canvas-phaser-ce/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/canvas-phaser-ce", - "version": "2.0.0-alpha.22", + "version": "2.0.0-alpha.23", "description": "Tools for using Phaser-ce to build native 2D games in NativeScript 👾", "main": "index", "typings": "index.d.ts", diff --git a/packages/canvas-phaser/package.json b/packages/canvas-phaser/package.json index e1ebb70f6..a897178d7 100644 --- a/packages/canvas-phaser/package.json +++ b/packages/canvas-phaser/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/canvas-phaser", - "version": "2.0.0-alpha.22", + "version": "2.0.0-alpha.23", "description": "Build awesome 2D games with Phaser.js and NativeScript", "main": "index", "typings": "index.d.ts", diff --git a/packages/canvas-pixi/package.json b/packages/canvas-pixi/package.json index 53a041078..d75a41e34 100644 --- a/packages/canvas-pixi/package.json +++ b/packages/canvas-pixi/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/canvas-pixi", - "version": "2.0.0-alpha.22", + "version": "2.0.0-alpha.23", "description": "Plugin for using pixi.js in NativeScript", "main": "index", "typings": "index.d.ts", diff --git a/packages/canvas-polyfill/package.json b/packages/canvas-polyfill/package.json index 8d7367a53..1fe43bbfc 100644 --- a/packages/canvas-polyfill/package.json +++ b/packages/canvas-polyfill/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/canvas-polyfill", - "version": "2.0.0-alpha.22", + "version": "2.0.0-alpha.23", "description": "Polyfill for making NativeScript compatible with web libs like pixi.js, three.js, phaser.js, babylon.js, etc....", "main": "index", "typings": "index.d.ts", diff --git a/packages/canvas-three/package.json b/packages/canvas-three/package.json index 2f424e168..2f4e342ba 100644 --- a/packages/canvas-three/package.json +++ b/packages/canvas-three/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/canvas-three", - "version": "2.0.0-alpha.22", + "version": "2.0.0-alpha.23", "description": "Utilities for using THREE.js on NativeScript", "main": "index", "typings": "index.d.ts", diff --git a/packages/canvas/package.json b/packages/canvas/package.json index 1ce7a8998..8acf110cb 100644 --- a/packages/canvas/package.json +++ b/packages/canvas/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/canvas", - "version": "2.0.0-alpha.22", + "version": "2.0.0-alpha.23", "description": "DOM Canvas API for NativeScript", "main": "index", "typings": "index.d.ts", diff --git a/packages/canvas/platforms/android/canvas-release.aar b/packages/canvas/platforms/android/canvas-release.aar index 70aa95416..456dcd66a 100644 Binary files a/packages/canvas/platforms/android/canvas-release.aar and b/packages/canvas/platforms/android/canvas-release.aar differ diff --git a/packages/canvas/platforms/ios/src/cpp/ImageAssetImpl.cpp b/packages/canvas/platforms/ios/src/cpp/ImageAssetImpl.cpp index e15447f96..4059755fe 100644 --- a/packages/canvas/platforms/ios/src/cpp/ImageAssetImpl.cpp +++ b/packages/canvas/platforms/ios/src/cpp/ImageAssetImpl.cpp @@ -173,8 +173,8 @@ void ImageAssetImpl::Scale(const v8::FunctionCallbackInfo &args) { auto context = isolate->GetCurrentContext(); if (args.Length() > 1) { - auto x = (uint32_t) args[0]->NumberValue(context).ToChecked(); - auto y = (uint32_t) args[1]->NumberValue(context).ToChecked(); + auto x = args[0]->Uint32Value(context).ToChecked(); + auto y = args[1]->Uint32Value(context).ToChecked(); if (x > 0 && y > 0) { canvas_native_image_asset_scale( ptr->GetImageAsset(), x, @@ -663,7 +663,7 @@ void ImageAssetImpl::SaveSync(const v8::FunctionCallbackInfo &args) { auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); auto path = ConvertFromV8String(isolate, args[0]); - auto format = (uint32_t) args[1]->NumberValue(context).ToChecked(); + auto format = args[1]->Uint32Value(context).ToChecked(); auto done = canvas_native_image_asset_save_path(ptr->GetImageAsset(), path.c_str(), format); args.GetReturnValue().Set(done); @@ -683,7 +683,7 @@ void ImageAssetImpl::SaveCb(const v8::FunctionCallbackInfo &args) { auto path = ConvertFromV8String(isolate, args[0]); - auto format = (uint32_t) args[1]->NumberValue(context).ToChecked(); + auto format = args[1]->Uint32Value(context).ToChecked(); auto asset = canvas_native_image_asset_shared_clone( ptr->GetImageAsset()); diff --git a/packages/canvas/platforms/ios/src/cpp/webgl/WebGLActiveInfoImpl.cpp b/packages/canvas/platforms/ios/src/cpp/webgl/WebGLActiveInfoImpl.cpp index 0622fc593..656fb18da 100644 --- a/packages/canvas/platforms/ios/src/cpp/webgl/WebGLActiveInfoImpl.cpp +++ b/packages/canvas/platforms/ios/src/cpp/webgl/WebGLActiveInfoImpl.cpp @@ -63,7 +63,6 @@ void WebGLActiveInfoImpl::GetSize(v8::Local name, const v8::PropertyCallbackInfo &info) { auto ptr = GetPointer(info.This()); - auto isolate = info.GetIsolate(); if (ptr != nullptr) { auto size = canvas_native_webgl_active_info_get_size(ptr->GetWebGLActiveInfo()); info.GetReturnValue().Set(size); @@ -77,7 +76,6 @@ void WebGLActiveInfoImpl::GetType(v8::Local name, const v8::PropertyCallbackInfo &info) { auto ptr = GetPointer(info.This()); - auto isolate = info.GetIsolate(); if (ptr != nullptr) { auto type = canvas_native_webgl_active_info_get_type(ptr->GetWebGLActiveInfo()); info.GetReturnValue().Set(type); diff --git a/packages/canvas/platforms/ios/src/cpp/webgl/WebGLRenderingContext.cpp b/packages/canvas/platforms/ios/src/cpp/webgl/WebGLRenderingContext.cpp index 2675f0358..ccc9b1125 100644 --- a/packages/canvas/platforms/ios/src/cpp/webgl/WebGLRenderingContext.cpp +++ b/packages/canvas/platforms/ios/src/cpp/webgl/WebGLRenderingContext.cpp @@ -122,12 +122,12 @@ v8::Local WebGLRenderingContext::GetParameterInternal(v8::Isolate *is value == 0) { return scope.Escape(v8::Null(isolate)); } - return scope.Escape(v8::Number::New(isolate, (double) value)); + return scope.Escape(v8::Integer::New(isolate, value)); } case (uint32_t) GLConstants::UNPACK_COLORSPACE_CONVERSION_WEBGL: - return scope.Escape(v8::Number::New(isolate, - (double) canvas_native_webgl_state_get_unpack_colorspace_conversion_webgl( - this->GetState()))); + return scope.Escape(v8::Integer::New(isolate, + canvas_native_webgl_state_get_unpack_colorspace_conversion_webgl( + this->GetState()))); case GL_ALIASED_LINE_WIDTH_RANGE: case GL_ALIASED_POINT_SIZE_RANGE: case GL_BLEND_COLOR: @@ -307,7 +307,7 @@ void WebGLRenderingContext::ActiveTexture(const v8::FunctionCallbackInfoGetCurrentContext(); - auto texture = (uint32_t) args[0]->NumberValue(context).ToChecked(); + auto texture = args[0]->Uint32Value(context).ToChecked(); canvas_native_webgl_active_texture(texture, ptr->GetState()); } @@ -322,32 +322,33 @@ void WebGLRenderingContext::AttachShader(const v8::FunctionCallbackInfoIsObject() && shaderValue->IsObject()) { - WebGLProgram *program = nullptr; - WebGLShader *shader = nullptr; - if (GetNativeType(isolate, programValue.As()) == NativeType::WebGLProgram) { - program = WebGLProgram::GetPointer(programValue.As()); - } - if (GetNativeType(isolate, shaderValue.As()) == NativeType::WebGLShader) { - shader = WebGLShader::GetPointer(shaderValue.As()); - } + auto programType = GetNativeType(isolate, programValue); + auto shaderType = GetNativeType(isolate, shaderValue); - if (program == nullptr) { - return; - } + WebGLProgram *program = nullptr; + WebGLShader *shader = nullptr; + if (programType == NativeType::WebGLProgram) { + program = WebGLProgram::GetPointer(programValue.As()); + } - if (shader == nullptr) { - return; - } + if (shaderType == NativeType::WebGLShader) { + shader = WebGLShader::GetPointer(shaderValue.As()); + } - canvas_native_webgl_attach_shader( - program->GetProgram(), - shader->GetShader(), - ptr->GetState() - ); + if (program == nullptr) { + return; + } + if (shader == nullptr) { + return; } + + canvas_native_webgl_attach_shader( + program->GetProgram(), + shader->GetShader(), + ptr->GetState() + ); } void WebGLRenderingContext::BindAttribLocation(const v8::FunctionCallbackInfo &args) { @@ -361,11 +362,10 @@ void WebGLRenderingContext::BindAttribLocation(const v8::FunctionCallbackInfoIsNumber() && - args[2]->IsString()) { + if (type == NativeType::WebGLProgram) { auto program = WebGLProgram::GetPointer(programValue.As()); - auto index = (uint32_t) args[1]->NumberValue(context).ToChecked(); + auto index = args[1]->Uint32Value(context).ToChecked(); auto name = ConvertFromV8String(isolate, args[2]); canvas_native_webgl_bind_attrib_location( program->GetProgram(), @@ -386,31 +386,29 @@ void WebGLRenderingContext::BindBuffer(const v8::FunctionCallbackInfo auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - if (args[0]->IsNumber()) { - auto target = (uint32_t) args[0]->NumberValue(context).ToChecked(); - if (!args[1]->IsNull() && - args[1]->IsObject()) { - auto type = GetNativeType(isolate, args[1].As()); - if (type == NativeType::WebGLBuffer) { - auto buffer = WebGLBuffer::GetPointer(args[1].As()); - if (buffer == - nullptr) { return; } - canvas_native_webgl_bind_buffer( - target, - buffer->GetBuffer(), - ptr->GetState() - ); - } - - } else { - // unbind - // check for null or undefined ? + auto target = args[0]->Uint32Value(context).ToChecked(); + if (!args[1]->IsNull() && + args[1]->IsObject()) { + auto type = GetNativeType(isolate, args[1].As()); + if (type == NativeType::WebGLBuffer) { + auto buffer = WebGLBuffer::GetPointer(args[1].As()); + if (buffer == + nullptr) { return; } canvas_native_webgl_bind_buffer( target, - 0, + buffer->GetBuffer(), ptr->GetState() ); } + + } else { + // unbind + // check for null or undefined ? + canvas_native_webgl_bind_buffer( + target, + 0, + ptr->GetState() + ); } } @@ -424,9 +422,9 @@ void WebGLRenderingContext::BindFramebuffer(const v8::FunctionCallbackInfoGetCurrentContext(); if (args[0]->IsNumber()) { - auto target = (uint32_t) args[0]->NumberValue(context).ToChecked(); + auto target = args[0]->Uint32Value(context).ToChecked(); if (args[1]->IsObject()) { - auto type = GetNativeType(isolate, args[1].As()); + auto type = GetNativeType(isolate, args[1]); if (type == NativeType::WebGLFramebuffer) { auto framebuffer = WebGLFramebuffer::GetPointer(args[1].As()); canvas_native_webgl_bind_frame_buffer( @@ -456,28 +454,26 @@ void WebGLRenderingContext::BindRenderbuffer(const v8::FunctionCallbackInfoGetCurrentContext(); - if (args[0]->IsNumber()) { - auto target = (uint32_t) args[0]->NumberValue(context).ToChecked(); - if (args[1]->IsObject()) { - auto type = GetNativeType(isolate, args[1].As()); - if (type == NativeType::WebGLRenderbuffer) { - auto renderbuffer = WebGLRenderbuffer::GetPointer(args[1].As()); + auto target = args[0]->Uint32Value(context).ToChecked(); + if (args[1]->IsObject()) { + auto type = GetNativeType(isolate, args[1].As()); + if (type == NativeType::WebGLRenderbuffer) { + auto renderbuffer = WebGLRenderbuffer::GetPointer(args[1].As()); - if (renderbuffer == - nullptr) { return; } - canvas_native_webgl_bind_render_buffer( - target, - renderbuffer->GetRenderBuffer(), - ptr->GetState() - ); - } - } else { + if (renderbuffer == + nullptr) { return; } canvas_native_webgl_bind_render_buffer( target, - 0, + renderbuffer->GetRenderBuffer(), ptr->GetState() ); } + } else { + canvas_native_webgl_bind_render_buffer( + target, + 0, + ptr->GetState() + ); } } @@ -490,25 +486,23 @@ void WebGLRenderingContext::BindTexture(const v8::FunctionCallbackInfoGetCurrentContext(); - if (args[0]->IsNumber()) { - auto target = (uint32_t) args[0]->NumberValue(context).ToChecked(); - if (args[1]->IsObject()) { - auto type = GetNativeType(isolate, args[1].As()); - if (type == NativeType::WebGLTexture) { - auto texture = WebGLTexture::GetPointer(args[1].As()); - canvas_native_webgl_bind_texture( - target, - texture->GetTexture(), - ptr->GetState() - ); - } - } else { + auto target = args[0]->Uint32Value(context).ToChecked(); + if (args[1]->IsObject()) { + auto type = GetNativeType(isolate, args[1].As()); + if (type == NativeType::WebGLTexture) { + auto texture = WebGLTexture::GetPointer(args[1].As()); canvas_native_webgl_bind_texture( target, - 0, + texture->GetTexture(), ptr->GetState() ); } + } else { + canvas_native_webgl_bind_texture( + target, + 0, + ptr->GetState() + ); } } @@ -544,8 +538,8 @@ void WebGLRenderingContext::BlendEquationSeparate(const v8::FunctionCallbackInfo auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto modeRGB = (uint32_t) args[0]->NumberValue(context).ToChecked(); - auto modeAlpha = (uint32_t) args[1]->NumberValue(context).ToChecked(); + auto modeRGB = args[0]->Uint32Value(context).ToChecked(); + auto modeAlpha = args[1]->Uint32Value(context).ToChecked(); canvas_native_webgl_blend_equation_separate( modeRGB, @@ -563,7 +557,7 @@ void WebGLRenderingContext::BlendEquation(const v8::FunctionCallbackInfoGetCurrentContext(); - auto mode = (uint32_t) args[0]->NumberValue(context).ToChecked(); + auto mode = args[0]->Uint32Value(context).ToChecked(); canvas_native_webgl_blend_equation( mode, ptr->GetState() @@ -579,10 +573,10 @@ void WebGLRenderingContext::BlendFuncSeparate(const v8::FunctionCallbackInfoGetCurrentContext(); - auto srcRGB = (uint32_t) args[0]->NumberValue(context).ToChecked(); - auto dstRGB = (uint32_t) args[1]->NumberValue(context).ToChecked(); - auto srcAlpha = (uint32_t) args[2]->NumberValue(context).ToChecked(); - auto dstAlpha = (uint32_t) args[3]->NumberValue(context).ToChecked(); + auto srcRGB = args[0]->Uint32Value(context).ToChecked(); + auto dstRGB = args[1]->Uint32Value(context).ToChecked(); + auto srcAlpha = args[2]->Uint32Value(context).ToChecked(); + auto dstAlpha = args[3]->Uint32Value(context).ToChecked(); canvas_native_webgl_blend_func_separate( srcRGB, @@ -602,8 +596,8 @@ void WebGLRenderingContext::BlendFunc(const v8::FunctionCallbackInfo auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto sfactor = (uint32_t) args[0]->NumberValue(context).ToChecked(); - auto dfactor = (uint32_t) args[1]->NumberValue(context).ToChecked(); + auto sfactor = args[0]->Uint32Value(context).ToChecked(); + auto dfactor = args[1]->Uint32Value(context).ToChecked(); canvas_native_webgl_blend_func( sfactor, @@ -624,8 +618,8 @@ void WebGLRenderingContext::BufferData(const v8::FunctionCallbackInfo auto count = args.Length(); if (count == 2) { - auto target = (uint32_t) args[0]->NumberValue(context).ToChecked(); - auto usage = (uint32_t) args[1]->NumberValue(context).ToChecked(); + auto target = args[0]->Uint32Value(context).ToChecked(); + auto usage = args[1]->Uint32Value(context).ToChecked(); canvas_native_webgl_buffer_data_none( target, @@ -634,9 +628,9 @@ void WebGLRenderingContext::BufferData(const v8::FunctionCallbackInfo ptr->GetState() ); } else if (count == 3) { - auto target = (uint32_t) args[0]->NumberValue(context).ToChecked(); + auto target = args[0]->Uint32Value(context).ToChecked(); - auto usage = (uint32_t) args[2]->NumberValue(context).ToChecked(); + auto usage = args[2]->Uint32Value(context).ToChecked(); if (args[1]->IsObject()) { @@ -730,7 +724,7 @@ void WebGLRenderingContext::BufferSubData(const v8::FunctionCallbackInfoNumberValue(context).ToChecked(); + auto target = args[0]->Uint32Value(context).ToChecked(); auto offset = args[1]->NumberValue(context).ToChecked(); canvas_native_webgl_buffer_sub_data_none( @@ -739,7 +733,7 @@ void WebGLRenderingContext::BufferSubData(const v8::FunctionCallbackInfoGetState() ); } else if (count == 3) { - auto target = (uint32_t) args[0]->NumberValue(context).ToChecked(); + auto target = args[0]->Uint32Value(context).ToChecked(); auto offset = args[1]->NumberValue(context).ToChecked(); if (args[2]->IsObject()) { @@ -793,14 +787,14 @@ WebGLRenderingContext::CheckFramebufferStatus(const v8::FunctionCallbackInfoIsNumber()) { - auto target = (uint32_t) args[0]->NumberValue(context).ToChecked(); + auto target = args[0]->Uint32Value(context).ToChecked(); auto ret = canvas_native_webgl_check_frame_buffer_status( target, ptr->GetState() ); - args.GetReturnValue().Set((int32_t) ret); + args.GetReturnValue().Set(ret); return; } @@ -856,7 +850,7 @@ void WebGLRenderingContext::ClearStencil(const v8::FunctionCallbackInfoGetCurrentContext(); - auto stencil = (int32_t) args[0]->NumberValue(context).ToChecked(); + auto stencil = args[0]->Int32Value(context).ToChecked(); canvas_native_webgl_clear_stencil( stencil, ptr->GetState() @@ -872,7 +866,7 @@ void WebGLRenderingContext::Clear(const v8::FunctionCallbackInfo &arg auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto mask = (uint32_t) args[0]->NumberValue(context).ToChecked(); + auto mask = args[0]->Uint32Value(context).ToChecked(); canvas_native_webgl_clear( mask, @@ -938,12 +932,12 @@ void WebGLRenderingContext::CompressedTexImage2D(const v8::FunctionCallbackInfo< auto count = args.Length(); if (count == 6) { - auto target = (uint32_t) args[0]->NumberValue(context).ToChecked(); - auto level = (int32_t) args[1]->NumberValue(context).ToChecked(); - auto internalformat = (uint32_t) args[2]->NumberValue(context).ToChecked(); - auto width = (int32_t) args[3]->NumberValue(context).ToChecked(); - auto height = (int32_t) args[4]->NumberValue(context).ToChecked(); - auto border = (int32_t) args[5]->NumberValue(context).ToChecked(); + auto target = args[0]->Uint32Value(context).ToChecked(); + auto level = args[1]->Int32Value(context).ToChecked(); + auto internalformat = args[2]->Uint32Value(context).ToChecked(); + auto width = args[3]->Int32Value(context).ToChecked(); + auto height = args[4]->Int32Value(context).ToChecked(); + auto border = args[5]->Int32Value(context).ToChecked(); canvas_native_webgl_compressed_tex_image2d_none( target, @@ -955,12 +949,12 @@ void WebGLRenderingContext::CompressedTexImage2D(const v8::FunctionCallbackInfo< ptr->GetState() ); } else if (count > 6) { - auto target = (uint32_t) args[0]->NumberValue(context).ToChecked(); - auto level = (int32_t) args[1]->NumberValue(context).ToChecked(); - auto internalformat = (uint32_t) args[2]->NumberValue(context).ToChecked(); - auto width = (int32_t) args[3]->NumberValue(context).ToChecked(); - auto height = (int32_t) args[4]->NumberValue(context).ToChecked(); - auto border = (int32_t) args[5]->NumberValue(context).ToChecked(); + auto target = args[0]->Uint32Value(context).ToChecked(); + auto level = args[1]->Int32Value(context).ToChecked(); + auto internalformat = args[2]->Uint32Value(context).ToChecked(); + auto width = args[3]->Int32Value(context).ToChecked(); + auto height = args[4]->Int32Value(context).ToChecked(); + auto border = args[5]->Int32Value(context).ToChecked(); auto pixels = args[6]; if (pixels->IsObject()) { if (pixels->IsArrayBufferView()) { @@ -1015,13 +1009,13 @@ WebGLRenderingContext::CompressedTexSubImage2D(const v8::FunctionCallbackInfoGetCurrentContext(); - auto target = (uint32_t) args[0]->NumberValue(context).ToChecked(); - auto level = (int32_t) args[1]->NumberValue(context).ToChecked(); - auto xoffset = (int32_t) args[2]->NumberValue(context).ToChecked(); - auto yoffset = (int32_t) args[3]->NumberValue(context).ToChecked(); - auto width = (int32_t) args[4]->NumberValue(context).ToChecked(); - auto height = (int32_t) args[5]->NumberValue(context).ToChecked(); - auto format = (uint32_t) args[6]->NumberValue(context).ToChecked(); + auto target = args[0]->Uint32Value(context).ToChecked(); + auto level = args[1]->Int32Value(context).ToChecked(); + auto xoffset = args[2]->Int32Value(context).ToChecked(); + auto yoffset = args[3]->Int32Value(context).ToChecked(); + auto width = args[4]->Int32Value(context).ToChecked(); + auto height = args[5]->Int32Value(context).ToChecked(); + auto format = args[6]->Uint32Value(context).ToChecked(); if (args[7]->IsObject()) { auto pixels = args[7]; if (pixels->IsArrayBufferView()) { @@ -1076,14 +1070,14 @@ void WebGLRenderingContext::CopyTexImage2D(const v8::FunctionCallbackInfoNumberValue(context).ToChecked(); - auto level = (int32_t) args[1]->NumberValue(context).ToChecked(); - auto internalformat = (uint32_t) args[2]->NumberValue(context).ToChecked(); - auto x = (int32_t) args[3]->NumberValue(context).ToChecked(); - auto y = (int32_t) args[4]->NumberValue(context).ToChecked(); - auto width = (int32_t) args[5]->NumberValue(context).ToChecked(); - auto height = (int32_t) args[6]->NumberValue(context).ToChecked(); - auto border = (int32_t) args[7]->NumberValue(context).ToChecked(); + auto target = args[0]->Uint32Value(context).ToChecked(); + auto level = args[1]->Int32Value(context).ToChecked(); + auto internalformat = args[2]->Uint32Value(context).ToChecked(); + auto x = args[3]->Int32Value(context).ToChecked(); + auto y = args[4]->Int32Value(context).ToChecked(); + auto width = args[5]->Int32Value(context).ToChecked(); + auto height = args[6]->Int32Value(context).ToChecked(); + auto border = args[7]->Int32Value(context).ToChecked(); canvas_native_webgl_copy_tex_image2d( target, @@ -1111,14 +1105,14 @@ void WebGLRenderingContext::CopyTexSubImage2D(const v8::FunctionCallbackInfoNumberValue(context).ToChecked(); - auto level = (int32_t) args[1]->NumberValue(context).ToChecked(); - auto xoffset = (int32_t) args[2]->NumberValue(context).ToChecked(); - auto yoffset = (int32_t) args[3]->NumberValue(context).ToChecked(); - auto x = (int32_t) args[4]->NumberValue(context).ToChecked(); - auto y = (int32_t) args[5]->NumberValue(context).ToChecked(); - auto width = (int32_t) args[6]->NumberValue(context).ToChecked(); - auto height = (int32_t) args[7]->NumberValue(context).ToChecked(); + auto target = args[0]->Uint32Value(context).ToChecked(); + auto level = args[1]->Int32Value(context).ToChecked(); + auto xoffset = args[2]->Int32Value(context).ToChecked(); + auto yoffset = args[3]->Int32Value(context).ToChecked(); + auto x = args[4]->Int32Value(context).ToChecked(); + auto y = args[5]->Int32Value(context).ToChecked(); + auto width = args[6]->Int32Value(context).ToChecked(); + auto height = args[7]->Int32Value(context).ToChecked(); canvas_native_webgl_copy_tex_sub_image2d( target, @@ -1243,7 +1237,7 @@ void WebGLRenderingContext::CreateShader(const v8::FunctionCallbackInfoNumberValue(context).ToChecked(); + auto type = args[0]->Uint32Value(context).ToChecked(); auto shader = canvas_native_webgl_create_shader( type, ptr->GetState()); if (shader != 0) { @@ -1290,7 +1284,7 @@ void WebGLRenderingContext::CullFace(const v8::FunctionCallbackInfo & auto context = isolate->GetCurrentContext(); - auto mode = (uint32_t) args[0]->NumberValue(context).ToChecked(); + auto mode = args[0]->Uint32Value(context).ToChecked(); canvas_native_webgl_cull_face( mode, @@ -1454,7 +1448,7 @@ void WebGLRenderingContext::DepthFunc(const v8::FunctionCallbackInfo auto value = args[0]; - auto func = (uint32_t) value->NumberValue(context).ToChecked(); + auto func = value->Uint32Value(context).ToChecked(); canvas_native_webgl_depth_func( func, @@ -1470,9 +1464,7 @@ void WebGLRenderingContext::DepthMask(const v8::FunctionCallbackInfo auto isolate = args.GetIsolate(); - auto value = args[0]; - - auto mask = value->BooleanValue(isolate); + auto mask = args[0]->BooleanValue(isolate); canvas_native_webgl_depth_mask( mask, @@ -1543,7 +1535,7 @@ WebGLRenderingContext::DisableVertexAttribArray(const v8::FunctionCallbackInfoGetCurrentContext(); - auto index = (uint32_t) args[0]->NumberValue(context).ToChecked(); + auto index = args[0]->Uint32Value(context).ToChecked(); canvas_native_webgl_disable_vertex_attrib_array( index, @@ -1560,7 +1552,7 @@ void WebGLRenderingContext::Disable(const v8::FunctionCallbackInfo &a auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto cap = (uint32_t) args[0]->NumberValue(context).ToChecked(); + auto cap = args[0]->Uint32Value(context).ToChecked(); canvas_native_webgl_disable( cap, @@ -1577,9 +1569,9 @@ void WebGLRenderingContext::DrawArrays(const v8::FunctionCallbackInfo auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto mode = (uint32_t) args[0]->NumberValue(context).ToChecked(); - auto first = (int32_t) args[1]->NumberValue(context).ToChecked(); - auto count = (int32_t) args[2]->NumberValue(context).ToChecked(); + auto mode = args[0]->Uint32Value(context).ToChecked(); + auto first = args[1]->Int32Value(context).ToChecked(); + auto count = args[2]->Int32Value(context).ToChecked(); canvas_native_webgl_draw_arrays( mode, @@ -1600,9 +1592,9 @@ void WebGLRenderingContext::DrawElements(const v8::FunctionCallbackInfoGetCurrentContext(); - auto mode = (uint32_t) args[0]->NumberValue(context).ToChecked(); - auto count = (int32_t) args[1]->NumberValue(context).ToChecked(); - auto type = (uint32_t) args[2]->NumberValue(context).ToChecked(); + auto mode = args[0]->Uint32Value(context).ToChecked(); + auto count = args[1]->Int32Value(context).ToChecked(); + auto type = args[2]->Int32Value(context).ToChecked(); auto offset = args[3]->NumberValue(context).ToChecked(); canvas_native_webgl_draw_elements( @@ -1625,7 +1617,7 @@ WebGLRenderingContext::EnableVertexAttribArray(const v8::FunctionCallbackInfoGetCurrentContext(); - auto index = (uint32_t) args[0]->NumberValue(context).ToChecked(); + auto index = args[0]->Uint32Value(context).ToChecked(); canvas_native_webgl_enable_vertex_attrib_array( index, @@ -1642,7 +1634,7 @@ void WebGLRenderingContext::Enable(const v8::FunctionCallbackInfo &ar auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto cap = (uint32_t) args[0]->NumberValue(context).ToChecked(); + auto cap = args[0]->Uint32Value(context).ToChecked(); canvas_native_webgl_enable( cap, @@ -1682,9 +1674,9 @@ WebGLRenderingContext::FramebufferRenderbuffer(const v8::FunctionCallbackInfoGetCurrentContext(); - auto target = (uint32_t) args[0]->NumberValue(context).ToChecked(); - auto attachment = (uint32_t) args[1]->NumberValue(context).ToChecked(); - auto renderbuffertarget = (uint32_t) args[2]->NumberValue(context).ToChecked(); + auto target = args[0]->Uint32Value(context).ToChecked(); + auto attachment = args[1]->Uint32Value(context).ToChecked(); + auto renderbuffertarget = args[2]->Uint32Value(context).ToChecked(); auto renderbufferValue = args[3]; auto type = GetNativeType(isolate, renderbufferValue); if (type == NativeType::WebGLRenderbuffer) { @@ -1710,10 +1702,10 @@ void WebGLRenderingContext::FramebufferTexture2D(const v8::FunctionCallbackInfo< auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto target = (uint32_t) args[0]->NumberValue(context).ToChecked(); - auto attachment = (uint32_t) args[1]->NumberValue(context).ToChecked(); - auto textarget = (uint32_t) args[2]->NumberValue(context).ToChecked(); - auto level = (int32_t) args[4]->NumberValue(context).ToChecked(); + auto target = args[0]->Uint32Value(context).ToChecked(); + auto attachment = args[1]->Uint32Value(context).ToChecked(); + auto textarget = args[2]->Uint32Value(context).ToChecked(); + auto level = args[4]->Int32Value(context).ToChecked(); auto textureValue = args[3]; auto type = GetNativeType(isolate, textureValue); if (type == NativeType::WebGLTexture) { @@ -1740,7 +1732,7 @@ void WebGLRenderingContext::FrontFace(const v8::FunctionCallbackInfo auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto mode = (uint32_t) args[0]->NumberValue(context).ToChecked(); + auto mode = args[0]->Uint32Value(context).ToChecked(); canvas_native_webgl_front_face( mode, @@ -1757,7 +1749,7 @@ void WebGLRenderingContext::GenerateMipmap(const v8::FunctionCallbackInfoGetCurrentContext(); - auto target = (uint32_t) args[0]->NumberValue(context).ToChecked(); + auto target = args[0]->Uint32Value(context).ToChecked(); canvas_native_webgl_generate_mipmap( target, @@ -1777,7 +1769,7 @@ void WebGLRenderingContext::GetActiveAttrib(const v8::FunctionCallbackInfoNumberValue(context).ToChecked(); + auto index = args[1]->Int32Value(context).ToChecked(); auto program = WebGLProgram::GetPointer(programValue.As()); if (program != nullptr) { auto info = canvas_native_webgl_get_active_attrib( @@ -1808,7 +1800,7 @@ void WebGLRenderingContext::GetActiveUniform(const v8::FunctionCallbackInfoNumberValue( + auto index = args[1]->Int32Value( context).ToChecked(); auto program = WebGLProgram::GetPointer(programValue.As()); if (program != nullptr) { @@ -1906,9 +1898,9 @@ void WebGLRenderingContext::GetBufferParameter(const v8::FunctionCallbackInfoGetCurrentContext(); - auto target = (uint32_t) args[0]->NumberValue( + auto target = args[0]->Uint32Value( context).ToChecked(); - auto pname = (uint32_t) args[1]->NumberValue( + auto pname = args[1]->Uint32Value( context).ToChecked(); auto param = canvas_native_webgl_get_buffer_parameter( @@ -2014,7 +2006,7 @@ void WebGLRenderingContext::GetError(const v8::FunctionCallbackInfo & auto ret = canvas_native_webgl_get_error( ptr->GetState()); - args.GetReturnValue().Set((int32_t) ret); + args.GetReturnValue().Set(ret); } @@ -2265,11 +2257,11 @@ void WebGLRenderingContext::GetFramebufferAttachmentParameter( auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto target = (uint32_t) args[0]->NumberValue( + auto target = args[0]->Uint32Value( context).ToChecked(); - auto attachment = (uint32_t) args[1]->NumberValue( + auto attachment = args[1]->Uint32Value( context).ToChecked(); - auto pname = (uint32_t) args[2]->NumberValue( + auto pname = args[2]->Uint32Value( context).ToChecked(); auto ret = canvas_native_webgl_get_framebuffer_attachment_parameter( target, @@ -2327,7 +2319,7 @@ void WebGLRenderingContext::GetParameter(const v8::FunctionCallbackInfoGetCurrentContext(); - auto pname = (uint32_t) args[0]->NumberValue( + auto pname = args[0]->Uint32Value( context).ToChecked(); auto result = canvas_native_webgl_get_parameter( pname, @@ -2386,7 +2378,7 @@ void WebGLRenderingContext::GetProgramParameter(const v8::FunctionCallbackInfoNumberValue( + auto pname = args[1]->Uint32Value( context).ToChecked(); if (type == NativeType::WebGLProgram) { auto program = WebGLProgram::GetPointer(programValue.As()); @@ -2439,9 +2431,9 @@ WebGLRenderingContext::GetRenderbufferParameter(const v8::FunctionCallbackInfoGetCurrentContext(); if (args.Length() > 1) { - auto target = (uint32_t) args[0]->NumberValue( + auto target = args[0]->Uint32Value( context).ToChecked(); - auto pname = (uint32_t) args[1]->NumberValue( + auto pname = args[1]->Uint32Value( context).ToChecked(); auto ret = canvas_native_webgl_get_renderbuffer_parameter( target, @@ -2502,7 +2494,7 @@ void WebGLRenderingContext::GetShaderParameter(const v8::FunctionCallbackInfoNumberValue( + auto pname = args[1]->Uint32Value( context).ToChecked(); if (type == NativeType::WebGLShader) { auto shader = WebGLShader::GetPointer(value.As()); @@ -2556,9 +2548,9 @@ WebGLRenderingContext::GetShaderPrecisionFormat(const v8::FunctionCallbackInfoGetCurrentContext(); - auto shaderType = (uint32_t) args[0]->NumberValue( + auto shaderType = args[0]->Uint32Value( context).ToChecked(); - auto precisionType = (uint32_t) args[1]->NumberValue( + auto precisionType = args[1]->Uint32Value( context).ToChecked(); auto ret = canvas_native_webgl_get_shader_precision_format( shaderType, @@ -2665,9 +2657,9 @@ WebGLRenderingContext::GetTexParameter(const v8::FunctionCallbackInfo auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto target = (uint32_t) args[0]->NumberValue( + auto target = args[0]->Uint32Value( context).ToChecked(); - auto pname = (uint32_t) args[1]->NumberValue( + auto pname = args[1]->Uint32Value( context).ToChecked(); auto ret = canvas_native_webgl_get_tex_parameter( target, @@ -2918,9 +2910,9 @@ WebGLRenderingContext::GetVertexAttribOffset(const v8::FunctionCallbackInfoGetCurrentContext(); - auto index = (uint32_t) args[0]->NumberValue( + auto index = args[0]->Uint32Value( context).ToChecked(); - auto pname = (uint32_t) args[1]->NumberValue( + auto pname = args[1]->Uint32Value( context).ToChecked(); auto ret = canvas_native_webgl_get_vertex_attrib_offset( index, @@ -2941,9 +2933,9 @@ WebGLRenderingContext::GetVertexAttrib(const v8::FunctionCallbackInfo auto context = isolate->GetCurrentContext(); - auto index = (uint32_t) args[0]->NumberValue( + auto index = args[0]->Uint32Value( context).ToChecked(); - auto pname = (uint32_t) args[1]->NumberValue( + auto pname = args[1]->Uint32Value( context).ToChecked(); auto ret = canvas_native_webgl_get_vertex_attrib( index, @@ -3006,9 +2998,9 @@ WebGLRenderingContext::Hint(const v8::FunctionCallbackInfo &args) { auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto target = (uint32_t) args[0]->NumberValue( + auto target = args[0]->Uint32Value( context).ToChecked(); - auto mode = (uint32_t) args[1]->NumberValue( + auto mode = args[1]->Uint32Value( context).ToChecked(); canvas_native_webgl_hint(target, mode, @@ -3067,7 +3059,7 @@ WebGLRenderingContext::IsEnabled(const v8::FunctionCallbackInfo &args auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto cap = (uint32_t) args[0]->NumberValue( + auto cap = args[0]->Uint32Value( context).ToChecked(); auto ret = canvas_native_webgl_is_enabled( cap, ptr->GetState()); @@ -3259,7 +3251,7 @@ WebGLRenderingContext::PixelStorei(const v8::FunctionCallbackInfo &ar auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto pname = (uint32_t) args[0]->NumberValue( + auto pname = args[0]->Uint32Value( context).ToChecked(); if (args[1]->IsBoolean()) { auto param = args[1]->BooleanValue(isolate); @@ -3269,7 +3261,7 @@ WebGLRenderingContext::PixelStorei(const v8::FunctionCallbackInfo &ar ptr->GetState() ); } else { - auto param = (int32_t) args[1]->NumberValue( + auto param = args[1]->Int32Value( context).ToChecked(); canvas_native_webgl_pixel_storei( pname, @@ -3312,17 +3304,17 @@ WebGLRenderingContext::ReadPixels(const v8::FunctionCallbackInfo &arg auto context = isolate->GetCurrentContext(); - auto x = (int32_t) args[0]->NumberValue( + auto x = args[0]->Int32Value( context).ToChecked(); - auto y = (int32_t) args[1]->NumberValue( + auto y = args[1]->Int32Value( context).ToChecked(); - auto width = (int32_t) args[2]->NumberValue( + auto width = args[2]->Int32Value( context).ToChecked(); - auto height = (int32_t) args[3]->NumberValue( + auto height = args[3]->Int32Value( context).ToChecked(); - auto format = (uint32_t) args[4]->NumberValue( + auto format = args[4]->Uint32Value( context).ToChecked(); - auto type = (uint32_t) args[5]->NumberValue( + auto type = args[5]->Uint32Value( context).ToChecked(); auto pixels = args[6]; @@ -3380,13 +3372,13 @@ WebGLRenderingContext::RenderbufferStorage(const v8::FunctionCallbackInfoGetCurrentContext(); - auto target = (uint32_t) args[0]->NumberValue( + auto target = args[0]->Uint32Value( context).ToChecked(); - auto internalFormat = (uint32_t) args[1]->NumberValue( + auto internalFormat = args[1]->Uint32Value( context).ToChecked(); - auto width = (int32_t) args[2]->NumberValue( + auto width = args[2]->Int32Value( context).ToChecked(); - auto height = (int32_t) args[3]->NumberValue( + auto height = args[3]->Int32Value( context).ToChecked(); canvas_native_webgl_renderbuffer_storage( target, @@ -3429,13 +3421,13 @@ WebGLRenderingContext::Scissor(const v8::FunctionCallbackInfo &args) auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto x = (int32_t) args[0]->NumberValue( + auto x = args[0]->Int32Value( context).ToChecked(); - auto y = (int32_t) args[1]->NumberValue( + auto y = args[1]->Int32Value( context).ToChecked(); - auto width = (int32_t) args[2]->NumberValue( + auto width = args[2]->Int32Value( context).ToChecked(); - auto height = (int32_t) args[3]->NumberValue( + auto height = args[3]->Int32Value( context).ToChecked(); canvas_native_webgl_scissor( x, @@ -3459,7 +3451,7 @@ WebGLRenderingContext::ShaderSource(const v8::FunctionCallbackInfo &a auto value = args[0]; auto type = GetNativeType(isolate, value); auto sourceValue = args[1]; - if (type == NativeType::WebGLShader && sourceValue->IsString()) { + if (type == NativeType::WebGLShader) { auto shader = WebGLShader::GetPointer(value.As()); auto source = ConvertFromV8String(isolate, sourceValue); if (shader != nullptr) { @@ -3482,13 +3474,13 @@ WebGLRenderingContext::StencilFuncSeparate(const v8::FunctionCallbackInfoGetCurrentContext(); - auto face = (uint32_t) args[0]->NumberValue( + auto face = args[0]->Uint32Value( context).ToChecked(); - auto func = (uint32_t) args[1]->NumberValue( + auto func = args[1]->Uint32Value( context).ToChecked(); - auto ref = (int32_t) args[2]->NumberValue( + auto ref = args[2]->Int32Value( context).ToChecked(); - auto mask = (uint32_t) args[3]->NumberValue( + auto mask = args[3]->Uint32Value( context).ToChecked(); canvas_native_webgl_stencil_func_separate( face, @@ -3510,11 +3502,11 @@ WebGLRenderingContext::StencilFunc(const v8::FunctionCallbackInfo &ar auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto func = (uint32_t) args[0]->NumberValue( + auto func = args[0]->Uint32Value( context).ToChecked(); - auto ref = (int32_t) args[1]->NumberValue( + auto ref = args[1]->Int32Value( context).ToChecked(); - auto mask = (uint32_t) args[2]->NumberValue( + auto mask = args[2]->Uint32Value( context).ToChecked(); canvas_native_webgl_stencil_func( func, @@ -3535,9 +3527,9 @@ WebGLRenderingContext::StencilMaskSeparate(const v8::FunctionCallbackInfoGetCurrentContext(); - auto face = (uint32_t) args[0]->NumberValue( + auto face = args[0]->Uint32Value( context).ToChecked(); - auto mask = (uint32_t) args[1]->NumberValue( + auto mask = args[1]->Uint32Value( context).ToChecked(); canvas_native_webgl_stencil_mask_separate( face, @@ -3557,7 +3549,7 @@ WebGLRenderingContext::StencilMask(const v8::FunctionCallbackInfo &ar auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto mask = (uint32_t) args[0]->NumberValue( + auto mask = args[0]->Uint32Value( context).ToChecked(); canvas_native_webgl_stencil_mask( mask, @@ -3577,13 +3569,13 @@ WebGLRenderingContext::StencilOpSeparate(const v8::FunctionCallbackInfoGetCurrentContext(); - auto face = (uint32_t) args[0]->NumberValue( + auto face = args[0]->Uint32Value( context).ToChecked(); - auto fail = (uint32_t) args[1]->NumberValue( + auto fail = args[1]->Uint32Value( context).ToChecked(); - auto zfail = (uint32_t) args[2]->NumberValue( + auto zfail = args[2]->Uint32Value( context).ToChecked(); - auto zpass = (uint32_t) args[3]->NumberValue( + auto zpass = args[3]->Uint32Value( context).ToChecked(); canvas_native_webgl_stencil_op_separate( face, @@ -3605,11 +3597,11 @@ WebGLRenderingContext::StencilOp(const v8::FunctionCallbackInfo &args auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto fail = (uint32_t) args[0]->NumberValue( + auto fail = args[0]->Uint32Value( context).ToChecked(); - auto zfail = (uint32_t) args[1]->NumberValue( + auto zfail = args[1]->Uint32Value( context).ToChecked(); - auto zpass = (uint32_t) args[2]->NumberValue( + auto zpass = args[2]->Uint32Value( context).ToChecked(); canvas_native_webgl_stencil_op( fail, @@ -3636,15 +3628,15 @@ WebGLRenderingContext::TexImage2D(const v8::FunctionCallbackInfo &arg // TODO tidy if (count == 5) { - auto target = (int32_t) args[0]->NumberValue( + auto target = args[0]->Int32Value( context).ToChecked(); - auto level = (int32_t) args[1]->NumberValue( + auto level = args[1]->Int32Value( context).ToChecked(); - auto internalformat = (int32_t) args[2]->NumberValue( + auto internalformat = args[2]->Int32Value( context).ToChecked(); - auto format = (int32_t) args[3]->NumberValue( + auto format = args[3]->Int32Value( context).ToChecked(); - auto type = (int32_t) args[4]->NumberValue( + auto type = args[4]->Int32Value( context).ToChecked(); canvas_native_webgl_tex_image2d_image_none( @@ -3657,15 +3649,15 @@ WebGLRenderingContext::TexImage2D(const v8::FunctionCallbackInfo &arg ); } else if (count == 6) { - auto target = (int32_t) args[0]->NumberValue( + auto target = args[0]->Int32Value( context).ToChecked(); - auto level = (int32_t) args[1]->NumberValue( + auto level = args[1]->Int32Value( context).ToChecked(); - auto internalformat = (int32_t) args[2]->NumberValue( + auto internalformat = args[2]->Int32Value( context).ToChecked(); - auto format = (int32_t) args[3]->NumberValue( + auto format = args[3]->Int32Value( context).ToChecked(); - auto type = (int32_t) args[4]->NumberValue( + auto type = args[4]->Int32Value( context).ToChecked(); auto pixels = args[5]; @@ -3746,21 +3738,21 @@ WebGLRenderingContext::TexImage2D(const v8::FunctionCallbackInfo &arg break; } } else if (count == 8) { - auto target = (int32_t) args[0]->NumberValue( + auto target = args[0]->Int32Value( context).ToChecked(); - auto level = (int32_t) args[1]->NumberValue( + auto level = args[1]->Int32Value( context).ToChecked(); - auto internalformat = (int32_t) args[2]->NumberValue( + auto internalformat = args[2]->Int32Value( context).ToChecked(); - auto width = (int32_t) args[3]->NumberValue( + auto width = args[3]->Int32Value( context).ToChecked(); - auto height = (int32_t) args[4]->NumberValue( + auto height = args[4]->Int32Value( context).ToChecked(); - auto border = (int32_t) args[5]->NumberValue( + auto border = args[5]->Int32Value( context).ToChecked(); - auto format = (int32_t) args[6]->NumberValue( + auto format = args[6]->Int32Value( context).ToChecked(); - auto type = (int32_t) args[7]->NumberValue( + auto type = args[7]->Int32Value( context).ToChecked(); canvas_native_webgl_tex_image2d_none( target, @@ -3774,21 +3766,21 @@ WebGLRenderingContext::TexImage2D(const v8::FunctionCallbackInfo &arg ptr->GetState() ); } else if (count == 9) { - auto target = (int32_t) args[0]->NumberValue( + auto target = args[0]->Int32Value( context).ToChecked(); - auto level = (int32_t) args[1]->NumberValue( + auto level = args[1]->Int32Value( context).ToChecked(); - auto internalformat = (int32_t) args[2]->NumberValue( + auto internalformat = args[2]->Int32Value( context).ToChecked(); - auto width = (int32_t) args[3]->NumberValue( + auto width = args[3]->Int32Value( context).ToChecked(); - auto height = (int32_t) args[4]->NumberValue( + auto height = args[4]->Int32Value( context).ToChecked(); - auto border = (int32_t) args[5]->NumberValue( + auto border = args[5]->Int32Value( context).ToChecked(); - auto format = (int32_t) args[6]->NumberValue( + auto format = args[6]->Int32Value( context).ToChecked(); - auto type = (int32_t) args[7]->NumberValue( + auto type = args[7]->Int32Value( context).ToChecked(); @@ -3863,9 +3855,9 @@ WebGLRenderingContext::TexParameterf(const v8::FunctionCallbackInfo & auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto target = (uint32_t) args[0]->NumberValue( + auto target = args[0]->Uint32Value( context).ToChecked(); - auto pname = (uint32_t) args[1]->NumberValue( + auto pname = args[1]->Uint32Value( context).ToChecked(); auto param = args[2]->NumberValue( context).ToChecked(); @@ -3888,11 +3880,11 @@ WebGLRenderingContext::TexParameteri(const v8::FunctionCallbackInfo & auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto target = (uint32_t) args[0]->NumberValue( + auto target = args[0]->Uint32Value( context).ToChecked(); - auto pname = (uint32_t) args[1]->NumberValue( + auto pname = args[1]->Uint32Value( context).ToChecked(); - auto param = (int32_t) args[2]->NumberValue( + auto param = args[2]->Int32Value( context).ToChecked(); canvas_native_webgl_tex_parameteri( target, @@ -3915,17 +3907,17 @@ WebGLRenderingContext::TexSubImage2D(const v8::FunctionCallbackInfo & auto count = args.Length(); if (count == 7) { - auto target = (uint32_t) args[0]->NumberValue( + auto target = args[0]->Uint32Value( context).ToChecked(); - auto level = (int32_t) args[1]->NumberValue( + auto level = args[1]->Int32Value( context).ToChecked(); - auto xoffset = (int32_t) args[2]->NumberValue( + auto xoffset = args[2]->Int32Value( context).ToChecked(); - auto yoffset = (int32_t) args[3]->NumberValue( + auto yoffset = args[3]->Int32Value( context).ToChecked(); - auto format = (uint32_t) args[4]->NumberValue( + auto format = args[4]->Uint32Value( context).ToChecked(); - auto type = (int32_t) args[5]->NumberValue( + auto type = args[5]->Int32Value( context).ToChecked(); @@ -4006,21 +3998,21 @@ WebGLRenderingContext::TexSubImage2D(const v8::FunctionCallbackInfo & } } else if (count == 9) { - auto target = (uint32_t) args[0]->NumberValue( + auto target = args[0]->Uint32Value( context).ToChecked(); - auto level = (int32_t) args[1]->NumberValue( + auto level = args[1]->Int32Value( context).ToChecked(); - auto xoffset = (int32_t) args[2]->NumberValue( + auto xoffset = args[2]->Int32Value( context).ToChecked(); - auto yoffset = (int32_t) args[3]->NumberValue( + auto yoffset = args[3]->Int32Value( context).ToChecked(); - auto width = (int32_t) args[4]->NumberValue( + auto width = args[4]->Int32Value( context).ToChecked(); - auto height = (int32_t) args[5]->NumberValue( + auto height = args[5]->Int32Value( context).ToChecked(); - auto format = (uint32_t) args[6]->NumberValue( + auto format = args[6]->Uint32Value( context).ToChecked(); - auto type = (int32_t) args[7]->NumberValue( + auto type = args[7]->Int32Value( context).ToChecked(); auto pixels = args[8]; @@ -4083,7 +4075,7 @@ WebGLRenderingContext::VertexAttrib1f(const v8::FunctionCallbackInfo auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto index = (uint32_t) args[0]->NumberValue( + auto index = args[0]->Uint32Value( context).ToChecked(); auto v0 = static_cast(args[1]->NumberValue( context).ToChecked()); @@ -4102,7 +4094,7 @@ WebGLRenderingContext::VertexAttrib2f(const v8::FunctionCallbackInfo auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto index = (uint32_t) args[0]->NumberValue( + auto index = args[0]->Uint32Value( context).ToChecked(); auto v0 = static_cast(args[1]->NumberValue( context).ToChecked()); @@ -4124,7 +4116,7 @@ WebGLRenderingContext::VertexAttrib3f(const v8::FunctionCallbackInfo auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto index = (uint32_t) args[0]->NumberValue( + auto index = args[0]->Uint32Value( context).ToChecked(); auto v0 = static_cast(args[1]->NumberValue( context).ToChecked()); @@ -4148,7 +4140,7 @@ WebGLRenderingContext::VertexAttrib4f(const v8::FunctionCallbackInfo auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto index = (uint32_t) args[0]->NumberValue( + auto index = args[0]->Uint32Value( context).ToChecked(); auto v0 = static_cast(args[1]->NumberValue( context).ToChecked()); @@ -4174,7 +4166,7 @@ WebGLRenderingContext::VertexAttrib1fv(const v8::FunctionCallbackInfo auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto index = (uint32_t) args[0]->NumberValue( + auto index = args[0]->Uint32Value( context).ToChecked(); auto value = args[1]; @@ -4204,7 +4196,7 @@ WebGLRenderingContext::VertexAttrib2fv(const v8::FunctionCallbackInfo auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto index = (uint32_t) args[0]->NumberValue( + auto index = args[0]->Uint32Value( context).ToChecked(); auto value = args[1]; @@ -4234,7 +4226,7 @@ WebGLRenderingContext::VertexAttrib3fv(const v8::FunctionCallbackInfo auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto index = (uint32_t) args[0]->NumberValue( + auto index = args[0]->Uint32Value( context).ToChecked(); auto value = args[1]; @@ -4264,7 +4256,7 @@ WebGLRenderingContext::VertexAttrib4fv(const v8::FunctionCallbackInfo auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto index = (uint32_t) args[0]->NumberValue( + auto index = args[0]->Uint32Value( context).ToChecked(); auto value = args[1]; @@ -4294,14 +4286,14 @@ WebGLRenderingContext::VertexAttribPointer(const v8::FunctionCallbackInfoGetCurrentContext(); - auto index = (uint32_t) args[0]->NumberValue( + auto index = args[0]->Uint32Value( context).ToChecked(); - auto size = (int32_t) args[1]->NumberValue( + auto size = args[1]->Int32Value( context).ToChecked(); - auto type = (uint32_t) args[2]->NumberValue( + auto type = args[2]->Uint32Value( context).ToChecked(); auto normalized = args[3]->BooleanValue(isolate); - auto stride = (int32_t) args[4]->NumberValue( + auto stride = args[4]->Int32Value( context).ToChecked(); auto offset = static_cast(args[5]->NumberValue( context).ToChecked()); @@ -4662,12 +4654,12 @@ WebGLRenderingContext::Uniform1i(const v8::FunctionCallbackInfo &args auto value = args[0]; auto location = WebGLUniformLocation::GetPointer(value.As()); - auto v0 = args[1]->NumberValue( + auto v0 = args[1]->Int32Value( context).ToChecked(); if (location != nullptr) { canvas_native_webgl_uniform1i( location->GetUniformLocation(), - static_cast(v0), + v0, ptr->GetState() ); } @@ -4685,15 +4677,15 @@ WebGLRenderingContext::Uniform2i(const v8::FunctionCallbackInfo &args auto value = args[0]; auto location = WebGLUniformLocation::GetPointer(value.As()); - auto v0 = args[1]->NumberValue( + auto v0 = args[1]->Int32Value( context).ToChecked(); - auto v1 = args[2]->NumberValue( + auto v1 = args[2]->Int32Value( context).ToChecked(); if (location != nullptr) { canvas_native_webgl_uniform2i( location->GetUniformLocation(), - static_cast(v0), - static_cast(v1), + v0, + v1, ptr->GetState() ); } @@ -4711,18 +4703,18 @@ WebGLRenderingContext::Uniform3i(const v8::FunctionCallbackInfo &args auto value = args[0]; auto location = WebGLUniformLocation::GetPointer(value.As()); - auto v0 = args[1]->NumberValue( + auto v0 = args[1]->Int32Value( context).ToChecked(); - auto v1 = args[2]->NumberValue( + auto v1 = args[2]->Int32Value( context).ToChecked(); - auto v2 = args[3]->NumberValue( + auto v2 = args[3]->Int32Value( context).ToChecked(); if (location != nullptr) { canvas_native_webgl_uniform3i( location->GetUniformLocation(), - static_cast(v0), - static_cast(v1), - static_cast(v2), + v0, + v1, + v2, ptr->GetState() ); } @@ -4740,21 +4732,21 @@ WebGLRenderingContext::Uniform4i(const v8::FunctionCallbackInfo &args auto value = args[0]; auto location = WebGLUniformLocation::GetPointer(value.As()); - auto v0 = args[1]->NumberValue( + auto v0 = args[1]->Int32Value( context).ToChecked(); - auto v1 = args[2]->NumberValue( + auto v1 = args[2]->Int32Value( context).ToChecked(); - auto v2 = args[3]->NumberValue( + auto v2 = args[3]->Int32Value( context).ToChecked(); - auto v3 = args[4]->NumberValue( + auto v3 = args[4]->Int32Value( context).ToChecked(); if (location != nullptr) { canvas_native_webgl_uniform4i( location->GetUniformLocation(), - static_cast(v0), - static_cast(v1), - static_cast(v2), - static_cast(v3), + v0, + v1, + v2, + v3, ptr->GetState() ); } @@ -5223,13 +5215,13 @@ WebGLRenderingContext::Viewport(const v8::FunctionCallbackInfo &args) auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto x = (int32_t) args[0]->NumberValue( + auto x = args[0]->Int32Value( context).ToChecked(); - auto y = (int32_t) args[1]->NumberValue( + auto y = args[1]->Int32Value( context).ToChecked(); - auto width = (int32_t) args[2]->NumberValue( + auto width = args[2]->Int32Value( context).ToChecked(); - auto height = (int32_t) args[3]->NumberValue( + auto height = args[3]->Int32Value( context).ToChecked(); canvas_native_webgl_viewport(x, y, width, @@ -5272,446 +5264,473 @@ WebGLRenderingContext::__ToDataURL(const v8::FunctionCallbackInfo &ar void WebGLRenderingContext::SetConstants(v8::Isolate *isolate, const v8::Local &tmpl) { - tmpl->Set(isolate, "DEPTH_BUFFER_BIT", v8::Uint32::New(isolate, 0x00000100)); + tmpl->Set(isolate, "DEPTH_BUFFER_BIT", v8::Integer::NewFromUnsigned(isolate, 0x00000100)); - tmpl->Set(isolate, "STENCIL_BUFFER_BIT", v8::Uint32::New(isolate, 0x00000400)); + tmpl->Set(isolate, "STENCIL_BUFFER_BIT", v8::Integer::NewFromUnsigned(isolate, 0x00000400)); - tmpl->Set(isolate, "COLOR_BUFFER_BIT", v8::Uint32::New(isolate, 0x00004000)); + tmpl->Set(isolate, "COLOR_BUFFER_BIT", v8::Integer::NewFromUnsigned(isolate, 0x00004000)); - tmpl->Set(isolate, "POINTS", v8::Uint32::New(isolate, 0x0000)); + tmpl->Set(isolate, "POINTS", v8::Integer::NewFromUnsigned(isolate, 0x0000)); - tmpl->Set(isolate, "LINES", v8::Uint32::New(isolate, 0x0001)); + tmpl->Set(isolate, "LINES", v8::Integer::NewFromUnsigned(isolate, 0x0001)); - tmpl->Set(isolate, "LINE_LOOP", v8::Uint32::New(isolate, 0x0002)); + tmpl->Set(isolate, "LINE_LOOP", v8::Integer::NewFromUnsigned(isolate, 0x0002)); - tmpl->Set(isolate, "LINE_STRIP", v8::Uint32::New(isolate, 0x0003)); + tmpl->Set(isolate, "LINE_STRIP", v8::Integer::NewFromUnsigned(isolate, 0x0003)); - tmpl->Set(isolate, "TRIANGLES", v8::Uint32::New(isolate, 0x0004)); + tmpl->Set(isolate, "TRIANGLES", v8::Integer::NewFromUnsigned(isolate, 0x0004)); - tmpl->Set(isolate, "TRIANGLE_STRIP", v8::Uint32::New(isolate, 0x0005)); + tmpl->Set(isolate, "TRIANGLE_STRIP", v8::Integer::NewFromUnsigned(isolate, 0x0005)); - tmpl->Set(isolate, "TRIANGLE_FAN", v8::Uint32::New(isolate, 0x0006)); + tmpl->Set(isolate, "TRIANGLE_FAN", v8::Integer::NewFromUnsigned(isolate, 0x0006)); - tmpl->Set(isolate, "ZERO", v8::Uint32::New(isolate, 0)); + tmpl->Set(isolate, "ZERO", v8::Integer::NewFromUnsigned(isolate, 0)); - tmpl->Set(isolate, "ONE", v8::Uint32::New(isolate, 1)); + tmpl->Set(isolate, "ONE", v8::Integer::NewFromUnsigned(isolate, 1)); - tmpl->Set(isolate, "SRC_COLOR", v8::Uint32::New(isolate, 0x0300)); + tmpl->Set(isolate, "SRC_COLOR", v8::Integer::NewFromUnsigned(isolate, 0x0300)); - tmpl->Set(isolate, "ONE_MINUS_SRC_COLOR", v8::Uint32::New(isolate, 0x0301)); + tmpl->Set(isolate, "ONE_MINUS_SRC_COLOR", v8::Integer::NewFromUnsigned(isolate, 0x0301)); - tmpl->Set(isolate, "SRC_ALPHA", v8::Uint32::New(isolate, 0x0302)); + tmpl->Set(isolate, "SRC_ALPHA", v8::Integer::NewFromUnsigned(isolate, 0x0302)); - tmpl->Set(isolate, "ONE_MINUS_SRC_ALPHA", v8::Uint32::New(isolate, 0x0303)); + tmpl->Set(isolate, "ONE_MINUS_SRC_ALPHA", v8::Integer::NewFromUnsigned(isolate, 0x0303)); - tmpl->Set(isolate, "DST_ALPHA", v8::Uint32::New(isolate, 0x0304)); + tmpl->Set(isolate, "DST_ALPHA", v8::Integer::NewFromUnsigned(isolate, 0x0304)); - tmpl->Set(isolate, "ONE_MINUS_DST_ALPHA", v8::Uint32::New(isolate, 0x0305)); + tmpl->Set(isolate, "ONE_MINUS_DST_ALPHA", v8::Integer::NewFromUnsigned(isolate, 0x0305)); - tmpl->Set(isolate, "DST_COLOR", v8::Uint32::New(isolate, 0x0306)); + tmpl->Set(isolate, "DST_COLOR", v8::Integer::NewFromUnsigned(isolate, 0x0306)); - tmpl->Set(isolate, "ONE_MINUS_DST_COLOR", v8::Uint32::New(isolate, 0x0307)); + tmpl->Set(isolate, "ONE_MINUS_DST_COLOR", v8::Integer::NewFromUnsigned(isolate, 0x0307)); - tmpl->Set(isolate, "SRC_ALPHA_SATURATE", v8::Uint32::New(isolate, 0x0308)); + tmpl->Set(isolate, "SRC_ALPHA_SATURATE", v8::Integer::NewFromUnsigned(isolate, 0x0308)); - tmpl->Set(isolate, "CONSTANT_COLOR", v8::Uint32::New(isolate, 0x8001)); - tmpl->Set(isolate, "ONE_MINUS_CONSTANT_COLOR", v8::Uint32::New(isolate, 0x8002)); - tmpl->Set(isolate, "CONSTANT_ALPHA", v8::Uint32::New(isolate, 0x8003)); - tmpl->Set(isolate, "ONE_MINUS_CONSTANT_ALPHA", v8::Uint32::New(isolate, 0x8004)); + tmpl->Set(isolate, "CONSTANT_COLOR", v8::Integer::NewFromUnsigned(isolate, 0x8001)); + tmpl->Set(isolate, "ONE_MINUS_CONSTANT_COLOR", v8::Integer::NewFromUnsigned(isolate, 0x8002)); + tmpl->Set(isolate, "CONSTANT_ALPHA", v8::Integer::NewFromUnsigned(isolate, 0x8003)); + tmpl->Set(isolate, "ONE_MINUS_CONSTANT_ALPHA", v8::Integer::NewFromUnsigned(isolate, 0x8004)); /* Blending equations */ - tmpl->Set(isolate, "FUNC_ADD", v8::Uint32::New(isolate, 0x8006)); - tmpl->Set(isolate, "FUNC_SUBTRACT", v8::Uint32::New(isolate, 0x800A)); - tmpl->Set(isolate, "FUNC_REVERSE_SUBTRACT", v8::Uint32::New(isolate, 0x800B)); - tmpl->Set(isolate, "BLEND_EQUATION", v8::Uint32::New(isolate, 0x8009)); - tmpl->Set(isolate, "BLEND_EQUATION_RGB", v8::Uint32::New(isolate, 0x8009)); - tmpl->Set(isolate, "BLEND_EQUATION_ALPHA", v8::Uint32::New(isolate, 0x883D)); - - - tmpl->Set(isolate, "BLEND_DST_RGB", v8::Uint32::New(isolate, 0x80C8)); - tmpl->Set(isolate, "BLEND_SRC_RGB", v8::Uint32::New(isolate, 0x80C9)); - tmpl->Set(isolate, "BLEND_DST_ALPHA", v8::Uint32::New(isolate, 0x80CA)); - - - tmpl->Set(isolate, "BLEND_SRC_ALPHA", v8::Uint32::New(isolate, 0x80CB)); - tmpl->Set(isolate, "BLEND_COLOR", v8::Uint32::New(isolate, 0x8005)); - tmpl->Set(isolate, "ARRAY_BUFFER_BINDING", v8::Uint32::New(isolate, 0x8894)); - - - tmpl->Set(isolate, "ELEMENT_ARRAY_BUFFER_BINDING", v8::Uint32::New(isolate, 0x8895)); - tmpl->Set(isolate, "LINE_WIDTH", v8::Uint32::New(isolate, 0x0B21)); - tmpl->Set(isolate, "ALIASED_POINT_SIZE_RANGE", v8::Uint32::New(isolate, 0x846D)); - - tmpl->Set(isolate, "ALIASED_LINE_WIDTH_RANGE", v8::Uint32::New(isolate, 0x846E)); - tmpl->Set(isolate, "CULL_FACE_MODE", v8::Uint32::New(isolate, 0x0B45)); - tmpl->Set(isolate, "FRONT_FACE", v8::Uint32::New(isolate, 0x0B46)); - - tmpl->Set(isolate, "DEPTH_RANGE", v8::Uint32::New(isolate, 0x0B70)); - tmpl->Set(isolate, "DEPTH_WRITEMASK", v8::Uint32::New(isolate, 0x0B72)); - tmpl->Set(isolate, "DEPTH_CLEAR_VALUE", v8::Uint32::New(isolate, 0x0B73)); - - tmpl->Set(isolate, "DEPTH_FUNC", v8::Uint32::New(isolate, 0x0B74)); - tmpl->Set(isolate, "STENCIL_CLEAR_VALUE", v8::Uint32::New(isolate, 0x0B91)); - tmpl->Set(isolate, "STENCIL_FUNC", v8::Uint32::New(isolate, 0x0B92)); - - tmpl->Set(isolate, "STENCIL_FAIL", v8::Uint32::New(isolate, 0x0B94)); - tmpl->Set(isolate, "STENCIL_PASS_DEPTH_FAIL", v8::Uint32::New(isolate, 0x0B95)); - tmpl->Set(isolate, "STENCIL_PASS_DEPTH_PASS", v8::Uint32::New(isolate, 0x0B96)); - - tmpl->Set(isolate, "STENCIL_REF", v8::Uint32::New(isolate, 0x0B97)); - tmpl->Set(isolate, "STENCIL_VALUE_MASK", v8::Uint32::New(isolate, 0x0B93)); - tmpl->Set(isolate, "STENCIL_WRITEMASK", v8::Uint32::New(isolate, 0x0B98)); - - tmpl->Set(isolate, "STENCIL_BACK_FUNC", v8::Uint32::New(isolate, 0x8800)); - tmpl->Set(isolate, "STENCIL_BACK_FAIL", v8::Uint32::New(isolate, 0x8801)); - tmpl->Set(isolate, "STENCIL_BACK_PASS_DEPTH_FAIL", v8::Uint32::New(isolate, 0x8802)); - - tmpl->Set(isolate, "STENCIL_BACK_PASS_DEPTH_PASS", v8::Uint32::New(isolate, 0x8803)); - tmpl->Set(isolate, "STENCIL_BACK_REF", v8::Uint32::New(isolate, 0x8CA3)); - tmpl->Set(isolate, "STENCIL_BACK_VALUE_MASK", v8::Uint32::New(isolate, 0x8CA4)); - tmpl->Set(isolate, "STENCIL_BACK_WRITEMASK", v8::Uint32::New(isolate, 0x8CA5)); - - tmpl->Set(isolate, "VIEWPORT", v8::Uint32::New(isolate, 0x0BA2)); - tmpl->Set(isolate, "SCISSOR_BOX", v8::Uint32::New(isolate, 0x0C10)); - tmpl->Set(isolate, "COLOR_CLEAR_VALUE", v8::Uint32::New(isolate, 0x0C22)); - tmpl->Set(isolate, "COLOR_WRITEMASK", v8::Uint32::New(isolate, 0x0C23)); - - tmpl->Set(isolate, "UNPACK_ALIGNMENT", v8::Uint32::New(isolate, 0x0CF5)); - tmpl->Set(isolate, "PACK_ALIGNMENT", v8::Uint32::New(isolate, 0x0D05)); - tmpl->Set(isolate, "MAX_TEXTURE_SIZE", v8::Uint32::New(isolate, 0x0D33)); - - - tmpl->Set(isolate, "MAX_VIEWPORT_DIMS", v8::Uint32::New(isolate, 0x0D3A)); - tmpl->Set(isolate, "SUBPIXEL_BITS", v8::Uint32::New(isolate, 0x0D50)); - - tmpl->Set(isolate, "RED_BITS", v8::Uint32::New(isolate, 0x0D52)); - tmpl->Set(isolate, "GREEN_BITS", v8::Uint32::New(isolate, 0x0D53)); - tmpl->Set(isolate, "BLUE_BITS", v8::Uint32::New(isolate, 0x0D54)); - tmpl->Set(isolate, "ALPHA_BITS", v8::Uint32::New(isolate, 0x0D55)); - - tmpl->Set(isolate, "STENCIL_BITS", v8::Uint32::New(isolate, 0x0D57)); - tmpl->Set(isolate, "POLYGON_OFFSET_UNITS", v8::Uint32::New(isolate, 0x2A00)); - tmpl->Set(isolate, "POLYGON_OFFSET_FACTOR", v8::Uint32::New(isolate, 0x8038)); - - tmpl->Set(isolate, "TEXTURE_BINDING_2D", v8::Uint32::New(isolate, 0x8069)); - tmpl->Set(isolate, "SAMPLE_BUFFERS", v8::Uint32::New(isolate, 0x80A8)); - tmpl->Set(isolate, "SAMPLES", v8::Uint32::New(isolate, 0x80A9)); - tmpl->Set(isolate, "SAMPLE_COVERAGE_VALUE", v8::Uint32::New(isolate, 0x80AA)); - - tmpl->Set(isolate, "SAMPLE_COVERAGE_INVERT", v8::Uint32::New(isolate, 0x80AB)); - tmpl->Set(isolate, "COMPRESSED_TEXTURE_FORMATS", v8::Uint32::New(isolate, 0x86A3)); - tmpl->Set(isolate, "VENDOR", v8::Uint32::New(isolate, 0x1F00)); - tmpl->Set(isolate, "RENDERER", v8::Uint32::New(isolate, 0x1F01)); - - tmpl->Set(isolate, "VERSION", v8::Uint32::New(isolate, 0x1F02)); - tmpl->Set(isolate, "IMPLEMENTATION_COLOR_READ_TYPE", v8::Uint32::New(isolate, 0x8B9A)); - tmpl->Set(isolate, "IMPLEMENTATION_COLOR_READ_FORMAT", v8::Uint32::New(isolate, 0x8B9B)); - tmpl->Set(isolate, "BROWSER_DEFAULT_WEBGL", v8::Uint32::New(isolate, 0x9244)); - - tmpl->Set(isolate, "STATIC_DRAW", v8::Uint32::New(isolate, 0x88E4)); - tmpl->Set(isolate, "STREAM_DRAW", v8::Uint32::New(isolate, 0x88E0)); - tmpl->Set(isolate, "DYNAMIC_DRAW", v8::Uint32::New(isolate, 0x88E8)); - tmpl->Set(isolate, "ARRAY_BUFFER", v8::Uint32::New(isolate, 0x8892)); - - tmpl->Set(isolate, "ELEMENT_ARRAY_BUFFER", v8::Uint32::New(isolate, 0x8893)); - tmpl->Set(isolate, "BUFFER_SIZE", v8::Uint32::New(isolate, 0x8764)); - tmpl->Set(isolate, "BUFFER_USAGE", v8::Uint32::New(isolate, 0x8765)); - tmpl->Set(isolate, "CURRENT_VERTEX_ATTRIB", v8::Uint32::New(isolate, 0x8626)); - - - tmpl->Set(isolate, "VERTEX_ATTRIB_ARRAY_ENABLED", v8::Uint32::New(isolate, 0x8622)); - tmpl->Set(isolate, "VERTEX_ATTRIB_ARRAY_SIZE", v8::Uint32::New(isolate, 0x8623)); - tmpl->Set(isolate, "VERTEX_ATTRIB_ARRAY_STRIDE", v8::Uint32::New(isolate, 0x8624)); - tmpl->Set(isolate, "VERTEX_ATTRIB_ARRAY_TYPE", v8::Uint32::New(isolate, 0x8625)); - tmpl->Set(isolate, "VERTEX_ATTRIB_ARRAY_NORMALIZED", v8::Uint32::New(isolate, 0x886A)); - tmpl->Set(isolate, "VERTEX_ATTRIB_ARRAY_POINTER", v8::Uint32::New(isolate, 0x8645)); - tmpl->Set(isolate, "VERTEX_ATTRIB_ARRAY_BUFFER_BINDING", v8::Uint32::New(isolate, 0x889F)); - - tmpl->Set(isolate, "CULL_FACE", v8::Uint32::New(isolate, 0x0B44)); - tmpl->Set(isolate, "FRONT", v8::Uint32::New(isolate, 0x0404)); - tmpl->Set(isolate, "BACK", v8::Uint32::New(isolate, 0x0405)); - tmpl->Set(isolate, "FRONT_AND_BACK", v8::Uint32::New(isolate, 0x0408)); + tmpl->Set(isolate, "FUNC_ADD", v8::Integer::NewFromUnsigned(isolate, 0x8006)); + tmpl->Set(isolate, "FUNC_SUBTRACT", v8::Integer::NewFromUnsigned(isolate, 0x800A)); + tmpl->Set(isolate, "FUNC_REVERSE_SUBTRACT", v8::Integer::NewFromUnsigned(isolate, 0x800B)); + tmpl->Set(isolate, "BLEND_EQUATION", v8::Integer::NewFromUnsigned(isolate, 0x8009)); + tmpl->Set(isolate, "BLEND_EQUATION_RGB", v8::Integer::NewFromUnsigned(isolate, 0x8009)); + tmpl->Set(isolate, "BLEND_EQUATION_ALPHA", v8::Integer::NewFromUnsigned(isolate, 0x883D)); - tmpl->Set(isolate, "BLEND", v8::Uint32::New(isolate, 0x0BE2)); - tmpl->Set(isolate, "DEPTH_TEST", v8::Uint32::New(isolate, 0x0B71)); - tmpl->Set(isolate, "DITHER", v8::Uint32::New(isolate, 0x0BD0)); - tmpl->Set(isolate, "POLYGON_OFFSET_FILL", v8::Uint32::New(isolate, 0x8037)); - tmpl->Set(isolate, "SAMPLE_ALPHA_TO_COVERAGE", v8::Uint32::New(isolate, 0x809E)); - tmpl->Set(isolate, "SAMPLE_COVERAGE", v8::Uint32::New(isolate, 0x80A0)); - tmpl->Set(isolate, "SCISSOR_TEST", v8::Uint32::New(isolate, 0x0C11)); - tmpl->Set(isolate, "STENCIL_TEST", v8::Uint32::New(isolate, 0x0B90)); + tmpl->Set(isolate, "BLEND_DST_RGB", v8::Integer::NewFromUnsigned(isolate, 0x80C8)); + tmpl->Set(isolate, "BLEND_SRC_RGB", v8::Integer::NewFromUnsigned(isolate, 0x80C9)); + tmpl->Set(isolate, "BLEND_DST_ALPHA", v8::Integer::NewFromUnsigned(isolate, 0x80CA)); + + + tmpl->Set(isolate, "BLEND_SRC_ALPHA", v8::Integer::NewFromUnsigned(isolate, 0x80CB)); + tmpl->Set(isolate, "BLEND_COLOR", v8::Integer::NewFromUnsigned(isolate, 0x8005)); + tmpl->Set(isolate, "ARRAY_BUFFER_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8894)); + + + tmpl->Set(isolate, "ELEMENT_ARRAY_BUFFER_BINDING", + v8::Integer::NewFromUnsigned(isolate, 0x8895)); + tmpl->Set(isolate, "LINE_WIDTH", v8::Integer::NewFromUnsigned(isolate, 0x0B21)); + tmpl->Set(isolate, "ALIASED_POINT_SIZE_RANGE", v8::Integer::NewFromUnsigned(isolate, 0x846D)); + + tmpl->Set(isolate, "ALIASED_LINE_WIDTH_RANGE", v8::Integer::NewFromUnsigned(isolate, 0x846E)); + tmpl->Set(isolate, "CULL_FACE_MODE", v8::Integer::NewFromUnsigned(isolate, 0x0B45)); + tmpl->Set(isolate, "FRONT_FACE", v8::Integer::NewFromUnsigned(isolate, 0x0B46)); + + tmpl->Set(isolate, "DEPTH_RANGE", v8::Integer::NewFromUnsigned(isolate, 0x0B70)); + tmpl->Set(isolate, "DEPTH_WRITEMASK", v8::Integer::NewFromUnsigned(isolate, 0x0B72)); + tmpl->Set(isolate, "DEPTH_CLEAR_VALUE", v8::Integer::NewFromUnsigned(isolate, 0x0B73)); + + tmpl->Set(isolate, "DEPTH_FUNC", v8::Integer::NewFromUnsigned(isolate, 0x0B74)); + tmpl->Set(isolate, "STENCIL_CLEAR_VALUE", v8::Integer::NewFromUnsigned(isolate, 0x0B91)); + tmpl->Set(isolate, "STENCIL_FUNC", v8::Integer::NewFromUnsigned(isolate, 0x0B92)); + + tmpl->Set(isolate, "STENCIL_FAIL", v8::Integer::NewFromUnsigned(isolate, 0x0B94)); + tmpl->Set(isolate, "STENCIL_PASS_DEPTH_FAIL", v8::Integer::NewFromUnsigned(isolate, 0x0B95)); + tmpl->Set(isolate, "STENCIL_PASS_DEPTH_PASS", v8::Integer::NewFromUnsigned(isolate, 0x0B96)); + + tmpl->Set(isolate, "STENCIL_REF", v8::Integer::NewFromUnsigned(isolate, 0x0B97)); + tmpl->Set(isolate, "STENCIL_VALUE_MASK", v8::Integer::NewFromUnsigned(isolate, 0x0B93)); + tmpl->Set(isolate, "STENCIL_WRITEMASK", v8::Integer::NewFromUnsigned(isolate, 0x0B98)); + + tmpl->Set(isolate, "STENCIL_BACK_FUNC", v8::Integer::NewFromUnsigned(isolate, 0x8800)); + tmpl->Set(isolate, "STENCIL_BACK_FAIL", v8::Integer::NewFromUnsigned(isolate, 0x8801)); + tmpl->Set(isolate, "STENCIL_BACK_PASS_DEPTH_FAIL", + v8::Integer::NewFromUnsigned(isolate, 0x8802)); + + tmpl->Set(isolate, "STENCIL_BACK_PASS_DEPTH_PASS", + v8::Integer::NewFromUnsigned(isolate, 0x8803)); + tmpl->Set(isolate, "STENCIL_BACK_REF", v8::Integer::NewFromUnsigned(isolate, 0x8CA3)); + tmpl->Set(isolate, "STENCIL_BACK_VALUE_MASK", v8::Integer::NewFromUnsigned(isolate, 0x8CA4)); + tmpl->Set(isolate, "STENCIL_BACK_WRITEMASK", v8::Integer::NewFromUnsigned(isolate, 0x8CA5)); + + tmpl->Set(isolate, "VIEWPORT", v8::Integer::NewFromUnsigned(isolate, 0x0BA2)); + tmpl->Set(isolate, "SCISSOR_BOX", v8::Integer::NewFromUnsigned(isolate, 0x0C10)); + tmpl->Set(isolate, "COLOR_CLEAR_VALUE", v8::Integer::NewFromUnsigned(isolate, 0x0C22)); + tmpl->Set(isolate, "COLOR_WRITEMASK", v8::Integer::NewFromUnsigned(isolate, 0x0C23)); + + tmpl->Set(isolate, "UNPACK_ALIGNMENT", v8::Integer::NewFromUnsigned(isolate, 0x0CF5)); + tmpl->Set(isolate, "PACK_ALIGNMENT", v8::Integer::NewFromUnsigned(isolate, 0x0D05)); + tmpl->Set(isolate, "MAX_TEXTURE_SIZE", v8::Integer::NewFromUnsigned(isolate, 0x0D33)); + + + tmpl->Set(isolate, "MAX_VIEWPORT_DIMS", v8::Integer::NewFromUnsigned(isolate, 0x0D3A)); + tmpl->Set(isolate, "SUBPIXEL_BITS", v8::Integer::NewFromUnsigned(isolate, 0x0D50)); + + tmpl->Set(isolate, "RED_BITS", v8::Integer::NewFromUnsigned(isolate, 0x0D52)); + tmpl->Set(isolate, "GREEN_BITS", v8::Integer::NewFromUnsigned(isolate, 0x0D53)); + tmpl->Set(isolate, "BLUE_BITS", v8::Integer::NewFromUnsigned(isolate, 0x0D54)); + tmpl->Set(isolate, "ALPHA_BITS", v8::Integer::NewFromUnsigned(isolate, 0x0D55)); + + tmpl->Set(isolate, "STENCIL_BITS", v8::Integer::NewFromUnsigned(isolate, 0x0D57)); + tmpl->Set(isolate, "POLYGON_OFFSET_UNITS", v8::Integer::NewFromUnsigned(isolate, 0x2A00)); + tmpl->Set(isolate, "POLYGON_OFFSET_FACTOR", v8::Integer::NewFromUnsigned(isolate, 0x8038)); + + tmpl->Set(isolate, "TEXTURE_BINDING_2D", v8::Integer::NewFromUnsigned(isolate, 0x8069)); + tmpl->Set(isolate, "SAMPLE_BUFFERS", v8::Integer::NewFromUnsigned(isolate, 0x80A8)); + tmpl->Set(isolate, "SAMPLES", v8::Integer::NewFromUnsigned(isolate, 0x80A9)); + tmpl->Set(isolate, "SAMPLE_COVERAGE_VALUE", v8::Integer::NewFromUnsigned(isolate, 0x80AA)); + + tmpl->Set(isolate, "SAMPLE_COVERAGE_INVERT", v8::Integer::NewFromUnsigned(isolate, 0x80AB)); + tmpl->Set(isolate, "COMPRESSED_TEXTURE_FORMATS", v8::Integer::NewFromUnsigned(isolate, 0x86A3)); + tmpl->Set(isolate, "VENDOR", v8::Integer::NewFromUnsigned(isolate, 0x1F00)); + tmpl->Set(isolate, "RENDERER", v8::Integer::NewFromUnsigned(isolate, 0x1F01)); + + tmpl->Set(isolate, "VERSION", v8::Integer::NewFromUnsigned(isolate, 0x1F02)); + tmpl->Set(isolate, "IMPLEMENTATION_COLOR_READ_TYPE", + v8::Integer::NewFromUnsigned(isolate, 0x8B9A)); + tmpl->Set(isolate, "IMPLEMENTATION_COLOR_READ_FORMAT", + v8::Integer::NewFromUnsigned(isolate, 0x8B9B)); + tmpl->Set(isolate, "BROWSER_DEFAULT_WEBGL", v8::Integer::NewFromUnsigned(isolate, 0x9244)); + + tmpl->Set(isolate, "STATIC_DRAW", v8::Integer::NewFromUnsigned(isolate, 0x88E4)); + tmpl->Set(isolate, "STREAM_DRAW", v8::Integer::NewFromUnsigned(isolate, 0x88E0)); + tmpl->Set(isolate, "DYNAMIC_DRAW", v8::Integer::NewFromUnsigned(isolate, 0x88E8)); + tmpl->Set(isolate, "ARRAY_BUFFER", v8::Integer::NewFromUnsigned(isolate, 0x8892)); + + tmpl->Set(isolate, "ELEMENT_ARRAY_BUFFER", v8::Integer::NewFromUnsigned(isolate, 0x8893)); + tmpl->Set(isolate, "BUFFER_SIZE", v8::Integer::NewFromUnsigned(isolate, 0x8764)); + tmpl->Set(isolate, "BUFFER_USAGE", v8::Integer::NewFromUnsigned(isolate, 0x8765)); + tmpl->Set(isolate, "CURRENT_VERTEX_ATTRIB", v8::Integer::NewFromUnsigned(isolate, 0x8626)); + + + tmpl->Set(isolate, "VERTEX_ATTRIB_ARRAY_ENABLED", + v8::Integer::NewFromUnsigned(isolate, 0x8622)); + tmpl->Set(isolate, "VERTEX_ATTRIB_ARRAY_SIZE", v8::Integer::NewFromUnsigned(isolate, 0x8623)); + tmpl->Set(isolate, "VERTEX_ATTRIB_ARRAY_STRIDE", v8::Integer::NewFromUnsigned(isolate, 0x8624)); + tmpl->Set(isolate, "VERTEX_ATTRIB_ARRAY_TYPE", v8::Integer::NewFromUnsigned(isolate, 0x8625)); + tmpl->Set(isolate, "VERTEX_ATTRIB_ARRAY_NORMALIZED", + v8::Integer::NewFromUnsigned(isolate, 0x886A)); + tmpl->Set(isolate, "VERTEX_ATTRIB_ARRAY_POINTER", + v8::Integer::NewFromUnsigned(isolate, 0x8645)); + tmpl->Set(isolate, "VERTEX_ATTRIB_ARRAY_BUFFER_BINDING", + v8::Integer::NewFromUnsigned(isolate, 0x889F)); + + tmpl->Set(isolate, "CULL_FACE", v8::Integer::NewFromUnsigned(isolate, 0x0B44)); + tmpl->Set(isolate, "FRONT", v8::Integer::NewFromUnsigned(isolate, 0x0404)); + tmpl->Set(isolate, "BACK", v8::Integer::NewFromUnsigned(isolate, 0x0405)); + tmpl->Set(isolate, "FRONT_AND_BACK", v8::Integer::NewFromUnsigned(isolate, 0x0408)); + + tmpl->Set(isolate, "BLEND", v8::Integer::NewFromUnsigned(isolate, 0x0BE2)); + tmpl->Set(isolate, "DEPTH_TEST", v8::Integer::NewFromUnsigned(isolate, 0x0B71)); + tmpl->Set(isolate, "DITHER", v8::Integer::NewFromUnsigned(isolate, 0x0BD0)); + tmpl->Set(isolate, "POLYGON_OFFSET_FILL", v8::Integer::NewFromUnsigned(isolate, 0x8037)); + + tmpl->Set(isolate, "SAMPLE_ALPHA_TO_COVERAGE", v8::Integer::NewFromUnsigned(isolate, 0x809E)); + tmpl->Set(isolate, "SAMPLE_COVERAGE", v8::Integer::NewFromUnsigned(isolate, 0x80A0)); + tmpl->Set(isolate, "SCISSOR_TEST", v8::Integer::NewFromUnsigned(isolate, 0x0C11)); + tmpl->Set(isolate, "STENCIL_TEST", v8::Integer::NewFromUnsigned(isolate, 0x0B90)); /* Errors */ - tmpl->Set(isolate, "NO_ERROR", v8::Uint32::New(isolate, 0)); - tmpl->Set(isolate, "INVALID_ENUM", v8::Uint32::New(isolate, 0x0500)); - tmpl->Set(isolate, "INVALID_VALUE", v8::Uint32::New(isolate, 0x0501)); - tmpl->Set(isolate, "INVALID_OPERATION", v8::Uint32::New(isolate, 0x0502)); + tmpl->Set(isolate, "NO_ERROR", v8::Integer::NewFromUnsigned(isolate, 0)); + tmpl->Set(isolate, "INVALID_ENUM", v8::Integer::NewFromUnsigned(isolate, 0x0500)); + tmpl->Set(isolate, "INVALID_VALUE", v8::Integer::NewFromUnsigned(isolate, 0x0501)); + tmpl->Set(isolate, "INVALID_OPERATION", v8::Integer::NewFromUnsigned(isolate, 0x0502)); - tmpl->Set(isolate, "OUT_OF_MEMORY", v8::Uint32::New(isolate, 0x0505)); - tmpl->Set(isolate, "CONTEXT_LOST_WEBGL", v8::Uint32::New(isolate, 0x9242)); - tmpl->Set(isolate, "CW", v8::Uint32::New(isolate, 0x0900)); - tmpl->Set(isolate, "CCW", v8::Uint32::New(isolate, 0x0901)); + tmpl->Set(isolate, "OUT_OF_MEMORY", v8::Integer::NewFromUnsigned(isolate, 0x0505)); + tmpl->Set(isolate, "CONTEXT_LOST_WEBGL", v8::Integer::NewFromUnsigned(isolate, 0x9242)); + tmpl->Set(isolate, "CW", v8::Integer::NewFromUnsigned(isolate, 0x0900)); + tmpl->Set(isolate, "CCW", v8::Integer::NewFromUnsigned(isolate, 0x0901)); - tmpl->Set(isolate, "DONT_CARE", v8::Uint32::New(isolate, 0x1100)); - tmpl->Set(isolate, "FASTEST", v8::Uint32::New(isolate, 0x1101)); - tmpl->Set(isolate, "NICEST", v8::Uint32::New(isolate, 0x1102)); - tmpl->Set(isolate, "GENERATE_MIPMAP_HINT", v8::Uint32::New(isolate, 0x8192)); + tmpl->Set(isolate, "DONT_CARE", v8::Integer::NewFromUnsigned(isolate, 0x1100)); + tmpl->Set(isolate, "FASTEST", v8::Integer::NewFromUnsigned(isolate, 0x1101)); + tmpl->Set(isolate, "NICEST", v8::Integer::NewFromUnsigned(isolate, 0x1102)); + tmpl->Set(isolate, "GENERATE_MIPMAP_HINT", v8::Integer::NewFromUnsigned(isolate, 0x8192)); - tmpl->Set(isolate, "BYTE", v8::Uint32::New(isolate, 0x1400)); - tmpl->Set(isolate, "UNSIGNED_BYTE", v8::Uint32::New(isolate, 0x1401)); - tmpl->Set(isolate, "SHORT", v8::Uint32::New(isolate, 0x1402)); - tmpl->Set(isolate, "UNSIGNED_SHORT", v8::Uint32::New(isolate, 0x1403)); + tmpl->Set(isolate, "BYTE", v8::Integer::NewFromUnsigned(isolate, 0x1400)); + tmpl->Set(isolate, "UNSIGNED_BYTE", v8::Integer::NewFromUnsigned(isolate, 0x1401)); + tmpl->Set(isolate, "SHORT", v8::Integer::NewFromUnsigned(isolate, 0x1402)); + tmpl->Set(isolate, "UNSIGNED_SHORT", v8::Integer::NewFromUnsigned(isolate, 0x1403)); - tmpl->Set(isolate, "BYTE", v8::Uint32::New(isolate, 0x1400)); - tmpl->Set(isolate, "UNSIGNED_BYTE", v8::Uint32::New(isolate, 0x1401)); - tmpl->Set(isolate, "SHORT", v8::Uint32::New(isolate, 0x1402)); - tmpl->Set(isolate, "UNSIGNED_SHORT", v8::Uint32::New(isolate, 0x1403)); + tmpl->Set(isolate, "BYTE", v8::Integer::NewFromUnsigned(isolate, 0x1400)); + tmpl->Set(isolate, "UNSIGNED_BYTE", v8::Integer::NewFromUnsigned(isolate, 0x1401)); + tmpl->Set(isolate, "SHORT", v8::Integer::NewFromUnsigned(isolate, 0x1402)); + tmpl->Set(isolate, "UNSIGNED_SHORT", v8::Integer::NewFromUnsigned(isolate, 0x1403)); - tmpl->Set(isolate, "INT", v8::Uint32::New(isolate, 0x1404)); - tmpl->Set(isolate, "UNSIGNED_INT", v8::Uint32::New(isolate, 0x1405)); - tmpl->Set(isolate, "FLOAT", v8::Uint32::New(isolate, 0x1406)); - tmpl->Set(isolate, "DEPTH_COMPONENT", v8::Uint32::New(isolate, 0x1902)); + tmpl->Set(isolate, "INT", v8::Integer::NewFromUnsigned(isolate, 0x1404)); + tmpl->Set(isolate, "UNSIGNED_INT", v8::Integer::NewFromUnsigned(isolate, 0x1405)); + tmpl->Set(isolate, "FLOAT", v8::Integer::NewFromUnsigned(isolate, 0x1406)); + tmpl->Set(isolate, "DEPTH_COMPONENT", v8::Integer::NewFromUnsigned(isolate, 0x1902)); - tmpl->Set(isolate, "ALPHA", v8::Uint32::New(isolate, 0x1906)); - tmpl->Set(isolate, "RGB", v8::Uint32::New(isolate, 0x1907)); + tmpl->Set(isolate, "ALPHA", v8::Integer::NewFromUnsigned(isolate, 0x1906)); + tmpl->Set(isolate, "RGB", v8::Integer::NewFromUnsigned(isolate, 0x1907)); /* Clearing buffers */ - tmpl->Set(isolate, "RGBA", v8::Uint32::New(isolate, 0x1908)); - tmpl->Set(isolate, "LUMINANCE", v8::Uint32::New(isolate, 0x1909)); - tmpl->Set(isolate, "LUMINANCE_ALPHA", v8::Uint32::New(isolate, 0x190A)); + tmpl->Set(isolate, "RGBA", v8::Integer::NewFromUnsigned(isolate, 0x1908)); + tmpl->Set(isolate, "LUMINANCE", v8::Integer::NewFromUnsigned(isolate, 0x1909)); + tmpl->Set(isolate, "LUMINANCE_ALPHA", v8::Integer::NewFromUnsigned(isolate, 0x190A)); /* Clearing buffers */ /* Rendering primitives */ - tmpl->Set(isolate, "UNSIGNED_SHORT_4_4_4_4", v8::Uint32::New(isolate, 0x8033)); - tmpl->Set(isolate, "UNSIGNED_SHORT_5_5_5_1", v8::Uint32::New(isolate, 0x8034)); - tmpl->Set(isolate, "UNSIGNED_SHORT_5_6_5", v8::Uint32::New(isolate, 0x8363)); - tmpl->Set(isolate, "FRAGMENT_SHADER", v8::Uint32::New(isolate, 0x8B30)); - tmpl->Set(isolate, "VERTEX_SHADER", v8::Uint32::New(isolate, 0x8B31)); - tmpl->Set(isolate, "COMPILE_STATUS", v8::Uint32::New(isolate, 0x8B81)); - tmpl->Set(isolate, "DELETE_STATUS", v8::Uint32::New(isolate, 0x8B80)); + tmpl->Set(isolate, "UNSIGNED_SHORT_4_4_4_4", v8::Integer::NewFromUnsigned(isolate, 0x8033)); + tmpl->Set(isolate, "UNSIGNED_SHORT_5_5_5_1", v8::Integer::NewFromUnsigned(isolate, 0x8034)); + tmpl->Set(isolate, "UNSIGNED_SHORT_5_6_5", v8::Integer::NewFromUnsigned(isolate, 0x8363)); + tmpl->Set(isolate, "FRAGMENT_SHADER", v8::Integer::NewFromUnsigned(isolate, 0x8B30)); + tmpl->Set(isolate, "VERTEX_SHADER", v8::Integer::NewFromUnsigned(isolate, 0x8B31)); + tmpl->Set(isolate, "COMPILE_STATUS", v8::Integer::NewFromUnsigned(isolate, 0x8B81)); + tmpl->Set(isolate, "DELETE_STATUS", v8::Integer::NewFromUnsigned(isolate, 0x8B80)); /* Rendering primitives */ /* Blending modes */ - tmpl->Set(isolate, "LINK_STATUS", v8::Uint32::New(isolate, 0x8B82)); - tmpl->Set(isolate, "VALIDATE_STATUS", v8::Uint32::New(isolate, 0x8B83)); - tmpl->Set(isolate, "ATTACHED_SHADERS", v8::Uint32::New(isolate, 0x8B85)); - tmpl->Set(isolate, "ACTIVE_ATTRIBUTES", v8::Uint32::New(isolate, 0x8B89)); - tmpl->Set(isolate, "ACTIVE_UNIFORMS", v8::Uint32::New(isolate, 0x8B86)); - tmpl->Set(isolate, "MAX_VERTEX_ATTRIBS", v8::Uint32::New(isolate, 0x8869)); - tmpl->Set(isolate, "MAX_VERTEX_UNIFORM_VECTORS", v8::Uint32::New(isolate, 0x8DFB)); - tmpl->Set(isolate, "MAX_VARYING_VECTORS", v8::Uint32::New(isolate, 0x8DFC)); - tmpl->Set(isolate, "MAX_COMBINED_TEXTURE_IMAGE_UNITS", v8::Uint32::New(isolate, 0x8B4D)); - tmpl->Set(isolate, "MAX_VERTEX_TEXTURE_IMAGE_UNITS", v8::Uint32::New(isolate, 0x8B4C)); - tmpl->Set(isolate, "MAX_TEXTURE_IMAGE_UNITS", v8::Uint32::New(isolate, 0x8872)); - tmpl->Set(isolate, "MAX_FRAGMENT_UNIFORM_VECTORS", v8::Uint32::New(isolate, 0x8DFD)); - tmpl->Set(isolate, "SHADER_TYPE", v8::Uint32::New(isolate, 0x8B4F)); - tmpl->Set(isolate, "SHADING_LANGUAGE_VERSION", v8::Uint32::New(isolate, 0x8B8C)); - tmpl->Set(isolate, "CURRENT_PROGRAM", v8::Uint32::New(isolate, 0x8B8D)); + tmpl->Set(isolate, "LINK_STATUS", v8::Integer::NewFromUnsigned(isolate, 0x8B82)); + tmpl->Set(isolate, "VALIDATE_STATUS", v8::Integer::NewFromUnsigned(isolate, 0x8B83)); + tmpl->Set(isolate, "ATTACHED_SHADERS", v8::Integer::NewFromUnsigned(isolate, 0x8B85)); + tmpl->Set(isolate, "ACTIVE_ATTRIBUTES", v8::Integer::NewFromUnsigned(isolate, 0x8B89)); + tmpl->Set(isolate, "ACTIVE_UNIFORMS", v8::Integer::NewFromUnsigned(isolate, 0x8B86)); + tmpl->Set(isolate, "MAX_VERTEX_ATTRIBS", v8::Integer::NewFromUnsigned(isolate, 0x8869)); + tmpl->Set(isolate, "MAX_VERTEX_UNIFORM_VECTORS", v8::Integer::NewFromUnsigned(isolate, 0x8DFB)); + tmpl->Set(isolate, "MAX_VARYING_VECTORS", v8::Integer::NewFromUnsigned(isolate, 0x8DFC)); + tmpl->Set(isolate, "MAX_COMBINED_TEXTURE_IMAGE_UNITS", + v8::Integer::NewFromUnsigned(isolate, 0x8B4D)); + tmpl->Set(isolate, "MAX_VERTEX_TEXTURE_IMAGE_UNITS", + v8::Integer::NewFromUnsigned(isolate, 0x8B4C)); + tmpl->Set(isolate, "MAX_TEXTURE_IMAGE_UNITS", v8::Integer::NewFromUnsigned(isolate, 0x8872)); + tmpl->Set(isolate, "MAX_FRAGMENT_UNIFORM_VECTORS", + v8::Integer::NewFromUnsigned(isolate, 0x8DFD)); + tmpl->Set(isolate, "SHADER_TYPE", v8::Integer::NewFromUnsigned(isolate, 0x8B4F)); + tmpl->Set(isolate, "SHADING_LANGUAGE_VERSION", v8::Integer::NewFromUnsigned(isolate, 0x8B8C)); + tmpl->Set(isolate, "CURRENT_PROGRAM", v8::Integer::NewFromUnsigned(isolate, 0x8B8D)); /* Blending modes */ - tmpl->Set(isolate, "NEVER", v8::Uint32::New(isolate, 0x0200)); - tmpl->Set(isolate, "LESS", v8::Uint32::New(isolate, 0x0201)); - tmpl->Set(isolate, "EQUAL", v8::Uint32::New(isolate, 0x0202)); + tmpl->Set(isolate, "NEVER", v8::Integer::NewFromUnsigned(isolate, 0x0200)); + tmpl->Set(isolate, "LESS", v8::Integer::NewFromUnsigned(isolate, 0x0201)); + tmpl->Set(isolate, "EQUAL", v8::Integer::NewFromUnsigned(isolate, 0x0202)); /* Blending equations */ /* Getting GL parameter information */ - tmpl->Set(isolate, "LEQUAL", v8::Uint32::New(isolate, 0x0203)); - tmpl->Set(isolate, "GREATER", v8::Uint32::New(isolate, 0x0204)); - tmpl->Set(isolate, "NOTEQUAL", v8::Uint32::New(isolate, 0x0205)); - tmpl->Set(isolate, "GEQUAL", v8::Uint32::New(isolate, 0x0206)); - tmpl->Set(isolate, "ALWAYS", v8::Uint32::New(isolate, 0x0207)); - tmpl->Set(isolate, "KEEP", v8::Uint32::New(isolate, 0x1E00)); - tmpl->Set(isolate, "REPLACE", v8::Uint32::New(isolate, 0x1E01)); - tmpl->Set(isolate, "INCR", v8::Uint32::New(isolate, 0x1E02)); - tmpl->Set(isolate, "DECR", v8::Uint32::New(isolate, 0x1E03)); - tmpl->Set(isolate, "INVERT", v8::Uint32::New(isolate, 0x150A)); - tmpl->Set(isolate, "INCR_WRAP", v8::Uint32::New(isolate, 0x8507)); - tmpl->Set(isolate, "DECR_WRAP", v8::Uint32::New(isolate, 0x8508)); - tmpl->Set(isolate, "NEAREST", v8::Uint32::New(isolate, 0x2600)); - tmpl->Set(isolate, "LINEAR", v8::Uint32::New(isolate, 0x2601)); - tmpl->Set(isolate, "NEAREST_MIPMAP_NEAREST", v8::Uint32::New(isolate, 0x2700)); - tmpl->Set(isolate, "LINEAR_MIPMAP_NEAREST", v8::Uint32::New(isolate, 0x2701)); - tmpl->Set(isolate, "NEAREST_MIPMAP_LINEAR", v8::Uint32::New(isolate, 0x2702)); - tmpl->Set(isolate, "LINEAR_MIPMAP_LINEAR", v8::Uint32::New(isolate, 0x2703)); - tmpl->Set(isolate, "TEXTURE_MAG_FILTER", v8::Uint32::New(isolate, 0x2800)); - tmpl->Set(isolate, "TEXTURE_MIN_FILTER", v8::Uint32::New(isolate, 0x2801)); - tmpl->Set(isolate, "TEXTURE_WRAP_S", v8::Uint32::New(isolate, 0x2802)); - tmpl->Set(isolate, "TEXTURE_WRAP_T", v8::Uint32::New(isolate, 0x2803)); - tmpl->Set(isolate, "TEXTURE_2D", v8::Uint32::New(isolate, 0x0DE1)); - tmpl->Set(isolate, "TEXTURE", v8::Uint32::New(isolate, 0x1702)); - tmpl->Set(isolate, "TEXTURE_CUBE_MAP", v8::Uint32::New(isolate, 0x8513)); - tmpl->Set(isolate, "TEXTURE_BINDING_CUBE_MAP", v8::Uint32::New(isolate, 0x8514)); - tmpl->Set(isolate, "TEXTURE_CUBE_MAP_POSITIVE_X", v8::Uint32::New(isolate, 0x8515)); - tmpl->Set(isolate, "TEXTURE_CUBE_MAP_NEGATIVE_X", v8::Uint32::New(isolate, 0x8516)); - tmpl->Set(isolate, "TEXTURE_CUBE_MAP_POSITIVE_Y", v8::Uint32::New(isolate, 0x8517)); - tmpl->Set(isolate, "TEXTURE_CUBE_MAP_NEGATIVE_Y", v8::Uint32::New(isolate, 0x8518)); - tmpl->Set(isolate, "TEXTURE_CUBE_MAP_POSITIVE_Z", v8::Uint32::New(isolate, 0x8519)); - tmpl->Set(isolate, "TEXTURE_CUBE_MAP_NEGATIVE_Z", v8::Uint32::New(isolate, 0x851A)); - tmpl->Set(isolate, "MAX_CUBE_MAP_TEXTURE_SIZE", v8::Uint32::New(isolate, 0x851C)); - tmpl->Set(isolate, "TEXTURE0", v8::Uint32::New(isolate, 0x84C0)); - tmpl->Set(isolate, "TEXTURE1", v8::Uint32::New(isolate, 0x84C1)); - tmpl->Set(isolate, "TEXTURE2", v8::Uint32::New(isolate, 0x84C2)); - tmpl->Set(isolate, "TEXTURE3", v8::Uint32::New(isolate, 0x84C3)); - tmpl->Set(isolate, "TEXTURE4", v8::Uint32::New(isolate, 0x84C4)); - tmpl->Set(isolate, "TEXTURE5", v8::Uint32::New(isolate, 0x84C5)); - tmpl->Set(isolate, "TEXTURE6", v8::Uint32::New(isolate, 0x84C6)); - tmpl->Set(isolate, "TEXTURE7", v8::Uint32::New(isolate, 0x84C7)); - tmpl->Set(isolate, "TEXTURE8", v8::Uint32::New(isolate, 0x84C8)); - tmpl->Set(isolate, "TEXTURE9", v8::Uint32::New(isolate, 0x84C9)); - tmpl->Set(isolate, "TEXTURE10", v8::Uint32::New(isolate, 0x84CA)); - tmpl->Set(isolate, "TEXTURE11", v8::Uint32::New(isolate, 0x84CB)); - tmpl->Set(isolate, "TEXTURE12", v8::Uint32::New(isolate, 0x84CC)); - tmpl->Set(isolate, "TEXTURE13", v8::Uint32::New(isolate, 0x84CD)); - tmpl->Set(isolate, "TEXTURE14", v8::Uint32::New(isolate, 0x84CE)); - tmpl->Set(isolate, "TEXTURE15", v8::Uint32::New(isolate, 0x84CF)); - tmpl->Set(isolate, "TEXTURE16", v8::Uint32::New(isolate, 0x84D0)); - tmpl->Set(isolate, "TEXTURE17", v8::Uint32::New(isolate, 0x84D1)); - tmpl->Set(isolate, "TEXTURE18", v8::Uint32::New(isolate, 0x84D2)); - tmpl->Set(isolate, "TEXTURE19", v8::Uint32::New(isolate, 0x84D3)); - tmpl->Set(isolate, "TEXTURE20", v8::Uint32::New(isolate, 0x84D4)); - tmpl->Set(isolate, "TEXTURE21", v8::Uint32::New(isolate, 0x84D5)); - tmpl->Set(isolate, "TEXTURE22", v8::Uint32::New(isolate, 0x84D6)); - tmpl->Set(isolate, "TEXTURE23", v8::Uint32::New(isolate, 0x84D7)); - tmpl->Set(isolate, "TEXTURE24", v8::Uint32::New(isolate, 0x84D8)); - tmpl->Set(isolate, "TEXTURE25", v8::Uint32::New(isolate, 0x84D9)); - tmpl->Set(isolate, "TEXTURE26", v8::Uint32::New(isolate, 0x84DA)); - tmpl->Set(isolate, "TEXTURE27", v8::Uint32::New(isolate, 0x84DB)); - tmpl->Set(isolate, "TEXTURE28", v8::Uint32::New(isolate, 0x84DC)); - tmpl->Set(isolate, "TEXTURE29", v8::Uint32::New(isolate, 0x84DD)); + tmpl->Set(isolate, "LEQUAL", v8::Integer::NewFromUnsigned(isolate, 0x0203)); + tmpl->Set(isolate, "GREATER", v8::Integer::NewFromUnsigned(isolate, 0x0204)); + tmpl->Set(isolate, "NOTEQUAL", v8::Integer::NewFromUnsigned(isolate, 0x0205)); + tmpl->Set(isolate, "GEQUAL", v8::Integer::NewFromUnsigned(isolate, 0x0206)); + tmpl->Set(isolate, "ALWAYS", v8::Integer::NewFromUnsigned(isolate, 0x0207)); + tmpl->Set(isolate, "KEEP", v8::Integer::NewFromUnsigned(isolate, 0x1E00)); + tmpl->Set(isolate, "REPLACE", v8::Integer::NewFromUnsigned(isolate, 0x1E01)); + tmpl->Set(isolate, "INCR", v8::Integer::NewFromUnsigned(isolate, 0x1E02)); + tmpl->Set(isolate, "DECR", v8::Integer::NewFromUnsigned(isolate, 0x1E03)); + tmpl->Set(isolate, "INVERT", v8::Integer::NewFromUnsigned(isolate, 0x150A)); + tmpl->Set(isolate, "INCR_WRAP", v8::Integer::NewFromUnsigned(isolate, 0x8507)); + tmpl->Set(isolate, "DECR_WRAP", v8::Integer::NewFromUnsigned(isolate, 0x8508)); + tmpl->Set(isolate, "NEAREST", v8::Integer::NewFromUnsigned(isolate, 0x2600)); + tmpl->Set(isolate, "LINEAR", v8::Integer::NewFromUnsigned(isolate, 0x2601)); + tmpl->Set(isolate, "NEAREST_MIPMAP_NEAREST", v8::Integer::NewFromUnsigned(isolate, 0x2700)); + tmpl->Set(isolate, "LINEAR_MIPMAP_NEAREST", v8::Integer::NewFromUnsigned(isolate, 0x2701)); + tmpl->Set(isolate, "NEAREST_MIPMAP_LINEAR", v8::Integer::NewFromUnsigned(isolate, 0x2702)); + tmpl->Set(isolate, "LINEAR_MIPMAP_LINEAR", v8::Integer::NewFromUnsigned(isolate, 0x2703)); + tmpl->Set(isolate, "TEXTURE_MAG_FILTER", v8::Integer::NewFromUnsigned(isolate, 0x2800)); + tmpl->Set(isolate, "TEXTURE_MIN_FILTER", v8::Integer::NewFromUnsigned(isolate, 0x2801)); + tmpl->Set(isolate, "TEXTURE_WRAP_S", v8::Integer::NewFromUnsigned(isolate, 0x2802)); + tmpl->Set(isolate, "TEXTURE_WRAP_T", v8::Integer::NewFromUnsigned(isolate, 0x2803)); + tmpl->Set(isolate, "TEXTURE_2D", v8::Integer::NewFromUnsigned(isolate, 0x0DE1)); + tmpl->Set(isolate, "TEXTURE", v8::Integer::NewFromUnsigned(isolate, 0x1702)); + tmpl->Set(isolate, "TEXTURE_CUBE_MAP", v8::Integer::NewFromUnsigned(isolate, 0x8513)); + tmpl->Set(isolate, "TEXTURE_BINDING_CUBE_MAP", v8::Integer::NewFromUnsigned(isolate, 0x8514)); + tmpl->Set(isolate, "TEXTURE_CUBE_MAP_POSITIVE_X", + v8::Integer::NewFromUnsigned(isolate, 0x8515)); + tmpl->Set(isolate, "TEXTURE_CUBE_MAP_NEGATIVE_X", + v8::Integer::NewFromUnsigned(isolate, 0x8516)); + tmpl->Set(isolate, "TEXTURE_CUBE_MAP_POSITIVE_Y", + v8::Integer::NewFromUnsigned(isolate, 0x8517)); + tmpl->Set(isolate, "TEXTURE_CUBE_MAP_NEGATIVE_Y", + v8::Integer::NewFromUnsigned(isolate, 0x8518)); + tmpl->Set(isolate, "TEXTURE_CUBE_MAP_POSITIVE_Z", + v8::Integer::NewFromUnsigned(isolate, 0x8519)); + tmpl->Set(isolate, "TEXTURE_CUBE_MAP_NEGATIVE_Z", + v8::Integer::NewFromUnsigned(isolate, 0x851A)); + tmpl->Set(isolate, "MAX_CUBE_MAP_TEXTURE_SIZE", v8::Integer::NewFromUnsigned(isolate, 0x851C)); + tmpl->Set(isolate, "TEXTURE0", v8::Integer::NewFromUnsigned(isolate, 0x84C0)); + tmpl->Set(isolate, "TEXTURE1", v8::Integer::NewFromUnsigned(isolate, 0x84C1)); + tmpl->Set(isolate, "TEXTURE2", v8::Integer::NewFromUnsigned(isolate, 0x84C2)); + tmpl->Set(isolate, "TEXTURE3", v8::Integer::NewFromUnsigned(isolate, 0x84C3)); + tmpl->Set(isolate, "TEXTURE4", v8::Integer::NewFromUnsigned(isolate, 0x84C4)); + tmpl->Set(isolate, "TEXTURE5", v8::Integer::NewFromUnsigned(isolate, 0x84C5)); + tmpl->Set(isolate, "TEXTURE6", v8::Integer::NewFromUnsigned(isolate, 0x84C6)); + tmpl->Set(isolate, "TEXTURE7", v8::Integer::NewFromUnsigned(isolate, 0x84C7)); + tmpl->Set(isolate, "TEXTURE8", v8::Integer::NewFromUnsigned(isolate, 0x84C8)); + tmpl->Set(isolate, "TEXTURE9", v8::Integer::NewFromUnsigned(isolate, 0x84C9)); + tmpl->Set(isolate, "TEXTURE10", v8::Integer::NewFromUnsigned(isolate, 0x84CA)); + tmpl->Set(isolate, "TEXTURE11", v8::Integer::NewFromUnsigned(isolate, 0x84CB)); + tmpl->Set(isolate, "TEXTURE12", v8::Integer::NewFromUnsigned(isolate, 0x84CC)); + tmpl->Set(isolate, "TEXTURE13", v8::Integer::NewFromUnsigned(isolate, 0x84CD)); + tmpl->Set(isolate, "TEXTURE14", v8::Integer::NewFromUnsigned(isolate, 0x84CE)); + tmpl->Set(isolate, "TEXTURE15", v8::Integer::NewFromUnsigned(isolate, 0x84CF)); + tmpl->Set(isolate, "TEXTURE16", v8::Integer::NewFromUnsigned(isolate, 0x84D0)); + tmpl->Set(isolate, "TEXTURE17", v8::Integer::NewFromUnsigned(isolate, 0x84D1)); + tmpl->Set(isolate, "TEXTURE18", v8::Integer::NewFromUnsigned(isolate, 0x84D2)); + tmpl->Set(isolate, "TEXTURE19", v8::Integer::NewFromUnsigned(isolate, 0x84D3)); + tmpl->Set(isolate, "TEXTURE20", v8::Integer::NewFromUnsigned(isolate, 0x84D4)); + tmpl->Set(isolate, "TEXTURE21", v8::Integer::NewFromUnsigned(isolate, 0x84D5)); + tmpl->Set(isolate, "TEXTURE22", v8::Integer::NewFromUnsigned(isolate, 0x84D6)); + tmpl->Set(isolate, "TEXTURE23", v8::Integer::NewFromUnsigned(isolate, 0x84D7)); + tmpl->Set(isolate, "TEXTURE24", v8::Integer::NewFromUnsigned(isolate, 0x84D8)); + tmpl->Set(isolate, "TEXTURE25", v8::Integer::NewFromUnsigned(isolate, 0x84D9)); + tmpl->Set(isolate, "TEXTURE26", v8::Integer::NewFromUnsigned(isolate, 0x84DA)); + tmpl->Set(isolate, "TEXTURE27", v8::Integer::NewFromUnsigned(isolate, 0x84DB)); + tmpl->Set(isolate, "TEXTURE28", v8::Integer::NewFromUnsigned(isolate, 0x84DC)); + tmpl->Set(isolate, "TEXTURE29", v8::Integer::NewFromUnsigned(isolate, 0x84DD)); /* Getting GL parameter information */ /* Buffers */ - tmpl->Set(isolate, "TEXTURE30", v8::Uint32::New(isolate, 0x84DE)); - tmpl->Set(isolate, "TEXTURE31", v8::Uint32::New(isolate, 0x84DF)); - tmpl->Set(isolate, "ACTIVE_TEXTURE", v8::Uint32::New(isolate, 0x84E0)); - tmpl->Set(isolate, "REPEAT", v8::Uint32::New(isolate, 0x2901)); - tmpl->Set(isolate, "CLAMP_TO_EDGE", v8::Uint32::New(isolate, 0x812F)); - tmpl->Set(isolate, "MIRRORED_REPEAT", v8::Uint32::New(isolate, 0x8370)); - tmpl->Set(isolate, "FLOAT_VEC2", v8::Uint32::New(isolate, 0x8B50)); + tmpl->Set(isolate, "TEXTURE30", v8::Integer::NewFromUnsigned(isolate, 0x84DE)); + tmpl->Set(isolate, "TEXTURE31", v8::Integer::NewFromUnsigned(isolate, 0x84DF)); + tmpl->Set(isolate, "ACTIVE_TEXTURE", v8::Integer::NewFromUnsigned(isolate, 0x84E0)); + tmpl->Set(isolate, "REPEAT", v8::Integer::NewFromUnsigned(isolate, 0x2901)); + tmpl->Set(isolate, "CLAMP_TO_EDGE", v8::Integer::NewFromUnsigned(isolate, 0x812F)); + tmpl->Set(isolate, "MIRRORED_REPEAT", v8::Integer::NewFromUnsigned(isolate, 0x8370)); + tmpl->Set(isolate, "FLOAT_VEC2", v8::Integer::NewFromUnsigned(isolate, 0x8B50)); /* Buffers */ /* Vertex attributes */ - tmpl->Set(isolate, "FLOAT_VEC3", v8::Uint32::New(isolate, 0x8B51)); - tmpl->Set(isolate, "FLOAT_VEC4", v8::Uint32::New(isolate, 0x8B52)); - tmpl->Set(isolate, "INT_VEC2", v8::Uint32::New(isolate, 0x8B53)); - tmpl->Set(isolate, "INT_VEC3", v8::Uint32::New(isolate, 0x8B54)); - tmpl->Set(isolate, "INT_VEC4", v8::Uint32::New(isolate, 0x8B55)); - tmpl->Set(isolate, "BOOL", v8::Uint32::New(isolate, 0x8B56)); - tmpl->Set(isolate, "BOOL_VEC2", v8::Uint32::New(isolate, 0x8B57)); - tmpl->Set(isolate, "BOOL_VEC3", v8::Uint32::New(isolate, 0x8B58)); + tmpl->Set(isolate, "FLOAT_VEC3", v8::Integer::NewFromUnsigned(isolate, 0x8B51)); + tmpl->Set(isolate, "FLOAT_VEC4", v8::Integer::NewFromUnsigned(isolate, 0x8B52)); + tmpl->Set(isolate, "INT_VEC2", v8::Integer::NewFromUnsigned(isolate, 0x8B53)); + tmpl->Set(isolate, "INT_VEC3", v8::Integer::NewFromUnsigned(isolate, 0x8B54)); + tmpl->Set(isolate, "INT_VEC4", v8::Integer::NewFromUnsigned(isolate, 0x8B55)); + tmpl->Set(isolate, "BOOL", v8::Integer::NewFromUnsigned(isolate, 0x8B56)); + tmpl->Set(isolate, "BOOL_VEC2", v8::Integer::NewFromUnsigned(isolate, 0x8B57)); + tmpl->Set(isolate, "BOOL_VEC3", v8::Integer::NewFromUnsigned(isolate, 0x8B58)); /* Vertex attributes */ /* Culling */ - tmpl->Set(isolate, "BOOL_VEC4", v8::Uint32::New(isolate, 0x8B59)); - tmpl->Set(isolate, "FLOAT_MAT2", v8::Uint32::New(isolate, 0x8B5A)); - tmpl->Set(isolate, "FLOAT_MAT3", v8::Uint32::New(isolate, 0x8B5B)); - tmpl->Set(isolate, "FLOAT_MAT4", v8::Uint32::New(isolate, 0x8B5C)); + tmpl->Set(isolate, "BOOL_VEC4", v8::Integer::NewFromUnsigned(isolate, 0x8B59)); + tmpl->Set(isolate, "FLOAT_MAT2", v8::Integer::NewFromUnsigned(isolate, 0x8B5A)); + tmpl->Set(isolate, "FLOAT_MAT3", v8::Integer::NewFromUnsigned(isolate, 0x8B5B)); + tmpl->Set(isolate, "FLOAT_MAT4", v8::Integer::NewFromUnsigned(isolate, 0x8B5C)); /* Culling */ /* Enabling and disabling */ - tmpl->Set(isolate, "SAMPLER_2D", v8::Uint32::New(isolate, 0x8B5E)); - tmpl->Set(isolate, "SAMPLER_CUBE", v8::Uint32::New(isolate, 0x8B60)); - tmpl->Set(isolate, "LOW_FLOAT", v8::Uint32::New(isolate, 0x8DF0)); - tmpl->Set(isolate, "MEDIUM_FLOAT", v8::Uint32::New(isolate, 0x8DF1)); - tmpl->Set(isolate, "HIGH_FLOAT", v8::Uint32::New(isolate, 0x8DF2)); - tmpl->Set(isolate, "LOW_INT", v8::Uint32::New(isolate, 0x8DF3)); - tmpl->Set(isolate, "MEDIUM_INT", v8::Uint32::New(isolate, 0x8DF4)); - tmpl->Set(isolate, "HIGH_INT", v8::Uint32::New(isolate, 0x8DF5)); + tmpl->Set(isolate, "SAMPLER_2D", v8::Integer::NewFromUnsigned(isolate, 0x8B5E)); + tmpl->Set(isolate, "SAMPLER_CUBE", v8::Integer::NewFromUnsigned(isolate, 0x8B60)); + tmpl->Set(isolate, "LOW_FLOAT", v8::Integer::NewFromUnsigned(isolate, 0x8DF0)); + tmpl->Set(isolate, "MEDIUM_FLOAT", v8::Integer::NewFromUnsigned(isolate, 0x8DF1)); + tmpl->Set(isolate, "HIGH_FLOAT", v8::Integer::NewFromUnsigned(isolate, 0x8DF2)); + tmpl->Set(isolate, "LOW_INT", v8::Integer::NewFromUnsigned(isolate, 0x8DF3)); + tmpl->Set(isolate, "MEDIUM_INT", v8::Integer::NewFromUnsigned(isolate, 0x8DF4)); + tmpl->Set(isolate, "HIGH_INT", v8::Integer::NewFromUnsigned(isolate, 0x8DF5)); /* Enabling and disabling */ - tmpl->Set(isolate, "FRAMEBUFFER", v8::Uint32::New(isolate, 0x8D40)); - tmpl->Set(isolate, "RENDERBUFFER", v8::Uint32::New(isolate, 0x8D41)); - tmpl->Set(isolate, "RGBA4", v8::Uint32::New(isolate, 0x8056)); - tmpl->Set(isolate, "RGB5_A1", v8::Uint32::New(isolate, 0x8057)); - tmpl->Set(isolate, "RGB565", v8::Uint32::New(isolate, 0x8D62)); - tmpl->Set(isolate, "DEPTH_COMPONENT16", v8::Uint32::New(isolate, 0x81A5)); - tmpl->Set(isolate, "STENCIL_INDEX8", v8::Uint32::New(isolate, 0x8D48)); + tmpl->Set(isolate, "FRAMEBUFFER", v8::Integer::NewFromUnsigned(isolate, 0x8D40)); + tmpl->Set(isolate, "RENDERBUFFER", v8::Integer::NewFromUnsigned(isolate, 0x8D41)); + tmpl->Set(isolate, "RGBA4", v8::Integer::NewFromUnsigned(isolate, 0x8056)); + tmpl->Set(isolate, "RGB5_A1", v8::Integer::NewFromUnsigned(isolate, 0x8057)); + tmpl->Set(isolate, "RGB565", v8::Integer::NewFromUnsigned(isolate, 0x8D62)); + tmpl->Set(isolate, "DEPTH_COMPONENT16", v8::Integer::NewFromUnsigned(isolate, 0x81A5)); + tmpl->Set(isolate, "STENCIL_INDEX8", v8::Integer::NewFromUnsigned(isolate, 0x8D48)); /* Errors */ /* Front face directions */ - tmpl->Set(isolate, "DEPTH_STENCIL", v8::Uint32::New(isolate, 0x84F9)); - tmpl->Set(isolate, "RENDERBUFFER_WIDTH", v8::Uint32::New(isolate, 0x8D42)); + tmpl->Set(isolate, "DEPTH_STENCIL", v8::Integer::NewFromUnsigned(isolate, 0x84F9)); + tmpl->Set(isolate, "RENDERBUFFER_WIDTH", v8::Integer::NewFromUnsigned(isolate, 0x8D42)); /* Front face directions */ /* Hints */ - tmpl->Set(isolate, "RENDERBUFFER_HEIGHT", v8::Uint32::New(isolate, 0x8D43)); - tmpl->Set(isolate, "RENDERBUFFER_INTERNAL_FORMAT", v8::Uint32::New(isolate, 0x8D44)); - tmpl->Set(isolate, "RENDERBUFFER_RED_SIZE", v8::Uint32::New(isolate, 0x8D50)); - tmpl->Set(isolate, "RENDERBUFFER_GREEN_SIZE", v8::Uint32::New(isolate, 0x8D51)); + tmpl->Set(isolate, "RENDERBUFFER_HEIGHT", v8::Integer::NewFromUnsigned(isolate, 0x8D43)); + tmpl->Set(isolate, "RENDERBUFFER_INTERNAL_FORMAT", + v8::Integer::NewFromUnsigned(isolate, 0x8D44)); + tmpl->Set(isolate, "RENDERBUFFER_RED_SIZE", v8::Integer::NewFromUnsigned(isolate, 0x8D50)); + tmpl->Set(isolate, "RENDERBUFFER_GREEN_SIZE", v8::Integer::NewFromUnsigned(isolate, 0x8D51)); /* Hints */ /* Data types */ - tmpl->Set(isolate, "RENDERBUFFER_BLUE_SIZE", v8::Uint32::New(isolate, 0x8D52)); - tmpl->Set(isolate, "RENDERBUFFER_ALPHA_SIZE", v8::Uint32::New(isolate, 0x8D53)); - tmpl->Set(isolate, "RENDERBUFFER_DEPTH_SIZE", v8::Uint32::New(isolate, 0x8D54)); - tmpl->Set(isolate, "RENDERBUFFER_STENCIL_SIZE", v8::Uint32::New(isolate, 0x8D55)); - tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE", v8::Uint32::New(isolate, 0x8CD0)); - tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_OBJECT_NAME", v8::Uint32::New(isolate, 0x8CD1)); - tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL", v8::Uint32::New(isolate, 0x8CD2)); + tmpl->Set(isolate, "RENDERBUFFER_BLUE_SIZE", v8::Integer::NewFromUnsigned(isolate, 0x8D52)); + tmpl->Set(isolate, "RENDERBUFFER_ALPHA_SIZE", v8::Integer::NewFromUnsigned(isolate, 0x8D53)); + tmpl->Set(isolate, "RENDERBUFFER_DEPTH_SIZE", v8::Integer::NewFromUnsigned(isolate, 0x8D54)); + tmpl->Set(isolate, "RENDERBUFFER_STENCIL_SIZE", v8::Integer::NewFromUnsigned(isolate, 0x8D55)); + tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE", + v8::Integer::NewFromUnsigned(isolate, 0x8CD0)); + tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_OBJECT_NAME", + v8::Integer::NewFromUnsigned(isolate, 0x8CD1)); + tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL", + v8::Integer::NewFromUnsigned(isolate, 0x8CD2)); /* Data types */ /* Pixel formats */ tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE", - v8::Uint32::New(isolate, 0x8CD3)); - tmpl->Set(isolate, "COLOR_ATTACHMENT0", v8::Uint32::New(isolate, 0x8CE0)); - tmpl->Set(isolate, "DEPTH_ATTACHMENT", v8::Uint32::New(isolate, 0x8D00)); - tmpl->Set(isolate, "STENCIL_ATTACHMENT", v8::Uint32::New(isolate, 0x8D20)); - tmpl->Set(isolate, "DEPTH_STENCIL_ATTACHMENT", v8::Uint32::New(isolate, 0x821A)); - tmpl->Set(isolate, "NONE", v8::Uint32::New(isolate, 0)); + v8::Integer::NewFromUnsigned(isolate, 0x8CD3)); + tmpl->Set(isolate, "COLOR_ATTACHMENT0", v8::Integer::NewFromUnsigned(isolate, 0x8CE0)); + tmpl->Set(isolate, "DEPTH_ATTACHMENT", v8::Integer::NewFromUnsigned(isolate, 0x8D00)); + tmpl->Set(isolate, "STENCIL_ATTACHMENT", v8::Integer::NewFromUnsigned(isolate, 0x8D20)); + tmpl->Set(isolate, "DEPTH_STENCIL_ATTACHMENT", v8::Integer::NewFromUnsigned(isolate, 0x821A)); + tmpl->Set(isolate, "NONE", v8::Integer::NewFromUnsigned(isolate, 0)); /* Pixel formats */ /* Pixel types */ - tmpl->Set(isolate, "FRAMEBUFFER_COMPLETE", v8::Uint32::New(isolate, 0x8CD5)); - tmpl->Set(isolate, "FRAMEBUFFER_INCOMPLETE_ATTACHMENT", v8::Uint32::New(isolate, 0x8CD6)); + tmpl->Set(isolate, "FRAMEBUFFER_COMPLETE", v8::Integer::NewFromUnsigned(isolate, 0x8CD5)); + tmpl->Set(isolate, "FRAMEBUFFER_INCOMPLETE_ATTACHMENT", + v8::Integer::NewFromUnsigned(isolate, 0x8CD6)); tmpl->Set(isolate, "FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT", - v8::Uint32::New(isolate, 0x8CD7)); + v8::Integer::NewFromUnsigned(isolate, 0x8CD7)); /* Pixel types */ /* Shaders */ - tmpl->Set(isolate, "FRAMEBUFFER_INCOMPLETE_DIMENSIONS", v8::Uint32::New(isolate, 0x8CD9)); - tmpl->Set(isolate, "FRAMEBUFFER_UNSUPPORTED", v8::Uint32::New(isolate, 0x8CDD)); - tmpl->Set(isolate, "FRAMEBUFFER_BINDING", v8::Uint32::New(isolate, 0x8CA6)); - tmpl->Set(isolate, "RENDERBUFFER_BINDING", v8::Uint32::New(isolate, 0x8CA7)); - tmpl->Set(isolate, "MAX_RENDERBUFFER_SIZE", v8::Uint32::New(isolate, 0x84E8)); - tmpl->Set(isolate, "INVALID_FRAMEBUFFER_OPERATION", v8::Uint32::New(isolate, 0x0506)); - tmpl->Set(isolate, "UNPACK_FLIP_Y_WEBGL", v8::Uint32::New(isolate, 0x9240)); - tmpl->Set(isolate, "UNPACK_PREMULTIPLY_ALPHA_WEBGL", v8::Uint32::New(isolate, 0x9241)); - tmpl->Set(isolate, "UNPACK_COLORSPACE_CONVERSION_WEBGL", v8::Uint32::New(isolate, 0x9243)); + tmpl->Set(isolate, "FRAMEBUFFER_INCOMPLETE_DIMENSIONS", + v8::Integer::NewFromUnsigned(isolate, 0x8CD9)); + tmpl->Set(isolate, "FRAMEBUFFER_UNSUPPORTED", v8::Integer::NewFromUnsigned(isolate, 0x8CDD)); + tmpl->Set(isolate, "FRAMEBUFFER_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8CA6)); + tmpl->Set(isolate, "RENDERBUFFER_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8CA7)); + tmpl->Set(isolate, "MAX_RENDERBUFFER_SIZE", v8::Integer::NewFromUnsigned(isolate, 0x84E8)); + tmpl->Set(isolate, "INVALID_FRAMEBUFFER_OPERATION", + v8::Integer::NewFromUnsigned(isolate, 0x0506)); + tmpl->Set(isolate, "UNPACK_FLIP_Y_WEBGL", v8::Integer::NewFromUnsigned(isolate, 0x9240)); + tmpl->Set(isolate, "UNPACK_PREMULTIPLY_ALPHA_WEBGL", + v8::Integer::NewFromUnsigned(isolate, 0x9241)); + tmpl->Set(isolate, "UNPACK_COLORSPACE_CONVERSION_WEBGL", + v8::Integer::NewFromUnsigned(isolate, 0x9243)); } void WebGLRenderingContext::SetProps(v8::Isolate *isolate, diff --git a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/ANGLE_instanced_arraysImpl.cpp b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/ANGLE_instanced_arraysImpl.cpp index 50c8dbee9..14e592f1d 100644 --- a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/ANGLE_instanced_arraysImpl.cpp +++ b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/ANGLE_instanced_arraysImpl.cpp @@ -5,7 +5,7 @@ #include "ANGLE_instanced_arraysImpl.h" #include "Caches.h" -ANGLE_instanced_arraysImpl::ANGLE_instanced_arraysImpl(ANGLE_instanced_arrays * arrays) +ANGLE_instanced_arraysImpl::ANGLE_instanced_arraysImpl(ANGLE_instanced_arrays *arrays) : arrays_(arrays) {} ANGLE_instanced_arraysImpl * @@ -26,10 +26,10 @@ void ANGLE_instanced_arraysImpl::DrawArraysInstancedANGLE( auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto mode = (uint32_t) args[0]->NumberValue(context).ToChecked(); - auto first = (int32_t) args[1]->NumberValue(context).ToChecked(); - auto count_ = (int32_t) args[2]->NumberValue(context).ToChecked(); - auto primcount = (int32_t) args[3]->NumberValue(context).ToChecked(); + auto mode = args[0]->Uint32Value(context).ToChecked(); + auto first = args[1]->Int32Value(context).ToChecked(); + auto count_ = args[2]->Int32Value(context).ToChecked(); + auto primcount = args[3]->Int32Value(context).ToChecked(); canvas_native_webgl_angle_instanced_arrays_draw_arrays_instanced_angle( mode, @@ -49,11 +49,11 @@ void ANGLE_instanced_arraysImpl::DrawElementsInstancedANGLE( auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto mode = (uint32_t) args[0]->NumberValue(context).ToChecked(); - auto count_ = (int32_t) args[1]->NumberValue(context).ToChecked(); - auto type = (uint32_t) args[2]->NumberValue(context).ToChecked(); - auto offset = (int32_t) args[3]->NumberValue(context).ToChecked(); - auto primcount = (int32_t) args[4]->NumberValue(context).ToChecked(); + auto mode = args[0]->Uint32Value(context).ToChecked(); + auto count_ = args[1]->Int32Value(context).ToChecked(); + auto type = args[2]->Uint32Value(context).ToChecked(); + auto offset = args[3]->Int32Value(context).ToChecked(); + auto primcount = args[4]->Int32Value(context).ToChecked(); canvas_native_webgl_angle_instanced_arrays_draw_elements_instanced_angle( mode, count_, @@ -73,8 +73,8 @@ void ANGLE_instanced_arraysImpl::VertexAttribDivisorANGLE( auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto index = (u_int32_t) args[0]->NumberValue(context).ToChecked(); - auto divisor = (u_int32_t) args[1]->NumberValue(context).ToChecked(); + auto index = args[0]->Uint32Value(context).ToChecked(); + auto divisor = args[1]->Uint32Value(context).ToChecked(); canvas_native_webgl_angle_instanced_arrays_vertex_attrib_divisor_angle( index, divisor, @@ -98,7 +98,7 @@ v8::Local ANGLE_instanced_arraysImpl::GetCtor(v8::Isolate tmpl->SetInternalFieldCount(1); tmpl->Set(ConvertToV8String(isolate, "VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE"), - v8::Number::New(isolate, 0x88FE)); + v8::Integer::NewFromUnsigned(isolate, 0x88FE)); tmpl->Set(ConvertToV8String(isolate, "ext_name"), ConvertToV8String(isolate, "ANGLE_instanced_arrays")); @@ -121,6 +121,6 @@ v8::Local ANGLE_instanced_arraysImpl::GetCtor(v8::Isolate return ctorTmpl; } -ANGLE_instanced_arrays* ANGLE_instanced_arraysImpl::GetArrays() { +ANGLE_instanced_arrays *ANGLE_instanced_arraysImpl::GetArrays() { return this->arrays_; } diff --git a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/EXT_blend_minmaxImpl.cpp b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/EXT_blend_minmaxImpl.cpp index c05667941..140fd0cc0 100644 --- a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/EXT_blend_minmaxImpl.cpp +++ b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/EXT_blend_minmaxImpl.cpp @@ -21,10 +21,10 @@ v8::Local EXT_blend_minmaxImpl::GetCtor(v8::Isolate *isola tmpl->SetInternalFieldCount(1); tmpl->Set(ConvertToV8String(isolate, "MIN_EXT"), - v8::Number::New(isolate, 0x8007)); + v8::Integer::NewFromUnsigned(isolate, 0x8007)); tmpl->Set(ConvertToV8String(isolate, "MAX_EXT"), - v8::Number::New(isolate, 0x8008)); + v8::Integer::NewFromUnsigned(isolate, 0x8008)); tmpl->Set(ConvertToV8String(isolate, "ext_name"), ConvertToV8String(isolate, "EXT_blend_minmax")); diff --git a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/EXT_color_buffer_half_floatImpl.cpp b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/EXT_color_buffer_half_floatImpl.cpp index a4cb7ea1a..f2d84ab92 100644 --- a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/EXT_color_buffer_half_floatImpl.cpp +++ b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/EXT_color_buffer_half_floatImpl.cpp @@ -21,16 +21,16 @@ v8::Local EXT_color_buffer_half_floatImpl::GetCtor(v8::Iso tmpl->SetInternalFieldCount(1); tmpl->Set(ConvertToV8String(isolate, "RGBA16F_EXT"), - v8::Number::New(isolate, 0x881A)); + v8::Integer::NewFromUnsigned(isolate, 0x881A)); tmpl->Set(ConvertToV8String(isolate, "RGB16F_EXT"), - v8::Number::New(isolate, 0x881B)); + v8::Integer::NewFromUnsigned(isolate, 0x881B)); tmpl->Set(ConvertToV8String(isolate, "FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT"), - v8::Number::New(isolate, 0x8211)); + v8::Integer::NewFromUnsigned(isolate, 0x8211)); tmpl->Set(ConvertToV8String(isolate, "UNSIGNED_NORMALIZED_EXT"), - v8::Number::New(isolate, 0x8C17)); + v8::Integer::NewFromUnsigned(isolate, 0x8C17)); tmpl->Set(ConvertToV8String(isolate, "ext_name"), ConvertToV8String(isolate, "EXT_color_buffer_half_float")); diff --git a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/EXT_disjoint_timer_queryImpl.cpp b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/EXT_disjoint_timer_queryImpl.cpp index 9c9027a29..c0acc2cbf 100644 --- a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/EXT_disjoint_timer_queryImpl.cpp +++ b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/EXT_disjoint_timer_queryImpl.cpp @@ -6,7 +6,7 @@ #include "Caches.h" EXT_disjoint_timer_queryImpl::EXT_disjoint_timer_queryImpl( - EXT_disjoint_timer_query* query) : query_(query) {} + EXT_disjoint_timer_query *query) : query_(query) {} v8::Local EXT_disjoint_timer_queryImpl::GetCtor(v8::Isolate *isolate) { @@ -24,25 +24,25 @@ v8::Local EXT_disjoint_timer_queryImpl::GetCtor(v8::Isolat tmpl->SetInternalFieldCount(1); tmpl->Set(ConvertToV8String(isolate, "QUERY_COUNTER_BITS_EXT"), - v8::Number::New(isolate, 0x8864)); + v8::Integer::NewFromUnsigned(isolate, 0x8864)); tmpl->Set(ConvertToV8String(isolate, "CURRENT_QUERY_EXT"), - v8::Number::New(isolate, 0x8865)); + v8::Integer::NewFromUnsigned(isolate, 0x8865)); tmpl->Set(ConvertToV8String(isolate, "QUERY_RESULT_EXT"), - v8::Number::New(isolate, 0x8866)); + v8::Integer::NewFromUnsigned(isolate, 0x8866)); tmpl->Set(ConvertToV8String(isolate, "QUERY_RESULT_AVAILABLE_EXT"), - v8::Number::New(isolate, 0x8867)); + v8::Integer::NewFromUnsigned(isolate, 0x8867)); tmpl->Set(ConvertToV8String(isolate, "TIME_ELAPSED_EXT"), - v8::Number::New(isolate, 0x88BF)); + v8::Integer::NewFromUnsigned(isolate, 0x88BF)); tmpl->Set(ConvertToV8String(isolate, "TIMESTAMP_EXT"), - v8::Number::New(isolate, 0x8E28)); + v8::Integer::NewFromUnsigned(isolate, 0x8E28)); tmpl->Set(ConvertToV8String(isolate, "GPU_DISJOINT_EXT"), - v8::Number::New(isolate, 0x8FBB)); + v8::Integer::NewFromUnsigned(isolate, 0x8FBB)); tmpl->Set(ConvertToV8String(isolate, "createQueryExt"), @@ -111,19 +111,17 @@ void EXT_disjoint_timer_queryImpl::DeleteQueryExt( } auto isolate = args.GetIsolate(); auto value = args[0]; - if (value->IsObject()) { - auto type = GetNativeType(isolate, value.As()); - - if (type == NativeType::WebGLQuery) { - auto query = WebGLQuery::GetPointer(value.As()); - if (query == - nullptr) { return; } - canvas_native_webgl_ext_disjoint_timer_query_delete_query_ext( - query->GetQuery(), - ptr->GetQuery()); - } - + auto type = GetNativeType(isolate, value); + + if (type == NativeType::WebGLQuery) { + auto query = WebGLQuery::GetPointer(value.As()); + if (query == + nullptr) { return; } + canvas_native_webgl_ext_disjoint_timer_query_delete_query_ext( + query->GetQuery(), + ptr->GetQuery()); } + } void EXT_disjoint_timer_queryImpl::IsQueryExt( @@ -134,20 +132,17 @@ void EXT_disjoint_timer_queryImpl::IsQueryExt( } auto isolate = args.GetIsolate(); auto value = args[0]; - if (value->IsObject()) { - auto type = GetNativeType(isolate, value.As()); - - if (type == NativeType::WebGLQuery) { - auto query = WebGLQuery::GetPointer(value.As()); - if (query != nullptr) { - auto ret = canvas_native_webgl_ext_disjoint_timer_query_is_query_ext( - query->GetQuery(), - ptr->GetQuery()); - - args.GetReturnValue().Set(ret); - } - } + auto type = GetNativeType(isolate, value); + if (type == NativeType::WebGLQuery) { + auto query = WebGLQuery::GetPointer(value.As()); + if (query != nullptr) { + auto ret = canvas_native_webgl_ext_disjoint_timer_query_is_query_ext( + query->GetQuery(), + ptr->GetQuery()); + + args.GetReturnValue().Set(ret); + } } args.GetReturnValue().Set(false); } @@ -164,19 +159,16 @@ void EXT_disjoint_timer_queryImpl::BeginQueryExt( auto targetValue = args[0]; auto queryValue = args[1]; - if (targetValue->IsNumber() && - queryValue->IsObject()) { - auto target = (uint32_t) targetValue->NumberValue(context).ToChecked(); - auto type = GetNativeType(isolate, queryValue.As()); - if (type == NativeType::WebGLQuery) { - auto query = WebGLQuery::GetPointer(queryValue.As()); + auto target = targetValue->Uint32Value(context).ToChecked(); + auto type = GetNativeType(isolate, queryValue); + if (type == NativeType::WebGLQuery) { + auto query = WebGLQuery::GetPointer(queryValue.As()); - canvas_native_webgl_ext_disjoint_timer_query_begin_query_ext( - target, - query->GetQuery(), - ptr->GetQuery() - ); - } + canvas_native_webgl_ext_disjoint_timer_query_begin_query_ext( + target, + query->GetQuery(), + ptr->GetQuery() + ); } } @@ -190,13 +182,11 @@ void EXT_disjoint_timer_queryImpl::EndQueryExt( auto context = isolate->GetCurrentContext(); auto value = args[0]; - if (value->IsNumber()) { - auto target = (uint32_t) value->NumberValue(context).ToChecked(); - canvas_native_webgl_ext_disjoint_timer_query_end_query_ext( - target, - ptr->GetQuery() - ); - } + auto target = value->Uint32Value(context).ToChecked(); + canvas_native_webgl_ext_disjoint_timer_query_end_query_ext( + target, + ptr->GetQuery() + ); } void EXT_disjoint_timer_queryImpl::QueryCounterExt( @@ -212,19 +202,16 @@ void EXT_disjoint_timer_queryImpl::QueryCounterExt( auto queryValue = args[0]; auto targetValue = args[1]; - if (targetValue->IsNumber() && - queryValue->IsObject()) { - auto target = (uint32_t) targetValue->NumberValue(context).ToChecked(); - auto type = GetNativeType(isolate, queryValue.As()); - if (type == NativeType::WebGLQuery) { - auto query = WebGLQuery::GetPointer(queryValue.As()); + auto target = targetValue->Uint32Value(context).ToChecked(); + auto type = GetNativeType(isolate, queryValue.As()); + if (type == NativeType::WebGLQuery) { + auto query = WebGLQuery::GetPointer(queryValue.As()); - canvas_native_webgl_ext_disjoint_timer_query_query_counter_ext( - query->GetQuery(), - target, - ptr->GetQuery() - ); - } + canvas_native_webgl_ext_disjoint_timer_query_query_counter_ext( + query->GetQuery(), + target, + ptr->GetQuery() + ); } } @@ -237,8 +224,8 @@ void EXT_disjoint_timer_queryImpl::GetQueryExt( auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto target = (uint32_t) args[0]->NumberValue(context).ToChecked(); - auto pname = (uint32_t) args[1]->NumberValue(context).ToChecked(); + auto target = args[0]->Uint32Value(context).ToChecked(); + auto pname = args[1]->Uint32Value(context).ToChecked(); auto ret = canvas_native_webgl_ext_disjoint_timer_query_get_query_ext( target, pname, @@ -260,14 +247,14 @@ void EXT_disjoint_timer_queryImpl::GetQueryObjectExt( auto query = WebGLQuery::GetPointer(args[0].As()); - auto pname = (uint32_t) args[1]->NumberValue(context).ToChecked(); + auto pname = args[1]->Uint32Value(context).ToChecked(); auto ret = canvas_native_webgl_ext_disjoint_timer_query_get_query_object_ext( query->GetQuery(), pname, ptr->GetQuery() ); - + // GL_QUERY_RESULT_AVAILABLE_EXT if (pname == 0x8867) { @@ -280,7 +267,7 @@ void EXT_disjoint_timer_queryImpl::GetQueryObjectExt( args.GetReturnValue().Set(canvas_native_webgl_result_get_i32( ret)); - + canvas_native_webgl_WebGLResult_destroy(ret); } @@ -296,7 +283,7 @@ void EXT_disjoint_timer_queryImpl::GetQueryParameterExt( auto query = WebGLQuery::GetPointer(args[0].As()); - auto pname = (uint32_t) args[1]->NumberValue(context).ToChecked(); + auto pname = args[1]->Uint32Value(context).ToChecked(); auto ret = canvas_native_webgl_ext_disjoint_timer_query_get_query_object_ext( query->GetQuery(), @@ -318,6 +305,6 @@ void EXT_disjoint_timer_queryImpl::GetQueryParameterExt( } -EXT_disjoint_timer_query* EXT_disjoint_timer_queryImpl::GetQuery() { +EXT_disjoint_timer_query *EXT_disjoint_timer_queryImpl::GetQuery() { return this->query_; } diff --git a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/EXT_sRGBImpl.h b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/EXT_sRGBImpl.h index 4b677ec34..3775f2b4f 100644 --- a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/EXT_sRGBImpl.h +++ b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/EXT_sRGBImpl.h @@ -25,13 +25,13 @@ class EXT_sRGBImpl { auto tmpl = ctorTmpl->InstanceTemplate(); tmpl->SetInternalFieldCount(1); tmpl->Set(ConvertToV8String(isolate, "SRGB_EXT"), - v8::Number::New(isolate, (double) GL_SRGB_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_SRGB_EXT)); tmpl->Set(ConvertToV8String(isolate, "SRGB_ALPHA_EXT"), - v8::Number::New(isolate, (double) GL_SRGB_ALPHA_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_SRGB_ALPHA_EXT)); tmpl->Set(ConvertToV8String(isolate, "SRGB8_ALPHA8_EXT"), - v8::Number::New(isolate, (double) GL_SRGB8_ALPHA8_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_SRGB8_ALPHA8_EXT)); tmpl->Set(ConvertToV8String(isolate, "FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT"), - v8::Number::New(isolate, (double) GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT)); tmpl->Set(ConvertToV8String(isolate, "ext_name"), ConvertToV8String(isolate, "EXT_sRGB")); cache->EXT_sRGBTmpl = diff --git a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/EXT_texture_filter_anisotropicImpl.h b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/EXT_texture_filter_anisotropicImpl.h index e180d5e1e..eaad185a7 100644 --- a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/EXT_texture_filter_anisotropicImpl.h +++ b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/EXT_texture_filter_anisotropicImpl.h @@ -26,9 +26,9 @@ class EXT_texture_filter_anisotropicImpl { auto tmpl = ctorTmpl->InstanceTemplate(); tmpl->SetInternalFieldCount(1); tmpl->Set(ConvertToV8String(isolate, "MAX_TEXTURE_MAX_ANISOTROPY_EXT"), - v8::Number::New(isolate, (double) GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT)); tmpl->Set(ConvertToV8String(isolate, "TEXTURE_MAX_ANISOTROPY_EXT"), - v8::Number::New(isolate, (double) GL_TEXTURE_MAX_ANISOTROPY_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_TEXTURE_MAX_ANISOTROPY_EXT)); tmpl->Set(ConvertToV8String(isolate, "ext_name"), ConvertToV8String(isolate, "EXT_texture_filter_anisotropic")); diff --git a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/OES_element_index_uintImpl.h b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/OES_element_index_uintImpl.h index 5e93dafcf..ec91dd0df 100644 --- a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/OES_element_index_uintImpl.h +++ b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/OES_element_index_uintImpl.h @@ -27,7 +27,7 @@ class OES_element_index_uintImpl { tmpl->SetInternalFieldCount(1); tmpl->Set(ConvertToV8String(isolate, "UNSIGNED_INT"), - v8::Number::New(isolate, (double) GL_UNSIGNED_INT)); + v8::Integer::NewFromUnsigned(isolate, GL_UNSIGNED_INT)); tmpl->Set(ConvertToV8String(isolate, "ext_name"), ConvertToV8String(isolate, "OES_element_index_uint")); diff --git a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/OES_standard_derivativesImpl.h b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/OES_standard_derivativesImpl.h index 0ee0b9da3..240bd574b 100644 --- a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/OES_standard_derivativesImpl.h +++ b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/OES_standard_derivativesImpl.h @@ -26,7 +26,7 @@ class OES_standard_derivativesImpl { auto tmpl = ctorTmpl->InstanceTemplate(); tmpl->SetInternalFieldCount(1); tmpl->Set(ConvertToV8String(isolate, "FRAGMENT_SHADER_DERIVATIVE_HINT_OES"), - v8::Number::New(isolate, GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES)); + v8::Integer::NewFromUnsigned(isolate, GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES)); tmpl->Set(ConvertToV8String(isolate, "ext_name"), ConvertToV8String(isolate, "OES_standard_derivatives")); cache->OES_standard_derivativesTmpl = diff --git a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/OES_texture_half_floatImpl.h b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/OES_texture_half_floatImpl.h index 69fedc3a0..1fb150b9d 100644 --- a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/OES_texture_half_floatImpl.h +++ b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/OES_texture_half_floatImpl.h @@ -26,7 +26,7 @@ class OES_texture_half_floatImpl { auto tmpl = ctorTmpl->InstanceTemplate(); tmpl->SetInternalFieldCount(1); tmpl->Set(ConvertToV8String(isolate, "ext_name"), ConvertToV8String(isolate, "OES_texture_half_float")); - tmpl->Set(ConvertToV8String(isolate, "HALF_FLOAT_OES"), v8::Number::New(isolate, (double ) GL_HALF_FLOAT_OES)); + tmpl->Set(ConvertToV8String(isolate, "HALF_FLOAT_OES"), v8::Integer::New(isolate, GL_HALF_FLOAT_OES)); cache->OES_texture_half_floatTmpl = std::make_unique>(isolate, ctorTmpl); return ctorTmpl; diff --git a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/OES_vertex_array_objectImpl.h b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/OES_vertex_array_objectImpl.h index 3eebc61f2..fa5733dee 100644 --- a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/OES_vertex_array_objectImpl.h +++ b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/OES_vertex_array_objectImpl.h @@ -33,7 +33,7 @@ class OES_vertex_array_objectImpl { tmpl->Set(ConvertToV8String(isolate, "ext_name"), ConvertToV8String(isolate, "OES_vertex_array_object")); tmpl->Set(ConvertToV8String(isolate, "VERTEX_ARRAY_BINDING_OES"), - v8::Number::New(isolate, (double) GL_VERTEX_ARRAY_BINDING_OES)); + v8::Integer::NewFromUnsigned(isolate, GL_VERTEX_ARRAY_BINDING_OES)); tmpl->Set(ConvertToV8String(isolate, "createVertexArrayOES"), v8::FunctionTemplate::New(isolate, &CreateVertexArrayOES)); tmpl->Set(ConvertToV8String(isolate, "deleteVertexArrayOES"), diff --git a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_color_buffer_floatImpl.h b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_color_buffer_floatImpl.h index 95ecf5e56..7f244f3d3 100644 --- a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_color_buffer_floatImpl.h +++ b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_color_buffer_floatImpl.h @@ -29,13 +29,13 @@ class WEBGL_color_buffer_floatImpl { ConvertToV8String(isolate, "WEBGL_color_buffer_float")); tmpl->Set(ConvertToV8String(isolate, "RGBA32F_EXT"), - v8::Number::New(isolate, (double) GL_RGBA32F_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_RGBA32F_EXT)); tmpl->Set(ConvertToV8String(isolate, "RGB32F_EXT"), - v8::Number::New(isolate, (double) GL_RGB32F_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_RGB32F_EXT)); tmpl->Set(ConvertToV8String(isolate, "FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT"), - v8::Number::New(isolate, (double) GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT)); tmpl->Set(ConvertToV8String(isolate, "UNSIGNED_NORMALIZED_EXT"), - v8::Number::New(isolate, (double) GL_UNSIGNED_NORMALIZED_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_UNSIGNED_NORMALIZED_EXT)); cache->WEBGL_color_buffer_floatTmpl = std::make_unique>(isolate, ctorTmpl); return ctorTmpl; diff --git a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_atcImpl.h b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_atcImpl.h index 250ec923d..08e0dc93c 100644 --- a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_atcImpl.h +++ b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_atcImpl.h @@ -28,11 +28,11 @@ class WEBGL_compressed_texture_atcImpl { tmpl->Set(ConvertToV8String(isolate, "ext_name"), ConvertToV8String(isolate, "WEBGL_compressed_texture_atc")); tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_RGB_ATC_WEBGL"), - v8::Number::New(isolate, (double) GL_ATC_RGB_AMD)); + v8::Integer::NewFromUnsigned(isolate, GL_ATC_RGB_AMD)); tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL"), - v8::Number::New(isolate, (double) GL_ATC_RGBA_EXPLICIT_ALPHA_AMD)); + v8::Integer::NewFromUnsigned(isolate, GL_ATC_RGBA_EXPLICIT_ALPHA_AMD)); tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL"), - v8::Number::New(isolate, (double) GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD)); + v8::Integer::NewFromUnsigned(isolate, GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD)); cache->WEBGL_compressed_texture_atcTmpl = std::make_unique>(isolate, ctorTmpl); diff --git a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etc1Impl.h b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etc1Impl.h index 9b7712dea..a9ec2bb7e 100644 --- a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etc1Impl.h +++ b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etc1Impl.h @@ -30,7 +30,7 @@ class WEBGL_compressed_texture_etc1Impl { tmpl->Set(ConvertToV8String(isolate, "ext_name"), ConvertToV8String(isolate, "WEBGL_compressed_texture_etc1")); tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_RGB_ETC1_WEBGL"), - v8::Number::New(isolate, GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG)); + v8::Integer::NewFromUnsigned(isolate, GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG)); cache->WEBGL_compressed_texture_etc1Tmpl = std::make_unique>(isolate, ctorTmpl); diff --git a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etcImpl.h b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etcImpl.h index deed82927..404d31729 100644 --- a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etcImpl.h +++ b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etcImpl.h @@ -27,34 +27,34 @@ class WEBGL_compressed_texture_etcImpl { tmpl->SetInternalFieldCount(1); tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_R11_EAC"), - v8::Number::New(isolate, (double) GL_COMPRESSED_R11_EAC)); + v8::Integer::NewFromUnsigned(isolate, GL_COMPRESSED_R11_EAC)); tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_SIGNED_R11_EAC"), - v8::Number::New(isolate, (double) GL_COMPRESSED_SIGNED_R11_EAC)); + v8::Integer::NewFromUnsigned(isolate, GL_COMPRESSED_SIGNED_R11_EAC)); tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_RG11_EAC"), - v8::Number::New(isolate, (double) GL_COMPRESSED_RG11_EAC)); + v8::Integer::NewFromUnsigned(isolate, GL_COMPRESSED_RG11_EAC)); tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_SIGNED_RG11_EAC"), - v8::Number::New(isolate, (double) GL_COMPRESSED_SIGNED_RG11_EAC)); + v8::Integer::NewFromUnsigned(isolate, GL_COMPRESSED_SIGNED_RG11_EAC)); tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_RGB8_ETC2"), - v8::Number::New(isolate, (double) GL_COMPRESSED_RGB8_ETC2)); + v8::Integer::NewFromUnsigned(isolate, GL_COMPRESSED_RGB8_ETC2)); tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_RGBA8_ETC2_EAC"), - v8::Number::New(isolate, (double) GL_COMPRESSED_RGBA8_ETC2_EAC)); + v8::Integer::NewFromUnsigned(isolate, GL_COMPRESSED_RGBA8_ETC2_EAC)); tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_SRGB8_ETC2"), - v8::Number::New(isolate, (double) GL_COMPRESSED_SRGB8_ETC2)); + v8::Integer::NewFromUnsigned(isolate, GL_COMPRESSED_SRGB8_ETC2)); tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_SRGB8_ALPHA8_ETC2_EAC"), - v8::Number::New(isolate, (double) GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC)); + v8::Integer::NewFromUnsigned(isolate, GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC)); tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2"), - v8::Number::New(isolate, (double) GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2)); + v8::Integer::NewFromUnsigned(isolate, GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2)); tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2"), - v8::Number::New(isolate, (double) GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2)); + v8::Integer::NewFromUnsigned(isolate, GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2)); tmpl->Set(ConvertToV8String(isolate, "ext_name"), ConvertToV8String(isolate, "WEBGL_compressed_texture_etc")); diff --git a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_pvrtcImpl.h b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_pvrtcImpl.h index 903a917e0..626e76a5b 100644 --- a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_pvrtcImpl.h +++ b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_pvrtcImpl.h @@ -28,16 +28,16 @@ class WEBGL_compressed_texture_pvrtcImpl { tmpl->SetInternalFieldCount(1); tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_RGB_PVRTC_4BPPV1_IMG"), - v8::Number::New(isolate, (double) GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG)); + v8::Integer::NewFromUnsigned(isolate, GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG)); tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_RGBA_PVRTC_4BPPV1_IMG"), - v8::Number::New(isolate, (double) GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG)); + v8::Integer::NewFromUnsigned(isolate, GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG)); tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_RGB_PVRTC_2BPPV1_IMG"), - v8::Number::New(isolate, (double) GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG)); + v8::Integer::NewFromUnsigned(isolate, GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG)); tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_RGBA_PVRTC_2BPPV1_IMG"), - v8::Number::New(isolate, (double) GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG)); + v8::Integer::NewFromUnsigned(isolate, GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG)); tmpl->Set(ConvertToV8String(isolate, "ext_name"), ConvertToV8String(isolate, "WEBGL_compressed_texture_pvrtc")); diff --git a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tcImpl.h b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tcImpl.h index dadd3a0ad..013c008e4 100644 --- a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tcImpl.h +++ b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tcImpl.h @@ -27,13 +27,13 @@ class WEBGL_compressed_texture_s3tcImpl { tmpl->SetInternalFieldCount(1); tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_RGB_S3TC_DXT1_EXT"), - v8::Number::New(isolate, (double) GL_COMPRESSED_RGB_S3TC_DXT1_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_COMPRESSED_RGB_S3TC_DXT1_EXT)); tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_RGBA_S3TC_DXT1_EXT"), - v8::Number::New(isolate, (double) GL_COMPRESSED_RGBA_S3TC_DXT1_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT)); tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_RGBA_S3TC_DXT3_EXT"), - v8::Number::New(isolate, (double) GL_COMPRESSED_RGBA_S3TC_DXT3_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT)); tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_RGBA_S3TC_DXT5_EXT"), - v8::Number::New(isolate, (double) GL_COMPRESSED_RGBA_S3TC_DXT5_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT)); tmpl->Set(ConvertToV8String(isolate, "ext_name"), ConvertToV8String(isolate, "WEBGL_compressed_texture_s3tc")); diff --git a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tc_srgbImpl.h b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tc_srgbImpl.h index bf2c8c946..0671734ff 100644 --- a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tc_srgbImpl.h +++ b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tc_srgbImpl.h @@ -27,16 +27,16 @@ class WEBGL_compressed_texture_s3tc_srgbImpl { tmpl->SetInternalFieldCount(1); tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_SRGB_S3TC_DXT1_EXT"), - v8::Number::New(isolate, (double) GL_COMPRESSED_SRGB_S3TC_DXT1_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_COMPRESSED_SRGB_S3TC_DXT1_EXT)); tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT"), - v8::Number::New(isolate, (double) GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT)); tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT"), - v8::Number::New(isolate, (double) GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT)); tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT"), - v8::Number::New(isolate, (double) GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT)); tmpl->Set(ConvertToV8String(isolate, "ext_name"), ConvertToV8String(isolate, "WEBGL_compressed_texture_s3tc_srgb")); diff --git a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_depth_textureImpl.h b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_depth_textureImpl.h index b498f36b2..5c62ce79e 100644 --- a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_depth_textureImpl.h +++ b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_depth_textureImpl.h @@ -27,7 +27,7 @@ class WEBGL_depth_textureImpl { auto tmpl = ctorTmpl->InstanceTemplate(); tmpl->SetInternalFieldCount(1); - tmpl->Set(ConvertToV8String(isolate, "UNSIGNED_INT_24_8_WEBGL"), v8::Number::New(isolate, 0x84FA)); + tmpl->Set(ConvertToV8String(isolate, "UNSIGNED_INT_24_8_WEBGL"), v8::Integer::NewFromUnsigned(isolate, 0x84FA)); tmpl->Set(ConvertToV8String(isolate, "ext_name"), ConvertToV8String(isolate, "WEBGL_depth_texture")); diff --git a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_draw_buffersImpl.cpp b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_draw_buffersImpl.cpp index 5c7b9cab0..e7ec4228d 100644 --- a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_draw_buffersImpl.cpp +++ b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_draw_buffersImpl.cpp @@ -4,12 +4,12 @@ #include "WEBGL_draw_buffersImpl.h" -WEBGL_draw_buffersImpl::WEBGL_draw_buffersImpl(WEBGL_draw_buffers* buffers) : buffers_(buffers) { +WEBGL_draw_buffersImpl::WEBGL_draw_buffersImpl(WEBGL_draw_buffers *buffers) : buffers_(buffers) { } void WEBGL_draw_buffersImpl::DrawBuffersWEBGL( - const v8::FunctionCallbackInfo &args) { + const v8::FunctionCallbackInfo &args) { WEBGL_draw_buffersImpl *ptr = GetPointer(args.This()); if (ptr == nullptr) { return; @@ -25,18 +25,10 @@ void WEBGL_draw_buffersImpl::DrawBuffersWEBGL( buf.reserve(len); for (int j = 0; j < len; ++j) { auto item = buffers->Get(context, j).ToLocalChecked(); - if (!item->IsNumber()) { - // todo verify - buf.push_back(0); - } else { - buf.push_back( - (uint32_t) item->NumberValue(context).ToChecked()); - } - + buf.push_back(item->Uint32Value(context).ToChecked()); } - - - canvas_native_webgl_draw_buffers_draw_buffers_webgl(buf.data(), buf.size(),ptr->GetDrawBuffers()); + canvas_native_webgl_draw_buffers_draw_buffers_webgl(buf.data(), buf.size(), + ptr->GetDrawBuffers()); } diff --git a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_draw_buffersImpl.h b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_draw_buffersImpl.h index 0c89266f1..3e767a740 100644 --- a/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_draw_buffersImpl.h +++ b/packages/canvas/platforms/ios/src/cpp/webgl/extensions/WEBGL_draw_buffersImpl.h @@ -12,9 +12,10 @@ class WEBGL_draw_buffersImpl { public: - WEBGL_draw_buffersImpl(WEBGL_draw_buffers* buffers); + WEBGL_draw_buffersImpl(WEBGL_draw_buffers *buffers); + ~WEBGL_draw_buffersImpl() { - // todo + // todo } static v8::Local GetCtor(v8::Isolate *isolate) { @@ -33,76 +34,76 @@ class WEBGL_draw_buffersImpl { tmpl->Set(ConvertToV8String(isolate, "drawBuffersWEBGL"), v8::FunctionTemplate::New(isolate, &DrawBuffersWEBGL)); - + tmpl->Set(ConvertToV8String(isolate, "COLOR_ATTACHMENT0_WEBGL"), - v8::Number::New(isolate, GL_COLOR_ATTACHMENT0_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_COLOR_ATTACHMENT0_EXT)); tmpl->Set(ConvertToV8String(isolate, "COLOR_ATTACHMENT1_WEBGL"), - v8::Number::New(isolate, GL_COLOR_ATTACHMENT1_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_COLOR_ATTACHMENT1_EXT)); tmpl->Set(ConvertToV8String(isolate, "COLOR_ATTACHMENT2_WEBGL"), - v8::Number::New(isolate, GL_COLOR_ATTACHMENT2_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_COLOR_ATTACHMENT2_EXT)); tmpl->Set(ConvertToV8String(isolate, "COLOR_ATTACHMENT3_WEBGL"), - v8::Number::New(isolate, GL_COLOR_ATTACHMENT3_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_COLOR_ATTACHMENT3_EXT)); tmpl->Set(ConvertToV8String(isolate, "COLOR_ATTACHMENT4_WEBGL"), - v8::Number::New(isolate, GL_COLOR_ATTACHMENT4_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_COLOR_ATTACHMENT4_EXT)); tmpl->Set(ConvertToV8String(isolate, "COLOR_ATTACHMENT5_WEBGL"), - v8::Number::New(isolate, GL_COLOR_ATTACHMENT5_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_COLOR_ATTACHMENT5_EXT)); tmpl->Set(ConvertToV8String(isolate, "COLOR_ATTACHMENT6_WEBGL"), - v8::Number::New(isolate, GL_COLOR_ATTACHMENT6_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_COLOR_ATTACHMENT6_EXT)); tmpl->Set(ConvertToV8String(isolate, "COLOR_ATTACHMENT7_WEBGL"), - v8::Number::New(isolate, GL_COLOR_ATTACHMENT7_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_COLOR_ATTACHMENT7_EXT)); tmpl->Set(ConvertToV8String(isolate, "COLOR_ATTACHMENT8_WEBGL"), - v8::Number::New(isolate, GL_COLOR_ATTACHMENT8_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_COLOR_ATTACHMENT8_EXT)); tmpl->Set(ConvertToV8String(isolate, "COLOR_ATTACHMENT9_WEBGL"), - v8::Number::New(isolate, GL_COLOR_ATTACHMENT9_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_COLOR_ATTACHMENT9_EXT)); tmpl->Set(ConvertToV8String(isolate, "COLOR_ATTACHMENT10_WEBGL"), - v8::Number::New(isolate, GL_COLOR_ATTACHMENT10_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_COLOR_ATTACHMENT10_EXT)); tmpl->Set(ConvertToV8String(isolate, "COLOR_ATTACHMENT11_WEBGL"), - v8::Number::New(isolate, GL_COLOR_ATTACHMENT11_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_COLOR_ATTACHMENT11_EXT)); tmpl->Set(ConvertToV8String(isolate, "COLOR_ATTACHMENT12_WEBGL"), - v8::Number::New(isolate, GL_COLOR_ATTACHMENT12_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_COLOR_ATTACHMENT12_EXT)); tmpl->Set(ConvertToV8String(isolate, "COLOR_ATTACHMENT13_WEBGL"), - v8::Number::New(isolate, GL_COLOR_ATTACHMENT13_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_COLOR_ATTACHMENT13_EXT)); tmpl->Set(ConvertToV8String(isolate, "COLOR_ATTACHMENT14_WEBGL"), - v8::Number::New(isolate, GL_COLOR_ATTACHMENT14_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_COLOR_ATTACHMENT14_EXT)); tmpl->Set(ConvertToV8String(isolate, "COLOR_ATTACHMENT15_WEBGL"), - v8::Number::New(isolate, GL_COLOR_ATTACHMENT15_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_COLOR_ATTACHMENT15_EXT)); tmpl->Set(ConvertToV8String(isolate, "DRAW_BUFFER0_WEBGL"), - v8::Number::New(isolate, GL_DRAW_BUFFER0_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_DRAW_BUFFER0_EXT)); tmpl->Set(ConvertToV8String(isolate, "DRAW_BUFFER1_WEBGL"), - v8::Number::New(isolate, GL_DRAW_BUFFER1_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_DRAW_BUFFER1_EXT)); tmpl->Set(ConvertToV8String(isolate, "DRAW_BUFFER2_WEBGL"), - v8::Number::New(isolate, GL_DRAW_BUFFER2_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_DRAW_BUFFER2_EXT)); tmpl->Set(ConvertToV8String(isolate, "DRAW_BUFFER3_WEBGL"), - v8::Number::New(isolate, GL_DRAW_BUFFER3_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_DRAW_BUFFER3_EXT)); tmpl->Set(ConvertToV8String(isolate, "DRAW_BUFFER4_WEBGL"), - v8::Number::New(isolate, GL_DRAW_BUFFER4_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_DRAW_BUFFER4_EXT)); tmpl->Set(ConvertToV8String(isolate, "DRAW_BUFFER5_WEBGL"), - v8::Number::New(isolate, GL_DRAW_BUFFER5_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_DRAW_BUFFER5_EXT)); tmpl->Set(ConvertToV8String(isolate, "DRAW_BUFFER6_WEBGL"), - v8::Number::New(isolate, GL_DRAW_BUFFER6_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_DRAW_BUFFER6_EXT)); tmpl->Set(ConvertToV8String(isolate, "DRAW_BUFFER7_WEBGL"), - v8::Number::New(isolate, GL_DRAW_BUFFER7_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_DRAW_BUFFER7_EXT)); tmpl->Set(ConvertToV8String(isolate, "DRAW_BUFFER8_WEBGL"), - v8::Number::New(isolate, GL_DRAW_BUFFER8_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_DRAW_BUFFER8_EXT)); tmpl->Set(ConvertToV8String(isolate, "DRAW_BUFFER9_WEBGL"), - v8::Number::New(isolate, GL_DRAW_BUFFER9_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_DRAW_BUFFER9_EXT)); tmpl->Set(ConvertToV8String(isolate, "DRAW_BUFFER10_WEBGL"), - v8::Number::New(isolate, GL_DRAW_BUFFER10_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_DRAW_BUFFER10_EXT)); tmpl->Set(ConvertToV8String(isolate, "DRAW_BUFFER11_WEBGL"), - v8::Number::New(isolate, GL_DRAW_BUFFER11_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_DRAW_BUFFER11_EXT)); tmpl->Set(ConvertToV8String(isolate, "DRAW_BUFFER12_WEBGL"), - v8::Number::New(isolate, GL_DRAW_BUFFER12_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_DRAW_BUFFER12_EXT)); tmpl->Set(ConvertToV8String(isolate, "DRAW_BUFFER13_WEBGL"), - v8::Number::New(isolate, GL_DRAW_BUFFER13_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_DRAW_BUFFER13_EXT)); tmpl->Set(ConvertToV8String(isolate, "DRAW_BUFFER14_WEBGL"), - v8::Number::New(isolate, GL_DRAW_BUFFER14_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_DRAW_BUFFER14_EXT)); tmpl->Set(ConvertToV8String(isolate, "DRAW_BUFFER15_WEBGL"), - v8::Number::New(isolate, GL_DRAW_BUFFER15_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_DRAW_BUFFER15_EXT)); tmpl->Set(ConvertToV8String(isolate, "MAX_COLOR_ATTACHMENTS_WEBGL"), - v8::Number::New(isolate, GL_MAX_COLOR_ATTACHMENTS_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_MAX_COLOR_ATTACHMENTS_EXT)); tmpl->Set(ConvertToV8String(isolate, "MAX_DRAW_BUFFERS_WEBGL"), - v8::Number::New(isolate, GL_MAX_DRAW_BUFFERS_EXT)); + v8::Integer::NewFromUnsigned(isolate, GL_MAX_DRAW_BUFFERS_EXT)); tmpl->Set(ConvertToV8String(isolate, "ext_name"), ConvertToV8String(isolate, "WEBGL_draw_buffers")); @@ -134,10 +135,10 @@ class WEBGL_draw_buffersImpl { static void DrawBuffersWEBGL(const v8::FunctionCallbackInfo &args); - WEBGL_draw_buffers* GetDrawBuffers() { + WEBGL_draw_buffers *GetDrawBuffers() { return this->buffers_; } private: - WEBGL_draw_buffers* buffers_; + WEBGL_draw_buffers *buffers_; }; diff --git a/packages/canvas/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.cpp b/packages/canvas/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.cpp index d4a5f99fa..29599d068 100644 --- a/packages/canvas/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.cpp +++ b/packages/canvas/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.cpp @@ -4,12 +4,12 @@ #include "WebGL2RenderingContext.h" -WebGL2RenderingContext::WebGL2RenderingContext(WebGLState* state) : WebGLRenderingContext( +WebGL2RenderingContext::WebGL2RenderingContext(WebGLState *state) : WebGLRenderingContext( state, WebGLRenderingVersion::V2) { } -WebGL2RenderingContext::WebGL2RenderingContext(WebGLState* state, +WebGL2RenderingContext::WebGL2RenderingContext(WebGLState *state, WebGLRenderingVersion version) : WebGLRenderingContext(state, version) { } @@ -61,7 +61,7 @@ void WebGL2RenderingContext::BeginQuery(const v8::FunctionCallbackInfoNumberValue(context).ToChecked(); + auto target = args[0]->Uint32Value(context).ToChecked(); auto query = WebGLQuery::GetPointer(value.As()); if (query != nullptr) { @@ -87,7 +87,7 @@ WebGL2RenderingContext::BeginTransformFeedback(const v8::FunctionCallbackInfoIsNumber()) { canvas_native_webgl2_begin_transform_feedback( - (uint32_t) args[0]->NumberValue(context).ToChecked(), + args[0]->Uint32Value(context).ToChecked(), ptr->GetState() ); } @@ -106,8 +106,8 @@ void WebGL2RenderingContext::BindBufferBase(const v8::FunctionCallbackInfoNumberValue(context).ToChecked(); - auto index = (uint32_t) args[1]->NumberValue(context).ToChecked(); + auto target = args[0]->Uint32Value(context).ToChecked(); + auto index = args[1]->Uint32Value(context).ToChecked(); auto buffer = WebGLBuffer::GetPointer(bufferValue.As()); @@ -132,8 +132,8 @@ void WebGL2RenderingContext::BindBufferRange(const v8::FunctionCallbackInfo 4 && type == NativeType::WebGLBuffer) { - auto target = (uint32_t) args[0]->NumberValue(context).ToChecked(); - auto index = (uint32_t) args[1]->NumberValue(context).ToChecked(); + auto target = args[0]->Uint32Value(context).ToChecked(); + auto index = args[1]->Uint32Value(context).ToChecked(); auto offset = args[3]->NumberValue(context).ToChecked(); auto size = args[4]->NumberValue(context).ToChecked(); auto buffer = WebGLBuffer::GetPointer(bufferValue.As()); @@ -160,7 +160,7 @@ void WebGL2RenderingContext::BindSampler(const v8::FunctionCallbackInfoNumberValue(context).ToChecked(); + auto unit = args[0]->Uint32Value(context).ToChecked(); auto sampler = WebGLSampler::GetPointer(samplerValue.As()); canvas_native_webgl2_bind_sampler( @@ -185,7 +185,7 @@ WebGL2RenderingContext::BindTransformFeedback(const v8::FunctionCallbackInfoNumberValue(context).ToChecked(); + auto target = args[0]->Uint32Value(context).ToChecked(); auto transformFeedback = WebGLTransformFeedback::GetPointer( transformFeedbackValue.As()); @@ -237,20 +237,20 @@ void WebGL2RenderingContext::BlitFramebuffer(const v8::FunctionCallbackInfoGetCurrentContext(); if (args.Length() > 9) { - auto srcX0 = (int32_t) args[0]->NumberValue(context).ToChecked(); - auto srcY0 = (int32_t) args[1]->NumberValue(context).ToChecked(); + auto srcX0 = args[0]->Int32Value(context).ToChecked(); + auto srcY0 = args[1]->Int32Value(context).ToChecked(); - auto srcX1 = (int32_t) args[2]->NumberValue(context).ToChecked(); - auto srcY1 = (int32_t) args[3]->NumberValue(context).ToChecked(); + auto srcX1 = args[2]->Int32Value(context).ToChecked(); + auto srcY1 = args[3]->Int32Value(context).ToChecked(); - auto dstX0 = (int32_t) args[4]->NumberValue(context).ToChecked(); - auto dstY0 = (int32_t) args[5]->NumberValue(context).ToChecked(); + auto dstX0 = args[4]->Int32Value(context).ToChecked(); + auto dstY0 = args[5]->Int32Value(context).ToChecked(); - auto dstX1 = (int32_t) args[6]->NumberValue(context).ToChecked(); - auto dstY1 = (int32_t) args[7]->NumberValue(context).ToChecked(); + auto dstX1 = args[6]->Int32Value(context).ToChecked(); + auto dstY1 = args[7]->Int32Value(context).ToChecked(); - auto mask = (uint32_t) args[8]->NumberValue(context).ToChecked(); - auto filter = (uint32_t) args[9]->NumberValue(context).ToChecked(); + auto mask = args[8]->Uint32Value(context).ToChecked(); + auto filter = args[9]->Uint32Value(context).ToChecked(); canvas_native_webgl2_blit_framebuffer( srcX0, srcY0, @@ -276,56 +276,46 @@ void WebGL2RenderingContext::ClearBufferfv(const v8::FunctionCallbackInfoGetCurrentContext(); - auto bufferValue = args[0]; - auto type = GetNativeType(isolate, bufferValue); auto values = args[2]; - if (args.Length() > 2 && type == NativeType::WebGLBuffer && - args[1]->IsObject()) { - auto drawbuffer = (int32_t) args[1]->NumberValue(context).ToChecked(); - auto buffer = WebGLBuffer::GetPointer(bufferValue.As()); - if (values->IsArray()) { - auto array = values.As(); - auto len = array->Length(); - std::vector buf; - buf.reserve(len); - for (int j = 0; j < len; ++j) { - auto item = array->Get( - context, j).ToLocalChecked(); - if (!item->IsNumber()) { - buf.push_back( - std::nanf("")); - } else { - buf.push_back( - static_cast(item->NumberValue(context).ToChecked()) - ); - } - } - - canvas_native_webgl2_clear_bufferfv( - buffer->GetBuffer(), - drawbuffer, - buf.data(), - buf.size(), - ptr->GetState() + auto buffer = args[0]->Uint32Value(context).ToChecked(); + auto drawbuffer = args[1]->Int32Value(context).ToChecked(); + if (values->IsArray()) { + auto array = values.As(); + auto len = array->Length(); + std::vector buf; + buf.reserve(len); + for (int j = 0; j < len; ++j) { + auto item = array->Get( + context, j).ToLocalChecked(); + buf.push_back( + static_cast(item->NumberValue(context).ToChecked()) ); + } - } else if (values->IsFloat32Array()) { - auto buf = values.As(); - auto array = buf->Buffer(); - auto offset = buf->ByteOffset(); - auto size = buf->Length(); - auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; - auto data = static_cast((void*) data_ptr); + canvas_native_webgl2_clear_bufferfv( + buffer, + drawbuffer, + buf.data(), + buf.size(), + ptr->GetState() + ); + } else if (values->IsFloat32Array()) { + auto buf = values.As(); + auto array = buf->Buffer(); + auto offset = buf->ByteOffset(); + auto size = buf->Length(); + auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; + auto data = static_cast((void *) data_ptr); - canvas_native_webgl2_clear_bufferfv( - buffer->GetBuffer(), - drawbuffer, - data, - size, - ptr->GetState() - ); - } + + canvas_native_webgl2_clear_bufferfv( + buffer, + drawbuffer, + data, + size, + ptr->GetState() + ); } } @@ -338,55 +328,49 @@ void WebGL2RenderingContext::ClearBufferiv(const v8::FunctionCallbackInfoGetCurrentContext(); - auto bufferValue = args[0]; - auto type = GetNativeType(isolate, bufferValue); auto values = args[2]; - if (args.Length() > 2 && type == NativeType::WebGLBuffer && - args[1]->IsObject()) { - auto drawbuffer = (int32_t) args[1]->NumberValue(context).ToChecked(); - auto buffer = WebGLBuffer::GetPointer(bufferValue.As()); - if (values->IsArray()) { - auto array = values.As(); - auto len = array->Length(); - std::vector buf; - buf.reserve(len); - for (int j = 0; j < len; ++j) { - auto item = array->Get( - context, j).ToLocalChecked(); - buf.push_back( - static_cast(item->NumberValue(context).ToChecked()) - ); - } - - canvas_native_webgl2_clear_bufferiv( - buffer->GetBuffer(), - drawbuffer, - buf.data(), - buf.size(), - ptr->GetState() + auto buffer = args[0]->Uint32Value(context).ToChecked(); + auto drawbuffer = args[1]->Int32Value(context).ToChecked(); + if (values->IsArray()) { + auto array = values.As(); + auto len = array->Length(); + std::vector buf; + buf.reserve(len); + for (int j = 0; j < len; ++j) { + auto item = array->Get( + context, j).ToLocalChecked(); + buf.push_back( + item->Int32Value(context).ToChecked() ); + } - } else if (values->IsInt32Array()) { - auto buf = values.As(); - auto array = buf->Buffer(); - auto offset = buf->ByteOffset(); - auto size = buf->Length(); - auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; - auto data = static_cast((void*) data_ptr); + canvas_native_webgl2_clear_bufferiv( + buffer, + drawbuffer, + buf.data(), + buf.size(), + ptr->GetState() + ); + } else if (values->IsInt32Array()) { + auto buf = values.As(); + auto array = buf->Buffer(); + auto offset = buf->ByteOffset(); + auto size = buf->Length(); + auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; + auto data = static_cast((void *) data_ptr); - canvas_native_webgl2_clear_bufferiv( - buffer->GetBuffer(), - drawbuffer, - data, - size, - ptr->GetState() - ); - } + canvas_native_webgl2_clear_bufferiv( + buffer, + drawbuffer, + data, + size, + ptr->GetState() + ); } } @@ -399,23 +383,17 @@ void WebGL2RenderingContext::ClearBufferfi(const v8::FunctionCallbackInfoGetCurrentContext(); - auto bufferValue = args[0]; - auto type = GetNativeType(isolate, bufferValue); - if (args.Length() > 3 && type == NativeType::WebGLBuffer) { - auto buffer = WebGLBuffer::GetPointer(bufferValue.As()); - if (buffer != nullptr) { - auto drawbuffer = (int32_t) args[1]->NumberValue(context).ToChecked(); - auto depth = args[2]->NumberValue(context).ToChecked(); - auto stencil = (int32_t) args[3]->NumberValue(context).ToChecked(); - canvas_native_webgl2_clear_bufferfi( - buffer->GetBuffer(), - drawbuffer, - static_cast(depth), - stencil, - ptr->GetState() - ); - } - } + auto buffer = args[0]->Uint32Value(context).ToChecked(); + auto drawbuffer = args[1]->Int32Value(context).ToChecked(); + auto depth = args[2]->NumberValue(context).ToChecked(); + auto stencil = args[3]->Int32Value(context).ToChecked(); + canvas_native_webgl2_clear_bufferfi( + buffer, + drawbuffer, + static_cast(depth), + stencil, + ptr->GetState() + ); } void WebGL2RenderingContext::ClearBufferuiv(const v8::FunctionCallbackInfo &args) { @@ -427,52 +405,48 @@ void WebGL2RenderingContext::ClearBufferuiv(const v8::FunctionCallbackInfoGetCurrentContext(); - auto bufferValue = args[0]; - auto type = GetNativeType(isolate, bufferValue); - auto values = args[2]; - if (args.Length() > 2 && type == NativeType::WebGLBuffer && - args[1]->IsObject()) { - auto drawbuffer = (int32_t) args[1]->NumberValue(context).ToChecked(); - auto buffer = WebGLBuffer::GetPointer(bufferValue.As()); - if (values->IsArray()) { - auto array = values.As(); - auto len = array->Length(); - std::vector buf; - buf.reserve(len); - for (int j = 0; j < len; ++j) { - auto item = array->Get( - context, j).ToLocalChecked(); - buf.push_back( - static_cast(item->NumberValue(context).ToChecked()) - ); - } + auto values = args[2]; - canvas_native_webgl2_clear_bufferuiv( - buffer->GetBuffer(), - drawbuffer, - buf.data(), - buf.size(), - ptr->GetState() + auto buffer = args[0]->Uint32Value(context).ToChecked(); + auto drawbuffer = args[1]->Int32Value(context).ToChecked(); + if (values->IsArray()) { + auto array = values.As(); + auto len = array->Length(); + std::vector buf; + buf.reserve(len); + for (int j = 0; j < len; ++j) { + auto item = array->Get( + context, j).ToLocalChecked(); + buf.push_back( + item->Uint32Value(context).ToChecked() ); + } - } else if (values->IsUint32Array()) { - auto buf = values.As(); - auto array = buf->Buffer(); - auto offset = buf->ByteOffset(); - auto size = buf->Length(); - auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; - auto data = static_cast((void*) data_ptr); + canvas_native_webgl2_clear_bufferuiv( + buffer, + drawbuffer, + buf.data(), + buf.size(), + ptr->GetState() + ); + + } else if (values->IsUint32Array()) { + auto buf = values.As(); + auto array = buf->Buffer(); + auto offset = buf->ByteOffset(); + auto size = buf->Length(); + auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; + auto data = static_cast((void *) data_ptr); - canvas_native_webgl2_clear_bufferuiv( - buffer->GetBuffer(), - drawbuffer, - data, size, - ptr->GetState() - ); - } + canvas_native_webgl2_clear_bufferuiv( + buffer, + drawbuffer, + data, size, + ptr->GetState() + ); } } @@ -490,7 +464,7 @@ void WebGL2RenderingContext::ClientWaitSync(const v8::FunctionCallbackInfo 2 && type == NativeType::WebGLSync) { auto sync = WebGLSyncImpl::GetPointer(syncValue.As()); if (sync != nullptr) { - auto flags = (uint32_t) args[1]->NumberValue(context).ToChecked(); + auto flags = args[1]->Uint32Value(context).ToChecked(); auto timeout = args[2]->NumberValue(context).ToChecked(); auto ret = canvas_native_webgl2_client_wait_sync( sync->GetSync(), @@ -499,7 +473,7 @@ void WebGL2RenderingContext::ClientWaitSync(const v8::FunctionCallbackInfoGetState() ); - args.GetReturnValue().Set((int32_t) ret); + args.GetReturnValue().Set(ret); return; } } @@ -518,15 +492,15 @@ WebGL2RenderingContext::CompressedTexSubImage3D(const v8::FunctionCallbackInfoGetCurrentContext(); if (args.Length() > 8) { - auto target = (uint32_t) args[0]->NumberValue(context).ToChecked(); - auto level = (int32_t) args[1]->NumberValue(context).ToChecked(); - auto xoffset = (int32_t) args[2]->NumberValue(context).ToChecked(); - auto yoffset = (int32_t) args[3]->NumberValue(context).ToChecked(); - auto zoffset = (int32_t) args[4]->NumberValue(context).ToChecked(); - auto width = (int32_t) args[5]->NumberValue(context).ToChecked(); - auto height = (int32_t) args[6]->NumberValue(context).ToChecked(); - auto depth = (int32_t) args[7]->NumberValue(context).ToChecked(); - auto format = (uint32_t) args[8]->NumberValue(context).ToChecked(); + auto target = args[0]->Uint32Value(context).ToChecked(); + auto level = args[1]->Int32Value(context).ToChecked(); + auto xoffset = args[2]->Int32Value(context).ToChecked(); + auto yoffset = args[3]->Int32Value(context).ToChecked(); + auto zoffset = args[4]->Int32Value(context).ToChecked(); + auto width = args[5]->Int32Value(context).ToChecked(); + auto height = args[6]->Int32Value(context).ToChecked(); + auto depth = args[7]->Int32Value(context).ToChecked(); + auto format = args[8]->Uint32Value(context).ToChecked(); auto imageSizeOrBufValue = args[0]; if (args[9]->IsObject()) { @@ -535,8 +509,8 @@ WebGL2RenderingContext::CompressedTexSubImage3D(const v8::FunctionCallbackInfoBuffer(); auto offset = buf->ByteOffset(); auto size = buf->ByteLength(); - auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; - auto data = static_cast((void*) data_ptr); + auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; + auto data = static_cast((void *) data_ptr); size_t srcOffset = 0; if (args[10]->IsNumber()) { @@ -567,10 +541,10 @@ WebGL2RenderingContext::CompressedTexSubImage3D(const v8::FunctionCallbackInfoNumberValue(context).ToChecked(); + auto imageSizeOrBuf = imageSizeOrBufValue->Int32Value(context).ToChecked(); auto offset = 0; if (args[10]->IsNumber()) { - offset = (int32_t) args[10]->NumberValue(context).ToChecked(); + offset = args[10]->Int32Value(context).ToChecked(); } canvas_native_webgl2_compressed_tex_sub_image3d_none( target, @@ -600,8 +574,8 @@ void WebGL2RenderingContext::CopyBufferSubData(const v8::FunctionCallbackInfoGetCurrentContext(); if (args.Length() > 4) { - auto readTarget = (uint32_t) args[0]->NumberValue(context).ToChecked(); - auto writeTarget = (uint32_t) args[1]->NumberValue(context).ToChecked(); + auto readTarget = args[0]->Uint32Value(context).ToChecked(); + auto writeTarget = args[1]->Uint32Value(context).ToChecked(); auto readOffset = args[2]->NumberValue(context).ToChecked(); auto writeOffset = args[3]->NumberValue(context).ToChecked(); auto size = args[4]->NumberValue(context).ToChecked(); @@ -626,15 +600,15 @@ void WebGL2RenderingContext::CopyTexSubImage3D(const v8::FunctionCallbackInfoGetCurrentContext(); if (args.Length() > 8) { - auto target = (uint32_t) args[0]->NumberValue(context).ToChecked(); - auto level = (int32_t) args[1]->NumberValue(context).ToChecked(); - auto xoffset = (int32_t) args[2]->NumberValue(context).ToChecked(); - auto yoffset = (int32_t) args[3]->NumberValue(context).ToChecked(); - auto zoffset = (int32_t) args[4]->NumberValue(context).ToChecked(); - auto x = (int32_t) args[5]->NumberValue(context).ToChecked(); - auto y = (int32_t) args[6]->NumberValue(context).ToChecked(); - auto width = (int32_t) args[7]->NumberValue(context).ToChecked(); - auto height = (int32_t) args[8]->NumberValue(context).ToChecked(); + auto target = args[0]->Uint32Value(context).ToChecked(); + auto level = args[1]->Int32Value(context).ToChecked(); + auto xoffset = args[2]->Int32Value(context).ToChecked(); + auto yoffset = args[3]->Int32Value(context).ToChecked(); + auto zoffset = args[4]->Int32Value(context).ToChecked(); + auto x = args[5]->Int32Value(context).ToChecked(); + auto y = args[6]->Int32Value(context).ToChecked(); + auto width = args[7]->Int32Value(context).ToChecked(); + auto height = args[8]->Int32Value(context).ToChecked(); canvas_native_webgl2_copy_tex_sub_image3d( target, level, @@ -845,10 +819,10 @@ void WebGL2RenderingContext::DrawArraysInstanced(const v8::FunctionCallbackInfo< auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto mode = (uint32_t) args[0]->NumberValue(context).ToChecked(); - auto first = (int32_t) args[1]->NumberValue(context).ToChecked(); - auto count_ = (int32_t) args[2]->NumberValue(context).ToChecked(); - auto instanceCount = (int32_t) args[3]->NumberValue(context).ToChecked(); + auto mode = args[0]->Uint32Value(context).ToChecked(); + auto first = args[1]->Int32Value(context).ToChecked(); + auto count_ = args[2]->Int32Value(context).ToChecked(); + auto instanceCount = args[3]->Int32Value(context).ToChecked(); canvas_native_webgl2_draw_arrays_instanced( mode, first, @@ -878,12 +852,11 @@ void WebGL2RenderingContext::DrawBuffers(const v8::FunctionCallbackInfoGet( context, j).ToLocalChecked(); - buf.emplace_back( - (uint32_t) item->NumberValue(context).ToChecked()); + buf.emplace_back(item->Uint32Value(context).ToChecked()); } canvas_native_webgl2_draw_buffers( - buf.data(), buf.size(), + buf.data(), buf.size(), ptr->GetState()); } } @@ -898,11 +871,11 @@ WebGL2RenderingContext::DrawElementsInstanced(const v8::FunctionCallbackInfoGetCurrentContext(); - auto mode = (uint32_t) args[0]->NumberValue(context).ToChecked(); - auto count_ = (int32_t) args[1]->NumberValue(context).ToChecked(); - auto type = (uint32_t) args[2]->NumberValue(context).ToChecked(); + auto mode = args[0]->Uint32Value(context).ToChecked(); + auto count_ = args[1]->Int32Value(context).ToChecked(); + auto type = args[2]->Uint32Value(context).ToChecked(); auto offset = args[3]->NumberValue(context).ToChecked(); - auto instanceCount = (int32_t) args[4]->NumberValue(context).ToChecked(); + auto instanceCount = args[4]->Int32Value(context).ToChecked(); canvas_native_webgl2_draw_elements_instanced( mode, count_, @@ -924,11 +897,11 @@ void WebGL2RenderingContext::DrawRangeElements(const v8::FunctionCallbackInfoGetCurrentContext(); - auto mode = (uint32_t) args[0]->NumberValue(context).ToChecked(); - auto start = (uint32_t) args[1]->NumberValue(context).ToChecked(); - auto end = (uint32_t) args[2]->NumberValue(context).ToChecked(); - auto count_ = (int32_t) args[3]->NumberValue(context).ToChecked(); - auto type = (uint32_t) args[4]->NumberValue(context).ToChecked(); + auto mode = args[0]->Uint32Value(context).ToChecked(); + auto start = args[1]->Uint32Value(context).ToChecked(); + auto end = args[2]->Uint32Value(context).ToChecked(); + auto count_ = args[3]->Int32Value(context).ToChecked(); + auto type = args[4]->Uint32Value(context).ToChecked(); auto offset = args[5]->NumberValue(context).ToChecked(); canvas_native_webgl2_draw_range_elements( mode, @@ -953,7 +926,7 @@ void WebGL2RenderingContext::EndQuery(const v8::FunctionCallbackInfo auto context = isolate->GetCurrentContext(); if (args[0]->IsNumber()) { - auto target = (uint32_t) args[0]->NumberValue(context).ToChecked(); + auto target = args[0]->Uint32Value(context).ToChecked(); canvas_native_webgl2_end_query(target, ptr->GetState()); } @@ -982,8 +955,8 @@ void WebGL2RenderingContext::FenceSync(const v8::FunctionCallbackInfo auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto condition = (uint32_t) args[0]->NumberValue(context).ToChecked(); - auto flags = (uint32_t) args[1]->NumberValue(context).ToChecked(); + auto condition = args[0]->Uint32Value(context).ToChecked(); + auto flags = args[1]->Uint32Value(context).ToChecked(); auto sync = canvas_native_webgl2_fence_sync( condition, flags, @@ -1009,11 +982,11 @@ WebGL2RenderingContext::FramebufferTextureLayer(const v8::FunctionCallbackInfoNumberValue(context).ToChecked(); - auto attachment = (uint32_t) args[1]->NumberValue(context).ToChecked(); + auto target = args[0]->Uint32Value(context).ToChecked(); + auto attachment = args[1]->Uint32Value(context).ToChecked(); auto texture = WebGLTexture::GetPointer(textureValue.As()); - auto level = (int32_t) args[3]->NumberValue(context).ToChecked(); - auto layer = (int32_t) args[4]->NumberValue(context).ToChecked(); + auto level = args[3]->Int32Value(context).ToChecked(); + auto layer = args[4]->Int32Value(context).ToChecked(); if (texture != nullptr) { canvas_native_webgl2_framebuffer_texture_layer( target, @@ -1044,13 +1017,13 @@ WebGL2RenderingContext::GetActiveUniformBlockName(const v8::FunctionCallbackInfo if (type == NativeType::WebGLProgram) { auto program = WebGLProgram::GetPointer(programValue.As()); if (program != nullptr) { - auto uniformBlockIndex = (uint32_t) args[1]->NumberValue(context).ToChecked(); + auto uniformBlockIndex = args[1]->Uint32Value(context).ToChecked(); auto name = canvas_native_webgl2_get_active_uniform_block_name( program->GetProgram(), uniformBlockIndex, ptr->GetState() ); - args.GetReturnValue().Set(ConvertToV8OneByteString(isolate, (char*)name)); + args.GetReturnValue().Set(ConvertToV8OneByteString(isolate, (char *) name)); return; } @@ -1077,8 +1050,8 @@ void WebGL2RenderingContext::GetActiveUniformBlockParameter( auto program = WebGLProgram::GetPointer(programValue.As()); if (program != nullptr) { - auto uniformBlockIndex = (uint32_t) args[1]->NumberValue(context).ToChecked(); - auto pname = (uint32_t) args[2]->NumberValue(context).ToChecked(); + auto uniformBlockIndex = args[1]->Uint32Value(context).ToChecked(); + auto pname = args[2]->Uint32Value(context).ToChecked(); auto ret = canvas_native_webgl2_get_active_uniform_block_parameter( program->GetProgram(), uniformBlockIndex, @@ -1098,7 +1071,7 @@ void WebGL2RenderingContext::GetActiveUniformBlockParameter( auto value = canvas_native_webgl_result_get_u32_array( ret); - auto buf = (uint8_t*)canvas_native_u32_buffer_get_bytes(value); + auto buf = (uint8_t *) canvas_native_u32_buffer_get_bytes(value); auto size = canvas_native_u32_buffer_get_length(value); auto bytes_size = size * sizeof(uint32_t); @@ -1106,7 +1079,8 @@ void WebGL2RenderingContext::GetActiveUniformBlockParameter( [](void *data, size_t length, void *deleter_data) { if (deleter_data != nullptr) { - canvas_native_u32_buffer_destroy((U32Buffer *) deleter_data); + canvas_native_u32_buffer_destroy( + (U32Buffer *) deleter_data); } }, value); @@ -1150,7 +1124,7 @@ void WebGL2RenderingContext::GetActiveUniforms(const v8::FunctionCallbackInfo()); auto uniformIndicesObject = args[1]; - auto pname = (uint32_t) args[2]->NumberValue(context).ToChecked(); + auto pname = args[2]->Uint32Value(context).ToChecked(); if (uniformIndicesObject->IsArray()) { auto uniformIndices = uniformIndicesObject.As(); @@ -1158,14 +1132,14 @@ void WebGL2RenderingContext::GetActiveUniforms(const v8::FunctionCallbackInfo buf; buf.reserve(size); for (int j = 0; j < size; j++) { - auto item = (uint32_t) uniformIndices->Get( - context, j).ToLocalChecked()->NumberValue(context).ToChecked(); + auto item = uniformIndices->Get( + context, j).ToLocalChecked()->Uint32Value(context).ToChecked(); buf.emplace_back(item); } auto ret = canvas_native_webgl2_get_active_uniforms( program->GetProgram(), - buf.data(), buf.size(), + buf.data(), buf.size(), pname, ptr->GetState() ); @@ -1186,7 +1160,7 @@ void WebGL2RenderingContext::GetActiveUniforms(const v8::FunctionCallbackInfoSet( context, j, - v8::Number::New(isolate, (double) item)); + v8::Integer::NewFromUnsigned(isolate, item)); } args.GetReturnValue().Set(array); canvas_native_u32_buffer_destroy(value); @@ -1208,8 +1182,7 @@ void WebGL2RenderingContext::GetActiveUniforms(const v8::FunctionCallbackInfoSet( context, j, - v8::Number::New(isolate, - (double) item)); + v8::Integer::New(isolate, item)); } args.GetReturnValue().Set(array); canvas_native_i32_buffer_destroy(value); @@ -1260,7 +1233,7 @@ void WebGL2RenderingContext::GetBufferSubData(const v8::FunctionCallbackInfoIsArrayBufferView()) { - auto target = (uint32_t) args[0]->NumberValue(context).ToChecked(); + auto target = args[0]->Uint32Value(context).ToChecked(); auto srcByteOffset = args[1]->NumberValue(context).ToChecked(); auto array = dstDataObject.As(); @@ -1271,7 +1244,6 @@ void WebGL2RenderingContext::GetBufferSubData(const v8::FunctionCallbackInfo(buf->GetBackingStore()->Data()) + offset; - auto BYTES_PER_ELEMENT = (ssize_t) array->Get( context, ConvertToV8String(isolate, "BYTES_PER_ELEMENT")).ToLocalChecked()->NumberValue( @@ -1345,8 +1317,8 @@ void WebGL2RenderingContext::GetIndexedParameter(const v8::FunctionCallbackInfo< auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto target = (uint32_t) args[0]->NumberValue(context).ToChecked(); - auto index = (uint32_t) args[1]->NumberValue(context).ToChecked(); + auto target = args[0]->Uint32Value(context).ToChecked(); + auto index = args[1]->Uint32Value(context).ToChecked(); auto ret = canvas_native_webgl2_get_indexed_parameter( target, index, @@ -1390,9 +1362,9 @@ void WebGL2RenderingContext::GetInternalformatParameter( auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto target = (uint32_t) args[0]->NumberValue(context).ToChecked(); - auto internalformat = (uint32_t) args[1]->NumberValue(context).ToChecked(); - auto pname = (uint32_t) args[2]->NumberValue(context).ToChecked(); + auto target = args[0]->Uint32Value(context).ToChecked(); + auto internalformat = args[1]->Uint32Value(context).ToChecked(); + auto pname = args[2]->Uint32Value(context).ToChecked(); switch (internalformat) { case GL_RGB: case GL_RGBA: @@ -1461,7 +1433,7 @@ void WebGL2RenderingContext::GetInternalformatParameter( if (pname == GL_SAMPLES) { auto value = canvas_native_webgl_result_get_i32_array(ret); - auto buf = (uint8_t*)canvas_native_i32_buffer_get_bytes(value); + auto buf = (uint8_t *) canvas_native_i32_buffer_get_bytes(value); auto size = canvas_native_i32_buffer_get_length(value); auto bytes_size = size * sizeof(int32_t); @@ -1469,7 +1441,8 @@ void WebGL2RenderingContext::GetInternalformatParameter( [](void *data, size_t length, void *deleter_data) { if (deleter_data != nullptr) { - canvas_native_i32_buffer_destroy((I32Buffer *) deleter_data); + canvas_native_i32_buffer_destroy( + (I32Buffer *) deleter_data); } }, value); @@ -1495,7 +1468,7 @@ void WebGL2RenderingContext::GetParameter(const v8::FunctionCallbackInfoGetCurrentContext(); - auto pname = (uint32_t) args[0]->NumberValue(context).ToChecked(); + auto pname = args[0]->Uint32Value(context).ToChecked(); auto result = canvas_native_webgl2_get_parameter( pname, ptr->GetState()); @@ -1510,7 +1483,7 @@ void WebGL2RenderingContext::GetParameter(const v8::FunctionCallbackInfoGetParameterInternal( - isolate, pname,result); + isolate, pname, result); canvas_native_webgl_WebGLResult_destroy(result); @@ -1535,7 +1508,7 @@ void WebGL2RenderingContext::GetQueryParameter(const v8::FunctionCallbackInfo()); if (query != nullptr) { - auto pname = (uint32_t) args[1]->NumberValue(context).ToChecked(); + auto pname = args[1]->Uint32Value(context).ToChecked(); auto ret = canvas_native_webgl2_get_query_parameter( @@ -1549,7 +1522,7 @@ void WebGL2RenderingContext::GetQueryParameter(const v8::FunctionCallbackInfo auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto target = (uint32_t) args[0]->NumberValue(context).ToChecked(); - auto pname = (uint32_t) args[1]->NumberValue(context).ToChecked(); + auto target = args[0]->Uint32Value(context).ToChecked(); + auto pname = args[1]->Uint32Value(context).ToChecked(); auto ret = canvas_native_webgl2_get_query( target, pname, @@ -1604,7 +1577,7 @@ void WebGL2RenderingContext::GetSamplerParameter(const v8::FunctionCallbackInfo< if (type == NativeType::WebGLSampler) { auto sampler = WebGLSampler::GetPointer(samplerValue.As()); if (sampler != nullptr) { - auto pname = (uint32_t) args[1]->NumberValue(context).ToChecked(); + auto pname = args[1]->Uint32Value(context).ToChecked(); auto ret = canvas_native_webgl2_get_sampler_parameter( sampler->GetSampler(), pname, @@ -1653,7 +1626,7 @@ void WebGL2RenderingContext::GetSyncParameter(const v8::FunctionCallbackInfo()); if (sync != nullptr) { - auto pname = (uint32_t) args[1]->NumberValue(context).ToChecked(); + auto pname = args[1]->Uint32Value(context).ToChecked(); auto ret = canvas_native_webgl2_get_sync_parameter( sync->GetSync(), pname, @@ -1693,7 +1666,7 @@ void WebGL2RenderingContext::GetTransformFeedbackVarying( auto type = GetNativeType(isolate, programValue); if (type == NativeType::WebGLProgram) { auto program = WebGLProgram::GetPointer(programValue.As()); - auto index = (uint32_t) args[1]->NumberValue(context).ToChecked(); + auto index = args[1]->Uint32Value(context).ToChecked(); if (program != nullptr) { auto ret = canvas_native_webgl2_get_transform_feedback_varying( program->GetProgram(), @@ -1776,7 +1749,7 @@ void WebGL2RenderingContext::GetUniformIndices(const v8::FunctionCallbackInfoSet(context, j, - v8::Number::New(isolate, - (int32_t) item)); + v8::Integer::NewFromUnsigned(isolate, item)); } args.GetReturnValue().Set(result); @@ -1820,7 +1792,7 @@ WebGL2RenderingContext::InvalidateFramebuffer(const v8::FunctionCallbackInfoGetCurrentContext(); auto attachments = args[1]; - auto target = (uint32_t) args[0]->NumberValue(context).ToChecked(); + auto target = args[0]->Uint32Value(context).ToChecked(); if (attachments->IsArray()) { auto array = attachments.As(); @@ -1828,8 +1800,8 @@ WebGL2RenderingContext::InvalidateFramebuffer(const v8::FunctionCallbackInfo buf; buf.reserve(len); for (int j = 0; j < len; ++j) { - auto item = (uint32_t) array->Get( - context, j).ToLocalChecked()->NumberValue(context).ToChecked(); + auto item = array->Get( + context, j).ToLocalChecked()->Uint32Value(context).ToChecked(); buf.push_back(item); } @@ -1851,19 +1823,19 @@ WebGL2RenderingContext::InvalidateSubFramebuffer(const v8::FunctionCallbackInfo< auto attachments = args[1]; if (attachments->IsArray()) { - auto target = (uint32_t) args[0]->NumberValue(context).ToChecked(); - auto x = (int32_t) args[2]->NumberValue(context).ToChecked(); - auto y = (int32_t) args[3]->NumberValue(context).ToChecked(); - auto width = (int32_t) args[4]->NumberValue(context).ToChecked(); - auto height = (int32_t) args[5]->NumberValue(context).ToChecked(); + auto target = args[0]->Uint32Value(context).ToChecked(); + auto x = args[2]->Int32Value(context).ToChecked(); + auto y = args[3]->Int32Value(context).ToChecked(); + auto width = args[4]->Int32Value(context).ToChecked(); + auto height = args[5]->Int32Value(context).ToChecked(); auto array = attachments.As(); auto len = array->Length(); std::vector buf; buf.reserve(len); for (int j = 0; j < len; ++j) { - auto item = (uint32_t) array->Get( - context, j).ToLocalChecked()->NumberValue(context).ToChecked(); + auto item = array->Get( + context, j).ToLocalChecked()->Uint32Value(context).ToChecked(); buf.push_back(item); } @@ -2022,7 +1994,7 @@ void WebGL2RenderingContext::ReadBuffer(const v8::FunctionCallbackInfoGetCurrentContext(); - auto src = (uint32_t) args[0]->NumberValue(context).ToChecked(); + auto src = args[0]->Uint32Value(context).ToChecked(); canvas_native_webgl2_read_buffer( src, ptr->GetState() @@ -2039,11 +2011,11 @@ void WebGL2RenderingContext::RenderbufferStorageMultisample( auto isolate = args.GetIsolate(); auto context = isolate->GetCurrentContext(); - auto target = (uint32_t) args[0]->NumberValue(context).ToChecked(); - auto samples = (int32_t) args[1]->NumberValue(context).ToChecked(); - auto internalFormat = (uint32_t) args[2]->NumberValue(context).ToChecked(); - auto width = (int32_t) args[3]->NumberValue(context).ToChecked(); - auto height = (int32_t) args[4]->NumberValue(context).ToChecked(); + auto target = args[0]->Uint32Value(context).ToChecked(); + auto samples = args[1]->Int32Value(context).ToChecked(); + auto internalFormat = args[2]->Uint32Value(context).ToChecked(); + auto width = args[3]->Int32Value(context).ToChecked(); + auto height = args[4]->Int32Value(context).ToChecked(); canvas_native_webgl2_renderbuffer_storage_multisample( target, samples, @@ -2078,7 +2050,7 @@ void WebGL2RenderingContext::SamplerParameterf(const v8::FunctionCallbackInfo()); - auto pname = (uint32_t) args[1]->NumberValue(context).ToChecked(); + auto pname = args[1]->Uint32Value(context).ToChecked(); auto param = args[2]->NumberValue(context).ToChecked(); if (sampler != nullptr) { canvas_native_webgl2_sampler_parameterf( @@ -2104,8 +2076,8 @@ void WebGL2RenderingContext::SamplerParameteri(const v8::FunctionCallbackInfo()); - auto pname = (uint32_t) args[1]->NumberValue(context).ToChecked(); - auto param = (int32_t) args[2]->NumberValue(context).ToChecked(); + auto pname = args[1]->Uint32Value(context).ToChecked(); + auto param = args[2]->Int32Value(context).ToChecked(); if (sampler != nullptr) { canvas_native_webgl2_sampler_parameteri( sampler->GetSampler(), @@ -2130,23 +2102,23 @@ void WebGL2RenderingContext::TexImage3D(const v8::FunctionCallbackInfoNumberValue( + auto target = args[0]->Int32Value( context).ToChecked(); - auto level = (int32_t) args[1]->NumberValue( + auto level = args[1]->Int32Value( context).ToChecked(); - auto internalformat = (int32_t) args[2]->NumberValue( + auto internalformat = args[2]->Int32Value( context).ToChecked(); - auto width = (int32_t) args[3]->NumberValue( + auto width = args[3]->Int32Value( context).ToChecked(); - auto height = (int32_t) args[4]->NumberValue( + auto height = args[4]->Int32Value( context).ToChecked(); - auto depth = (int32_t) args[5]->NumberValue( + auto depth = args[5]->Int32Value( context).ToChecked(); - auto border = (int32_t) args[6]->NumberValue( + auto border = args[6]->Int32Value( context).ToChecked(); - auto format = (int32_t) args[7]->NumberValue( + auto format = args[7]->Int32Value( context).ToChecked(); - auto type = (uint32_t) args[8]->NumberValue( + auto type = args[8]->Uint32Value( context).ToChecked(); auto imageOrPixelsOrOffset = args[9]; @@ -2177,8 +2149,8 @@ void WebGL2RenderingContext::TexImage3D(const v8::FunctionCallbackInfoBuffer(); auto offset = buf->ByteOffset(); auto size = buf->ByteLength(); - auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; - auto data = static_cast((void*) data_ptr); + auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; + auto data = static_cast((void *) data_ptr); canvas_native_webgl2_tex_image3d( @@ -2250,23 +2222,23 @@ void WebGL2RenderingContext::TexImage3D(const v8::FunctionCallbackInfo 10) { - auto target = (int32_t) args[0]->NumberValue( + auto target = args[0]->Int32Value( context).ToChecked(); - auto level = (int32_t) args[1]->NumberValue( + auto level = args[1]->Int32Value( context).ToChecked(); - auto internalformat = (int32_t) args[2]->NumberValue( + auto internalformat = args[2]->Int32Value( context).ToChecked(); - auto width = (int32_t) args[3]->NumberValue( + auto width = args[3]->Int32Value( context).ToChecked(); - auto height = (int32_t) args[4]->NumberValue( + auto height = args[4]->Int32Value( context).ToChecked(); - auto depth = (int32_t) args[5]->NumberValue( + auto depth = args[5]->Int32Value( context).ToChecked(); - auto border = (int32_t) args[6]->NumberValue( + auto border = args[6]->Int32Value( context).ToChecked(); - auto format = (int32_t) args[7]->NumberValue( + auto format = args[7]->Int32Value( context).ToChecked(); - auto type = (uint32_t) args[8]->NumberValue( + auto type = args[8]->Uint32Value( context).ToChecked(); auto imageOrPixelsOrOffset = args[9]; @@ -2283,8 +2255,8 @@ void WebGL2RenderingContext::TexImage3D(const v8::FunctionCallbackInfoBuffer(); auto offset = buf->ByteOffset(); auto size = buf->ByteLength(); - auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; - auto data = static_cast((void*) data_ptr); + auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; + auto data = static_cast((void *) data_ptr); srcOffsetValue = srcOffsetValue * size; @@ -2322,15 +2294,15 @@ void WebGL2RenderingContext::TexStorage2D(const v8::FunctionCallbackInfoGetCurrentContext(); - auto target = (uint32_t) args[0]->NumberValue( + auto target = args[0]->Uint32Value( context).ToChecked(); - auto levels = (int32_t) args[1]->NumberValue( + auto levels = args[1]->Int32Value( context).ToChecked(); - auto internalFormat = (uint32_t) args[2]->NumberValue( + auto internalFormat = args[2]->Uint32Value( context).ToChecked(); - auto width = (int32_t) args[3]->NumberValue( + auto width = args[3]->Int32Value( context).ToChecked(); - auto height = (int32_t) args[4]->NumberValue( + auto height = args[4]->Int32Value( context).ToChecked(); canvas_native_webgl2_tex_storage2d( target, @@ -2351,17 +2323,17 @@ void WebGL2RenderingContext::TexStorage3D(const v8::FunctionCallbackInfoGetCurrentContext(); - auto target = (uint32_t) args[0]->NumberValue( + auto target = args[0]->Uint32Value( context).ToChecked(); - auto levels = (int32_t) args[1]->NumberValue( + auto levels = args[1]->Int32Value( context).ToChecked(); - auto internalFormat = (uint32_t) args[2]->NumberValue( + auto internalFormat = args[2]->Uint32Value( context).ToChecked(); - auto width = (int32_t) args[3]->NumberValue( + auto width = args[3]->Int32Value( context).ToChecked(); - auto height = (int32_t) args[4]->NumberValue( + auto height = args[4]->Int32Value( context).ToChecked(); - auto depth = (int32_t) args[5]->NumberValue( + auto depth = args[5]->Int32Value( context).ToChecked(); canvas_native_webgl2_tex_storage3d( target, @@ -2385,25 +2357,25 @@ void WebGL2RenderingContext::TexSubImage3D(const v8::FunctionCallbackInfoNumberValue( + auto target = args[0]->Uint32Value( context).ToChecked(); - auto level = (int32_t) args[1]->NumberValue( + auto level = args[1]->Int32Value( context).ToChecked(); - auto xoffset = (int32_t) args[2]->NumberValue( + auto xoffset = args[2]->Int32Value( context).ToChecked(); - auto yoffset = (int32_t) args[3]->NumberValue( + auto yoffset = args[3]->Int32Value( context).ToChecked(); - auto zoffset = (int32_t) args[4]->NumberValue( + auto zoffset = args[4]->Int32Value( context).ToChecked(); - auto width = (int32_t) args[5]->NumberValue( + auto width = args[5]->Int32Value( context).ToChecked(); - auto height = (int32_t) args[6]->NumberValue( + auto height = args[6]->Int32Value( context).ToChecked(); - auto depth = (int32_t) args[7]->NumberValue( + auto depth = args[7]->Int32Value( context).ToChecked(); - auto format = (uint32_t) args[8]->NumberValue( + auto format = args[8]->Uint32Value( context).ToChecked(); - auto type = (int32_t) args[9]->NumberValue( + auto type = args[9]->Uint32Value( context).ToChecked(); if (args[10]->IsNumber()) { @@ -2434,9 +2406,8 @@ void WebGL2RenderingContext::TexSubImage3D(const v8::FunctionCallbackInfoBuffer(); auto offset = buf->ByteOffset(); auto size = buf->ByteLength(); - auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; - auto data = static_cast((void*) data_ptr); - + auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; + auto data = static_cast((void *) data_ptr); canvas_native_webgl2_tex_sub_image3d( @@ -2482,25 +2453,25 @@ void WebGL2RenderingContext::TexSubImage3D(const v8::FunctionCallbackInfo 11) { - auto target = (uint32_t) args[0]->NumberValue( + auto target = args[0]->Uint32Value( context).ToChecked(); - auto level = (int32_t) args[1]->NumberValue( + auto level = args[1]->Int32Value( context).ToChecked(); - auto xoffset = (int32_t) args[2]->NumberValue( + auto xoffset = args[2]->Int32Value( context).ToChecked(); - auto yoffset = (int32_t) args[3]->NumberValue( + auto yoffset = args[3]->Int32Value( context).ToChecked(); - auto zoffset = (int32_t) args[4]->NumberValue( + auto zoffset = args[4]->Int32Value( context).ToChecked(); - auto width = (int32_t) args[5]->NumberValue( + auto width = args[5]->Int32Value( context).ToChecked(); - auto height = (int32_t) args[6]->NumberValue( + auto height = args[6]->Int32Value( context).ToChecked(); - auto depth = (int32_t) args[7]->NumberValue( + auto depth = args[7]->Int32Value( context).ToChecked(); - auto format = (uint32_t) args[8]->NumberValue( + auto format = args[8]->Uint32Value( context).ToChecked(); - auto type = (uint32_t) args[9]->NumberValue( + auto type = args[9]->Uint32Value( context).ToChecked(); size_t srcOffsetValue = 0; @@ -2519,8 +2490,8 @@ void WebGL2RenderingContext::TexSubImage3D(const v8::FunctionCallbackInfoBuffer(); auto offset = buf->ByteOffset(); auto size = buf->ByteLength(); - auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; - auto data = static_cast((void*) data_ptr); + auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; + auto data = static_cast((void *) data_ptr); srcOffsetValue = @@ -2564,7 +2535,7 @@ WebGL2RenderingContext::TransformFeedbackVaryings(const v8::FunctionCallbackInfo if (type == NativeType::WebGLProgram) { auto program = WebGLProgram::GetPointer(programValue.As()); auto varyingsObject = args[1]; - auto bufferMode = (uint32_t) args[2]->NumberValue( + auto bufferMode = args[2]->Uint32Value( context).ToChecked(); if (program != nullptr && @@ -2584,10 +2555,10 @@ WebGL2RenderingContext::TransformFeedbackVaryings(const v8::FunctionCallbackInfo } - const char* cStrings[store.size()]; - for (size_t i = 0; i < store.size(); ++i) { - cStrings[i] = store[i].c_str(); - } + const char *cStrings[store.size()]; + for (size_t i = 0; i < store.size(); ++i) { + cStrings[i] = store[i].c_str(); + } canvas_native_webgl2_transform_feedback_varyings( program->GetProgram(), @@ -2616,7 +2587,7 @@ void WebGL2RenderingContext::Uniform1ui(const v8::FunctionCallbackInfo()); - auto v0 = (uint32_t) v0Value->NumberValue( + auto v0 = v0Value->Uint32Value( context).ToChecked(); if (location != nullptr) { @@ -2645,9 +2616,9 @@ void WebGL2RenderingContext::Uniform2ui(const v8::FunctionCallbackInfo()); - auto v0 = (uint32_t) args[1]->NumberValue( + auto v0 = args[1]->Uint32Value( context).ToChecked(); - auto v1 = (uint32_t) args[2]->NumberValue( + auto v1 = args[2]->Uint32Value( context).ToChecked(); if (location != nullptr) { @@ -2677,13 +2648,13 @@ void WebGL2RenderingContext::Uniform3ui(const v8::FunctionCallbackInfo()); - auto v0 = (uint32_t) args[1]->NumberValue( + auto v0 = args[1]->Uint32Value( context).ToChecked(); - auto v1 = (uint32_t) args[2]->NumberValue( + auto v1 = args[2]->Uint32Value( context).ToChecked(); - auto v2 = (uint32_t) args[3]->NumberValue( + auto v2 = args[3]->Uint32Value( context).ToChecked(); if (location != nullptr) { @@ -2714,15 +2685,15 @@ void WebGL2RenderingContext::Uniform4ui(const v8::FunctionCallbackInfo()); - auto v0 = (uint32_t) args[1]->NumberValue( + auto v0 = args[1]->Uint32Value( context).ToChecked(); - auto v1 = (uint32_t) args[2]->NumberValue( + auto v1 = args[2]->Uint32Value( context).ToChecked(); - auto v2 = (uint32_t) args[3]->NumberValue( + auto v2 = args[3]->Uint32Value( context).ToChecked(); - auto v3 = (uint32_t) args[4]->NumberValue( + auto v3 = args[4]->Uint32Value( context).ToChecked(); @@ -2758,13 +2729,13 @@ void WebGL2RenderingContext::Uniform1uiv(const v8::FunctionCallbackInfo()); auto dataValue = args[1]; if (location != nullptr && - dataValue->IsUint32Array()) { + dataValue->IsUint32Array()) { auto buf = dataValue.As(); auto array = buf->Buffer(); auto offset = buf->ByteOffset(); auto size = buf->Length(); - auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; - auto data = static_cast((void*) data_ptr); + auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; + auto data = static_cast((void *) data_ptr); canvas_native_webgl2_uniform1uiv( @@ -2778,9 +2749,9 @@ void WebGL2RenderingContext::Uniform1uiv(const v8::FunctionCallbackInfoLength(); buf.reserve(len); for (int i = 0; i < len; i++) { - auto item = (uint32_t) array->Get( + auto item = array->Get( context, - i).ToLocalChecked()->NumberValue( + i).ToLocalChecked()->Uint32Value( context).ToChecked(); buf.push_back(item); } @@ -2815,14 +2786,13 @@ void WebGL2RenderingContext::Uniform2uiv(const v8::FunctionCallbackInfo()); auto dataValue = args[1]; if (location != nullptr && - dataValue->IsUint32Array()) { + dataValue->IsUint32Array()) { auto buf = dataValue.As(); auto array = buf->Buffer(); auto offset = buf->ByteOffset(); auto size = buf->Length(); - auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; - auto data = static_cast((void*) data_ptr); - + auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; + auto data = static_cast((void *) data_ptr); canvas_native_webgl2_uniform2uiv( @@ -2836,9 +2806,9 @@ void WebGL2RenderingContext::Uniform2uiv(const v8::FunctionCallbackInfoLength(); buf.reserve(len); for (int i = 0; i < len; i++) { - auto item = (uint32_t) array->Get( + auto item = array->Get( context, - i).ToLocalChecked()->NumberValue( + i).ToLocalChecked()->Uint32Value( context).ToChecked(); buf.push_back(item); } @@ -2872,14 +2842,14 @@ void WebGL2RenderingContext::Uniform3uiv(const v8::FunctionCallbackInfo()); auto dataValue = args[1]; if (location != nullptr && - dataValue->IsUint32Array()) { + dataValue->IsUint32Array()) { auto buf = dataValue.As(); auto array = buf->Buffer(); auto offset = buf->ByteOffset(); auto size = buf->Length(); - auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; - auto data = static_cast((void*) data_ptr); + auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; + auto data = static_cast((void *) data_ptr); canvas_native_webgl2_uniform3uiv( @@ -2893,9 +2863,9 @@ void WebGL2RenderingContext::Uniform3uiv(const v8::FunctionCallbackInfoLength(); buf.reserve(len); for (int i = 0; i < len; i++) { - auto item = (uint32_t) array->Get( + auto item = array->Get( context, - i).ToLocalChecked()->NumberValue( + i).ToLocalChecked()->Uint32Value( context).ToChecked(); buf.push_back(item); } @@ -2929,14 +2899,14 @@ void WebGL2RenderingContext::Uniform4uiv(const v8::FunctionCallbackInfo()); auto dataValue = args[1]; if (location != nullptr && - dataValue->IsUint32Array()) { + dataValue->IsUint32Array()) { auto buf = dataValue.As(); auto array = buf->Buffer(); auto offset = buf->ByteOffset(); auto size = buf->Length(); - auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; - auto data = static_cast((void*) data_ptr); + auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; + auto data = static_cast((void *) data_ptr); canvas_native_webgl2_uniform4uiv( @@ -2950,9 +2920,9 @@ void WebGL2RenderingContext::Uniform4uiv(const v8::FunctionCallbackInfoLength(); buf.reserve(len); for (int i = 0; i < len; i++) { - auto item = (uint32_t) array->Get( + auto item = array->Get( context, - i).ToLocalChecked()->NumberValue( + i).ToLocalChecked()->Uint32Value( context).ToChecked(); buf.push_back(item); } @@ -2983,16 +2953,16 @@ void WebGL2RenderingContext::UniformBlockBinding(const v8::FunctionCallbackInfo< if (type == NativeType::WebGLProgram) { auto program = WebGLProgram::GetPointer(programValue.As()); - auto uniformBlockIndex = args[1]->NumberValue( + auto uniformBlockIndex = args[1]->Uint32Value( context).ToChecked(); - auto uniformBlockBinding = args[2]->NumberValue( + auto uniformBlockBinding = args[2]->Uint32Value( context).ToChecked(); if (program != nullptr) { canvas_native_webgl2_uniform_block_binding( program->GetProgram(), - (uint32_t) uniformBlockIndex, - (uint32_t) uniformBlockBinding, + uniformBlockIndex, + uniformBlockBinding, ptr->GetState() ); } @@ -3023,8 +2993,8 @@ void WebGL2RenderingContext::UniformMatrix2x3fv(const v8::FunctionCallbackInfoBuffer(); auto offset = buf->ByteOffset(); auto size = buf->Length(); - auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; - auto data = static_cast((void*) data_ptr); + auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; + auto data = static_cast((void *) data_ptr); canvas_native_webgl2_uniform_matrix2x3fv( @@ -3080,8 +3050,8 @@ void WebGL2RenderingContext::UniformMatrix2x4fv(const v8::FunctionCallbackInfoBuffer(); auto offset = buf->ByteOffset(); auto size = buf->Length(); - auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; - auto data = static_cast((void*) data_ptr); + auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; + auto data = static_cast((void *) data_ptr); canvas_native_webgl2_uniform_matrix2x4fv( @@ -3103,7 +3073,6 @@ void WebGL2RenderingContext::UniformMatrix2x4fv(const v8::FunctionCallbackInfoGetUniformLocation(), transpose, @@ -3139,8 +3108,8 @@ void WebGL2RenderingContext::UniformMatrix3x2fv(const v8::FunctionCallbackInfoBuffer(); auto offset = buf->ByteOffset(); auto size = buf->Length(); - auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; - auto data = static_cast((void*) data_ptr); + auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; + auto data = static_cast((void *) data_ptr); canvas_native_webgl2_uniform_matrix3x2fv( @@ -3162,7 +3131,6 @@ void WebGL2RenderingContext::UniformMatrix3x2fv(const v8::FunctionCallbackInfoGetUniformLocation(), transpose, @@ -3196,8 +3164,8 @@ void WebGL2RenderingContext::UniformMatrix3x4fv(const v8::FunctionCallbackInfoBuffer(); auto offset = buf->ByteOffset(); auto size = buf->Length(); - auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; - auto data = static_cast((void*) data_ptr); + auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; + auto data = static_cast((void *) data_ptr); canvas_native_webgl2_uniform_matrix3x4fv( @@ -3219,7 +3187,6 @@ void WebGL2RenderingContext::UniformMatrix3x4fv(const v8::FunctionCallbackInfoGetUniformLocation(), transpose, @@ -3254,8 +3221,8 @@ void WebGL2RenderingContext::UniformMatrix4x2fv(const v8::FunctionCallbackInfoBuffer(); auto offset = buf->ByteOffset(); auto size = buf->Length(); - auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; - auto data = static_cast((void*) data_ptr); + auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; + auto data = static_cast((void *) data_ptr); canvas_native_webgl2_uniform_matrix4x2fv( location->GetUniformLocation(), @@ -3276,7 +3243,6 @@ void WebGL2RenderingContext::UniformMatrix4x2fv(const v8::FunctionCallbackInfoGetUniformLocation(), transpose, @@ -3310,8 +3276,8 @@ void WebGL2RenderingContext::UniformMatrix4x3fv(const v8::FunctionCallbackInfoBuffer(); auto offset = buf->ByteOffset(); auto size = buf->Length(); - auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; - auto data = static_cast((void*) data_ptr); + auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; + auto data = static_cast((void *) data_ptr); canvas_native_webgl2_uniform_matrix4x3fv( location->GetUniformLocation(), @@ -3353,13 +3319,13 @@ void WebGL2RenderingContext::VertexAttribDivisor(const v8::FunctionCallbackInfo< auto context = isolate->GetCurrentContext(); - auto index = args[0]->NumberValue( + auto index = args[0]->Uint32Value( context).ToChecked(); - auto divisor = args[1]->NumberValue( + auto divisor = args[1]->Uint32Value( context).ToChecked(); canvas_native_webgl2_vertex_attrib_divisor( - (uint32_t) index, - (uint32_t) divisor, + index, + divisor, ptr->GetState() ); @@ -3375,22 +3341,22 @@ void WebGL2RenderingContext::VertexAttribI4i(const v8::FunctionCallbackInfoGetCurrentContext(); - auto index = args[0]->NumberValue( + auto index = args[0]->Int32Value( context).ToChecked(); - auto v0 = args[1]->NumberValue( + auto v0 = args[1]->Int32Value( context).ToChecked(); - auto v1 = args[2]->NumberValue( + auto v1 = args[2]->Int32Value( context).ToChecked(); - auto v2 = args[3]->NumberValue( + auto v2 = args[3]->Int32Value( context).ToChecked(); - auto v3 = args[4]->NumberValue( + auto v3 = args[4]->Int32Value( context).ToChecked(); canvas_native_webgl2_vertex_attrib_i4i( - (uint32_t) index, - (int32_t) v0, - (int32_t) v1, - (int32_t) v2, - (int32_t) v3, + index, + v0, + v1, + v2, + v3, ptr->GetState() ); @@ -3406,7 +3372,7 @@ void WebGL2RenderingContext::VertexAttribI4iv(const v8::FunctionCallbackInfoGetCurrentContext(); - auto index = (uint32_t) args[0]->NumberValue( + auto index = args[0]->Uint32Value( context).ToChecked(); auto value = args[1]; if (value->IsInt32Array()) { @@ -3415,8 +3381,8 @@ void WebGL2RenderingContext::VertexAttribI4iv(const v8::FunctionCallbackInfoBuffer(); auto offset = buf->ByteOffset(); auto size = buf->Length(); - auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; - auto data = static_cast((void*) data_ptr); + auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; + auto data = static_cast((void *) data_ptr); canvas_native_webgl2_vertex_attrib_i4iv( @@ -3430,9 +3396,9 @@ void WebGL2RenderingContext::VertexAttribI4iv(const v8::FunctionCallbackInfo buf; buf.reserve(len); for (int i = 0; i < len; i++) { - auto item = (int32_t) array->Get( + auto item = array->Get( context, - i).ToLocalChecked()->NumberValue( + i).ToLocalChecked()->Int32Value( context).ToChecked(); buf.push_back(item); } @@ -3457,15 +3423,15 @@ void WebGL2RenderingContext::VertexAttribI4ui(const v8::FunctionCallbackInfoGetCurrentContext(); - auto index = (uint32_t) args[0]->NumberValue( + auto index = args[0]->Uint32Value( context).ToChecked(); - auto v0 = (uint32_t) args[1]->NumberValue( + auto v0 = args[1]->Uint32Value( context).ToChecked(); - auto v1 = (uint32_t) args[2]->NumberValue( + auto v1 = args[2]->Uint32Value( context).ToChecked(); - auto v2 = (uint32_t) args[3]->NumberValue( + auto v2 = args[3]->Uint32Value( context).ToChecked(); - auto v3 = (uint32_t) args[4]->NumberValue( + auto v3 = args[4]->Uint32Value( context).ToChecked(); canvas_native_webgl2_vertex_attrib_i4ui( @@ -3488,7 +3454,7 @@ void WebGL2RenderingContext::VertexAttribI4uiv(const v8::FunctionCallbackInfoGetCurrentContext(); - auto index = (uint32_t) args[0]->NumberValue( + auto index = args[0]->Uint32Value( context).ToChecked(); auto value = args[1]; if (value->IsUint32Array()) { @@ -3496,8 +3462,8 @@ void WebGL2RenderingContext::VertexAttribI4uiv(const v8::FunctionCallbackInfoBuffer(); auto offset = buf->ByteOffset(); auto size = buf->Length(); - auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; - auto data = static_cast((void*) data_ptr); + auto data_ptr = static_cast(array->GetBackingStore()->Data()) + offset; + auto data = static_cast((void *) data_ptr); canvas_native_webgl2_vertex_attrib_i4uiv( @@ -3511,9 +3477,9 @@ void WebGL2RenderingContext::VertexAttribI4uiv(const v8::FunctionCallbackInfo buf; buf.reserve(len); for (int i = 0; i < len; i++) { - auto item = (uint32_t) array->Get( + auto item = array->Get( context, - i).ToLocalChecked()->NumberValue( + i).ToLocalChecked()->Uint32Value( context).ToChecked(); buf.push_back(item); } @@ -3532,392 +3498,431 @@ void WebGL2RenderingContext::SetConstants(v8::Isolate *isolate, const v8::Local &tmpl) { /* Getting GL parameter information */ - tmpl->Set(isolate, "READ_BUFFER", v8::Uint32::New(isolate, 0x0C02)); - - tmpl->Set(isolate, "UNPACK_ROW_LENGTH", v8::Uint32::New(isolate, 0x0CF2)); + tmpl->Set(isolate, "READ_BUFFER", v8::Integer::NewFromUnsigned(isolate, 0x0C02)); - tmpl->Set(isolate, "UNPACK_SKIP_ROWS", v8::Uint32::New(isolate, 0x0CF3)); + tmpl->Set(isolate, "UNPACK_ROW_LENGTH", v8::Integer::NewFromUnsigned(isolate, 0x0CF2)); - tmpl->Set(isolate, "UNPACK_SKIP_PIXELS", v8::Uint32::New(isolate, 0x0CF4)); + tmpl->Set(isolate, "UNPACK_SKIP_ROWS", v8::Integer::NewFromUnsigned(isolate, 0x0CF3)); - tmpl->Set(isolate, "PACK_ROW_LENGTH", v8::Uint32::New(isolate, 0x0D02)); + tmpl->Set(isolate, "UNPACK_SKIP_PIXELS", v8::Integer::NewFromUnsigned(isolate, 0x0CF4)); - tmpl->Set(isolate, "PACK_SKIP_ROWS", v8::Uint32::New(isolate, 0x0D03)); + tmpl->Set(isolate, "PACK_ROW_LENGTH", v8::Integer::NewFromUnsigned(isolate, 0x0D02)); - tmpl->Set(isolate, "PACK_SKIP_PIXELS", v8::Uint32::New(isolate, 0x0D04)); + tmpl->Set(isolate, "PACK_SKIP_ROWS", v8::Integer::NewFromUnsigned(isolate, 0x0D03)); - tmpl->Set(isolate, "TEXTURE_BINDING_3D", v8::Uint32::New(isolate, 0x806A)); + tmpl->Set(isolate, "PACK_SKIP_PIXELS", v8::Integer::NewFromUnsigned(isolate, 0x0D04)); - tmpl->Set(isolate, "UNPACK_SKIP_IMAGES", v8::Uint32::New(isolate, 0x806D)); + tmpl->Set(isolate, "TEXTURE_BINDING_3D", v8::Integer::NewFromUnsigned(isolate, 0x806A)); - tmpl->Set(isolate, "UNPACK_IMAGE_HEIGHT", v8::Uint32::New(isolate, 0x806E)); + tmpl->Set(isolate, "UNPACK_SKIP_IMAGES", v8::Integer::NewFromUnsigned(isolate, 0x806D)); - tmpl->Set(isolate, "MAX_3D_TEXTURE_SIZE", v8::Uint32::New(isolate, 0x8073)); + tmpl->Set(isolate, "UNPACK_IMAGE_HEIGHT", v8::Integer::NewFromUnsigned(isolate, 0x806E)); - tmpl->Set(isolate, "MAX_ELEMENTS_VERTICES", v8::Uint32::New(isolate, 0x80E8)); + tmpl->Set(isolate, "MAX_3D_TEXTURE_SIZE", v8::Integer::NewFromUnsigned(isolate, 0x8073)); - tmpl->Set(isolate, "MAX_ELEMENTS_INDICES", v8::Uint32::New(isolate, 0x80E9)); + tmpl->Set(isolate, "MAX_ELEMENTS_VERTICES", v8::Integer::NewFromUnsigned(isolate, 0x80E8)); - tmpl->Set(isolate, "MAX_TEXTURE_LOD_BIAS", v8::Uint32::New(isolate, 0x84FD)); + tmpl->Set(isolate, "MAX_ELEMENTS_INDICES", v8::Integer::NewFromUnsigned(isolate, 0x80E9)); - tmpl->Set(isolate, "MAX_FRAGMENT_UNIFORM_COMPONENTS", v8::Uint32::New(isolate, 0x8B49)); + tmpl->Set(isolate, "MAX_TEXTURE_LOD_BIAS", v8::Integer::NewFromUnsigned(isolate, 0x84FD)); - tmpl->Set(isolate, "MAX_VERTEX_UNIFORM_COMPONENTS", v8::Uint32::New(isolate, 0x8B4A)); + tmpl->Set(isolate, "MAX_FRAGMENT_UNIFORM_COMPONENTS", + v8::Integer::NewFromUnsigned(isolate, 0x8B49)); - tmpl->Set(isolate, "MAX_ARRAY_TEXTURE_LAYERS", v8::Uint32::New(isolate, 0x88FF)); + tmpl->Set(isolate, "MAX_VERTEX_UNIFORM_COMPONENTS", + v8::Integer::NewFromUnsigned(isolate, 0x8B4A)); - tmpl->Set(isolate, "MIN_PROGRAM_TEXEL_OFFSET", v8::Uint32::New(isolate, 0x8904)); + tmpl->Set(isolate, "MAX_ARRAY_TEXTURE_LAYERS", v8::Integer::NewFromUnsigned(isolate, 0x88FF)); - tmpl->Set(isolate, "MAX_PROGRAM_TEXEL_OFFSET", v8::Uint32::New(isolate, 0x8905)); + tmpl->Set(isolate, "MIN_PROGRAM_TEXEL_OFFSET", v8::Integer::NewFromUnsigned(isolate, 0x8904)); - tmpl->Set(isolate, "MAX_VARYING_COMPONENTS", v8::Uint32::New(isolate, 0x8B4B)); + tmpl->Set(isolate, "MAX_PROGRAM_TEXEL_OFFSET", v8::Integer::NewFromUnsigned(isolate, 0x8905)); - tmpl->Set(isolate, "FRAGMENT_SHADER_DERIVATIVE_HINT", v8::Uint32::New(isolate, 0x8B8B)); + tmpl->Set(isolate, "MAX_VARYING_COMPONENTS", v8::Integer::NewFromUnsigned(isolate, 0x8B4B)); - tmpl->Set(isolate, "RASTERIZER_DISCARD", v8::Uint32::New(isolate, 0x8C89)); + tmpl->Set(isolate, "FRAGMENT_SHADER_DERIVATIVE_HINT", + v8::Integer::NewFromUnsigned(isolate, 0x8B8B)); - tmpl->Set(isolate, "VERTEX_ARRAY_BINDING", v8::Uint32::New(isolate, 0x85B5)); - tmpl->Set(isolate, "MAX_VERTEX_OUTPUT_COMPONENTS", v8::Uint32::New(isolate, 0x9122)); - tmpl->Set(isolate, "MAX_FRAGMENT_INPUT_COMPONENTS", v8::Uint32::New(isolate, 0x9125)); - tmpl->Set(isolate, "MAX_SERVER_WAIT_TIMEOUT", v8::Uint32::New(isolate, 0x9111)); - tmpl->Set(isolate, "MAX_ELEMENT_INDEX", v8::Uint32::New(isolate, 0x8D6B)); + tmpl->Set(isolate, "RASTERIZER_DISCARD", v8::Integer::NewFromUnsigned(isolate, 0x8C89)); - tmpl->Set(isolate, "RED", v8::Uint32::New(isolate, 0x1903)); - tmpl->Set(isolate, "RGB8", v8::Uint32::New(isolate, 0x8051)); - tmpl->Set(isolate, "RGBA8", v8::Uint32::New(isolate, 0x8058)); - tmpl->Set(isolate, "RGB10_A2", v8::Uint32::New(isolate, 0x8059)); - tmpl->Set(isolate, "TEXTURE_3D", v8::Uint32::New(isolate, 0x806F)); + tmpl->Set(isolate, "VERTEX_ARRAY_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x85B5)); + tmpl->Set(isolate, "MAX_VERTEX_OUTPUT_COMPONENTS", + v8::Integer::NewFromUnsigned(isolate, 0x9122)); + tmpl->Set(isolate, "MAX_FRAGMENT_INPUT_COMPONENTS", + v8::Integer::NewFromUnsigned(isolate, 0x9125)); + tmpl->Set(isolate, "MAX_SERVER_WAIT_TIMEOUT", v8::Integer::NewFromUnsigned(isolate, 0x9111)); + tmpl->Set(isolate, "MAX_ELEMENT_INDEX", v8::Integer::NewFromUnsigned(isolate, 0x8D6B)); - tmpl->Set(isolate, "TEXTURE_WRAP_R", v8::Uint32::New(isolate, 0x8072)); - tmpl->Set(isolate, "TEXTURE_MIN_LOD", v8::Uint32::New(isolate, 0x813A)); - tmpl->Set(isolate, "TEXTURE_MAX_LOD", v8::Uint32::New(isolate, 0x813B)); - tmpl->Set(isolate, "TEXTURE_BASE_LEVEL", v8::Uint32::New(isolate, 0x813C)); - tmpl->Set(isolate, "TEXTURE_MAX_LEVEL", v8::Uint32::New(isolate, 0x813D)); + tmpl->Set(isolate, "RED", v8::Integer::NewFromUnsigned(isolate, 0x1903)); + tmpl->Set(isolate, "RGB8", v8::Integer::NewFromUnsigned(isolate, 0x8051)); + tmpl->Set(isolate, "RGBA8", v8::Integer::NewFromUnsigned(isolate, 0x8058)); + tmpl->Set(isolate, "RGB10_A2", v8::Integer::NewFromUnsigned(isolate, 0x8059)); + tmpl->Set(isolate, "TEXTURE_3D", v8::Integer::NewFromUnsigned(isolate, 0x806F)); + tmpl->Set(isolate, "TEXTURE_WRAP_R", v8::Integer::NewFromUnsigned(isolate, 0x8072)); + tmpl->Set(isolate, "TEXTURE_MIN_LOD", v8::Integer::NewFromUnsigned(isolate, 0x813A)); + tmpl->Set(isolate, "TEXTURE_MAX_LOD", v8::Integer::NewFromUnsigned(isolate, 0x813B)); + tmpl->Set(isolate, "TEXTURE_BASE_LEVEL", v8::Integer::NewFromUnsigned(isolate, 0x813C)); + tmpl->Set(isolate, "TEXTURE_MAX_LEVEL", v8::Integer::NewFromUnsigned(isolate, 0x813D)); - tmpl->Set(isolate, "TEXTURE_COMPARE_MODE", v8::Uint32::New(isolate, 0x884C)); - tmpl->Set(isolate, "TEXTURE_COMPARE_FUNC", v8::Uint32::New(isolate, 0x884D)); - tmpl->Set(isolate, "SRGB", v8::Uint32::New(isolate, 0x8C40)); - tmpl->Set(isolate, "SRGB8", v8::Uint32::New(isolate, 0x8C41)); - tmpl->Set(isolate, "SRGB8_ALPHA8", v8::Uint32::New(isolate, 0x8C43)); - tmpl->Set(isolate, "COMPARE_REF_TO_TEXTURE", v8::Uint32::New(isolate, 0x884E)); - tmpl->Set(isolate, "RGBA32F", v8::Uint32::New(isolate, 0x8814)); - tmpl->Set(isolate, "RGB32F", v8::Uint32::New(isolate, 0x8815)); - tmpl->Set(isolate, "RGBA16F", v8::Uint32::New(isolate, 0x881A)); - tmpl->Set(isolate, "RGB16F", v8::Uint32::New(isolate, 0x881B)); + tmpl->Set(isolate, "TEXTURE_COMPARE_MODE", v8::Integer::NewFromUnsigned(isolate, 0x884C)); + tmpl->Set(isolate, "TEXTURE_COMPARE_FUNC", v8::Integer::NewFromUnsigned(isolate, 0x884D)); + tmpl->Set(isolate, "SRGB", v8::Integer::NewFromUnsigned(isolate, 0x8C40)); + tmpl->Set(isolate, "SRGB8", v8::Integer::NewFromUnsigned(isolate, 0x8C41)); + tmpl->Set(isolate, "SRGB8_ALPHA8", v8::Integer::NewFromUnsigned(isolate, 0x8C43)); - tmpl->Set(isolate, "TEXTURE_2D_ARRAY", v8::Uint32::New(isolate, 0x8C1A)); - tmpl->Set(isolate, "TEXTURE_BINDING_2D_ARRAY", v8::Uint32::New(isolate, 0x8C1D)); - tmpl->Set(isolate, "R11F_G11F_B10F", v8::Uint32::New(isolate, 0x8C3A)); - tmpl->Set(isolate, "RGB9_E5", v8::Uint32::New(isolate, 0x8C3D)); - tmpl->Set(isolate, "RGBA32UI", v8::Uint32::New(isolate, 0x8D70)); + tmpl->Set(isolate, "COMPARE_REF_TO_TEXTURE", v8::Integer::NewFromUnsigned(isolate, 0x884E)); + tmpl->Set(isolate, "RGBA32F", v8::Integer::NewFromUnsigned(isolate, 0x8814)); + tmpl->Set(isolate, "RGB32F", v8::Integer::NewFromUnsigned(isolate, 0x8815)); + tmpl->Set(isolate, "RGBA16F", v8::Integer::NewFromUnsigned(isolate, 0x881A)); + tmpl->Set(isolate, "RGB16F", v8::Integer::NewFromUnsigned(isolate, 0x881B)); + tmpl->Set(isolate, "TEXTURE_2D_ARRAY", v8::Integer::NewFromUnsigned(isolate, 0x8C1A)); + tmpl->Set(isolate, "TEXTURE_BINDING_2D_ARRAY", v8::Integer::NewFromUnsigned(isolate, 0x8C1D)); + tmpl->Set(isolate, "R11F_G11F_B10F", v8::Integer::NewFromUnsigned(isolate, 0x8C3A)); + tmpl->Set(isolate, "RGB9_E5", v8::Integer::NewFromUnsigned(isolate, 0x8C3D)); + tmpl->Set(isolate, "RGBA32UI", v8::Integer::NewFromUnsigned(isolate, 0x8D70)); - tmpl->Set(isolate, "RGB32UI", v8::Uint32::New(isolate, 0x8D71)); - tmpl->Set(isolate, "RGBA16UI", v8::Uint32::New(isolate, 0x8D76)); - tmpl->Set(isolate, "RGB16UI", v8::Uint32::New(isolate, 0x8D77)); - tmpl->Set(isolate, "RGBA8UI", v8::Uint32::New(isolate, 0x8D7C)); - tmpl->Set(isolate, "RGB8UI", v8::Uint32::New(isolate, 0x8D7D)); + tmpl->Set(isolate, "RGB32UI", v8::Integer::NewFromUnsigned(isolate, 0x8D71)); + tmpl->Set(isolate, "RGBA16UI", v8::Integer::NewFromUnsigned(isolate, 0x8D76)); + tmpl->Set(isolate, "RGB16UI", v8::Integer::NewFromUnsigned(isolate, 0x8D77)); + tmpl->Set(isolate, "RGBA8UI", v8::Integer::NewFromUnsigned(isolate, 0x8D7C)); + tmpl->Set(isolate, "RGB8UI", v8::Integer::NewFromUnsigned(isolate, 0x8D7D)); - tmpl->Set(isolate, "RGBA32I", v8::Uint32::New(isolate, 0x8D82)); - tmpl->Set(isolate, "RGB32I", v8::Uint32::New(isolate, 0x8D83)); - tmpl->Set(isolate, "RGBA16I", v8::Uint32::New(isolate, 0x8D88)); - tmpl->Set(isolate, "RGB16I", v8::Uint32::New(isolate, 0x8D89)); - tmpl->Set(isolate, "RGBA8I", v8::Uint32::New(isolate, 0x8D8E)); + tmpl->Set(isolate, "RGBA32I", v8::Integer::NewFromUnsigned(isolate, 0x8D82)); + tmpl->Set(isolate, "RGB32I", v8::Integer::NewFromUnsigned(isolate, 0x8D83)); + tmpl->Set(isolate, "RGBA16I", v8::Integer::NewFromUnsigned(isolate, 0x8D88)); + tmpl->Set(isolate, "RGB16I", v8::Integer::NewFromUnsigned(isolate, 0x8D89)); + tmpl->Set(isolate, "RGBA8I", v8::Integer::NewFromUnsigned(isolate, 0x8D8E)); - tmpl->Set(isolate, "RGB8I", v8::Uint32::New(isolate, 0x8D8F)); - tmpl->Set(isolate, "RED_INTEGER", v8::Uint32::New(isolate, 0x8D94)); - tmpl->Set(isolate, "RGB_INTEGER", v8::Uint32::New(isolate, 0x8D98)); - tmpl->Set(isolate, "RGBA_INTEGER", v8::Uint32::New(isolate, 0x8D99)); - tmpl->Set(isolate, "R8", v8::Uint32::New(isolate, 0x8229)); + tmpl->Set(isolate, "RGB8I", v8::Integer::NewFromUnsigned(isolate, 0x8D8F)); + tmpl->Set(isolate, "RED_INTEGER", v8::Integer::NewFromUnsigned(isolate, 0x8D94)); + tmpl->Set(isolate, "RGB_INTEGER", v8::Integer::NewFromUnsigned(isolate, 0x8D98)); + tmpl->Set(isolate, "RGBA_INTEGER", v8::Integer::NewFromUnsigned(isolate, 0x8D99)); + tmpl->Set(isolate, "R8", v8::Integer::NewFromUnsigned(isolate, 0x8229)); - tmpl->Set(isolate, "RG8", v8::Uint32::New(isolate, 0x822B)); - tmpl->Set(isolate, "R16F", v8::Uint32::New(isolate, 0x822D)); - tmpl->Set(isolate, "R32F", v8::Uint32::New(isolate, 0x822E)); - tmpl->Set(isolate, "RG16F", v8::Uint32::New(isolate, 0x822F)); - tmpl->Set(isolate, "RG32F", v8::Uint32::New(isolate, 0x8230)); + tmpl->Set(isolate, "RG8", v8::Integer::NewFromUnsigned(isolate, 0x822B)); + tmpl->Set(isolate, "R16F", v8::Integer::NewFromUnsigned(isolate, 0x822D)); + tmpl->Set(isolate, "R32F", v8::Integer::NewFromUnsigned(isolate, 0x822E)); + tmpl->Set(isolate, "RG16F", v8::Integer::NewFromUnsigned(isolate, 0x822F)); + tmpl->Set(isolate, "RG32F", v8::Integer::NewFromUnsigned(isolate, 0x8230)); - tmpl->Set(isolate, "R8I", v8::Uint32::New(isolate, 0x8231)); - tmpl->Set(isolate, "R8UI", v8::Uint32::New(isolate, 0x8232)); - tmpl->Set(isolate, "R16I", v8::Uint32::New(isolate, 0x8233)); - tmpl->Set(isolate, "R16UI", v8::Uint32::New(isolate, 0x8234)); - tmpl->Set(isolate, "R32I", v8::Uint32::New(isolate, 0x8235)); + tmpl->Set(isolate, "R8I", v8::Integer::NewFromUnsigned(isolate, 0x8231)); + tmpl->Set(isolate, "R8UI", v8::Integer::NewFromUnsigned(isolate, 0x8232)); + tmpl->Set(isolate, "R16I", v8::Integer::NewFromUnsigned(isolate, 0x8233)); + tmpl->Set(isolate, "R16UI", v8::Integer::NewFromUnsigned(isolate, 0x8234)); + tmpl->Set(isolate, "R32I", v8::Integer::NewFromUnsigned(isolate, 0x8235)); - tmpl->Set(isolate, "R32UI", v8::Uint32::New(isolate, 0x8236)); - tmpl->Set(isolate, "RG8I", v8::Uint32::New(isolate, 0x8237)); - tmpl->Set(isolate, "RG8UI", v8::Uint32::New(isolate, 0x8238)); - tmpl->Set(isolate, "RG16I", v8::Uint32::New(isolate, 0x8239)); - tmpl->Set(isolate, "RG16UI", v8::Uint32::New(isolate, 0x823A)); - tmpl->Set(isolate, "RG32I", v8::Uint32::New(isolate, 0x823B)); - tmpl->Set(isolate, "RG32UI", v8::Uint32::New(isolate, 0x823C)); - tmpl->Set(isolate, "R8_SNORM", v8::Uint32::New(isolate, 0x8F94)); - tmpl->Set(isolate, "RG8_SNORM", v8::Uint32::New(isolate, 0x8F95)); - tmpl->Set(isolate, "RGB8_SNORM", v8::Uint32::New(isolate, 0x8F96)); + tmpl->Set(isolate, "R32UI", v8::Integer::NewFromUnsigned(isolate, 0x8236)); + tmpl->Set(isolate, "RG8I", v8::Integer::NewFromUnsigned(isolate, 0x8237)); + tmpl->Set(isolate, "RG8UI", v8::Integer::NewFromUnsigned(isolate, 0x8238)); + tmpl->Set(isolate, "RG16I", v8::Integer::NewFromUnsigned(isolate, 0x8239)); + tmpl->Set(isolate, "RG16UI", v8::Integer::NewFromUnsigned(isolate, 0x823A)); + tmpl->Set(isolate, "RG32I", v8::Integer::NewFromUnsigned(isolate, 0x823B)); + tmpl->Set(isolate, "RG32UI", v8::Integer::NewFromUnsigned(isolate, 0x823C)); + tmpl->Set(isolate, "R8_SNORM", v8::Integer::NewFromUnsigned(isolate, 0x8F94)); + tmpl->Set(isolate, "RG8_SNORM", v8::Integer::NewFromUnsigned(isolate, 0x8F95)); + tmpl->Set(isolate, "RGB8_SNORM", v8::Integer::NewFromUnsigned(isolate, 0x8F96)); - tmpl->Set(isolate, "RGBA8_SNORM", v8::Uint32::New(isolate, 0x8F97)); - tmpl->Set(isolate, "RGB10_A2UI", v8::Uint32::New(isolate, 0x906F)); - tmpl->Set(isolate, "TEXTURE_IMMUTABLE_FORMAT", v8::Uint32::New(isolate, 0x912F)); - tmpl->Set(isolate, "TEXTURE_IMMUTABLE_LEVELS", v8::Uint32::New(isolate, 0x82DF)); - tmpl->Set(isolate, "UNSIGNED_INT_2_10_10_10_REV", v8::Uint32::New(isolate, 0x8368)); - - tmpl->Set(isolate, "UNSIGNED_INT_10F_11F_11F_REV", v8::Uint32::New(isolate, 0x8C3B)); - tmpl->Set(isolate, "UNSIGNED_INT_5_9_9_9_REV", v8::Uint32::New(isolate, 0x8C3E)); - tmpl->Set(isolate, "FLOAT_32_UNSIGNED_INT_24_8_REV", v8::Uint32::New(isolate, 0x8DAD)); - tmpl->Set(isolate, "UNSIGNED_INT_24_8", v8::Uint32::New(isolate, 0x84FA)); - tmpl->Set(isolate, "HALF_FLOAT", v8::Uint32::New(isolate, 0x140B)); - - - tmpl->Set(isolate, "RG", v8::Uint32::New(isolate, 0x8227)); - tmpl->Set(isolate, "RG_INTEGER", v8::Uint32::New(isolate, 0x8228)); - tmpl->Set(isolate, "INT_2_10_10_10_REV", v8::Uint32::New(isolate, 0x8D9F)); - tmpl->Set(isolate, "QUERY_RESULT_AVAILABLE", v8::Uint32::New(isolate, 0x8865)); - tmpl->Set(isolate, "QUERY_RESULT", v8::Uint32::New(isolate, 0x8866)); - - - tmpl->Set(isolate, "CURRENT_QUERY", v8::Uint32::New(isolate, 0x8867)); - tmpl->Set(isolate, "ANY_SAMPLES_PASSED", v8::Uint32::New(isolate, 0x8C2F)); - tmpl->Set(isolate, "ANY_SAMPLES_PASSED_CONSERVATIVE", v8::Uint32::New(isolate, 0x8D6A)); - tmpl->Set(isolate, "MAX_DRAW_BUFFERS", v8::Uint32::New(isolate, 0x8824)); - - tmpl->Set(isolate, "DRAW_BUFFER0", v8::Uint32::New(isolate, 0x8825)); - tmpl->Set(isolate, "DRAW_BUFFER1", v8::Uint32::New(isolate, 0x8826)); - tmpl->Set(isolate, "DRAW_BUFFER2", v8::Uint32::New(isolate, 0x8827)); - tmpl->Set(isolate, "DRAW_BUFFER3", v8::Uint32::New(isolate, 0x8828)); - tmpl->Set(isolate, "DRAW_BUFFER4", v8::Uint32::New(isolate, 0x8829)); - tmpl->Set(isolate, "DRAW_BUFFER5", v8::Uint32::New(isolate, 0x882A)); - tmpl->Set(isolate, "DRAW_BUFFER6", v8::Uint32::New(isolate, 0x882B)); - tmpl->Set(isolate, "DRAW_BUFFER7", v8::Uint32::New(isolate, 0x882C)); - tmpl->Set(isolate, "DRAW_BUFFER8", v8::Uint32::New(isolate, 0x882D)); - tmpl->Set(isolate, "DRAW_BUFFER9", v8::Uint32::New(isolate, 0x882E)); - tmpl->Set(isolate, "DRAW_BUFFER10", v8::Uint32::New(isolate, 0x882F)); + tmpl->Set(isolate, "RGBA8_SNORM", v8::Integer::NewFromUnsigned(isolate, 0x8F97)); + tmpl->Set(isolate, "RGB10_A2UI", v8::Integer::NewFromUnsigned(isolate, 0x906F)); + tmpl->Set(isolate, "TEXTURE_IMMUTABLE_FORMAT", v8::Integer::NewFromUnsigned(isolate, 0x912F)); + tmpl->Set(isolate, "TEXTURE_IMMUTABLE_LEVELS", v8::Integer::NewFromUnsigned(isolate, 0x82DF)); + tmpl->Set(isolate, "UNSIGNED_INT_2_10_10_10_REV", + v8::Integer::NewFromUnsigned(isolate, 0x8368)); + + + tmpl->Set(isolate, "UNSIGNED_INT_10F_11F_11F_REV", + v8::Integer::NewFromUnsigned(isolate, 0x8C3B)); + tmpl->Set(isolate, "UNSIGNED_INT_5_9_9_9_REV", v8::Integer::NewFromUnsigned(isolate, 0x8C3E)); + tmpl->Set(isolate, "FLOAT_32_UNSIGNED_INT_24_8_REV", + v8::Integer::NewFromUnsigned(isolate, 0x8DAD)); + tmpl->Set(isolate, "UNSIGNED_INT_24_8", v8::Integer::NewFromUnsigned(isolate, 0x84FA)); + tmpl->Set(isolate, "HALF_FLOAT", v8::Integer::NewFromUnsigned(isolate, 0x140B)); + + + tmpl->Set(isolate, "RG", v8::Integer::NewFromUnsigned(isolate, 0x8227)); + tmpl->Set(isolate, "RG_INTEGER", v8::Integer::NewFromUnsigned(isolate, 0x8228)); + tmpl->Set(isolate, "INT_2_10_10_10_REV", v8::Integer::NewFromUnsigned(isolate, 0x8D9F)); + tmpl->Set(isolate, "QUERY_RESULT_AVAILABLE", v8::Integer::NewFromUnsigned(isolate, 0x8865)); + tmpl->Set(isolate, "QUERY_RESULT", v8::Integer::NewFromUnsigned(isolate, 0x8866)); + + + tmpl->Set(isolate, "CURRENT_QUERY", v8::Integer::NewFromUnsigned(isolate, 0x8867)); + tmpl->Set(isolate, "ANY_SAMPLES_PASSED", v8::Integer::NewFromUnsigned(isolate, 0x8C2F)); + tmpl->Set(isolate, "ANY_SAMPLES_PASSED_CONSERVATIVE", + v8::Integer::NewFromUnsigned(isolate, 0x8D6A)); + tmpl->Set(isolate, "MAX_DRAW_BUFFERS", v8::Integer::NewFromUnsigned(isolate, 0x8824)); + + tmpl->Set(isolate, "DRAW_BUFFER0", v8::Integer::NewFromUnsigned(isolate, 0x8825)); + tmpl->Set(isolate, "DRAW_BUFFER1", v8::Integer::NewFromUnsigned(isolate, 0x8826)); + tmpl->Set(isolate, "DRAW_BUFFER2", v8::Integer::NewFromUnsigned(isolate, 0x8827)); + tmpl->Set(isolate, "DRAW_BUFFER3", v8::Integer::NewFromUnsigned(isolate, 0x8828)); + tmpl->Set(isolate, "DRAW_BUFFER4", v8::Integer::NewFromUnsigned(isolate, 0x8829)); + tmpl->Set(isolate, "DRAW_BUFFER5", v8::Integer::NewFromUnsigned(isolate, 0x882A)); + tmpl->Set(isolate, "DRAW_BUFFER6", v8::Integer::NewFromUnsigned(isolate, 0x882B)); + tmpl->Set(isolate, "DRAW_BUFFER7", v8::Integer::NewFromUnsigned(isolate, 0x882C)); + tmpl->Set(isolate, "DRAW_BUFFER8", v8::Integer::NewFromUnsigned(isolate, 0x882D)); + tmpl->Set(isolate, "DRAW_BUFFER9", v8::Integer::NewFromUnsigned(isolate, 0x882E)); + tmpl->Set(isolate, "DRAW_BUFFER10", v8::Integer::NewFromUnsigned(isolate, 0x882F)); /* Getting GL parameter information */ /* Textures */ - tmpl->Set(isolate, "DRAW_BUFFER11", v8::Uint32::New(isolate, 0x8830)); - tmpl->Set(isolate, "DRAW_BUFFER12", v8::Uint32::New(isolate, 0x8831)); - tmpl->Set(isolate, "DRAW_BUFFER13", v8::Uint32::New(isolate, 0x8832)); - tmpl->Set(isolate, "DRAW_BUFFER14", v8::Uint32::New(isolate, 0x8833)); - tmpl->Set(isolate, "DRAW_BUFFER15", v8::Uint32::New(isolate, 0x8834)); - - tmpl->Set(isolate, "MAX_COLOR_ATTACHMENTS", v8::Uint32::New(isolate, 0x8CDF)); - tmpl->Set(isolate, "COLOR_ATTACHMENT1", v8::Uint32::New(isolate, 0x8CE1)); - tmpl->Set(isolate, "COLOR_ATTACHMENT2", v8::Uint32::New(isolate, 0x8CE2)); - tmpl->Set(isolate, "COLOR_ATTACHMENT3", v8::Uint32::New(isolate, 0x8CE3)); - tmpl->Set(isolate, "COLOR_ATTACHMENT4", v8::Uint32::New(isolate, 0x8CE4)); - tmpl->Set(isolate, "COLOR_ATTACHMENT5", v8::Uint32::New(isolate, 0x8CE5)); - tmpl->Set(isolate, "COLOR_ATTACHMENT6", v8::Uint32::New(isolate, 0x8CE6)); - tmpl->Set(isolate, "COLOR_ATTACHMENT7", v8::Uint32::New(isolate, 0x8CE7)); - tmpl->Set(isolate, "COLOR_ATTACHMENT8", v8::Uint32::New(isolate, 0x8CE8)); - tmpl->Set(isolate, "COLOR_ATTACHMENT9", v8::Uint32::New(isolate, 0x8CE9)); - tmpl->Set(isolate, "COLOR_ATTACHMENT10", v8::Uint32::New(isolate, 0x8CEA)); - tmpl->Set(isolate, "COLOR_ATTACHMENT11", v8::Uint32::New(isolate, 0x8CEB)); - tmpl->Set(isolate, "COLOR_ATTACHMENT12", v8::Uint32::New(isolate, 0x8CEC)); - tmpl->Set(isolate, "COLOR_ATTACHMENT13", v8::Uint32::New(isolate, 0x8CED)); - tmpl->Set(isolate, "COLOR_ATTACHMENT14", v8::Uint32::New(isolate, 0x8CEE)); - tmpl->Set(isolate, "COLOR_ATTACHMENT15", v8::Uint32::New(isolate, 0x8CEF)); - - tmpl->Set(isolate, "SAMPLER_3D", v8::Uint32::New(isolate, 0x8B5F)); - tmpl->Set(isolate, "SAMPLER_2D_SHADOW", v8::Uint32::New(isolate, 0x8B62)); - tmpl->Set(isolate, "SAMPLER_2D_ARRAY", v8::Uint32::New(isolate, 0x8DC1)); - tmpl->Set(isolate, "SAMPLER_2D_ARRAY_SHADOW", v8::Uint32::New(isolate, 0x8DC4)); - tmpl->Set(isolate, "SAMPLER_CUBE_SHADOW", v8::Uint32::New(isolate, 0x8DC5)); - - tmpl->Set(isolate, "INT_SAMPLER_2D", v8::Uint32::New(isolate, 0x8DCA)); - tmpl->Set(isolate, "INT_SAMPLER_3D", v8::Uint32::New(isolate, 0x8DCB)); - tmpl->Set(isolate, "INT_SAMPLER_CUBE", v8::Uint32::New(isolate, 0x8DCC)); - tmpl->Set(isolate, "INT_SAMPLER_2D_ARRAY", v8::Uint32::New(isolate, 0x8DCF)); - tmpl->Set(isolate, "UNSIGNED_INT_SAMPLER_2D", v8::Uint32::New(isolate, 0x8DD2)); - - tmpl->Set(isolate, "UNSIGNED_INT_SAMPLER_3D", v8::Uint32::New(isolate, 0x8DD3)); - tmpl->Set(isolate, "UNSIGNED_INT_SAMPLER_CUBE", v8::Uint32::New(isolate, 0x8DD4)); - tmpl->Set(isolate, "UNSIGNED_INT_SAMPLER_2D_ARRAY", v8::Uint32::New(isolate, 0x8DD7)); - tmpl->Set(isolate, "MAX_SAMPLES", v8::Uint32::New(isolate, 0x8D57)); - tmpl->Set(isolate, "SAMPLER_BINDING", v8::Uint32::New(isolate, 0x8919)); - - tmpl->Set(isolate, "PIXEL_PACK_BUFFER", v8::Uint32::New(isolate, 0x88EB)); - tmpl->Set(isolate, "PIXEL_UNPACK_BUFFER", v8::Uint32::New(isolate, 0x88EC)); - tmpl->Set(isolate, "PIXEL_PACK_BUFFER_BINDING", v8::Uint32::New(isolate, 0x88ED)); - tmpl->Set(isolate, "PIXEL_UNPACK_BUFFER_BINDING", v8::Uint32::New(isolate, 0x88EF)); - tmpl->Set(isolate, "COPY_READ_BUFFER", v8::Uint32::New(isolate, 0x8F36)); - - tmpl->Set(isolate, "COPY_WRITE_BUFFER", v8::Uint32::New(isolate, 0x8F37)); - tmpl->Set(isolate, "COPY_READ_BUFFER_BINDING", v8::Uint32::New(isolate, 0x8F36)); - tmpl->Set(isolate, "COPY_WRITE_BUFFER_BINDING", v8::Uint32::New(isolate, 0x8F37)); - tmpl->Set(isolate, "FLOAT_MAT2x3", v8::Uint32::New(isolate, 0x8B65)); - tmpl->Set(isolate, "FLOAT_MAT2x4", v8::Uint32::New(isolate, 0x8B66)); - - tmpl->Set(isolate, "FLOAT_MAT3x2", v8::Uint32::New(isolate, 0x8B67)); - tmpl->Set(isolate, "FLOAT_MAT3x4", v8::Uint32::New(isolate, 0x8B68)); - tmpl->Set(isolate, "FLOAT_MAT4x2", v8::Uint32::New(isolate, 0x8B69)); - tmpl->Set(isolate, "FLOAT_MAT4x3", v8::Uint32::New(isolate, 0x8B6A)); - tmpl->Set(isolate, "UNSIGNED_INT_VEC2", v8::Uint32::New(isolate, 0x8DC6)); - - tmpl->Set(isolate, "UNSIGNED_INT_VEC3", v8::Uint32::New(isolate, 0x8DC7)); - tmpl->Set(isolate, "UNSIGNED_INT_VEC4", v8::Uint32::New(isolate, 0x8DC8)); - tmpl->Set(isolate, "UNSIGNED_NORMALIZED", v8::Uint32::New(isolate, 0x8C17)); - tmpl->Set(isolate, "SIGNED_NORMALIZED", v8::Uint32::New(isolate, 0x8F9C)); + tmpl->Set(isolate, "DRAW_BUFFER11", v8::Integer::NewFromUnsigned(isolate, 0x8830)); + tmpl->Set(isolate, "DRAW_BUFFER12", v8::Integer::NewFromUnsigned(isolate, 0x8831)); + tmpl->Set(isolate, "DRAW_BUFFER13", v8::Integer::NewFromUnsigned(isolate, 0x8832)); + tmpl->Set(isolate, "DRAW_BUFFER14", v8::Integer::NewFromUnsigned(isolate, 0x8833)); + tmpl->Set(isolate, "DRAW_BUFFER15", v8::Integer::NewFromUnsigned(isolate, 0x8834)); + + tmpl->Set(isolate, "MAX_COLOR_ATTACHMENTS", v8::Integer::NewFromUnsigned(isolate, 0x8CDF)); + tmpl->Set(isolate, "COLOR_ATTACHMENT1", v8::Integer::NewFromUnsigned(isolate, 0x8CE1)); + tmpl->Set(isolate, "COLOR_ATTACHMENT2", v8::Integer::NewFromUnsigned(isolate, 0x8CE2)); + tmpl->Set(isolate, "COLOR_ATTACHMENT3", v8::Integer::NewFromUnsigned(isolate, 0x8CE3)); + tmpl->Set(isolate, "COLOR_ATTACHMENT4", v8::Integer::NewFromUnsigned(isolate, 0x8CE4)); + tmpl->Set(isolate, "COLOR_ATTACHMENT5", v8::Integer::NewFromUnsigned(isolate, 0x8CE5)); + tmpl->Set(isolate, "COLOR_ATTACHMENT6", v8::Integer::NewFromUnsigned(isolate, 0x8CE6)); + tmpl->Set(isolate, "COLOR_ATTACHMENT7", v8::Integer::NewFromUnsigned(isolate, 0x8CE7)); + tmpl->Set(isolate, "COLOR_ATTACHMENT8", v8::Integer::NewFromUnsigned(isolate, 0x8CE8)); + tmpl->Set(isolate, "COLOR_ATTACHMENT9", v8::Integer::NewFromUnsigned(isolate, 0x8CE9)); + tmpl->Set(isolate, "COLOR_ATTACHMENT10", v8::Integer::NewFromUnsigned(isolate, 0x8CEA)); + tmpl->Set(isolate, "COLOR_ATTACHMENT11", v8::Integer::NewFromUnsigned(isolate, 0x8CEB)); + tmpl->Set(isolate, "COLOR_ATTACHMENT12", v8::Integer::NewFromUnsigned(isolate, 0x8CEC)); + tmpl->Set(isolate, "COLOR_ATTACHMENT13", v8::Integer::NewFromUnsigned(isolate, 0x8CED)); + tmpl->Set(isolate, "COLOR_ATTACHMENT14", v8::Integer::NewFromUnsigned(isolate, 0x8CEE)); + tmpl->Set(isolate, "COLOR_ATTACHMENT15", v8::Integer::NewFromUnsigned(isolate, 0x8CEF)); + + tmpl->Set(isolate, "SAMPLER_3D", v8::Integer::NewFromUnsigned(isolate, 0x8B5F)); + tmpl->Set(isolate, "SAMPLER_2D_SHADOW", v8::Integer::NewFromUnsigned(isolate, 0x8B62)); + tmpl->Set(isolate, "SAMPLER_2D_ARRAY", v8::Integer::NewFromUnsigned(isolate, 0x8DC1)); + tmpl->Set(isolate, "SAMPLER_2D_ARRAY_SHADOW", v8::Integer::NewFromUnsigned(isolate, 0x8DC4)); + tmpl->Set(isolate, "SAMPLER_CUBE_SHADOW", v8::Integer::NewFromUnsigned(isolate, 0x8DC5)); + + tmpl->Set(isolate, "INT_SAMPLER_2D", v8::Integer::NewFromUnsigned(isolate, 0x8DCA)); + tmpl->Set(isolate, "INT_SAMPLER_3D", v8::Integer::NewFromUnsigned(isolate, 0x8DCB)); + tmpl->Set(isolate, "INT_SAMPLER_CUBE", v8::Integer::NewFromUnsigned(isolate, 0x8DCC)); + tmpl->Set(isolate, "INT_SAMPLER_2D_ARRAY", v8::Integer::NewFromUnsigned(isolate, 0x8DCF)); + tmpl->Set(isolate, "UNSIGNED_INT_SAMPLER_2D", v8::Integer::NewFromUnsigned(isolate, 0x8DD2)); + + tmpl->Set(isolate, "UNSIGNED_INT_SAMPLER_3D", v8::Integer::NewFromUnsigned(isolate, 0x8DD3)); + tmpl->Set(isolate, "UNSIGNED_INT_SAMPLER_CUBE", v8::Integer::NewFromUnsigned(isolate, 0x8DD4)); + tmpl->Set(isolate, "UNSIGNED_INT_SAMPLER_2D_ARRAY", + v8::Integer::NewFromUnsigned(isolate, 0x8DD7)); + tmpl->Set(isolate, "MAX_SAMPLES", v8::Integer::NewFromUnsigned(isolate, 0x8D57)); + tmpl->Set(isolate, "SAMPLER_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8919)); + + tmpl->Set(isolate, "PIXEL_PACK_BUFFER", v8::Integer::NewFromUnsigned(isolate, 0x88EB)); + tmpl->Set(isolate, "PIXEL_UNPACK_BUFFER", v8::Integer::NewFromUnsigned(isolate, 0x88EC)); + tmpl->Set(isolate, "PIXEL_PACK_BUFFER_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x88ED)); + tmpl->Set(isolate, "PIXEL_UNPACK_BUFFER_BINDING", + v8::Integer::NewFromUnsigned(isolate, 0x88EF)); + tmpl->Set(isolate, "COPY_READ_BUFFER", v8::Integer::NewFromUnsigned(isolate, 0x8F36)); + + tmpl->Set(isolate, "COPY_WRITE_BUFFER", v8::Integer::NewFromUnsigned(isolate, 0x8F37)); + tmpl->Set(isolate, "COPY_READ_BUFFER_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8F36)); + tmpl->Set(isolate, "COPY_WRITE_BUFFER_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8F37)); + tmpl->Set(isolate, "FLOAT_MAT2x3", v8::Integer::NewFromUnsigned(isolate, 0x8B65)); + tmpl->Set(isolate, "FLOAT_MAT2x4", v8::Integer::NewFromUnsigned(isolate, 0x8B66)); + + tmpl->Set(isolate, "FLOAT_MAT3x2", v8::Integer::NewFromUnsigned(isolate, 0x8B67)); + tmpl->Set(isolate, "FLOAT_MAT3x4", v8::Integer::NewFromUnsigned(isolate, 0x8B68)); + tmpl->Set(isolate, "FLOAT_MAT4x2", v8::Integer::NewFromUnsigned(isolate, 0x8B69)); + tmpl->Set(isolate, "FLOAT_MAT4x3", v8::Integer::NewFromUnsigned(isolate, 0x8B6A)); + tmpl->Set(isolate, "UNSIGNED_INT_VEC2", v8::Integer::NewFromUnsigned(isolate, 0x8DC6)); + + tmpl->Set(isolate, "UNSIGNED_INT_VEC3", v8::Integer::NewFromUnsigned(isolate, 0x8DC7)); + tmpl->Set(isolate, "UNSIGNED_INT_VEC4", v8::Integer::NewFromUnsigned(isolate, 0x8DC8)); + tmpl->Set(isolate, "UNSIGNED_NORMALIZED", v8::Integer::NewFromUnsigned(isolate, 0x8C17)); + tmpl->Set(isolate, "SIGNED_NORMALIZED", v8::Integer::NewFromUnsigned(isolate, 0x8F9C)); /* Vertex attributes */ - tmpl->Set(isolate, "VERTEX_ATTRIB_ARRAY_INTEGER", v8::Uint32::New(isolate, 0x88FD)); - tmpl->Set(isolate, "VERTEX_ATTRIB_ARRAY_DIVISOR", v8::Uint32::New(isolate, 0x88FE)); - tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BUFFER_MODE", v8::Uint32::New(isolate, 0x8C7F)); + tmpl->Set(isolate, "VERTEX_ATTRIB_ARRAY_INTEGER", + v8::Integer::NewFromUnsigned(isolate, 0x88FD)); + tmpl->Set(isolate, "VERTEX_ATTRIB_ARRAY_DIVISOR", + v8::Integer::NewFromUnsigned(isolate, 0x88FE)); + tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BUFFER_MODE", + v8::Integer::NewFromUnsigned(isolate, 0x8C7F)); tmpl->Set(isolate, "MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS", - v8::Uint32::New(isolate, 0x8C80)); - tmpl->Set(isolate, "TRANSFORM_FEEDBACK_VARYINGS", v8::Uint32::New(isolate, 0x8C83)); - - tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BUFFER_START", v8::Uint32::New(isolate, 0x8C84)); - tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BUFFER_SIZE", v8::Uint32::New(isolate, 0x8C85)); - tmpl->Set(isolate, "TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN", v8::Uint32::New(isolate, 0x8C88)); + v8::Integer::NewFromUnsigned(isolate, 0x8C80)); + tmpl->Set(isolate, "TRANSFORM_FEEDBACK_VARYINGS", + v8::Integer::NewFromUnsigned(isolate, 0x8C83)); + + tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BUFFER_START", + v8::Integer::NewFromUnsigned(isolate, 0x8C84)); + tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BUFFER_SIZE", + v8::Integer::NewFromUnsigned(isolate, 0x8C85)); + tmpl->Set(isolate, "TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN", + v8::Integer::NewFromUnsigned(isolate, 0x8C88)); tmpl->Set(isolate, "MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS", - v8::Uint32::New(isolate, 0x8C8A)); + v8::Integer::NewFromUnsigned(isolate, 0x8C8A)); /* Textures */ /* Pixel types */ - tmpl->Set(isolate, "MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS", v8::Uint32::New(isolate, 0x8C8B)); - tmpl->Set(isolate, "INTERLEAVED_ATTRIBS", v8::Uint32::New(isolate, 0x8C8C)); - tmpl->Set(isolate, "SEPARATE_ATTRIBS", v8::Uint32::New(isolate, 0x8C8D)); - tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BUFFER", v8::Uint32::New(isolate, 0x8C8E)); - tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BUFFER_BINDING", v8::Uint32::New(isolate, 0x8C8F)); + tmpl->Set(isolate, "MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS", + v8::Integer::NewFromUnsigned(isolate, 0x8C8B)); + tmpl->Set(isolate, "INTERLEAVED_ATTRIBS", v8::Integer::NewFromUnsigned(isolate, 0x8C8C)); + tmpl->Set(isolate, "SEPARATE_ATTRIBS", v8::Integer::NewFromUnsigned(isolate, 0x8C8D)); + tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BUFFER", v8::Integer::NewFromUnsigned(isolate, 0x8C8E)); + tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BUFFER_BINDING", + v8::Integer::NewFromUnsigned(isolate, 0x8C8F)); - tmpl->Set(isolate, "TRANSFORM_FEEDBACK", v8::Uint32::New(isolate, 0x8E22)); - tmpl->Set(isolate, "TRANSFORM_FEEDBACK_PAUSED", v8::Uint32::New(isolate, 0x8E23)); - tmpl->Set(isolate, "TRANSFORM_FEEDBACK_ACTIVE", v8::Uint32::New(isolate, 0x8E24)); - tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BINDING", v8::Uint32::New(isolate, 0x8E25)); + tmpl->Set(isolate, "TRANSFORM_FEEDBACK", v8::Integer::NewFromUnsigned(isolate, 0x8E22)); + tmpl->Set(isolate, "TRANSFORM_FEEDBACK_PAUSED", v8::Integer::NewFromUnsigned(isolate, 0x8E23)); + tmpl->Set(isolate, "TRANSFORM_FEEDBACK_ACTIVE", v8::Integer::NewFromUnsigned(isolate, 0x8E24)); + tmpl->Set(isolate, "TRANSFORM_FEEDBACK_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8E25)); /* Pixel types */ /* Queries */ - tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING", v8::Uint32::New(isolate, 0x8210)); - tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE", v8::Uint32::New(isolate, 0x8211)); - tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_RED_SIZE", v8::Uint32::New(isolate, 0x8212)); - tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_GREEN_SIZE", v8::Uint32::New(isolate, 0x8213)); - tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_BLUE_SIZE", v8::Uint32::New(isolate, 0x8214)); + tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING", + v8::Integer::NewFromUnsigned(isolate, 0x8210)); + tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE", + v8::Integer::NewFromUnsigned(isolate, 0x8211)); + tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_RED_SIZE", + v8::Integer::NewFromUnsigned(isolate, 0x8212)); + tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_GREEN_SIZE", + v8::Integer::NewFromUnsigned(isolate, 0x8213)); + tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_BLUE_SIZE", + v8::Integer::NewFromUnsigned(isolate, 0x8214)); /* Queries */ /* Draw buffers */ - tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE", v8::Uint32::New(isolate, 0x8215)); - tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE", v8::Uint32::New(isolate, 0x8216)); - tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE", v8::Uint32::New(isolate, 0x8217)); - tmpl->Set(isolate, "FRAMEBUFFER_DEFAULT", v8::Uint32::New(isolate, 0x8218)); - tmpl->Set(isolate, "DEPTH_STENCIL_ATTACHMENT", v8::Uint32::New(isolate, 0x821A)); - - tmpl->Set(isolate, "DEPTH_STENCIL", v8::Uint32::New(isolate, 0x84F9)); - tmpl->Set(isolate, "DEPTH24_STENCIL8", v8::Uint32::New(isolate, 0x88F0)); - tmpl->Set(isolate, "DRAW_FRAMEBUFFER_BINDING", v8::Uint32::New(isolate, 0x8CA6)); - tmpl->Set(isolate, "READ_FRAMEBUFFER", v8::Uint32::New(isolate, 0x8CA8)); - tmpl->Set(isolate, "DRAW_FRAMEBUFFER", v8::Uint32::New(isolate, 0x8CA9)); - - tmpl->Set(isolate, "READ_FRAMEBUFFER_BINDING", v8::Uint32::New(isolate, 0x8CAA)); - tmpl->Set(isolate, "RENDERBUFFER_SAMPLES", v8::Uint32::New(isolate, 0x8CAB)); - tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER", v8::Uint32::New(isolate, 0x8CD4)); - tmpl->Set(isolate, "FRAMEBUFFER_INCOMPLETE_MULTISAMPLE", v8::Uint32::New(isolate, 0x8D56)); - tmpl->Set(isolate, "UNIFORM_BUFFER", v8::Uint32::New(isolate, 0x8A11)); - - tmpl->Set(isolate, "UNIFORM_BUFFER_BINDING", v8::Uint32::New(isolate, 0x8A28)); - tmpl->Set(isolate, "UNIFORM_BUFFER_START", v8::Uint32::New(isolate, 0x8A29)); - tmpl->Set(isolate, "UNIFORM_BUFFER_SIZE", v8::Uint32::New(isolate, 0x8A2A)); - tmpl->Set(isolate, "MAX_VERTEX_UNIFORM_BLOCKS", v8::Uint32::New(isolate, 0x8A2B)); - tmpl->Set(isolate, "MAX_FRAGMENT_UNIFORM_BLOCKS", v8::Uint32::New(isolate, 0x8A2D)); - - tmpl->Set(isolate, "MAX_COMBINED_UNIFORM_BLOCKS", v8::Uint32::New(isolate, 0x8A2E)); - tmpl->Set(isolate, "MAX_UNIFORM_BUFFER_BINDINGS", v8::Uint32::New(isolate, 0x8A2F)); - tmpl->Set(isolate, "MAX_UNIFORM_BLOCK_SIZE", v8::Uint32::New(isolate, 0x8A30)); - tmpl->Set(isolate, "MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS", v8::Uint32::New(isolate, 0x8A31)); + tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE", + v8::Integer::NewFromUnsigned(isolate, 0x8215)); + tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE", + v8::Integer::NewFromUnsigned(isolate, 0x8216)); + tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE", + v8::Integer::NewFromUnsigned(isolate, 0x8217)); + tmpl->Set(isolate, "FRAMEBUFFER_DEFAULT", v8::Integer::NewFromUnsigned(isolate, 0x8218)); + tmpl->Set(isolate, "DEPTH_STENCIL_ATTACHMENT", v8::Integer::NewFromUnsigned(isolate, 0x821A)); + + tmpl->Set(isolate, "DEPTH_STENCIL", v8::Integer::NewFromUnsigned(isolate, 0x84F9)); + tmpl->Set(isolate, "DEPTH24_STENCIL8", v8::Integer::NewFromUnsigned(isolate, 0x88F0)); + tmpl->Set(isolate, "DRAW_FRAMEBUFFER_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8CA6)); + tmpl->Set(isolate, "READ_FRAMEBUFFER", v8::Integer::NewFromUnsigned(isolate, 0x8CA8)); + tmpl->Set(isolate, "DRAW_FRAMEBUFFER", v8::Integer::NewFromUnsigned(isolate, 0x8CA9)); + + tmpl->Set(isolate, "READ_FRAMEBUFFER_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8CAA)); + tmpl->Set(isolate, "RENDERBUFFER_SAMPLES", v8::Integer::NewFromUnsigned(isolate, 0x8CAB)); + tmpl->Set(isolate, "FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER", + v8::Integer::NewFromUnsigned(isolate, 0x8CD4)); + tmpl->Set(isolate, "FRAMEBUFFER_INCOMPLETE_MULTISAMPLE", + v8::Integer::NewFromUnsigned(isolate, 0x8D56)); + tmpl->Set(isolate, "UNIFORM_BUFFER", v8::Integer::NewFromUnsigned(isolate, 0x8A11)); + + tmpl->Set(isolate, "UNIFORM_BUFFER_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8A28)); + tmpl->Set(isolate, "UNIFORM_BUFFER_START", v8::Integer::NewFromUnsigned(isolate, 0x8A29)); + tmpl->Set(isolate, "UNIFORM_BUFFER_SIZE", v8::Integer::NewFromUnsigned(isolate, 0x8A2A)); + tmpl->Set(isolate, "MAX_VERTEX_UNIFORM_BLOCKS", v8::Integer::NewFromUnsigned(isolate, 0x8A2B)); + tmpl->Set(isolate, "MAX_FRAGMENT_UNIFORM_BLOCKS", + v8::Integer::NewFromUnsigned(isolate, 0x8A2D)); + + tmpl->Set(isolate, "MAX_COMBINED_UNIFORM_BLOCKS", + v8::Integer::NewFromUnsigned(isolate, 0x8A2E)); + tmpl->Set(isolate, "MAX_UNIFORM_BUFFER_BINDINGS", + v8::Integer::NewFromUnsigned(isolate, 0x8A2F)); + tmpl->Set(isolate, "MAX_UNIFORM_BLOCK_SIZE", v8::Integer::NewFromUnsigned(isolate, 0x8A30)); + tmpl->Set(isolate, "MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS", + v8::Integer::NewFromUnsigned(isolate, 0x8A31)); tmpl->Set(isolate, "MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS", - v8::Uint32::New(isolate, 0x8A33)); + v8::Integer::NewFromUnsigned(isolate, 0x8A33)); - tmpl->Set(isolate, "UNIFORM_BUFFER_OFFSET_ALIGNMENT", v8::Uint32::New(isolate, 0x8A34)); - tmpl->Set(isolate, "ACTIVE_UNIFORM_BLOCKS", v8::Uint32::New(isolate, 0x8A36)); - tmpl->Set(isolate, "UNIFORM_TYPE", v8::Uint32::New(isolate, 0x8A37)); - tmpl->Set(isolate, "UNIFORM_SIZE", v8::Uint32::New(isolate, 0x8A38)); - tmpl->Set(isolate, "UNIFORM_BLOCK_INDEX", v8::Uint32::New(isolate, 0x8A3A)); + tmpl->Set(isolate, "UNIFORM_BUFFER_OFFSET_ALIGNMENT", + v8::Integer::NewFromUnsigned(isolate, 0x8A34)); + tmpl->Set(isolate, "ACTIVE_UNIFORM_BLOCKS", v8::Integer::NewFromUnsigned(isolate, 0x8A36)); + tmpl->Set(isolate, "UNIFORM_TYPE", v8::Integer::NewFromUnsigned(isolate, 0x8A37)); + tmpl->Set(isolate, "UNIFORM_SIZE", v8::Integer::NewFromUnsigned(isolate, 0x8A38)); + tmpl->Set(isolate, "UNIFORM_BLOCK_INDEX", v8::Integer::NewFromUnsigned(isolate, 0x8A3A)); - tmpl->Set(isolate, "UNIFORM_OFFSET", v8::Uint32::New(isolate, 0x8A3B)); - tmpl->Set(isolate, "UNIFORM_ARRAY_STRIDE", v8::Uint32::New(isolate, 0x8A3C)); - tmpl->Set(isolate, "UNIFORM_MATRIX_STRIDE", v8::Uint32::New(isolate, 0x8A3D)); + tmpl->Set(isolate, "UNIFORM_OFFSET", v8::Integer::NewFromUnsigned(isolate, 0x8A3B)); + tmpl->Set(isolate, "UNIFORM_ARRAY_STRIDE", v8::Integer::NewFromUnsigned(isolate, 0x8A3C)); + tmpl->Set(isolate, "UNIFORM_MATRIX_STRIDE", v8::Integer::NewFromUnsigned(isolate, 0x8A3D)); /* Draw buffers */ /* Samplers */ - tmpl->Set(isolate, "UNIFORM_IS_ROW_MAJOR", v8::Uint32::New(isolate, 0x8A3E)); - tmpl->Set(isolate, "UNIFORM_BLOCK_BINDING", v8::Uint32::New(isolate, 0x8A3F)); - tmpl->Set(isolate, "UNIFORM_BLOCK_DATA_SIZE", v8::Uint32::New(isolate, 0x8A40)); - tmpl->Set(isolate, "UNIFORM_BLOCK_ACTIVE_UNIFORMS", v8::Uint32::New(isolate, 0x8A42)); - tmpl->Set(isolate, "UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES", v8::Uint32::New(isolate, 0x8A43)); + tmpl->Set(isolate, "UNIFORM_IS_ROW_MAJOR", v8::Integer::NewFromUnsigned(isolate, 0x8A3E)); + tmpl->Set(isolate, "UNIFORM_BLOCK_BINDING", v8::Integer::NewFromUnsigned(isolate, 0x8A3F)); + tmpl->Set(isolate, "UNIFORM_BLOCK_DATA_SIZE", v8::Integer::NewFromUnsigned(isolate, 0x8A40)); + tmpl->Set(isolate, "UNIFORM_BLOCK_ACTIVE_UNIFORMS", + v8::Integer::NewFromUnsigned(isolate, 0x8A42)); + tmpl->Set(isolate, "UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES", + v8::Integer::NewFromUnsigned(isolate, 0x8A43)); tmpl->Set(isolate, "UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER", - v8::Uint32::New(isolate, 0x8A44)); + v8::Integer::NewFromUnsigned(isolate, 0x8A44)); tmpl->Set(isolate, "UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER", - v8::Uint32::New(isolate, 0x8A46)); - tmpl->Set(isolate, "OBJECT_TYPE", v8::Uint32::New(isolate, 0x9112)); - tmpl->Set(isolate, "SYNC_CONDITION", v8::Uint32::New(isolate, 0x9113)); - tmpl->Set(isolate, "SYNC_STATUS", v8::Uint32::New(isolate, 0x9114)); + v8::Integer::NewFromUnsigned(isolate, 0x8A46)); + tmpl->Set(isolate, "OBJECT_TYPE", v8::Integer::NewFromUnsigned(isolate, 0x9112)); + tmpl->Set(isolate, "SYNC_CONDITION", v8::Integer::NewFromUnsigned(isolate, 0x9113)); + tmpl->Set(isolate, "SYNC_STATUS", v8::Integer::NewFromUnsigned(isolate, 0x9114)); - tmpl->Set(isolate, "SYNC_FLAGS", v8::Uint32::New(isolate, 0x9115)); - tmpl->Set(isolate, "SYNC_FENCE", v8::Uint32::New(isolate, 0x9116)); - tmpl->Set(isolate, "SYNC_GPU_COMMANDS_COMPLETE", v8::Uint32::New(isolate, 0x9117)); - tmpl->Set(isolate, "UNSIGNALED", v8::Uint32::New(isolate, 0x9118)); - tmpl->Set(isolate, "SIGNALED", v8::Uint32::New(isolate, 0x9119)); + tmpl->Set(isolate, "SYNC_FLAGS", v8::Integer::NewFromUnsigned(isolate, 0x9115)); + tmpl->Set(isolate, "SYNC_FENCE", v8::Integer::NewFromUnsigned(isolate, 0x9116)); + tmpl->Set(isolate, "SYNC_GPU_COMMANDS_COMPLETE", v8::Integer::NewFromUnsigned(isolate, 0x9117)); + tmpl->Set(isolate, "UNSIGNALED", v8::Integer::NewFromUnsigned(isolate, 0x9118)); + tmpl->Set(isolate, "SIGNALED", v8::Integer::NewFromUnsigned(isolate, 0x9119)); /* Samplers */ /* Buffers */ - tmpl->Set(isolate, "ALREADY_SIGNALED", v8::Uint32::New(isolate, 0x911A)); - tmpl->Set(isolate, "TIMEOUT_EXPIRED", v8::Uint32::New(isolate, 0x911B)); - tmpl->Set(isolate, "CONDITION_SATISFIED", v8::Uint32::New(isolate, 0x911C)); - tmpl->Set(isolate, "WAIT_FAILED", v8::Uint32::New(isolate, 0x911D)); - tmpl->Set(isolate, "SYNC_FLUSH_COMMANDS_BIT", v8::Uint32::New(isolate, 0x00000001)); + tmpl->Set(isolate, "ALREADY_SIGNALED", v8::Integer::NewFromUnsigned(isolate, 0x911A)); + tmpl->Set(isolate, "TIMEOUT_EXPIRED", v8::Integer::NewFromUnsigned(isolate, 0x911B)); + tmpl->Set(isolate, "CONDITION_SATISFIED", v8::Integer::NewFromUnsigned(isolate, 0x911C)); + tmpl->Set(isolate, "WAIT_FAILED", v8::Integer::NewFromUnsigned(isolate, 0x911D)); + tmpl->Set(isolate, "SYNC_FLUSH_COMMANDS_BIT", + v8::Integer::NewFromUnsigned(isolate, 0x00000001)); - tmpl->Set(isolate, "COLOR", v8::Uint32::New(isolate, 0x1800)); - tmpl->Set(isolate, "DEPTH", v8::Uint32::New(isolate, 0x1801)); - tmpl->Set(isolate, "STENCIL", v8::Uint32::New(isolate, 0x1802)); + tmpl->Set(isolate, "COLOR", v8::Integer::NewFromUnsigned(isolate, 0x1800)); + tmpl->Set(isolate, "DEPTH", v8::Integer::NewFromUnsigned(isolate, 0x1801)); + tmpl->Set(isolate, "STENCIL", v8::Integer::NewFromUnsigned(isolate, 0x1802)); /* Buffers */ /* Data types */ - tmpl->Set(isolate, "MIN", v8::Uint32::New(isolate, 0x8007)); - tmpl->Set(isolate, "MAX", v8::Uint32::New(isolate, 0x8008)); - tmpl->Set(isolate, "DEPTH_COMPONENT24", v8::Uint32::New(isolate, 0x81A6)); - tmpl->Set(isolate, "STREAM_READ", v8::Uint32::New(isolate, 0x88E1)); - tmpl->Set(isolate, "STREAM_COPY", v8::Uint32::New(isolate, 0x88E2)); + tmpl->Set(isolate, "MIN", v8::Integer::NewFromUnsigned(isolate, 0x8007)); + tmpl->Set(isolate, "MAX", v8::Integer::NewFromUnsigned(isolate, 0x8008)); + tmpl->Set(isolate, "DEPTH_COMPONENT24", v8::Integer::NewFromUnsigned(isolate, 0x81A6)); + tmpl->Set(isolate, "STREAM_READ", v8::Integer::NewFromUnsigned(isolate, 0x88E1)); + tmpl->Set(isolate, "STREAM_COPY", v8::Integer::NewFromUnsigned(isolate, 0x88E2)); - tmpl->Set(isolate, "STATIC_READ", v8::Uint32::New(isolate, 0x88E5)); - tmpl->Set(isolate, "STATIC_COPY", v8::Uint32::New(isolate, 0x88E6)); - tmpl->Set(isolate, "DYNAMIC_READ", v8::Uint32::New(isolate, 0x88E9)); - tmpl->Set(isolate, "DYNAMIC_COPY", v8::Uint32::New(isolate, 0x88EA)); - tmpl->Set(isolate, "DEPTH_COMPONENT32F", v8::Uint32::New(isolate, 0x8CAC)); - tmpl->Set(isolate, "DEPTH32F_STENCIL8", v8::Uint32::New(isolate, 0x8CAD)); + tmpl->Set(isolate, "STATIC_READ", v8::Integer::NewFromUnsigned(isolate, 0x88E5)); + tmpl->Set(isolate, "STATIC_COPY", v8::Integer::NewFromUnsigned(isolate, 0x88E6)); + tmpl->Set(isolate, "DYNAMIC_READ", v8::Integer::NewFromUnsigned(isolate, 0x88E9)); + tmpl->Set(isolate, "DYNAMIC_COPY", v8::Integer::NewFromUnsigned(isolate, 0x88EA)); + tmpl->Set(isolate, "DEPTH_COMPONENT32F", v8::Integer::NewFromUnsigned(isolate, 0x8CAC)); + tmpl->Set(isolate, "DEPTH32F_STENCIL8", v8::Integer::NewFromUnsigned(isolate, 0x8CAD)); /* Data types */ - tmpl->Set(isolate, "INVALID_INDEX", v8::Number::New(isolate, (double) 0xFFFFFFFF)); + tmpl->Set(isolate, "INVALID_INDEX", v8::Integer::NewFromUnsigned(isolate, 0xFFFFFFFF)); tmpl->Set(isolate, "TIMEOUT_IGNORED", v8::Int32::New(isolate, -1)); /* Vertex attributes */ /* Transform feedback */ - tmpl->Set(isolate, "MAX_CLIENT_WAIT_TIMEOUT_WEBGL", v8::Uint32::New(isolate, 0x9247)); + tmpl->Set(isolate, "MAX_CLIENT_WAIT_TIMEOUT_WEBGL", + v8::Integer::NewFromUnsigned(isolate, 0x9247)); /* Transform feedback */ diff --git a/tools/demo/canvas-three/index.ts b/tools/demo/canvas-three/index.ts index 0f915fe6e..05308cccc 100644 --- a/tools/demo/canvas-three/index.ts +++ b/tools/demo/canvas-three/index.ts @@ -108,8 +108,8 @@ export class DemoSharedCanvasThree extends DemoSharedBase { //this.webgl_buffergeometry_drawrange(this.canvas); //this.panorama_cube(this.canvas); //this.webgl_postprocessing_unreal_bloom(this.canvas); - //the_frantic_run_of_the_valorous_rabbit(this.canvas,this.canvas.parent); - ghost_card(this.canvas); + the_frantic_run_of_the_valorous_rabbit(this.canvas,this.canvas.parent); + //ghost_card(this.canvas); } webgl_postprocessing_unreal_bloom(canvas) { diff --git a/tools/demo/canvas/index.ts b/tools/demo/canvas/index.ts index cc2ca648c..a5aedb46b 100644 --- a/tools/demo/canvas/index.ts +++ b/tools/demo/canvas/index.ts @@ -646,14 +646,14 @@ export class DemoSharedCanvas extends DemoSharedBase { //this.multiCanvas(this.canvas); //triangle(this.canvas); //this.zen3dCube(this.canvas); - //this.zen3dGeometryLoaderGltf(this.canvas); + this.zen3dGeometryLoaderGltf(this.canvas); //this.playCanvas(this.canvas); //this.drawRandomFullscreenImage(this.canvas); //issue54(this.canvas); //this.decoder() //this.context2DTest(this.canvas); - issue93(this.canvas); + //issue93(this.canvas); } drawRandomFullscreenImage(canvas) {