diff --git a/Package.swift b/Package.swift index 7157ffdd..891b5951 100644 --- a/Package.swift +++ b/Package.swift @@ -8,35 +8,43 @@ let package = Package( products: [ .executable( name: "DOMKitDemo", - targets: ["DOMKitDemo"]), + targets: ["DOMKitDemo"] + ), .library( name: "DOMKit", - targets: ["DOMKit"]), + targets: ["DOMKit"] + ), .library(name: "WebIDL", targets: ["WebIDL"]), .executable(name: "WebIDLToSwift", targets: ["WebIDLToSwift"]), ], dependencies: [ .package( url: "https://github.com/swiftwasm/JavaScriptKit.git", - .branch("main")), + .revision("95d0c4cd78b48ffc7e19c618d57c3244917be09a") + ), ], targets: [ .target( name: "DOMKitDemo", - dependencies: ["DOMKit"]), + dependencies: ["DOMKit"] + ), .target( name: "DOMKit", - dependencies: ["ECMAScript", "JavaScriptKit", .product(name: "JavaScriptEventLoop", package: "JavaScriptKit")]), + dependencies: ["ECMAScript", "JavaScriptKit", .product(name: "JavaScriptEventLoop", package: "JavaScriptKit")] + ), // This support library should be moved to JavaScriptKit .target(name: "ECMAScript", dependencies: [ "JavaScriptKit", - .product(name: "JavaScriptEventLoop", package: "JavaScriptKit")]), + .product(name: "JavaScriptEventLoop", package: "JavaScriptKit"), + ]), .target(name: "WebIDL"), .target( name: "WebIDLToSwift", - dependencies: ["WebIDL"]), + dependencies: ["WebIDL"] + ), .testTarget( name: "DOMKitTests", - dependencies: ["DOMKit"]), + dependencies: ["DOMKit"] + ), ] ) diff --git a/Sources/DOMKit/Generated.swift b/Sources/DOMKit/Generated.swift index d607201c..22b3eff4 100644 --- a/Sources/DOMKit/Generated.swift +++ b/Sources/DOMKit/Generated.swift @@ -17883,6 +17883,9 @@ public typealias GLuint = UInt32 public typealias GLfloat = Float public typealias GLclampf = Float +public typealias GLint64 = Int64 +public typealias GLuint64 = UInt64 + public typealias MutationCallback = ([MutationRecord], MutationObserver) -> Void public typealias BlobCallback = (Blob?) -> Void public typealias FunctionStringCallback = (String) -> Void @@ -19038,138 +19041,1619 @@ public enum VideoResizeModeEnum: JSString, JSValueCompatible { return nil } - @inlinable public init?(string: String) { - self.init(rawValue: JSString(string)) + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} + +public class VideoTrack: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.VideoTrack].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) + _kind = ReadonlyAttribute(jsObject: jsObject, name: Strings.kind) + _label = ReadonlyAttribute(jsObject: jsObject, name: Strings.label) + _language = ReadonlyAttribute(jsObject: jsObject, name: Strings.language) + _selected = ReadWriteAttribute(jsObject: jsObject, name: Strings.selected) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var id: String + + @ReadonlyAttribute + public var kind: String + + @ReadonlyAttribute + public var label: String + + @ReadonlyAttribute + public var language: String + + @ReadWriteAttribute + public var selected: Bool +} + +public class VideoTrackList: EventTarget { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.VideoTrackList].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + _selectedIndex = ReadonlyAttribute(jsObject: jsObject, name: Strings.selectedIndex) + _onchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onchange) + _onaddtrack = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onaddtrack) + _onremovetrack = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onremovetrack) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var length: UInt32 + + @inlinable public subscript(key: Int) -> VideoTrack { + jsObject[key].fromJSValue()! + } + + @inlinable public func getTrackById(id: String) -> VideoTrack? { + let this = jsObject + return this[Strings.getTrackById].function!(this: this, arguments: [id.jsValue]).fromJSValue()! + } + + @ReadonlyAttribute + public var selectedIndex: Int32 + + @ClosureAttribute1Optional + public var onchange: EventHandler + + @ClosureAttribute1Optional + public var onaddtrack: EventHandler + + @ClosureAttribute1Optional + public var onremovetrack: EventHandler +} + +public enum VideoTransferCharacteristics: JSString, JSValueCompatible { + case bt709 = "bt709" + case smpte170m = "smpte170m" + case iec6196621 = "iec61966-2-1" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} + +public class WaveShaperNode: AudioNode { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WaveShaperNode].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _curve = ReadWriteAttribute(jsObject: jsObject, name: Strings.curve) + _oversample = ReadWriteAttribute(jsObject: jsObject, name: Strings.oversample) + super.init(unsafelyWrapping: jsObject) + } + + @inlinable public convenience init(context: BaseAudioContext, options: WaveShaperOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) + } + + @ReadWriteAttribute + public var curve: Float32Array? + + @ReadWriteAttribute + public var oversample: OverSampleType +} + +public class WaveShaperOptions: BridgedDictionary { + public convenience init(curve: [Float], oversample: OverSampleType) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.curve] = curve.jsValue + object[Strings.oversample] = oversample.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _curve = ReadWriteAttribute(jsObject: object, name: Strings.curve) + _oversample = ReadWriteAttribute(jsObject: object, name: Strings.oversample) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var curve: [Float] + + @ReadWriteAttribute + public var oversample: OverSampleType +} + +public class WebGL2RenderingContext: JSBridgedClass, WebGLRenderingContextBase, WebGL2RenderingContextBase, WebGL2RenderingContextOverloads { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WebGL2RenderingContext].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} + +public protocol WebGL2RenderingContextBase: JSBridgedClass {} +public extension WebGL2RenderingContextBase { + @inlinable static var READ_BUFFER: GLenum { 0x0C02 } + + @inlinable static var UNPACK_ROW_LENGTH: GLenum { 0x0CF2 } + + @inlinable static var UNPACK_SKIP_ROWS: GLenum { 0x0CF3 } + + @inlinable static var UNPACK_SKIP_PIXELS: GLenum { 0x0CF4 } + + @inlinable static var PACK_ROW_LENGTH: GLenum { 0x0D02 } + + @inlinable static var PACK_SKIP_ROWS: GLenum { 0x0D03 } + + @inlinable static var PACK_SKIP_PIXELS: GLenum { 0x0D04 } + + @inlinable static var COLOR: GLenum { 0x1800 } + + @inlinable static var DEPTH: GLenum { 0x1801 } + + @inlinable static var STENCIL: GLenum { 0x1802 } + + @inlinable static var RED: GLenum { 0x1903 } + + @inlinable static var RGB8: GLenum { 0x8051 } + + @inlinable static var RGBA8: GLenum { 0x8058 } + + @inlinable static var RGB10_A2: GLenum { 0x8059 } + + @inlinable static var TEXTURE_BINDING_3D: GLenum { 0x806A } + + @inlinable static var UNPACK_SKIP_IMAGES: GLenum { 0x806D } + + @inlinable static var UNPACK_IMAGE_HEIGHT: GLenum { 0x806E } + + @inlinable static var TEXTURE_3D: GLenum { 0x806F } + + @inlinable static var TEXTURE_WRAP_R: GLenum { 0x8072 } + + @inlinable static var MAX_3D_TEXTURE_SIZE: GLenum { 0x8073 } + + @inlinable static var UNSIGNED_INT_2_10_10_10_REV: GLenum { 0x8368 } + + @inlinable static var MAX_ELEMENTS_VERTICES: GLenum { 0x80E8 } + + @inlinable static var MAX_ELEMENTS_INDICES: GLenum { 0x80E9 } + + @inlinable static var TEXTURE_MIN_LOD: GLenum { 0x813A } + + @inlinable static var TEXTURE_MAX_LOD: GLenum { 0x813B } + + @inlinable static var TEXTURE_BASE_LEVEL: GLenum { 0x813C } + + @inlinable static var TEXTURE_MAX_LEVEL: GLenum { 0x813D } + + @inlinable static var MIN: GLenum { 0x8007 } + + @inlinable static var MAX: GLenum { 0x8008 } + + @inlinable static var DEPTH_COMPONENT24: GLenum { 0x81A6 } + + @inlinable static var MAX_TEXTURE_LOD_BIAS: GLenum { 0x84FD } + + @inlinable static var TEXTURE_COMPARE_MODE: GLenum { 0x884C } + + @inlinable static var TEXTURE_COMPARE_FUNC: GLenum { 0x884D } + + @inlinable static var CURRENT_QUERY: GLenum { 0x8865 } + + @inlinable static var QUERY_RESULT: GLenum { 0x8866 } + + @inlinable static var QUERY_RESULT_AVAILABLE: GLenum { 0x8867 } + + @inlinable static var STREAM_READ: GLenum { 0x88E1 } + + @inlinable static var STREAM_COPY: GLenum { 0x88E2 } + + @inlinable static var STATIC_READ: GLenum { 0x88E5 } + + @inlinable static var STATIC_COPY: GLenum { 0x88E6 } + + @inlinable static var DYNAMIC_READ: GLenum { 0x88E9 } + + @inlinable static var DYNAMIC_COPY: GLenum { 0x88EA } + + @inlinable static var MAX_DRAW_BUFFERS: GLenum { 0x8824 } + + @inlinable static var DRAW_BUFFER0: GLenum { 0x8825 } + + @inlinable static var DRAW_BUFFER1: GLenum { 0x8826 } + + @inlinable static var DRAW_BUFFER2: GLenum { 0x8827 } + + @inlinable static var DRAW_BUFFER3: GLenum { 0x8828 } + + @inlinable static var DRAW_BUFFER4: GLenum { 0x8829 } + + @inlinable static var DRAW_BUFFER5: GLenum { 0x882A } + + @inlinable static var DRAW_BUFFER6: GLenum { 0x882B } + + @inlinable static var DRAW_BUFFER7: GLenum { 0x882C } + + @inlinable static var DRAW_BUFFER8: GLenum { 0x882D } + + @inlinable static var DRAW_BUFFER9: GLenum { 0x882E } + + @inlinable static var DRAW_BUFFER10: GLenum { 0x882F } + + @inlinable static var DRAW_BUFFER11: GLenum { 0x8830 } + + @inlinable static var DRAW_BUFFER12: GLenum { 0x8831 } + + @inlinable static var DRAW_BUFFER13: GLenum { 0x8832 } + + @inlinable static var DRAW_BUFFER14: GLenum { 0x8833 } + + @inlinable static var DRAW_BUFFER15: GLenum { 0x8834 } + + @inlinable static var MAX_FRAGMENT_UNIFORM_COMPONENTS: GLenum { 0x8B49 } + + @inlinable static var MAX_VERTEX_UNIFORM_COMPONENTS: GLenum { 0x8B4A } + + @inlinable static var SAMPLER_3D: GLenum { 0x8B5F } + + @inlinable static var SAMPLER_2D_SHADOW: GLenum { 0x8B62 } + + @inlinable static var FRAGMENT_SHADER_DERIVATIVE_HINT: GLenum { 0x8B8B } + + @inlinable static var PIXEL_PACK_BUFFER: GLenum { 0x88EB } + + @inlinable static var PIXEL_UNPACK_BUFFER: GLenum { 0x88EC } + + @inlinable static var PIXEL_PACK_BUFFER_BINDING: GLenum { 0x88ED } + + @inlinable static var PIXEL_UNPACK_BUFFER_BINDING: GLenum { 0x88EF } + + @inlinable static var FLOAT_MAT2x3: GLenum { 0x8B65 } + + @inlinable static var FLOAT_MAT2x4: GLenum { 0x8B66 } + + @inlinable static var FLOAT_MAT3x2: GLenum { 0x8B67 } + + @inlinable static var FLOAT_MAT3x4: GLenum { 0x8B68 } + + @inlinable static var FLOAT_MAT4x2: GLenum { 0x8B69 } + + @inlinable static var FLOAT_MAT4x3: GLenum { 0x8B6A } + + @inlinable static var SRGB: GLenum { 0x8C40 } + + @inlinable static var SRGB8: GLenum { 0x8C41 } + + @inlinable static var SRGB8_ALPHA8: GLenum { 0x8C43 } + + @inlinable static var COMPARE_REF_TO_TEXTURE: GLenum { 0x884E } + + @inlinable static var RGBA32F: GLenum { 0x8814 } + + @inlinable static var RGB32F: GLenum { 0x8815 } + + @inlinable static var RGBA16F: GLenum { 0x881A } + + @inlinable static var RGB16F: GLenum { 0x881B } + + @inlinable static var VERTEX_ATTRIB_ARRAY_INTEGER: GLenum { 0x88FD } + + @inlinable static var MAX_ARRAY_TEXTURE_LAYERS: GLenum { 0x88FF } + + @inlinable static var MIN_PROGRAM_TEXEL_OFFSET: GLenum { 0x8904 } + + @inlinable static var MAX_PROGRAM_TEXEL_OFFSET: GLenum { 0x8905 } + + @inlinable static var MAX_VARYING_COMPONENTS: GLenum { 0x8B4B } + + @inlinable static var TEXTURE_2D_ARRAY: GLenum { 0x8C1A } + + @inlinable static var TEXTURE_BINDING_2D_ARRAY: GLenum { 0x8C1D } + + @inlinable static var R11F_G11F_B10F: GLenum { 0x8C3A } + + @inlinable static var UNSIGNED_INT_10F_11F_11F_REV: GLenum { 0x8C3B } + + @inlinable static var RGB9_E5: GLenum { 0x8C3D } + + @inlinable static var UNSIGNED_INT_5_9_9_9_REV: GLenum { 0x8C3E } + + @inlinable static var TRANSFORM_FEEDBACK_BUFFER_MODE: GLenum { 0x8C7F } + + @inlinable static var MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: GLenum { 0x8C80 } + + @inlinable static var TRANSFORM_FEEDBACK_VARYINGS: GLenum { 0x8C83 } + + @inlinable static var TRANSFORM_FEEDBACK_BUFFER_START: GLenum { 0x8C84 } + + @inlinable static var TRANSFORM_FEEDBACK_BUFFER_SIZE: GLenum { 0x8C85 } + + @inlinable static var TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: GLenum { 0x8C88 } + + @inlinable static var RASTERIZER_DISCARD: GLenum { 0x8C89 } + + @inlinable static var MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: GLenum { 0x8C8A } + + @inlinable static var MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: GLenum { 0x8C8B } + + @inlinable static var INTERLEAVED_ATTRIBS: GLenum { 0x8C8C } + + @inlinable static var SEPARATE_ATTRIBS: GLenum { 0x8C8D } + + @inlinable static var TRANSFORM_FEEDBACK_BUFFER: GLenum { 0x8C8E } + + @inlinable static var TRANSFORM_FEEDBACK_BUFFER_BINDING: GLenum { 0x8C8F } + + @inlinable static var RGBA32UI: GLenum { 0x8D70 } + + @inlinable static var RGB32UI: GLenum { 0x8D71 } + + @inlinable static var RGBA16UI: GLenum { 0x8D76 } + + @inlinable static var RGB16UI: GLenum { 0x8D77 } + + @inlinable static var RGBA8UI: GLenum { 0x8D7C } + + @inlinable static var RGB8UI: GLenum { 0x8D7D } + + @inlinable static var RGBA32I: GLenum { 0x8D82 } + + @inlinable static var RGB32I: GLenum { 0x8D83 } + + @inlinable static var RGBA16I: GLenum { 0x8D88 } + + @inlinable static var RGB16I: GLenum { 0x8D89 } + + @inlinable static var RGBA8I: GLenum { 0x8D8E } + + @inlinable static var RGB8I: GLenum { 0x8D8F } + + @inlinable static var RED_INTEGER: GLenum { 0x8D94 } + + @inlinable static var RGB_INTEGER: GLenum { 0x8D98 } + + @inlinable static var RGBA_INTEGER: GLenum { 0x8D99 } + + @inlinable static var SAMPLER_2D_ARRAY: GLenum { 0x8DC1 } + + @inlinable static var SAMPLER_2D_ARRAY_SHADOW: GLenum { 0x8DC4 } + + @inlinable static var SAMPLER_CUBE_SHADOW: GLenum { 0x8DC5 } + + @inlinable static var UNSIGNED_INT_VEC2: GLenum { 0x8DC6 } + + @inlinable static var UNSIGNED_INT_VEC3: GLenum { 0x8DC7 } + + @inlinable static var UNSIGNED_INT_VEC4: GLenum { 0x8DC8 } + + @inlinable static var INT_SAMPLER_2D: GLenum { 0x8DCA } + + @inlinable static var INT_SAMPLER_3D: GLenum { 0x8DCB } + + @inlinable static var INT_SAMPLER_CUBE: GLenum { 0x8DCC } + + @inlinable static var INT_SAMPLER_2D_ARRAY: GLenum { 0x8DCF } + + @inlinable static var UNSIGNED_INT_SAMPLER_2D: GLenum { 0x8DD2 } + + @inlinable static var UNSIGNED_INT_SAMPLER_3D: GLenum { 0x8DD3 } + + @inlinable static var UNSIGNED_INT_SAMPLER_CUBE: GLenum { 0x8DD4 } + + @inlinable static var UNSIGNED_INT_SAMPLER_2D_ARRAY: GLenum { 0x8DD7 } + + @inlinable static var DEPTH_COMPONENT32F: GLenum { 0x8CAC } + + @inlinable static var DEPTH32F_STENCIL8: GLenum { 0x8CAD } + + @inlinable static var FLOAT_32_UNSIGNED_INT_24_8_REV: GLenum { 0x8DAD } + + @inlinable static var FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: GLenum { 0x8210 } + + @inlinable static var FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: GLenum { 0x8211 } + + @inlinable static var FRAMEBUFFER_ATTACHMENT_RED_SIZE: GLenum { 0x8212 } + + @inlinable static var FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: GLenum { 0x8213 } + + @inlinable static var FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: GLenum { 0x8214 } + + @inlinable static var FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: GLenum { 0x8215 } + + @inlinable static var FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: GLenum { 0x8216 } + + @inlinable static var FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: GLenum { 0x8217 } + + @inlinable static var FRAMEBUFFER_DEFAULT: GLenum { 0x8218 } + + @inlinable static var UNSIGNED_INT_24_8: GLenum { 0x84FA } + + @inlinable static var DEPTH24_STENCIL8: GLenum { 0x88F0 } + + @inlinable static var UNSIGNED_NORMALIZED: GLenum { 0x8C17 } + + @inlinable static var DRAW_FRAMEBUFFER_BINDING: GLenum { 0x8CA6 } + + @inlinable static var READ_FRAMEBUFFER: GLenum { 0x8CA8 } + + @inlinable static var DRAW_FRAMEBUFFER: GLenum { 0x8CA9 } + + @inlinable static var READ_FRAMEBUFFER_BINDING: GLenum { 0x8CAA } + + @inlinable static var RENDERBUFFER_SAMPLES: GLenum { 0x8CAB } + + @inlinable static var FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: GLenum { 0x8CD4 } + + @inlinable static var MAX_COLOR_ATTACHMENTS: GLenum { 0x8CDF } + + @inlinable static var COLOR_ATTACHMENT1: GLenum { 0x8CE1 } + + @inlinable static var COLOR_ATTACHMENT2: GLenum { 0x8CE2 } + + @inlinable static var COLOR_ATTACHMENT3: GLenum { 0x8CE3 } + + @inlinable static var COLOR_ATTACHMENT4: GLenum { 0x8CE4 } + + @inlinable static var COLOR_ATTACHMENT5: GLenum { 0x8CE5 } + + @inlinable static var COLOR_ATTACHMENT6: GLenum { 0x8CE6 } + + @inlinable static var COLOR_ATTACHMENT7: GLenum { 0x8CE7 } + + @inlinable static var COLOR_ATTACHMENT8: GLenum { 0x8CE8 } + + @inlinable static var COLOR_ATTACHMENT9: GLenum { 0x8CE9 } + + @inlinable static var COLOR_ATTACHMENT10: GLenum { 0x8CEA } + + @inlinable static var COLOR_ATTACHMENT11: GLenum { 0x8CEB } + + @inlinable static var COLOR_ATTACHMENT12: GLenum { 0x8CEC } + + @inlinable static var COLOR_ATTACHMENT13: GLenum { 0x8CED } + + @inlinable static var COLOR_ATTACHMENT14: GLenum { 0x8CEE } + + @inlinable static var COLOR_ATTACHMENT15: GLenum { 0x8CEF } + + @inlinable static var FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: GLenum { 0x8D56 } + + @inlinable static var MAX_SAMPLES: GLenum { 0x8D57 } + + @inlinable static var HALF_FLOAT: GLenum { 0x140B } + + @inlinable static var RG: GLenum { 0x8227 } + + @inlinable static var RG_INTEGER: GLenum { 0x8228 } + + @inlinable static var R8: GLenum { 0x8229 } + + @inlinable static var RG8: GLenum { 0x822B } + + @inlinable static var R16F: GLenum { 0x822D } + + @inlinable static var R32F: GLenum { 0x822E } + + @inlinable static var RG16F: GLenum { 0x822F } + + @inlinable static var RG32F: GLenum { 0x8230 } + + @inlinable static var R8I: GLenum { 0x8231 } + + @inlinable static var R8UI: GLenum { 0x8232 } + + @inlinable static var R16I: GLenum { 0x8233 } + + @inlinable static var R16UI: GLenum { 0x8234 } + + @inlinable static var R32I: GLenum { 0x8235 } + + @inlinable static var R32UI: GLenum { 0x8236 } + + @inlinable static var RG8I: GLenum { 0x8237 } + + @inlinable static var RG8UI: GLenum { 0x8238 } + + @inlinable static var RG16I: GLenum { 0x8239 } + + @inlinable static var RG16UI: GLenum { 0x823A } + + @inlinable static var RG32I: GLenum { 0x823B } + + @inlinable static var RG32UI: GLenum { 0x823C } + + @inlinable static var VERTEX_ARRAY_BINDING: GLenum { 0x85B5 } + + @inlinable static var R8_SNORM: GLenum { 0x8F94 } + + @inlinable static var RG8_SNORM: GLenum { 0x8F95 } + + @inlinable static var RGB8_SNORM: GLenum { 0x8F96 } + + @inlinable static var RGBA8_SNORM: GLenum { 0x8F97 } + + @inlinable static var SIGNED_NORMALIZED: GLenum { 0x8F9C } + + @inlinable static var COPY_READ_BUFFER: GLenum { 0x8F36 } + + @inlinable static var COPY_WRITE_BUFFER: GLenum { 0x8F37 } + + @inlinable static var COPY_READ_BUFFER_BINDING: GLenum { 0x8F36 } + + @inlinable static var COPY_WRITE_BUFFER_BINDING: GLenum { 0x8F37 } + + @inlinable static var UNIFORM_BUFFER: GLenum { 0x8A11 } + + @inlinable static var UNIFORM_BUFFER_BINDING: GLenum { 0x8A28 } + + @inlinable static var UNIFORM_BUFFER_START: GLenum { 0x8A29 } + + @inlinable static var UNIFORM_BUFFER_SIZE: GLenum { 0x8A2A } + + @inlinable static var MAX_VERTEX_UNIFORM_BLOCKS: GLenum { 0x8A2B } + + @inlinable static var MAX_FRAGMENT_UNIFORM_BLOCKS: GLenum { 0x8A2D } + + @inlinable static var MAX_COMBINED_UNIFORM_BLOCKS: GLenum { 0x8A2E } + + @inlinable static var MAX_UNIFORM_BUFFER_BINDINGS: GLenum { 0x8A2F } + + @inlinable static var MAX_UNIFORM_BLOCK_SIZE: GLenum { 0x8A30 } + + @inlinable static var MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: GLenum { 0x8A31 } + + @inlinable static var MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: GLenum { 0x8A33 } + + @inlinable static var UNIFORM_BUFFER_OFFSET_ALIGNMENT: GLenum { 0x8A34 } + + @inlinable static var ACTIVE_UNIFORM_BLOCKS: GLenum { 0x8A36 } + + @inlinable static var UNIFORM_TYPE: GLenum { 0x8A37 } + + @inlinable static var UNIFORM_SIZE: GLenum { 0x8A38 } + + @inlinable static var UNIFORM_BLOCK_INDEX: GLenum { 0x8A3A } + + @inlinable static var UNIFORM_OFFSET: GLenum { 0x8A3B } + + @inlinable static var UNIFORM_ARRAY_STRIDE: GLenum { 0x8A3C } + + @inlinable static var UNIFORM_MATRIX_STRIDE: GLenum { 0x8A3D } + + @inlinable static var UNIFORM_IS_ROW_MAJOR: GLenum { 0x8A3E } + + @inlinable static var UNIFORM_BLOCK_BINDING: GLenum { 0x8A3F } + + @inlinable static var UNIFORM_BLOCK_DATA_SIZE: GLenum { 0x8A40 } + + @inlinable static var UNIFORM_BLOCK_ACTIVE_UNIFORMS: GLenum { 0x8A42 } + + @inlinable static var UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: GLenum { 0x8A43 } + + @inlinable static var UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: GLenum { 0x8A44 } + + @inlinable static var UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: GLenum { 0x8A46 } + + @inlinable static var INVALID_INDEX: GLenum { 0xFFFF_FFFF } + + @inlinable static var MAX_VERTEX_OUTPUT_COMPONENTS: GLenum { 0x9122 } + + @inlinable static var MAX_FRAGMENT_INPUT_COMPONENTS: GLenum { 0x9125 } + + @inlinable static var MAX_SERVER_WAIT_TIMEOUT: GLenum { 0x9111 } + + @inlinable static var OBJECT_TYPE: GLenum { 0x9112 } + + @inlinable static var SYNC_CONDITION: GLenum { 0x9113 } + + @inlinable static var SYNC_STATUS: GLenum { 0x9114 } + + @inlinable static var SYNC_FLAGS: GLenum { 0x9115 } + + @inlinable static var SYNC_FENCE: GLenum { 0x9116 } + + @inlinable static var SYNC_GPU_COMMANDS_COMPLETE: GLenum { 0x9117 } + + @inlinable static var UNSIGNALED: GLenum { 0x9118 } + + @inlinable static var SIGNALED: GLenum { 0x9119 } + + @inlinable static var ALREADY_SIGNALED: GLenum { 0x911A } + + @inlinable static var TIMEOUT_EXPIRED: GLenum { 0x911B } + + @inlinable static var CONDITION_SATISFIED: GLenum { 0x911C } + + @inlinable static var WAIT_FAILED: GLenum { 0x911D } + + @inlinable static var SYNC_FLUSH_COMMANDS_BIT: GLenum { 0x0000_0001 } + + @inlinable static var VERTEX_ATTRIB_ARRAY_DIVISOR: GLenum { 0x88FE } + + @inlinable static var ANY_SAMPLES_PASSED: GLenum { 0x8C2F } + + @inlinable static var ANY_SAMPLES_PASSED_CONSERVATIVE: GLenum { 0x8D6A } + + @inlinable static var SAMPLER_BINDING: GLenum { 0x8919 } + + @inlinable static var RGB10_A2UI: GLenum { 0x906F } + + @inlinable static var INT_2_10_10_10_REV: GLenum { 0x8D9F } + + @inlinable static var TRANSFORM_FEEDBACK: GLenum { 0x8E22 } + + @inlinable static var TRANSFORM_FEEDBACK_PAUSED: GLenum { 0x8E23 } + + @inlinable static var TRANSFORM_FEEDBACK_ACTIVE: GLenum { 0x8E24 } + + @inlinable static var TRANSFORM_FEEDBACK_BINDING: GLenum { 0x8E25 } + + @inlinable static var TEXTURE_IMMUTABLE_FORMAT: GLenum { 0x912F } + + @inlinable static var MAX_ELEMENT_INDEX: GLenum { 0x8D6B } + + @inlinable static var TEXTURE_IMMUTABLE_LEVELS: GLenum { 0x82DF } + + @inlinable static var TIMEOUT_IGNORED: GLint64 { -1 } + + @inlinable static var MAX_CLIENT_WAIT_TIMEOUT_WEBGL: GLenum { 0x9247 } + + @inlinable func copyBufferSubData(readTarget: GLenum, writeTarget: GLenum, readOffset: GLintptr, writeOffset: GLintptr, size: GLsizeiptr) { + let this = jsObject + _ = this[Strings.copyBufferSubData].function!(this: this, arguments: [readTarget.jsValue, writeTarget.jsValue, readOffset.jsValue, writeOffset.jsValue, size.jsValue]) + } + + @inlinable func getBufferSubData(target: GLenum, srcByteOffset: GLintptr, dstBuffer: ArrayBufferView, dstOffset: GLuint? = nil, length: GLuint? = nil) { + let this = jsObject + _ = this[Strings.getBufferSubData].function!(this: this, arguments: [target.jsValue, srcByteOffset.jsValue, dstBuffer.jsValue, dstOffset?.jsValue ?? .undefined, length?.jsValue ?? .undefined]) + } + + @inlinable func blitFramebuffer(srcX0: GLint, srcY0: GLint, srcX1: GLint, srcY1: GLint, dstX0: GLint, dstY0: GLint, dstX1: GLint, dstY1: GLint, mask: GLbitfield, filter: GLenum) { + let _arg0 = srcX0.jsValue + let _arg1 = srcY0.jsValue + let _arg2 = srcX1.jsValue + let _arg3 = srcY1.jsValue + let _arg4 = dstX0.jsValue + let _arg5 = dstY0.jsValue + let _arg6 = dstX1.jsValue + let _arg7 = dstY1.jsValue + let _arg8 = mask.jsValue + let _arg9 = filter.jsValue + let this = jsObject + _ = this[Strings.blitFramebuffer].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) + } + + @inlinable func framebufferTextureLayer(target: GLenum, attachment: GLenum, texture: WebGLTexture?, level: GLint, layer: GLint) { + let this = jsObject + _ = this[Strings.framebufferTextureLayer].function!(this: this, arguments: [target.jsValue, attachment.jsValue, texture.jsValue, level.jsValue, layer.jsValue]) + } + + @inlinable func invalidateFramebuffer(target: GLenum, attachments: [GLenum]) { + let this = jsObject + _ = this[Strings.invalidateFramebuffer].function!(this: this, arguments: [target.jsValue, attachments.jsValue]) + } + + @inlinable func invalidateSubFramebuffer(target: GLenum, attachments: [GLenum], x: GLint, y: GLint, width: GLsizei, height: GLsizei) { + let _arg0 = target.jsValue + let _arg1 = attachments.jsValue + let _arg2 = x.jsValue + let _arg3 = y.jsValue + let _arg4 = width.jsValue + let _arg5 = height.jsValue + let this = jsObject + _ = this[Strings.invalidateSubFramebuffer].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) + } + + @inlinable func readBuffer(src: GLenum) { + let this = jsObject + _ = this[Strings.readBuffer].function!(this: this, arguments: [src.jsValue]) + } + + @inlinable func getInternalformatParameter(target: GLenum, internalformat: GLenum, pname: GLenum) -> JSValue { + let this = jsObject + return this[Strings.getInternalformatParameter].function!(this: this, arguments: [target.jsValue, internalformat.jsValue, pname.jsValue]).fromJSValue()! + } + + @inlinable func renderbufferStorageMultisample(target: GLenum, samples: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei) { + let this = jsObject + _ = this[Strings.renderbufferStorageMultisample].function!(this: this, arguments: [target.jsValue, samples.jsValue, internalformat.jsValue, width.jsValue, height.jsValue]) + } + + @inlinable func texStorage2D(target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei) { + let this = jsObject + _ = this[Strings.texStorage2D].function!(this: this, arguments: [target.jsValue, levels.jsValue, internalformat.jsValue, width.jsValue, height.jsValue]) + } + + @inlinable func texStorage3D(target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei) { + let _arg0 = target.jsValue + let _arg1 = levels.jsValue + let _arg2 = internalformat.jsValue + let _arg3 = width.jsValue + let _arg4 = height.jsValue + let _arg5 = depth.jsValue + let this = jsObject + _ = this[Strings.texStorage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) + } + + @inlinable func texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, pboOffset: GLintptr) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = internalformat.jsValue + let _arg3 = width.jsValue + let _arg4 = height.jsValue + let _arg5 = depth.jsValue + let _arg6 = border.jsValue + let _arg7 = format.jsValue + let _arg8 = type.jsValue + let _arg9 = pboOffset.jsValue + let this = jsObject + _ = this[Strings.texImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) + } + + @inlinable func texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, source: TexImageSource) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = internalformat.jsValue + let _arg3 = width.jsValue + let _arg4 = height.jsValue + let _arg5 = depth.jsValue + let _arg6 = border.jsValue + let _arg7 = format.jsValue + let _arg8 = type.jsValue + let _arg9 = source.jsValue + let this = jsObject + _ = this[Strings.texImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) + } + + @inlinable func texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView?) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = internalformat.jsValue + let _arg3 = width.jsValue + let _arg4 = height.jsValue + let _arg5 = depth.jsValue + let _arg6 = border.jsValue + let _arg7 = format.jsValue + let _arg8 = type.jsValue + let _arg9 = srcData.jsValue + let this = jsObject + _ = this[Strings.texImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) + } + + @inlinable func texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = internalformat.jsValue + let _arg3 = width.jsValue + let _arg4 = height.jsValue + let _arg5 = depth.jsValue + let _arg6 = border.jsValue + let _arg7 = format.jsValue + let _arg8 = type.jsValue + let _arg9 = srcData.jsValue + let _arg10 = srcOffset.jsValue + let this = jsObject + _ = this[Strings.texImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10]) + } + + @inlinable func texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, pboOffset: GLintptr) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = xoffset.jsValue + let _arg3 = yoffset.jsValue + let _arg4 = zoffset.jsValue + let _arg5 = width.jsValue + let _arg6 = height.jsValue + let _arg7 = depth.jsValue + let _arg8 = format.jsValue + let _arg9 = type.jsValue + let _arg10 = pboOffset.jsValue + let this = jsObject + _ = this[Strings.texSubImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10]) + } + + @inlinable func texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, source: TexImageSource) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = xoffset.jsValue + let _arg3 = yoffset.jsValue + let _arg4 = zoffset.jsValue + let _arg5 = width.jsValue + let _arg6 = height.jsValue + let _arg7 = depth.jsValue + let _arg8 = format.jsValue + let _arg9 = type.jsValue + let _arg10 = source.jsValue + let this = jsObject + _ = this[Strings.texSubImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10]) + } + + @inlinable func texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, srcData: ArrayBufferView?, srcOffset: GLuint? = nil) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = xoffset.jsValue + let _arg3 = yoffset.jsValue + let _arg4 = zoffset.jsValue + let _arg5 = width.jsValue + let _arg6 = height.jsValue + let _arg7 = depth.jsValue + let _arg8 = format.jsValue + let _arg9 = type.jsValue + let _arg10 = srcData.jsValue + let _arg11 = srcOffset?.jsValue ?? .undefined + let this = jsObject + _ = this[Strings.texSubImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11]) + } + + @inlinable func copyTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = xoffset.jsValue + let _arg3 = yoffset.jsValue + let _arg4 = zoffset.jsValue + let _arg5 = x.jsValue + let _arg6 = y.jsValue + let _arg7 = width.jsValue + let _arg8 = height.jsValue + let this = jsObject + _ = this[Strings.copyTexSubImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) + } + + @inlinable func compressedTexImage3D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, imageSize: GLsizei, offset: GLintptr) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = internalformat.jsValue + let _arg3 = width.jsValue + let _arg4 = height.jsValue + let _arg5 = depth.jsValue + let _arg6 = border.jsValue + let _arg7 = imageSize.jsValue + let _arg8 = offset.jsValue + let this = jsObject + _ = this[Strings.compressedTexImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) + } + + @inlinable func compressedTexImage3D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, srcData: ArrayBufferView, srcOffset: GLuint? = nil, srcLengthOverride: GLuint? = nil) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = internalformat.jsValue + let _arg3 = width.jsValue + let _arg4 = height.jsValue + let _arg5 = depth.jsValue + let _arg6 = border.jsValue + let _arg7 = srcData.jsValue + let _arg8 = srcOffset?.jsValue ?? .undefined + let _arg9 = srcLengthOverride?.jsValue ?? .undefined + let this = jsObject + _ = this[Strings.compressedTexImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) + } + + @inlinable func compressedTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, imageSize: GLsizei, offset: GLintptr) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = xoffset.jsValue + let _arg3 = yoffset.jsValue + let _arg4 = zoffset.jsValue + let _arg5 = width.jsValue + let _arg6 = height.jsValue + let _arg7 = depth.jsValue + let _arg8 = format.jsValue + let _arg9 = imageSize.jsValue + let _arg10 = offset.jsValue + let this = jsObject + _ = this[Strings.compressedTexSubImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10]) + } + + @inlinable func compressedTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, srcData: ArrayBufferView, srcOffset: GLuint? = nil, srcLengthOverride: GLuint? = nil) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = xoffset.jsValue + let _arg3 = yoffset.jsValue + let _arg4 = zoffset.jsValue + let _arg5 = width.jsValue + let _arg6 = height.jsValue + let _arg7 = depth.jsValue + let _arg8 = format.jsValue + let _arg9 = srcData.jsValue + let _arg10 = srcOffset?.jsValue ?? .undefined + let _arg11 = srcLengthOverride?.jsValue ?? .undefined + let this = jsObject + _ = this[Strings.compressedTexSubImage3D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11]) + } + + @inlinable func getFragDataLocation(program: WebGLProgram, name: String) -> GLint { + let this = jsObject + return this[Strings.getFragDataLocation].function!(this: this, arguments: [program.jsValue, name.jsValue]).fromJSValue()! + } + + @inlinable func uniform1ui(location: WebGLUniformLocation?, v0: GLuint) { + let this = jsObject + _ = this[Strings.uniform1ui].function!(this: this, arguments: [location.jsValue, v0.jsValue]) + } + + @inlinable func uniform2ui(location: WebGLUniformLocation?, v0: GLuint, v1: GLuint) { + let this = jsObject + _ = this[Strings.uniform2ui].function!(this: this, arguments: [location.jsValue, v0.jsValue, v1.jsValue]) + } + + @inlinable func uniform3ui(location: WebGLUniformLocation?, v0: GLuint, v1: GLuint, v2: GLuint) { + let this = jsObject + _ = this[Strings.uniform3ui].function!(this: this, arguments: [location.jsValue, v0.jsValue, v1.jsValue, v2.jsValue]) + } + + @inlinable func uniform4ui(location: WebGLUniformLocation?, v0: GLuint, v1: GLuint, v2: GLuint, v3: GLuint) { + let this = jsObject + _ = this[Strings.uniform4ui].function!(this: this, arguments: [location.jsValue, v0.jsValue, v1.jsValue, v2.jsValue, v3.jsValue]) + } + + @inlinable func uniform1uiv(location: WebGLUniformLocation?, data: Uint32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + let this = jsObject + _ = this[Strings.uniform1uiv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) + } + + @inlinable func uniform2uiv(location: WebGLUniformLocation?, data: Uint32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + let this = jsObject + _ = this[Strings.uniform2uiv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) + } + + @inlinable func uniform3uiv(location: WebGLUniformLocation?, data: Uint32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + let this = jsObject + _ = this[Strings.uniform3uiv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) + } + + @inlinable func uniform4uiv(location: WebGLUniformLocation?, data: Uint32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + let this = jsObject + _ = this[Strings.uniform4uiv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) + } + + @inlinable func uniformMatrix3x2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + let this = jsObject + _ = this[Strings.uniformMatrix3x2fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) + } + + @inlinable func uniformMatrix4x2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + let this = jsObject + _ = this[Strings.uniformMatrix4x2fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) + } + + @inlinable func uniformMatrix2x3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + let this = jsObject + _ = this[Strings.uniformMatrix2x3fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) + } + + @inlinable func uniformMatrix4x3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + let this = jsObject + _ = this[Strings.uniformMatrix4x3fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) + } + + @inlinable func uniformMatrix2x4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + let this = jsObject + _ = this[Strings.uniformMatrix2x4fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) + } + + @inlinable func uniformMatrix3x4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + let this = jsObject + _ = this[Strings.uniformMatrix3x4fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) + } + + @inlinable func vertexAttribI4i(index: GLuint, x: GLint, y: GLint, z: GLint, w: GLint) { + let this = jsObject + _ = this[Strings.vertexAttribI4i].function!(this: this, arguments: [index.jsValue, x.jsValue, y.jsValue, z.jsValue, w.jsValue]) + } + + @inlinable func vertexAttribI4iv(index: GLuint, values: Int32List) { + let this = jsObject + _ = this[Strings.vertexAttribI4iv].function!(this: this, arguments: [index.jsValue, values.jsValue]) + } + + @inlinable func vertexAttribI4ui(index: GLuint, x: GLuint, y: GLuint, z: GLuint, w: GLuint) { + let this = jsObject + _ = this[Strings.vertexAttribI4ui].function!(this: this, arguments: [index.jsValue, x.jsValue, y.jsValue, z.jsValue, w.jsValue]) + } + + @inlinable func vertexAttribI4uiv(index: GLuint, values: Uint32List) { + let this = jsObject + _ = this[Strings.vertexAttribI4uiv].function!(this: this, arguments: [index.jsValue, values.jsValue]) + } + + @inlinable func vertexAttribIPointer(index: GLuint, size: GLint, type: GLenum, stride: GLsizei, offset: GLintptr) { + let this = jsObject + _ = this[Strings.vertexAttribIPointer].function!(this: this, arguments: [index.jsValue, size.jsValue, type.jsValue, stride.jsValue, offset.jsValue]) + } + + @inlinable func vertexAttribDivisor(index: GLuint, divisor: GLuint) { + let this = jsObject + _ = this[Strings.vertexAttribDivisor].function!(this: this, arguments: [index.jsValue, divisor.jsValue]) + } + + @inlinable func drawArraysInstanced(mode: GLenum, first: GLint, count: GLsizei, instanceCount: GLsizei) { + let this = jsObject + _ = this[Strings.drawArraysInstanced].function!(this: this, arguments: [mode.jsValue, first.jsValue, count.jsValue, instanceCount.jsValue]) + } + + @inlinable func drawElementsInstanced(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, instanceCount: GLsizei) { + let this = jsObject + _ = this[Strings.drawElementsInstanced].function!(this: this, arguments: [mode.jsValue, count.jsValue, type.jsValue, offset.jsValue, instanceCount.jsValue]) + } + + @inlinable func drawRangeElements(mode: GLenum, start: GLuint, end: GLuint, count: GLsizei, type: GLenum, offset: GLintptr) { + let _arg0 = mode.jsValue + let _arg1 = start.jsValue + let _arg2 = end.jsValue + let _arg3 = count.jsValue + let _arg4 = type.jsValue + let _arg5 = offset.jsValue + let this = jsObject + _ = this[Strings.drawRangeElements].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) + } + + @inlinable func drawBuffers(buffers: [GLenum]) { + let this = jsObject + _ = this[Strings.drawBuffers].function!(this: this, arguments: [buffers.jsValue]) + } + + @inlinable func clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Float32List, srcOffset: GLuint? = nil) { + let this = jsObject + _ = this[Strings.clearBufferfv].function!(this: this, arguments: [buffer.jsValue, drawbuffer.jsValue, values.jsValue, srcOffset?.jsValue ?? .undefined]) + } + + @inlinable func clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Int32List, srcOffset: GLuint? = nil) { + let this = jsObject + _ = this[Strings.clearBufferiv].function!(this: this, arguments: [buffer.jsValue, drawbuffer.jsValue, values.jsValue, srcOffset?.jsValue ?? .undefined]) + } + + @inlinable func clearBufferuiv(buffer: GLenum, drawbuffer: GLint, values: Uint32List, srcOffset: GLuint? = nil) { + let this = jsObject + _ = this[Strings.clearBufferuiv].function!(this: this, arguments: [buffer.jsValue, drawbuffer.jsValue, values.jsValue, srcOffset?.jsValue ?? .undefined]) + } + + @inlinable func clearBufferfi(buffer: GLenum, drawbuffer: GLint, depth: GLfloat, stencil: GLint) { + let this = jsObject + _ = this[Strings.clearBufferfi].function!(this: this, arguments: [buffer.jsValue, drawbuffer.jsValue, depth.jsValue, stencil.jsValue]) + } + + @inlinable func createQuery() -> WebGLQuery? { + let this = jsObject + return this[Strings.createQuery].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable func deleteQuery(query: WebGLQuery?) { + let this = jsObject + _ = this[Strings.deleteQuery].function!(this: this, arguments: [query.jsValue]) + } + + @inlinable func isQuery(query: WebGLQuery?) -> GLboolean { + let this = jsObject + return this[Strings.isQuery].function!(this: this, arguments: [query.jsValue]).fromJSValue()! + } + + @inlinable func beginQuery(target: GLenum, query: WebGLQuery) { + let this = jsObject + _ = this[Strings.beginQuery].function!(this: this, arguments: [target.jsValue, query.jsValue]) + } + + @inlinable func endQuery(target: GLenum) { + let this = jsObject + _ = this[Strings.endQuery].function!(this: this, arguments: [target.jsValue]) + } + + @inlinable func getQuery(target: GLenum, pname: GLenum) -> WebGLQuery? { + let this = jsObject + return this[Strings.getQuery].function!(this: this, arguments: [target.jsValue, pname.jsValue]).fromJSValue()! + } + + @inlinable func getQueryParameter(query: WebGLQuery, pname: GLenum) -> JSValue { + let this = jsObject + return this[Strings.getQueryParameter].function!(this: this, arguments: [query.jsValue, pname.jsValue]).fromJSValue()! + } + + @inlinable func createSampler() -> WebGLSampler? { + let this = jsObject + return this[Strings.createSampler].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable func deleteSampler(sampler: WebGLSampler?) { + let this = jsObject + _ = this[Strings.deleteSampler].function!(this: this, arguments: [sampler.jsValue]) + } + + @inlinable func isSampler(sampler: WebGLSampler?) -> GLboolean { + let this = jsObject + return this[Strings.isSampler].function!(this: this, arguments: [sampler.jsValue]).fromJSValue()! + } + + @inlinable func bindSampler(unit: GLuint, sampler: WebGLSampler?) { + let this = jsObject + _ = this[Strings.bindSampler].function!(this: this, arguments: [unit.jsValue, sampler.jsValue]) + } + + @inlinable func samplerParameteri(sampler: WebGLSampler, pname: GLenum, param: GLint) { + let this = jsObject + _ = this[Strings.samplerParameteri].function!(this: this, arguments: [sampler.jsValue, pname.jsValue, param.jsValue]) + } + + @inlinable func samplerParameterf(sampler: WebGLSampler, pname: GLenum, param: GLfloat) { + let this = jsObject + _ = this[Strings.samplerParameterf].function!(this: this, arguments: [sampler.jsValue, pname.jsValue, param.jsValue]) + } + + @inlinable func getSamplerParameter(sampler: WebGLSampler, pname: GLenum) -> JSValue { + let this = jsObject + return this[Strings.getSamplerParameter].function!(this: this, arguments: [sampler.jsValue, pname.jsValue]).fromJSValue()! + } + + @inlinable func fenceSync(condition: GLenum, flags: GLbitfield) -> WebGLSync? { + let this = jsObject + return this[Strings.fenceSync].function!(this: this, arguments: [condition.jsValue, flags.jsValue]).fromJSValue()! + } + + @inlinable func isSync(sync: WebGLSync?) -> GLboolean { + let this = jsObject + return this[Strings.isSync].function!(this: this, arguments: [sync.jsValue]).fromJSValue()! + } + + @inlinable func deleteSync(sync: WebGLSync?) { + let this = jsObject + _ = this[Strings.deleteSync].function!(this: this, arguments: [sync.jsValue]) + } + + @inlinable func clientWaitSync(sync: WebGLSync, flags: GLbitfield, timeout: GLuint64) -> GLenum { + let this = jsObject + return this[Strings.clientWaitSync].function!(this: this, arguments: [sync.jsValue, flags.jsValue, timeout.jsValue]).fromJSValue()! + } + + @inlinable func waitSync(sync: WebGLSync, flags: GLbitfield, timeout: GLint64) { + let this = jsObject + _ = this[Strings.waitSync].function!(this: this, arguments: [sync.jsValue, flags.jsValue, timeout.jsValue]) + } + + @inlinable func getSyncParameter(sync: WebGLSync, pname: GLenum) -> JSValue { + let this = jsObject + return this[Strings.getSyncParameter].function!(this: this, arguments: [sync.jsValue, pname.jsValue]).fromJSValue()! + } + + @inlinable func createTransformFeedback() -> WebGLTransformFeedback? { + let this = jsObject + return this[Strings.createTransformFeedback].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable func deleteTransformFeedback(tf: WebGLTransformFeedback?) { + let this = jsObject + _ = this[Strings.deleteTransformFeedback].function!(this: this, arguments: [tf.jsValue]) + } + + @inlinable func isTransformFeedback(tf: WebGLTransformFeedback?) -> GLboolean { + let this = jsObject + return this[Strings.isTransformFeedback].function!(this: this, arguments: [tf.jsValue]).fromJSValue()! + } + + @inlinable func bindTransformFeedback(target: GLenum, tf: WebGLTransformFeedback?) { + let this = jsObject + _ = this[Strings.bindTransformFeedback].function!(this: this, arguments: [target.jsValue, tf.jsValue]) + } + + @inlinable func beginTransformFeedback(primitiveMode: GLenum) { + let this = jsObject + _ = this[Strings.beginTransformFeedback].function!(this: this, arguments: [primitiveMode.jsValue]) + } + + @inlinable func endTransformFeedback() { + let this = jsObject + _ = this[Strings.endTransformFeedback].function!(this: this, arguments: []) + } + + @inlinable func transformFeedbackVaryings(program: WebGLProgram, varyings: [String], bufferMode: GLenum) { + let this = jsObject + _ = this[Strings.transformFeedbackVaryings].function!(this: this, arguments: [program.jsValue, varyings.jsValue, bufferMode.jsValue]) + } + + @inlinable func getTransformFeedbackVarying(program: WebGLProgram, index: GLuint) -> WebGLActiveInfo? { + let this = jsObject + return this[Strings.getTransformFeedbackVarying].function!(this: this, arguments: [program.jsValue, index.jsValue]).fromJSValue()! + } + + @inlinable func pauseTransformFeedback() { + let this = jsObject + _ = this[Strings.pauseTransformFeedback].function!(this: this, arguments: []) + } + + @inlinable func resumeTransformFeedback() { + let this = jsObject + _ = this[Strings.resumeTransformFeedback].function!(this: this, arguments: []) + } + + @inlinable func bindBufferBase(target: GLenum, index: GLuint, buffer: WebGLBuffer?) { + let this = jsObject + _ = this[Strings.bindBufferBase].function!(this: this, arguments: [target.jsValue, index.jsValue, buffer.jsValue]) + } + + @inlinable func bindBufferRange(target: GLenum, index: GLuint, buffer: WebGLBuffer?, offset: GLintptr, size: GLsizeiptr) { + let this = jsObject + _ = this[Strings.bindBufferRange].function!(this: this, arguments: [target.jsValue, index.jsValue, buffer.jsValue, offset.jsValue, size.jsValue]) + } + + @inlinable func getIndexedParameter(target: GLenum, index: GLuint) -> JSValue { + let this = jsObject + return this[Strings.getIndexedParameter].function!(this: this, arguments: [target.jsValue, index.jsValue]).fromJSValue()! + } + + @inlinable func getUniformIndices(program: WebGLProgram, uniformNames: [String]) -> [GLuint]? { + let this = jsObject + return this[Strings.getUniformIndices].function!(this: this, arguments: [program.jsValue, uniformNames.jsValue]).fromJSValue()! + } + + @inlinable func getActiveUniforms(program: WebGLProgram, uniformIndices: [GLuint], pname: GLenum) -> JSValue { + let this = jsObject + return this[Strings.getActiveUniforms].function!(this: this, arguments: [program.jsValue, uniformIndices.jsValue, pname.jsValue]).fromJSValue()! + } + + @inlinable func getUniformBlockIndex(program: WebGLProgram, uniformBlockName: String) -> GLuint { + let this = jsObject + return this[Strings.getUniformBlockIndex].function!(this: this, arguments: [program.jsValue, uniformBlockName.jsValue]).fromJSValue()! + } + + @inlinable func getActiveUniformBlockParameter(program: WebGLProgram, uniformBlockIndex: GLuint, pname: GLenum) -> JSValue { + let this = jsObject + return this[Strings.getActiveUniformBlockParameter].function!(this: this, arguments: [program.jsValue, uniformBlockIndex.jsValue, pname.jsValue]).fromJSValue()! + } + + @inlinable func getActiveUniformBlockName(program: WebGLProgram, uniformBlockIndex: GLuint) -> String? { + let this = jsObject + return this[Strings.getActiveUniformBlockName].function!(this: this, arguments: [program.jsValue, uniformBlockIndex.jsValue]).fromJSValue()! + } + + @inlinable func uniformBlockBinding(program: WebGLProgram, uniformBlockIndex: GLuint, uniformBlockBinding: GLuint) { + let this = jsObject + _ = this[Strings.uniformBlockBinding].function!(this: this, arguments: [program.jsValue, uniformBlockIndex.jsValue, uniformBlockBinding.jsValue]) + } + + @inlinable func createVertexArray() -> WebGLVertexArrayObject? { + let this = jsObject + return this[Strings.createVertexArray].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable func deleteVertexArray(vertexArray: WebGLVertexArrayObject?) { + let this = jsObject + _ = this[Strings.deleteVertexArray].function!(this: this, arguments: [vertexArray.jsValue]) + } + + @inlinable func isVertexArray(vertexArray: WebGLVertexArrayObject?) -> GLboolean { + let this = jsObject + return this[Strings.isVertexArray].function!(this: this, arguments: [vertexArray.jsValue]).fromJSValue()! + } + + @inlinable func bindVertexArray(array: WebGLVertexArrayObject?) { + let this = jsObject + _ = this[Strings.bindVertexArray].function!(this: this, arguments: [array.jsValue]) + } +} + +public protocol WebGL2RenderingContextOverloads: JSBridgedClass {} +public extension WebGL2RenderingContextOverloads { + @inlinable func bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum) { + let this = jsObject + _ = this[Strings.bufferData].function!(this: this, arguments: [target.jsValue, size.jsValue, usage.jsValue]) + } + + @inlinable func bufferData(target: GLenum, srcData: BufferSource?, usage: GLenum) { + let this = jsObject + _ = this[Strings.bufferData].function!(this: this, arguments: [target.jsValue, srcData.jsValue, usage.jsValue]) + } + + @inlinable func bufferSubData(target: GLenum, dstByteOffset: GLintptr, srcData: BufferSource) { + let this = jsObject + _ = this[Strings.bufferSubData].function!(this: this, arguments: [target.jsValue, dstByteOffset.jsValue, srcData.jsValue]) + } + + @inlinable func bufferData(target: GLenum, srcData: ArrayBufferView, usage: GLenum, srcOffset: GLuint, length: GLuint? = nil) { + let this = jsObject + _ = this[Strings.bufferData].function!(this: this, arguments: [target.jsValue, srcData.jsValue, usage.jsValue, srcOffset.jsValue, length?.jsValue ?? .undefined]) + } + + @inlinable func bufferSubData(target: GLenum, dstByteOffset: GLintptr, srcData: ArrayBufferView, srcOffset: GLuint, length: GLuint? = nil) { + let this = jsObject + _ = this[Strings.bufferSubData].function!(this: this, arguments: [target.jsValue, dstByteOffset.jsValue, srcData.jsValue, srcOffset.jsValue, length?.jsValue ?? .undefined]) + } + + @inlinable func texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pixels: ArrayBufferView?) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = internalformat.jsValue + let _arg3 = width.jsValue + let _arg4 = height.jsValue + let _arg5 = border.jsValue + let _arg6 = format.jsValue + let _arg7 = type.jsValue + let _arg8 = pixels.jsValue + let this = jsObject + _ = this[Strings.texImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) + } + + @inlinable func texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: TexImageSource) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = internalformat.jsValue + let _arg3 = format.jsValue + let _arg4 = type.jsValue + let _arg5 = source.jsValue + let this = jsObject + _ = this[Strings.texImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) + } + + @inlinable func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView?) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = xoffset.jsValue + let _arg3 = yoffset.jsValue + let _arg4 = width.jsValue + let _arg5 = height.jsValue + let _arg6 = format.jsValue + let _arg7 = type.jsValue + let _arg8 = pixels.jsValue + let this = jsObject + _ = this[Strings.texSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) + } + + @inlinable func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: TexImageSource) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = xoffset.jsValue + let _arg3 = yoffset.jsValue + let _arg4 = format.jsValue + let _arg5 = type.jsValue + let _arg6 = source.jsValue + let this = jsObject + _ = this[Strings.texSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) + } + + @inlinable func texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pboOffset: GLintptr) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = internalformat.jsValue + let _arg3 = width.jsValue + let _arg4 = height.jsValue + let _arg5 = border.jsValue + let _arg6 = format.jsValue + let _arg7 = type.jsValue + let _arg8 = pboOffset.jsValue + let this = jsObject + _ = this[Strings.texImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) + } + + @inlinable func texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, source: TexImageSource) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = internalformat.jsValue + let _arg3 = width.jsValue + let _arg4 = height.jsValue + let _arg5 = border.jsValue + let _arg6 = format.jsValue + let _arg7 = type.jsValue + let _arg8 = source.jsValue + let this = jsObject + _ = this[Strings.texImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) + } + + @inlinable func texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = internalformat.jsValue + let _arg3 = width.jsValue + let _arg4 = height.jsValue + let _arg5 = border.jsValue + let _arg6 = format.jsValue + let _arg7 = type.jsValue + let _arg8 = srcData.jsValue + let _arg9 = srcOffset.jsValue + let this = jsObject + _ = this[Strings.texImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) + } + + @inlinable func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pboOffset: GLintptr) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = xoffset.jsValue + let _arg3 = yoffset.jsValue + let _arg4 = width.jsValue + let _arg5 = height.jsValue + let _arg6 = format.jsValue + let _arg7 = type.jsValue + let _arg8 = pboOffset.jsValue + let this = jsObject + _ = this[Strings.texSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } - @inlinable public var jsValue: JSValue { rawValue.jsValue } -} - -public class VideoTrack: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.VideoTrack].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) - _kind = ReadonlyAttribute(jsObject: jsObject, name: Strings.kind) - _label = ReadonlyAttribute(jsObject: jsObject, name: Strings.label) - _language = ReadonlyAttribute(jsObject: jsObject, name: Strings.language) - _selected = ReadWriteAttribute(jsObject: jsObject, name: Strings.selected) - self.jsObject = jsObject + @inlinable func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, source: TexImageSource) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = xoffset.jsValue + let _arg3 = yoffset.jsValue + let _arg4 = width.jsValue + let _arg5 = height.jsValue + let _arg6 = format.jsValue + let _arg7 = type.jsValue + let _arg8 = source.jsValue + let this = jsObject + _ = this[Strings.texSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } - @ReadonlyAttribute - public var id: String - - @ReadonlyAttribute - public var kind: String - - @ReadonlyAttribute - public var label: String - - @ReadonlyAttribute - public var language: String - - @ReadWriteAttribute - public var selected: Bool -} - -public class VideoTrackList: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.VideoTrackList].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) - _selectedIndex = ReadonlyAttribute(jsObject: jsObject, name: Strings.selectedIndex) - _onchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onchange) - _onaddtrack = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onaddtrack) - _onremovetrack = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onremovetrack) - super.init(unsafelyWrapping: jsObject) + @inlinable func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = xoffset.jsValue + let _arg3 = yoffset.jsValue + let _arg4 = width.jsValue + let _arg5 = height.jsValue + let _arg6 = format.jsValue + let _arg7 = type.jsValue + let _arg8 = srcData.jsValue + let _arg9 = srcOffset.jsValue + let this = jsObject + _ = this[Strings.texSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) } - @ReadonlyAttribute - public var length: UInt32 - - @inlinable public subscript(key: Int) -> VideoTrack { - jsObject[key].fromJSValue()! + @inlinable func compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, imageSize: GLsizei, offset: GLintptr) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = internalformat.jsValue + let _arg3 = width.jsValue + let _arg4 = height.jsValue + let _arg5 = border.jsValue + let _arg6 = imageSize.jsValue + let _arg7 = offset.jsValue + let this = jsObject + _ = this[Strings.compressedTexImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) } - @inlinable public func getTrackById(id: String) -> VideoTrack? { + @inlinable func compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, srcData: ArrayBufferView, srcOffset: GLuint? = nil, srcLengthOverride: GLuint? = nil) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = internalformat.jsValue + let _arg3 = width.jsValue + let _arg4 = height.jsValue + let _arg5 = border.jsValue + let _arg6 = srcData.jsValue + let _arg7 = srcOffset?.jsValue ?? .undefined + let _arg8 = srcLengthOverride?.jsValue ?? .undefined let this = jsObject - return this[Strings.getTrackById].function!(this: this, arguments: [id.jsValue]).fromJSValue()! + _ = this[Strings.compressedTexImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } - @ReadonlyAttribute - public var selectedIndex: Int32 - - @ClosureAttribute1Optional - public var onchange: EventHandler + @inlinable func compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, imageSize: GLsizei, offset: GLintptr) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = xoffset.jsValue + let _arg3 = yoffset.jsValue + let _arg4 = width.jsValue + let _arg5 = height.jsValue + let _arg6 = format.jsValue + let _arg7 = imageSize.jsValue + let _arg8 = offset.jsValue + let this = jsObject + _ = this[Strings.compressedTexSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) + } - @ClosureAttribute1Optional - public var onaddtrack: EventHandler + @inlinable func compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, srcData: ArrayBufferView, srcOffset: GLuint? = nil, srcLengthOverride: GLuint? = nil) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = xoffset.jsValue + let _arg3 = yoffset.jsValue + let _arg4 = width.jsValue + let _arg5 = height.jsValue + let _arg6 = format.jsValue + let _arg7 = srcData.jsValue + let _arg8 = srcOffset?.jsValue ?? .undefined + let _arg9 = srcLengthOverride?.jsValue ?? .undefined + let this = jsObject + _ = this[Strings.compressedTexSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9]) + } - @ClosureAttribute1Optional - public var onremovetrack: EventHandler -} + @inlinable func uniform1fv(location: WebGLUniformLocation?, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + let this = jsObject + _ = this[Strings.uniform1fv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) + } -public enum VideoTransferCharacteristics: JSString, JSValueCompatible { - case bt709 = "bt709" - case smpte170m = "smpte170m" - case iec6196621 = "iec61966-2-1" + @inlinable func uniform2fv(location: WebGLUniformLocation?, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + let this = jsObject + _ = this[Strings.uniform2fv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) + } - @inlinable public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.jsString { - return Self(rawValue: string) - } - return nil + @inlinable func uniform3fv(location: WebGLUniformLocation?, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + let this = jsObject + _ = this[Strings.uniform3fv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) } - @inlinable public init?(string: String) { - self.init(rawValue: JSString(string)) + @inlinable func uniform4fv(location: WebGLUniformLocation?, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + let this = jsObject + _ = this[Strings.uniform4fv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) } - @inlinable public var jsValue: JSValue { rawValue.jsValue } -} + @inlinable func uniform1iv(location: WebGLUniformLocation?, data: Int32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + let this = jsObject + _ = this[Strings.uniform1iv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) + } -public class WaveShaperNode: AudioNode { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WaveShaperNode].function! } + @inlinable func uniform2iv(location: WebGLUniformLocation?, data: Int32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + let this = jsObject + _ = this[Strings.uniform2iv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) + } - public required init(unsafelyWrapping jsObject: JSObject) { - _curve = ReadWriteAttribute(jsObject: jsObject, name: Strings.curve) - _oversample = ReadWriteAttribute(jsObject: jsObject, name: Strings.oversample) - super.init(unsafelyWrapping: jsObject) + @inlinable func uniform3iv(location: WebGLUniformLocation?, data: Int32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + let this = jsObject + _ = this[Strings.uniform3iv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) } - @inlinable public convenience init(context: BaseAudioContext, options: WaveShaperOptions? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [context.jsValue, options?.jsValue ?? .undefined])) + @inlinable func uniform4iv(location: WebGLUniformLocation?, data: Int32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + let this = jsObject + _ = this[Strings.uniform4iv].function!(this: this, arguments: [location.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) } - @ReadWriteAttribute - public var curve: Float32Array? + @inlinable func uniformMatrix2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + let this = jsObject + _ = this[Strings.uniformMatrix2fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) + } - @ReadWriteAttribute - public var oversample: OverSampleType -} + @inlinable func uniformMatrix3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + let this = jsObject + _ = this[Strings.uniformMatrix3fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) + } -public class WaveShaperOptions: BridgedDictionary { - public convenience init(curve: [Float], oversample: OverSampleType) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.curve] = curve.jsValue - object[Strings.oversample] = oversample.jsValue - self.init(unsafelyWrapping: object) + @inlinable func uniformMatrix4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32List, srcOffset: GLuint? = nil, srcLength: GLuint? = nil) { + let this = jsObject + _ = this[Strings.uniformMatrix4fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, data.jsValue, srcOffset?.jsValue ?? .undefined, srcLength?.jsValue ?? .undefined]) } - public required init(unsafelyWrapping object: JSObject) { - _curve = ReadWriteAttribute(jsObject: object, name: Strings.curve) - _oversample = ReadWriteAttribute(jsObject: object, name: Strings.oversample) - super.init(unsafelyWrapping: object) + @inlinable func readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, dstData: ArrayBufferView?) { + let _arg0 = x.jsValue + let _arg1 = y.jsValue + let _arg2 = width.jsValue + let _arg3 = height.jsValue + let _arg4 = format.jsValue + let _arg5 = type.jsValue + let _arg6 = dstData.jsValue + let this = jsObject + _ = this[Strings.readPixels].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) } - @ReadWriteAttribute - public var curve: [Float] + @inlinable func readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, offset: GLintptr) { + let _arg0 = x.jsValue + let _arg1 = y.jsValue + let _arg2 = width.jsValue + let _arg3 = height.jsValue + let _arg4 = format.jsValue + let _arg5 = type.jsValue + let _arg6 = offset.jsValue + let this = jsObject + _ = this[Strings.readPixels].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) + } - @ReadWriteAttribute - public var oversample: OverSampleType + @inlinable func readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, dstData: ArrayBufferView, dstOffset: GLuint) { + let _arg0 = x.jsValue + let _arg1 = y.jsValue + let _arg2 = width.jsValue + let _arg3 = height.jsValue + let _arg4 = format.jsValue + let _arg5 = type.jsValue + let _arg6 = dstData.jsValue + let _arg7 = dstOffset.jsValue + let this = jsObject + _ = this[Strings.readPixels].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) + } } public class WebGLActiveInfo: JSBridgedClass { @@ -19335,6 +20819,14 @@ public class WebGLProgram: WebGLObject { } } +public class WebGLQuery: WebGLObject { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLQuery].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} + public class WebGLRenderbuffer: WebGLObject { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLRenderbuffer].function! } @@ -20727,6 +22219,14 @@ public extension WebGLRenderingContextOverloads { } } +public class WebGLSampler: WebGLObject { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLSampler].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} + public class WebGLShader: WebGLObject { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLShader].function! } @@ -20757,6 +22257,14 @@ public class WebGLShaderPrecisionFormat: JSBridgedClass { public var precision: GLint } +public class WebGLSync: WebGLObject { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLSync].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} + public class WebGLTexture: WebGLObject { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLTexture].function! } @@ -20765,6 +22273,14 @@ public class WebGLTexture: WebGLObject { } } +public class WebGLTransformFeedback: WebGLObject { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLTransformFeedback].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} + public class WebGLUniformLocation: JSBridgedClass { @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WebGLUniformLocation].function! } @@ -20775,6 +22291,14 @@ public class WebGLUniformLocation: JSBridgedClass { } } +public class WebGLVertexArrayObject: WebGLObject { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLVertexArrayObject].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} + public class WebSocket: EventTarget { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebSocket].function! } @@ -22908,18 +24432,24 @@ public enum console { @usableFromInline static let VideoTrack: JSString = "VideoTrack" @usableFromInline static let VideoTrackList: JSString = "VideoTrackList" @usableFromInline static let WaveShaperNode: JSString = "WaveShaperNode" + @usableFromInline static let WebGL2RenderingContext: JSString = "WebGL2RenderingContext" @usableFromInline static let WebGLActiveInfo: JSString = "WebGLActiveInfo" @usableFromInline static let WebGLBuffer: JSString = "WebGLBuffer" @usableFromInline static let WebGLContextEvent: JSString = "WebGLContextEvent" @usableFromInline static let WebGLFramebuffer: JSString = "WebGLFramebuffer" @usableFromInline static let WebGLObject: JSString = "WebGLObject" @usableFromInline static let WebGLProgram: JSString = "WebGLProgram" + @usableFromInline static let WebGLQuery: JSString = "WebGLQuery" @usableFromInline static let WebGLRenderbuffer: JSString = "WebGLRenderbuffer" @usableFromInline static let WebGLRenderingContext: JSString = "WebGLRenderingContext" + @usableFromInline static let WebGLSampler: JSString = "WebGLSampler" @usableFromInline static let WebGLShader: JSString = "WebGLShader" @usableFromInline static let WebGLShaderPrecisionFormat: JSString = "WebGLShaderPrecisionFormat" + @usableFromInline static let WebGLSync: JSString = "WebGLSync" @usableFromInline static let WebGLTexture: JSString = "WebGLTexture" + @usableFromInline static let WebGLTransformFeedback: JSString = "WebGLTransformFeedback" @usableFromInline static let WebGLUniformLocation: JSString = "WebGLUniformLocation" + @usableFromInline static let WebGLVertexArrayObject: JSString = "WebGLVertexArrayObject" @usableFromInline static let WebSocket: JSString = "WebSocket" @usableFromInline static let WheelEvent: JSString = "WheelEvent" @usableFromInline static let Window: JSString = "Window" @@ -23079,15 +24609,22 @@ public enum console { @usableFromInline static let baseURI: JSString = "baseURI" @usableFromInline static let before: JSString = "before" @usableFromInline static let beginPath: JSString = "beginPath" + @usableFromInline static let beginQuery: JSString = "beginQuery" + @usableFromInline static let beginTransformFeedback: JSString = "beginTransformFeedback" @usableFromInline static let behavior: JSString = "behavior" @usableFromInline static let bezierCurveTo: JSString = "bezierCurveTo" @usableFromInline static let bgColor: JSString = "bgColor" @usableFromInline static let binaryType: JSString = "binaryType" @usableFromInline static let bindAttribLocation: JSString = "bindAttribLocation" @usableFromInline static let bindBuffer: JSString = "bindBuffer" + @usableFromInline static let bindBufferBase: JSString = "bindBufferBase" + @usableFromInline static let bindBufferRange: JSString = "bindBufferRange" @usableFromInline static let bindFramebuffer: JSString = "bindFramebuffer" @usableFromInline static let bindRenderbuffer: JSString = "bindRenderbuffer" + @usableFromInline static let bindSampler: JSString = "bindSampler" @usableFromInline static let bindTexture: JSString = "bindTexture" + @usableFromInline static let bindTransformFeedback: JSString = "bindTransformFeedback" + @usableFromInline static let bindVertexArray: JSString = "bindVertexArray" @usableFromInline static let bitrate: JSString = "bitrate" @usableFromInline static let bitrateMode: JSString = "bitrateMode" @usableFromInline static let bitsPerSecond: JSString = "bitsPerSecond" @@ -23096,6 +24633,7 @@ public enum console { @usableFromInline static let blendEquationSeparate: JSString = "blendEquationSeparate" @usableFromInline static let blendFunc: JSString = "blendFunc" @usableFromInline static let blendFuncSeparate: JSString = "blendFuncSeparate" + @usableFromInline static let blitFramebuffer: JSString = "blitFramebuffer" @usableFromInline static let blob: JSString = "blob" @usableFromInline static let block: JSString = "block" @usableFromInline static let blocking: JSString = "blocking" @@ -23159,6 +24697,10 @@ public enum console { @usableFromInline static let classList: JSString = "classList" @usableFromInline static let className: JSString = "className" @usableFromInline static let clear: JSString = "clear" + @usableFromInline static let clearBufferfi: JSString = "clearBufferfi" + @usableFromInline static let clearBufferfv: JSString = "clearBufferfv" + @usableFromInline static let clearBufferiv: JSString = "clearBufferiv" + @usableFromInline static let clearBufferuiv: JSString = "clearBufferuiv" @usableFromInline static let clearColor: JSString = "clearColor" @usableFromInline static let clearData: JSString = "clearData" @usableFromInline static let clearDepth: JSString = "clearDepth" @@ -23173,6 +24715,7 @@ public enum console { @usableFromInline static let clientInformation: JSString = "clientInformation" @usableFromInline static let clientLeft: JSString = "clientLeft" @usableFromInline static let clientTop: JSString = "clientTop" + @usableFromInline static let clientWaitSync: JSString = "clientWaitSync" @usableFromInline static let clientWidth: JSString = "clientWidth" @usableFromInline static let clientX: JSString = "clientX" @usableFromInline static let clientY: JSString = "clientY" @@ -23218,7 +24761,9 @@ public enum console { @usableFromInline static let composedPath: JSString = "composedPath" @usableFromInline static let composite: JSString = "composite" @usableFromInline static let compressedTexImage2D: JSString = "compressedTexImage2D" + @usableFromInline static let compressedTexImage3D: JSString = "compressedTexImage3D" @usableFromInline static let compressedTexSubImage2D: JSString = "compressedTexSubImage2D" + @usableFromInline static let compressedTexSubImage3D: JSString = "compressedTexSubImage3D" @usableFromInline static let computedOffset: JSString = "computedOffset" @usableFromInline static let coneInnerAngle: JSString = "coneInnerAngle" @usableFromInline static let coneOuterAngle: JSString = "coneOuterAngle" @@ -23247,9 +24792,11 @@ public enum console { @usableFromInline static let cookie: JSString = "cookie" @usableFromInline static let cookieEnabled: JSString = "cookieEnabled" @usableFromInline static let coords: JSString = "coords" + @usableFromInline static let copyBufferSubData: JSString = "copyBufferSubData" @usableFromInline static let copyFromChannel: JSString = "copyFromChannel" @usableFromInline static let copyTexImage2D: JSString = "copyTexImage2D" @usableFromInline static let copyTexSubImage2D: JSString = "copyTexSubImage2D" + @usableFromInline static let copyTexSubImage3D: JSString = "copyTexSubImage3D" @usableFromInline static let copyTo: JSString = "copyTo" @usableFromInline static let copyToChannel: JSString = "copyToChannel" @usableFromInline static let count: JSString = "count" @@ -23294,9 +24841,11 @@ public enum console { @usableFromInline static let createPeriodicWave: JSString = "createPeriodicWave" @usableFromInline static let createProcessingInstruction: JSString = "createProcessingInstruction" @usableFromInline static let createProgram: JSString = "createProgram" + @usableFromInline static let createQuery: JSString = "createQuery" @usableFromInline static let createRadialGradient: JSString = "createRadialGradient" @usableFromInline static let createRange: JSString = "createRange" @usableFromInline static let createRenderbuffer: JSString = "createRenderbuffer" + @usableFromInline static let createSampler: JSString = "createSampler" @usableFromInline static let createScriptProcessor: JSString = "createScriptProcessor" @usableFromInline static let createShader: JSString = "createShader" @usableFromInline static let createStereoPanner: JSString = "createStereoPanner" @@ -23305,6 +24854,8 @@ public enum console { @usableFromInline static let createTHead: JSString = "createTHead" @usableFromInline static let createTextNode: JSString = "createTextNode" @usableFromInline static let createTexture: JSString = "createTexture" + @usableFromInline static let createTransformFeedback: JSString = "createTransformFeedback" + @usableFromInline static let createVertexArray: JSString = "createVertexArray" @usableFromInline static let createWaveShaper: JSString = "createWaveShaper" @usableFromInline static let credentials: JSString = "credentials" @usableFromInline static let crossOrigin: JSString = "crossOrigin" @@ -23353,12 +24904,17 @@ public enum console { @usableFromInline static let deleteData: JSString = "deleteData" @usableFromInline static let deleteFramebuffer: JSString = "deleteFramebuffer" @usableFromInline static let deleteProgram: JSString = "deleteProgram" + @usableFromInline static let deleteQuery: JSString = "deleteQuery" @usableFromInline static let deleteRenderbuffer: JSString = "deleteRenderbuffer" @usableFromInline static let deleteRow: JSString = "deleteRow" + @usableFromInline static let deleteSampler: JSString = "deleteSampler" @usableFromInline static let deleteShader: JSString = "deleteShader" + @usableFromInline static let deleteSync: JSString = "deleteSync" @usableFromInline static let deleteTFoot: JSString = "deleteTFoot" @usableFromInline static let deleteTHead: JSString = "deleteTHead" @usableFromInline static let deleteTexture: JSString = "deleteTexture" + @usableFromInline static let deleteTransformFeedback: JSString = "deleteTransformFeedback" + @usableFromInline static let deleteVertexArray: JSString = "deleteVertexArray" @usableFromInline static let deltaMode: JSString = "deltaMode" @usableFromInline static let deltaX: JSString = "deltaX" @usableFromInline static let deltaY: JSString = "deltaY" @@ -23404,9 +24960,13 @@ public enum console { @usableFromInline static let download: JSString = "download" @usableFromInline static let draggable: JSString = "draggable" @usableFromInline static let drawArrays: JSString = "drawArrays" + @usableFromInline static let drawArraysInstanced: JSString = "drawArraysInstanced" + @usableFromInline static let drawBuffers: JSString = "drawBuffers" @usableFromInline static let drawElements: JSString = "drawElements" + @usableFromInline static let drawElementsInstanced: JSString = "drawElementsInstanced" @usableFromInline static let drawFocusIfNeeded: JSString = "drawFocusIfNeeded" @usableFromInline static let drawImage: JSString = "drawImage" + @usableFromInline static let drawRangeElements: JSString = "drawRangeElements" @usableFromInline static let drawingBufferHeight: JSString = "drawingBufferHeight" @usableFromInline static let drawingBufferWidth: JSString = "drawingBufferWidth" @usableFromInline static let dropEffect: JSString = "dropEffect" @@ -23436,7 +24996,9 @@ public enum console { @usableFromInline static let endContainer: JSString = "endContainer" @usableFromInline static let endDelay: JSString = "endDelay" @usableFromInline static let endOffset: JSString = "endOffset" + @usableFromInline static let endQuery: JSString = "endQuery" @usableFromInline static let endTime: JSString = "endTime" + @usableFromInline static let endTransformFeedback: JSString = "endTransformFeedback" @usableFromInline static let ended: JSString = "ended" @usableFromInline static let endings: JSString = "endings" @usableFromInline static let enqueue: JSString = "enqueue" @@ -23460,6 +25022,7 @@ public enum console { @usableFromInline static let fastSeek: JSString = "fastSeek" @usableFromInline static let feedback: JSString = "feedback" @usableFromInline static let feedforward: JSString = "feedforward" + @usableFromInline static let fenceSync: JSString = "fenceSync" @usableFromInline static let fetch: JSString = "fetch" @usableFromInline static let fftSize: JSString = "fftSize" @usableFromInline static let fgColor: JSString = "fgColor" @@ -23507,6 +25070,7 @@ public enum console { @usableFromInline static let frameRate: JSString = "frameRate" @usableFromInline static let framebufferRenderbuffer: JSString = "framebufferRenderbuffer" @usableFromInline static let framebufferTexture2D: JSString = "framebufferTexture2D" + @usableFromInline static let framebufferTextureLayer: JSString = "framebufferTextureLayer" @usableFromInline static let framerate: JSString = "framerate" @usableFromInline static let frames: JSString = "frames" @usableFromInline static let frequency: JSString = "frequency" @@ -23525,6 +25089,9 @@ public enum console { @usableFromInline static let get: JSString = "get" @usableFromInline static let getActiveAttrib: JSString = "getActiveAttrib" @usableFromInline static let getActiveUniform: JSString = "getActiveUniform" + @usableFromInline static let getActiveUniformBlockName: JSString = "getActiveUniformBlockName" + @usableFromInline static let getActiveUniformBlockParameter: JSString = "getActiveUniformBlockParameter" + @usableFromInline static let getActiveUniforms: JSString = "getActiveUniforms" @usableFromInline static let getAll: JSString = "getAll" @usableFromInline static let getAllResponseHeaders: JSString = "getAllResponseHeaders" @usableFromInline static let getAnimations: JSString = "getAnimations" @@ -23541,6 +25108,7 @@ public enum console { @usableFromInline static let getBounds: JSString = "getBounds" @usableFromInline static let getBoxQuads: JSString = "getBoxQuads" @usableFromInline static let getBufferParameter: JSString = "getBufferParameter" + @usableFromInline static let getBufferSubData: JSString = "getBufferSubData" @usableFromInline static let getByteFrequencyData: JSString = "getByteFrequencyData" @usableFromInline static let getByteTimeDomainData: JSString = "getByteTimeDomainData" @usableFromInline static let getCapabilities: JSString = "getCapabilities" @@ -23562,9 +25130,12 @@ public enum console { @usableFromInline static let getExtension: JSString = "getExtension" @usableFromInline static let getFloatFrequencyData: JSString = "getFloatFrequencyData" @usableFromInline static let getFloatTimeDomainData: JSString = "getFloatTimeDomainData" + @usableFromInline static let getFragDataLocation: JSString = "getFragDataLocation" @usableFromInline static let getFramebufferAttachmentParameter: JSString = "getFramebufferAttachmentParameter" @usableFromInline static let getFrequencyResponse: JSString = "getFrequencyResponse" @usableFromInline static let getImageData: JSString = "getImageData" + @usableFromInline static let getIndexedParameter: JSString = "getIndexedParameter" + @usableFromInline static let getInternalformatParameter: JSString = "getInternalformatParameter" @usableFromInline static let getKeyframes: JSString = "getKeyframes" @usableFromInline static let getLineDash: JSString = "getLineDash" @usableFromInline static let getModifierState: JSString = "getModifierState" @@ -23573,6 +25144,8 @@ public enum console { @usableFromInline static let getParameter: JSString = "getParameter" @usableFromInline static let getProgramInfoLog: JSString = "getProgramInfoLog" @usableFromInline static let getProgramParameter: JSString = "getProgramParameter" + @usableFromInline static let getQuery: JSString = "getQuery" + @usableFromInline static let getQueryParameter: JSString = "getQueryParameter" @usableFromInline static let getReader: JSString = "getReader" @usableFromInline static let getRegistration: JSString = "getRegistration" @usableFromInline static let getRegistrations: JSString = "getRegistrations" @@ -23580,6 +25153,7 @@ public enum console { @usableFromInline static let getResponseHeader: JSString = "getResponseHeader" @usableFromInline static let getRootNode: JSString = "getRootNode" @usableFromInline static let getSVGDocument: JSString = "getSVGDocument" + @usableFromInline static let getSamplerParameter: JSString = "getSamplerParameter" @usableFromInline static let getSettings: JSString = "getSettings" @usableFromInline static let getShaderInfoLog: JSString = "getShaderInfoLog" @usableFromInline static let getShaderParameter: JSString = "getShaderParameter" @@ -23589,12 +25163,16 @@ public enum console { @usableFromInline static let getState: JSString = "getState" @usableFromInline static let getSupportedConstraints: JSString = "getSupportedConstraints" @usableFromInline static let getSupportedExtensions: JSString = "getSupportedExtensions" + @usableFromInline static let getSyncParameter: JSString = "getSyncParameter" @usableFromInline static let getTexParameter: JSString = "getTexParameter" @usableFromInline static let getTiming: JSString = "getTiming" @usableFromInline static let getTrackById: JSString = "getTrackById" @usableFromInline static let getTracks: JSString = "getTracks" @usableFromInline static let getTransform: JSString = "getTransform" + @usableFromInline static let getTransformFeedbackVarying: JSString = "getTransformFeedbackVarying" @usableFromInline static let getUniform: JSString = "getUniform" + @usableFromInline static let getUniformBlockIndex: JSString = "getUniformBlockIndex" + @usableFromInline static let getUniformIndices: JSString = "getUniformIndices" @usableFromInline static let getUniformLocation: JSString = "getUniformLocation" @usableFromInline static let getUserMedia: JSString = "getUserMedia" @usableFromInline static let getVertexAttrib: JSString = "getVertexAttrib" @@ -23687,6 +25265,8 @@ public enum console { @usableFromInline static let integrity: JSString = "integrity" @usableFromInline static let intersectsNode: JSString = "intersectsNode" @usableFromInline static let invalidIteratorState: JSString = "invalidIteratorState" + @usableFromInline static let invalidateFramebuffer: JSString = "invalidateFramebuffer" + @usableFromInline static let invalidateSubFramebuffer: JSString = "invalidateSubFramebuffer" @usableFromInline static let inverse: JSString = "inverse" @usableFromInline static let invertSelf: JSString = "invertSelf" @usableFromInline static let `is`: JSString = "is" @@ -23708,14 +25288,19 @@ public enum console { @usableFromInline static let isPointInRange: JSString = "isPointInRange" @usableFromInline static let isPointInStroke: JSString = "isPointInStroke" @usableFromInline static let isProgram: JSString = "isProgram" + @usableFromInline static let isQuery: JSString = "isQuery" @usableFromInline static let isReloadNavigation: JSString = "isReloadNavigation" @usableFromInline static let isRenderbuffer: JSString = "isRenderbuffer" @usableFromInline static let isSameNode: JSString = "isSameNode" + @usableFromInline static let isSampler: JSString = "isSampler" @usableFromInline static let isSecureContext: JSString = "isSecureContext" @usableFromInline static let isShader: JSString = "isShader" + @usableFromInline static let isSync: JSString = "isSync" @usableFromInline static let isTexture: JSString = "isTexture" + @usableFromInline static let isTransformFeedback: JSString = "isTransformFeedback" @usableFromInline static let isTrusted: JSString = "isTrusted" @usableFromInline static let isTypeSupported: JSString = "isTypeSupported" + @usableFromInline static let isVertexArray: JSString = "isVertexArray" @usableFromInline static let isVisible: JSString = "isVisible" @usableFromInline static let item: JSString = "item" @usableFromInline static let items: JSString = "items" @@ -24047,6 +25632,7 @@ public enum console { @usableFromInline static let patternMismatch: JSString = "patternMismatch" @usableFromInline static let pause: JSString = "pause" @usableFromInline static let pauseOnExit: JSString = "pauseOnExit" + @usableFromInline static let pauseTransformFeedback: JSString = "pauseTransformFeedback" @usableFromInline static let paused: JSString = "paused" @usableFromInline static let pdfViewerEnabled: JSString = "pdfViewerEnabled" @usableFromInline static let pending: JSString = "pending" @@ -24140,6 +25726,7 @@ public enum console { @usableFromInline static let readAsBinaryString: JSString = "readAsBinaryString" @usableFromInline static let readAsDataURL: JSString = "readAsDataURL" @usableFromInline static let readAsText: JSString = "readAsText" + @usableFromInline static let readBuffer: JSString = "readBuffer" @usableFromInline static let readOnly: JSString = "readOnly" @usableFromInline static let readPixels: JSString = "readPixels" @usableFromInline static let readable: JSString = "readable" @@ -24180,6 +25767,7 @@ public enum console { @usableFromInline static let removeTrack: JSString = "removeTrack" @usableFromInline static let removedNodes: JSString = "removedNodes" @usableFromInline static let renderbufferStorage: JSString = "renderbufferStorage" + @usableFromInline static let renderbufferStorageMultisample: JSString = "renderbufferStorageMultisample" @usableFromInline static let renderedBuffer: JSString = "renderedBuffer" @usableFromInline static let `repeat`: JSString = "repeat" @usableFromInline static let repetitionCount: JSString = "repetitionCount" @@ -24216,6 +25804,7 @@ public enum console { @usableFromInline static let resultType: JSString = "resultType" @usableFromInline static let resultingClientId: JSString = "resultingClientId" @usableFromInline static let resume: JSString = "resume" + @usableFromInline static let resumeTransformFeedback: JSString = "resumeTransformFeedback" @usableFromInline static let returnValue: JSString = "returnValue" @usableFromInline static let rev: JSString = "rev" @usableFromInline static let reverse: JSString = "reverse" @@ -24239,6 +25828,8 @@ public enum console { @usableFromInline static let sampleCoverage: JSString = "sampleCoverage" @usableFromInline static let sampleRate: JSString = "sampleRate" @usableFromInline static let sampleSize: JSString = "sampleSize" + @usableFromInline static let samplerParameterf: JSString = "samplerParameterf" + @usableFromInline static let samplerParameteri: JSString = "samplerParameteri" @usableFromInline static let sandbox: JSString = "sandbox" @usableFromInline static let save: JSString = "save" @usableFromInline static let scalabilityMode: JSString = "scalabilityMode" @@ -24424,9 +26015,13 @@ public enum console { @usableFromInline static let temporalLayerId: JSString = "temporalLayerId" @usableFromInline static let terminate: JSString = "terminate" @usableFromInline static let texImage2D: JSString = "texImage2D" + @usableFromInline static let texImage3D: JSString = "texImage3D" @usableFromInline static let texParameterf: JSString = "texParameterf" @usableFromInline static let texParameteri: JSString = "texParameteri" + @usableFromInline static let texStorage2D: JSString = "texStorage2D" + @usableFromInline static let texStorage3D: JSString = "texStorage3D" @usableFromInline static let texSubImage2D: JSString = "texSubImage2D" + @usableFromInline static let texSubImage3D: JSString = "texSubImage3D" @usableFromInline static let text: JSString = "text" @usableFromInline static let textAlign: JSString = "textAlign" @usableFromInline static let textBaseline: JSString = "textBaseline" @@ -24467,6 +26062,7 @@ public enum console { @usableFromInline static let transferFromImageBitmap: JSString = "transferFromImageBitmap" @usableFromInline static let transferToImageBitmap: JSString = "transferToImageBitmap" @usableFromInline static let transform: JSString = "transform" + @usableFromInline static let transformFeedbackVaryings: JSString = "transformFeedbackVaryings" @usableFromInline static let transformPoint: JSString = "transformPoint" @usableFromInline static let transformToDocument: JSString = "transformToDocument" @usableFromInline static let transformToFragment: JSString = "transformToFragment" @@ -24480,21 +26076,36 @@ public enum console { @usableFromInline static let uniform1fv: JSString = "uniform1fv" @usableFromInline static let uniform1i: JSString = "uniform1i" @usableFromInline static let uniform1iv: JSString = "uniform1iv" + @usableFromInline static let uniform1ui: JSString = "uniform1ui" + @usableFromInline static let uniform1uiv: JSString = "uniform1uiv" @usableFromInline static let uniform2f: JSString = "uniform2f" @usableFromInline static let uniform2fv: JSString = "uniform2fv" @usableFromInline static let uniform2i: JSString = "uniform2i" @usableFromInline static let uniform2iv: JSString = "uniform2iv" + @usableFromInline static let uniform2ui: JSString = "uniform2ui" + @usableFromInline static let uniform2uiv: JSString = "uniform2uiv" @usableFromInline static let uniform3f: JSString = "uniform3f" @usableFromInline static let uniform3fv: JSString = "uniform3fv" @usableFromInline static let uniform3i: JSString = "uniform3i" @usableFromInline static let uniform3iv: JSString = "uniform3iv" + @usableFromInline static let uniform3ui: JSString = "uniform3ui" + @usableFromInline static let uniform3uiv: JSString = "uniform3uiv" @usableFromInline static let uniform4f: JSString = "uniform4f" @usableFromInline static let uniform4fv: JSString = "uniform4fv" @usableFromInline static let uniform4i: JSString = "uniform4i" @usableFromInline static let uniform4iv: JSString = "uniform4iv" + @usableFromInline static let uniform4ui: JSString = "uniform4ui" + @usableFromInline static let uniform4uiv: JSString = "uniform4uiv" + @usableFromInline static let uniformBlockBinding: JSString = "uniformBlockBinding" @usableFromInline static let uniformMatrix2fv: JSString = "uniformMatrix2fv" + @usableFromInline static let uniformMatrix2x3fv: JSString = "uniformMatrix2x3fv" + @usableFromInline static let uniformMatrix2x4fv: JSString = "uniformMatrix2x4fv" @usableFromInline static let uniformMatrix3fv: JSString = "uniformMatrix3fv" + @usableFromInline static let uniformMatrix3x2fv: JSString = "uniformMatrix3x2fv" + @usableFromInline static let uniformMatrix3x4fv: JSString = "uniformMatrix3x4fv" @usableFromInline static let uniformMatrix4fv: JSString = "uniformMatrix4fv" + @usableFromInline static let uniformMatrix4x2fv: JSString = "uniformMatrix4x2fv" + @usableFromInline static let uniformMatrix4x3fv: JSString = "uniformMatrix4x3fv" @usableFromInline static let unregister: JSString = "unregister" @usableFromInline static let unregisterProtocolHandler: JSString = "unregisterProtocolHandler" @usableFromInline static let upX: JSString = "upX" @@ -24533,6 +26144,12 @@ public enum console { @usableFromInline static let vertexAttrib3fv: JSString = "vertexAttrib3fv" @usableFromInline static let vertexAttrib4f: JSString = "vertexAttrib4f" @usableFromInline static let vertexAttrib4fv: JSString = "vertexAttrib4fv" + @usableFromInline static let vertexAttribDivisor: JSString = "vertexAttribDivisor" + @usableFromInline static let vertexAttribI4i: JSString = "vertexAttribI4i" + @usableFromInline static let vertexAttribI4iv: JSString = "vertexAttribI4iv" + @usableFromInline static let vertexAttribI4ui: JSString = "vertexAttribI4ui" + @usableFromInline static let vertexAttribI4uiv: JSString = "vertexAttribI4uiv" + @usableFromInline static let vertexAttribIPointer: JSString = "vertexAttribIPointer" @usableFromInline static let vertexAttribPointer: JSString = "vertexAttribPointer" @usableFromInline static let video: JSString = "video" @usableFromInline static let videoBitsPerSecond: JSString = "videoBitsPerSecond" @@ -24548,6 +26165,7 @@ public enum console { @usableFromInline static let volume: JSString = "volume" @usableFromInline static let vspace: JSString = "vspace" @usableFromInline static let w: JSString = "w" + @usableFromInline static let waitSync: JSString = "waitSync" @usableFromInline static let waiting: JSString = "waiting" @usableFromInline static let warn: JSString = "warn" @usableFromInline static let wasClean: JSString = "wasClean" @@ -26994,6 +28612,48 @@ public enum TimerHandler: JSValueCompatible, Any_TimerHandler { } } +public protocol Any_Uint32List: ConvertibleToJSValue {} +extension Uint32Array: Any_Uint32List {} +extension Array: Any_Uint32List where Element == GLuint {} + +public enum Uint32List: JSValueCompatible, Any_Uint32List { + case uint32Array(Uint32Array) + case seq_of_GLuint([GLuint]) + + var uint32Array: Uint32Array? { + switch self { + case let .uint32Array(uint32Array): return uint32Array + default: return nil + } + } + + var seq_of_GLuint: [GLuint]? { + switch self { + case let .seq_of_GLuint(seq_of_GLuint): return seq_of_GLuint + default: return nil + } + } + + public static func construct(from value: JSValue) -> Self? { + if let uint32Array: Uint32Array = value.fromJSValue() { + return .uint32Array(uint32Array) + } + if let seq_of_GLuint: [GLuint] = value.fromJSValue() { + return .seq_of_GLuint(seq_of_GLuint) + } + return nil + } + + public var jsValue: JSValue { + switch self { + case let .uint32Array(uint32Array): + return uint32Array.jsValue + case let .seq_of_GLuint(seq_of_GLuint): + return seq_of_GLuint.jsValue + } + } +} + public protocol Any_XMLHttpRequestBodyInit: ConvertibleToJSValue {} extension Blob: Any_XMLHttpRequestBodyInit {} extension BufferSource: Any_XMLHttpRequestBodyInit {} diff --git a/Sources/DOMKit/RenderingContext.swift b/Sources/DOMKit/RenderingContext.swift index ad42b922..6e493665 100644 --- a/Sources/DOMKit/RenderingContext.swift +++ b/Sources/DOMKit/RenderingContext.swift @@ -5,17 +5,17 @@ import JavaScriptKit public protocol Any_RenderingContext: ConvertibleToJSValue {} extension CanvasRenderingContext2D: Any_RenderingContext {} -//extension GPUCanvasContext: Any_RenderingContext {} +// extension GPUCanvasContext: Any_RenderingContext {} extension ImageBitmapRenderingContext: Any_RenderingContext {} -//extension WebGL2RenderingContext: Any_RenderingContext {} -//extension WebGLRenderingContext: Any_RenderingContext {} +extension WebGL2RenderingContext: Any_RenderingContext {} +extension WebGLRenderingContext: Any_RenderingContext {} public enum RenderingContext: JSValueCompatible, Any_RenderingContext { case canvasRenderingContext2D(CanvasRenderingContext2D) // case gpuCanvasContext(GPUCanvasContext) case imageBitmapRenderingContext(ImageBitmapRenderingContext) -// case webGL2RenderingContext(WebGL2RenderingContext) -// case webGLRenderingContext(WebGLRenderingContext) + case webGL2RenderingContext(WebGL2RenderingContext) + case webGLRenderingContext(WebGLRenderingContext) var canvasRenderingContext2D: CanvasRenderingContext2D? { switch self { @@ -31,26 +31,26 @@ public enum RenderingContext: JSValueCompatible, Any_RenderingContext { // } // } - var imageBitmapRenderingContext: ImageBitmapRenderingContext? { + public var imageBitmapRenderingContext: ImageBitmapRenderingContext? { switch self { case let .imageBitmapRenderingContext(imageBitmapRenderingContext): return imageBitmapRenderingContext default: return nil } } -// var webGL2RenderingContext: WebGL2RenderingContext? { -// switch self { -// case let .webGL2RenderingContext(webGL2RenderingContext): return webGL2RenderingContext -// default: return nil -// } -// } -// -// var webGLRenderingContext: WebGLRenderingContext? { -// switch self { -// case let .webGLRenderingContext(webGLRenderingContext): return webGLRenderingContext -// default: return nil -// } -// } + public var webGL2RenderingContext: WebGL2RenderingContext? { + switch self { + case let .webGL2RenderingContext(webGL2RenderingContext): return webGL2RenderingContext + default: return nil + } + } + + public var webGLRenderingContext: WebGLRenderingContext? { + switch self { + case let .webGLRenderingContext(webGLRenderingContext): return webGLRenderingContext + default: return nil + } + } public static func construct(from value: JSValue) -> Self? { if let canvasRenderingContext2D: CanvasRenderingContext2D = value.fromJSValue() { @@ -62,12 +62,12 @@ public enum RenderingContext: JSValueCompatible, Any_RenderingContext { if let imageBitmapRenderingContext: ImageBitmapRenderingContext = value.fromJSValue() { return .imageBitmapRenderingContext(imageBitmapRenderingContext) } -// if let webGL2RenderingContext: WebGL2RenderingContext = value.fromJSValue() { -// return .webGL2RenderingContext(webGL2RenderingContext) -// } -// if let webGLRenderingContext: WebGLRenderingContext = value.fromJSValue() { -// return .webGLRenderingContext(webGLRenderingContext) -// } + if let webGL2RenderingContext: WebGL2RenderingContext = value.fromJSValue() { + return .webGL2RenderingContext(webGL2RenderingContext) + } + if let webGLRenderingContext: WebGLRenderingContext = value.fromJSValue() { + return .webGLRenderingContext(webGLRenderingContext) + } return nil } @@ -79,10 +79,10 @@ public enum RenderingContext: JSValueCompatible, Any_RenderingContext { // return gpuCanvasContext.jsValue case let .imageBitmapRenderingContext(imageBitmapRenderingContext): return imageBitmapRenderingContext.jsValue -// case let .webGL2RenderingContext(webGL2RenderingContext): -// return webGL2RenderingContext.jsValue -// case let .webGLRenderingContext(webGLRenderingContext): -// return webGLRenderingContext.jsValue + case let .webGL2RenderingContext(webGL2RenderingContext): + return webGL2RenderingContext.jsValue + case let .webGLRenderingContext(webGLRenderingContext): + return webGLRenderingContext.jsValue } } } diff --git a/Sources/DOMKitDemo/WebGLDemo.swift b/Sources/DOMKitDemo/WebGLDemo.swift new file mode 100644 index 00000000..290e1fc0 --- /dev/null +++ b/Sources/DOMKitDemo/WebGLDemo.swift @@ -0,0 +1,192 @@ +// Copyright 2021-2022, GFXFundamentals and DOMKit contributors. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of GFXFundamentals. nor the names of his +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import DOMKit + +let vertexShaderSource = + """ + #version 300 es + + // an attribute is an input (in) to a vertex shader. + // It will receive data from a buffer + in vec4 a_position; + + // all shaders have a main function + void main() { + + // gl_Position is a special variable a vertex shader + // is responsible for setting + gl_Position = a_position; + } + """ + +let fragmentShaderSource = + """ + #version 300 es + + // fragment shaders don't have a default precision so we need + // to pick one. highp is a good default. It means "high precision" + precision highp float; + + // we need to declare an output for the fragment shader + out vec4 outColor; + + void main() { + // Just set the output to a constant redish-purple + outColor = vec4(1, 0, 0.5, 1); + } + """ + +extension WebGL2RenderingContext { + func createShader(type: GLenum, source: String) -> WebGLShader? { + guard let shader = createShader(type: type) else { return nil } + + shaderSource(shader: shader, source: source) + compileShader(shader: shader) + + switch getShaderParameter(shader: shader, pname: Self.COMPILE_STATUS) { + case .undefined, .boolean(false): + if let log = getShaderInfoLog(shader: shader) { + console.log(data: log.jsValue) + } + deleteShader(shader: shader) + return nil + + default: + return shader + } + } + + func createProgram(vShader: WebGLShader, fShader: WebGLShader) -> WebGLProgram? { + guard let program = createProgram() else { return nil } + + attachShader(program: program, shader: vShader) + attachShader(program: program, shader: fShader) + linkProgram(program: program) + + switch getProgramParameter(program: program, pname: Self.LINK_STATUS) { + case .undefined, .boolean(false): + if let log = getProgramInfoLog(program: program) { + console.log(data: log.jsValue) + } + deleteProgram(program: program) + return nil + + default: + return program + } + } +} + +extension HTMLCanvasElement { + func resizeToDisplaySize() { + if width != UInt32(clientWidth) || height != UInt32(clientHeight) { + width = UInt32(clientWidth) + height = UInt32(clientHeight) + } + } +} + +func runWebGLDemo() { + // Get A WebGL context + let canvas = HTMLCanvasElement(from: document.createElement(localName: "canvas"))! + _ = document.body?.appendChild(node: canvas) + let context = canvas.getContext(contextId: "webgl2")!.webGL2RenderingContext! + + // create GLSL shaders, upload the GLSL source, compile the shaders + guard + let vShader = context.createShader(type: WebGL2RenderingContext.VERTEX_SHADER, source: vertexShaderSource), + let fShader = context.createShader(type: WebGL2RenderingContext.FRAGMENT_SHADER, source: fragmentShaderSource), + + // Link the two shaders into a program + let program = context.createProgram(vShader: vShader, fShader: fShader) + else { + console.error(data: "Failed to create or link shaders") + return + } + + // look up where the vertex data needs to go. + let positionAttributeLocation = GLuint(context.getAttribLocation(program: program, name: "a_position")) + + // Create a buffer and put three 2d clip space points in it + let positionBuffer = context.createBuffer() + + // Bind it to ARRAY_BUFFER (think of it as ARRAY_BUFFER = positionBuffer) + context.bindBuffer(target: WebGL2RenderingContext.ARRAY_BUFFER, buffer: positionBuffer) + context.bufferData( + target: WebGL2RenderingContext.ARRAY_BUFFER, + srcData: BufferSource.arrayBuffer( + Float32Array([ + 0.0, 0.0, + 0.0, 0.5, + 0.7, 0.0, + ]).buffer + ), + usage: WebGL2RenderingContext.STATIC_DRAW + ) + + // Create a vertex array object (attribute state) + guard let vao = context.createVertexArray() else { + console.error(data: "Failed to create VAO") + return + } + + // and make it the one we're currently working with + context.bindVertexArray(array: vao) + + // Turn on the attribute + context.enableVertexAttribArray(index: positionAttributeLocation) + + context.vertexAttribPointer( + index: positionAttributeLocation, + size: 2, // 2 components per iteration + type: WebGL2RenderingContext.FLOAT, // the data is 32bit floats + normalized: false, // don't normalize the data + stride: 0, // 0 = move forward size * sizeof(type) each iteration to get the next position + offset: 0 // start at the beginning of the buffer + ) + + canvas.resizeToDisplaySize() + + // Tell WebGL how to convert from clip space to pixels + context.viewport(x: 0, y: 0, width: GLsizei(canvas.width), height: GLsizei(canvas.height)) + + // Clear the canvas + context.clearColor(red: 0, green: 0, blue: 0, alpha: 0) + context.clear(mask: WebGL2RenderingContext.COLOR_BUFFER_BIT) + + // Tell it to use our program (pair of shaders) + context.useProgram(program: program) + + // Bind the attribute/buffer set we want. + context.bindVertexArray(array: vao) + + // draw + context.drawArrays(mode: WebGL2RenderingContext.TRIANGLES, first: 0, count: 3) +} diff --git a/Sources/DOMKitDemo/main.swift b/Sources/DOMKitDemo/main.swift index 82074f78..dfe47211 100644 --- a/Sources/DOMKitDemo/main.swift +++ b/Sources/DOMKitDemo/main.swift @@ -1,10 +1,15 @@ -import JavaScriptKit import DOMKit +import JavaScriptKit let document = globalThis.document -let header = HTMLElement(from: document.createElement(localName: "h1"))! -header.innerText = "Hello World!" -_ = document.body!.appendChild(node: header) +let button = HTMLElement(from: document.createElement(localName: "button"))! +button.innerText = "Hello World!" +_ = document.body!.appendChild(node: button) console.log(data: "Hello, world!") + +button.onclick = { _ in + runWebGLDemo() + return .undefined +} diff --git a/parse-idl/parse-all.js b/parse-idl/parse-all.js index 6856b7ab..93f1d45b 100644 --- a/parse-idl/parse-all.js +++ b/parse-idl/parse-all.js @@ -31,6 +31,7 @@ console.log( "mediastream-recording", "webcodecs", "webgl1", + "webgl2", ].map((key) => parsedFiles[key]), null, 2