From a751933d6c15abadb7d7bd9b57852e1c30ae957d Mon Sep 17 00:00:00 2001 From: Matt Seddon Date: Sun, 23 Mar 2014 15:55:16 +0000 Subject: [PATCH 1/2] WebGL and Typed Arrays Support --- .../scala/org/scalajs/dom/TypedArrays.scala | 244 +++++++ src/main/scala/org/scalajs/dom/WebGL.scala | 669 ++++++++++++++++++ 2 files changed, 913 insertions(+) create mode 100644 src/main/scala/org/scalajs/dom/TypedArrays.scala create mode 100644 src/main/scala/org/scalajs/dom/WebGL.scala diff --git a/src/main/scala/org/scalajs/dom/TypedArrays.scala b/src/main/scala/org/scalajs/dom/TypedArrays.scala new file mode 100644 index 000000000..8a13af3fe --- /dev/null +++ b/src/main/scala/org/scalajs/dom/TypedArrays.scala @@ -0,0 +1,244 @@ +/** + * Copyright (C) 2014 Matt Seddon. This source is donated in full to the EPFL scala-js-dom project. + * + * Based on https://www.khronos.org/registry/typedarray/specs/1.0/ + */ +package org.scalajs.dom + +import scala.scalajs.js +import scala.scalajs.js.annotation._ + +class ArrayBuffer extends js.Object { + def byteLength: js.Number = ??? + def slice(begin: js.Number, end: js.Number): ArrayBufferView = ??? + def slice(begin: js.Number): ArrayBufferView = ??? +} + +object ArrayBuffer { + def isView(value: js.Any): js.Boolean = ??? +} + +trait ArrayBufferView extends js.Object { + def buffer: ArrayBuffer = ??? + def byteOffset: js.Number = ??? + def byteLength: js.Number = ??? +} + +/** + * Defines common functionality across all typed arrays. + * NOTE: This is just a utility and should probably be + * re-jigged so as not to pollute the org.scalajs.dom package somehow. + */ +trait TypedArrayCommon[T] extends js.Object { + @JSBracketAccess + def apply(index: js.Number): js.Number = ??? + @JSBracketAccess + def update(index: js.Number, value: js.Number): Unit = ??? + + def set(array: T, offset: js.Number): Unit = ??? + def set(array: T): Unit = ??? + def set(array: js.Array[js.Number], offset: js.Number): Unit = ??? + def set(array: js.Array[js.Number]): Unit = ??? + + def subarray(start: js.Number, end: js.Number): T = ??? +} + +class Int8Array private () extends js.Object + with ArrayBufferView + with TypedArrayCommon[Int8Array] { + def this(length: js.Number) = this() + def this(array: Int8Array) = this() + def this(array: js.Array[js.Number]) = this() + def this(buffer: ArrayBuffer) = this() + def this(buffer: ArrayBuffer, byteOffset: js.Number) = this() + def this(buffer: ArrayBuffer, byteOffset: js.Number, length: js.Number) = this() +} + +object Int8Array extends js.Object { + val BYTES_PER_ELEMENT: js.Number = 1 +} + +class Uint8Array private () extends js.Object + with ArrayBufferView + with TypedArrayCommon[Uint8Array] { + def this(length: js.Number) = this() + def this(array: Uint8Array) = this() + def this(array: js.Array[js.Number]) = this() + def this(buffer: ArrayBuffer) = this() + def this(buffer: ArrayBuffer, byteOffset: js.Number) = this() + def this(buffer: ArrayBuffer, byteOffset: js.Number, length: js.Number) = this() +} + +object Uint8Array extends js.Object { + val BYTES_PER_ELEMENT: js.Number = 1 +} + +class Uint8ClampedArray private () extends js.Object + with ArrayBufferView + with TypedArrayCommon[Uint8ClampedArray]{ + def this(length: js.Number) = this() + def this(array: Uint8ClampedArray) = this() + def this(array: js.Array[js.Number]) = this() + def this(buffer: ArrayBuffer) = this() + def this(buffer: ArrayBuffer, byteOffset: js.Number) = this() + def this(buffer: ArrayBuffer, byteOffset: js.Number, length: js.Number) = this() +} + +object Uint8ClampedArray extends js.Object { + val BYTES_PER_ELEMENT: js.Number = 1 +} + +class Int16Array private () extends js.Object + with ArrayBufferView + with TypedArrayCommon[Int16Array] { + def this(length: js.Number) = this() + def this(array: Int16Array) = this() + def this(array: js.Array[js.Number]) = this() + def this(buffer: ArrayBuffer) = this() + def this(buffer: ArrayBuffer, byteOffset: js.Number) = this() + def this(buffer: ArrayBuffer, byteOffset: js.Number, length: js.Number) = this() +} + +object Int16Array extends js.Object { + val BYTES_PER_ELEMENT: js.Number = 2 +} + +class Uint16Array private () extends js.Object + with ArrayBufferView + with TypedArrayCommon[Uint16Array] { + def this(length: js.Number) = this() + def this(array: Uint16Array) = this() + def this(array: js.Array[js.Number]) = this() + def this(buffer: ArrayBuffer) = this() + def this(buffer: ArrayBuffer, byteOffset: js.Number) = this() + def this(buffer: ArrayBuffer, byteOffset: js.Number, length: js.Number) = this() +} + +object Uint16Array extends js.Object { + val BYTES_PER_ELEMENT: js.Number = 2 +} + +class Uint16ClampedArray private () extends js.Object + with ArrayBufferView + with TypedArrayCommon[Uint16ClampedArray] { + def this(length: js.Number) = this() + def this(array: Uint16ClampedArray) = this() + def this(array: js.Array[js.Number]) = this() + def this(buffer: ArrayBuffer) = this() + def this(buffer: ArrayBuffer, byteOffset: js.Number) = this() + def this(buffer: ArrayBuffer, byteOffset: js.Number, length: js.Number) = this() +} + +object Uint16ClampedArray extends js.Object { + val BYTES_PER_ELEMENT: js.Number = 2 +} + +class Int32Array private () extends js.Object + with ArrayBufferView + with TypedArrayCommon[Int32Array] { + def this(length: js.Number) = this() + def this(array: Int32Array) = this() + def this(array: js.Array[js.Number]) = this() + def this(buffer: ArrayBuffer) = this() + def this(buffer: ArrayBuffer, byteOffset: js.Number) = this() + def this(buffer: ArrayBuffer, byteOffset: js.Number, length: js.Number) = this() +} + +object Int32Array extends js.Object { + val BYTES_PER_ELEMENT: js.Number = 4 +} + + +class Uint32Array private () extends js.Object + with ArrayBufferView + with TypedArrayCommon[Uint32Array] { + def this(length: js.Number) = this() + def this(array: Uint32Array) = this() + def this(array: js.Array[js.Number]) = this() + def this(buffer: ArrayBuffer) = this() + def this(buffer: ArrayBuffer, byteOffset: js.Number) = this() + def this(buffer: ArrayBuffer, byteOffset: js.Number, length: js.Number) = this() +} + +object Uint32Array extends js.Object { + val BYTES_PER_ELEMENT: js.Number = 4 +} + +class Uint32ClampedArray private () extends js.Object + with ArrayBufferView + with TypedArrayCommon[Uint32ClampedArray] { + def this(length: js.Number) = this() + def this(array: Uint32ClampedArray) = this() + def this(array: js.Array[js.Number]) = this() + def this(buffer: ArrayBuffer) = this() + def this(buffer: ArrayBuffer, byteOffset: js.Number) = this() + def this(buffer: ArrayBuffer, byteOffset: js.Number, length: js.Number) = this() +} + +object Uint32ClampedArray extends js.Object { + val BYTES_PER_ELEMENT: js.Number = 4 +} + +class Float32Array private () extends js.Object + with ArrayBufferView + with TypedArrayCommon[Float32Array] { + + def this(length: js.Number) = this() + def this(array: Float32Array) = this() + def this(array: js.Array[js.Number]) = this() + def this(buffer: ArrayBuffer) = this() + def this(buffer: ArrayBuffer, byteOffset: js.Number) = this() + def this(buffer: ArrayBuffer, byteOffset: js.Number, length: js.Number) = this() +} + +object Float32Array extends js.Object { + val BYTES_PER_ELEMENT: js.Number = 4 +} + +class Float64Array private () extends js.Object + with ArrayBufferView + with TypedArrayCommon[Float64Array] { + def this(length: js.Number) = this() + def this(array: Float64Array) = this() + def this(array: js.Array[js.Number]) = this() + def this(buffer: ArrayBuffer) = this() + def this(buffer: ArrayBuffer, byteOffset: js.Number) = this() + def this(buffer: ArrayBuffer, byteOffset: js.Number, length: js.Number) = this() +} + +object Float64Array extends js.Object { + val BYTES_PER_ELEMENT: js.Number = 8 +} + +class DataView(buffer: ArrayBuffer, byteOffset: js.Number, byteLength: js.Number) extends js.Object + with ArrayBufferView { + def getInt8(byteOffset: js.Number): js.Number = ??? + def getUint8(byteOffset: js.Number): js.Number = ??? + def getInt16(byteOffset: js.Number): js.Number = ??? + def getInt16(byteOffset: js.Number, littleEndian: js.Boolean): js.Number = ??? + def getUint16(byteOffset: js.Number): js.Number = ??? + def getUint16(byteOffset: js.Number, littleEndian: js.Boolean): js.Number = ??? + def getInt32(byteOffset: js.Number): js.Number = ??? + def getInt32(byteOffset: js.Number, littleEndian: js.Boolean): js.Number = ??? + def getUint32(byteOffset: js.Number): js.Number = ??? + def getUint32(byteOffset: js.Number, littleEndian: js.Boolean): js.Number = ??? + def getFloat32(byteOffset: js.Number): js.Number = ??? + def getFloat32(byteOffset: js.Number, littleEndian: js.Boolean): js.Number = ??? + def getFloat64(byteOffset: js.Number): js.Number = ??? + def getFloat64(byteOffset: js.Number, littleEndian: js.Boolean): js.Number = ??? + + def setInt8(byteOffset: js.Number, value: js.Number): js.Number = ??? + def setUint8(byteOffset: js.Number, value: js.Number): js.Number = ??? + def setInt16(byteOffset: js.Number, value: js.Number): js.Number = ??? + def setInt16(byteOffset: js.Number, value: js.Number, littleEndian: js.Boolean): js.Number = ??? + def setUint16(byteOffset: js.Number, value: js.Number): js.Number = ??? + def setUint16(byteOffset: js.Number, value: js.Number, littleEndian: js.Boolean): js.Number = ??? + def setInt32(byteOffset: js.Number, value: js.Number): js.Number = ??? + def setInt32(byteOffset: js.Number, value: js.Number, littleEndian: js.Boolean): js.Number = ??? + def setUint32(byteOffset: js.Number, value: js.Number): js.Number = ??? + def setUint32(byteOffset: js.Number, value: js.Number, littleEndian: js.Boolean): js.Number = ??? + def setFloat32(byteOffset: js.Number, value: js.Number): js.Number = ??? + def setFloat32(byteOffset: js.Number, value: js.Number, littleEndian: js.Boolean): js.Number = ??? + def setFloat64(byteOffset: js.Number, value: js.Number): js.Number = ??? + def setFloat64(byteOffset: js.Number, value: js.Number, littleEndian: js.Boolean): js.Number = ??? +} diff --git a/src/main/scala/org/scalajs/dom/WebGL.scala b/src/main/scala/org/scalajs/dom/WebGL.scala new file mode 100644 index 000000000..cbc22f594 --- /dev/null +++ b/src/main/scala/org/scalajs/dom/WebGL.scala @@ -0,0 +1,669 @@ +/** + * Copyright (C) 2014 Matt Seddon. This source is donated in full to the EPFL scala-js-dom project. + * + * Based on https://www.khronos.org/registry/webgl/specs/1.0/ + */ + +package org.scalajs.dom + +import scala.scalajs.js +import js.annotation._ + +class WebGLContextAttributes extends js.Object { + var alpha: js.Boolean = ??? + var depth: js.Boolean = ??? + var stencil: js.Boolean = ??? + var antialias: js.Boolean = ??? + var premultipliedAlpha: js.Boolean = ??? + var preserveDrawingBuffer: js.Boolean = ??? +} + +class WebGLBuffer private () extends js.Object + +class WebGLFramebuffer private () extends js.Object + +class WebGLProgram private () extends js.Object + +class WebGLRenderbuffer private () extends js.Object + +class WebGLShader private () extends js.Object + +class WebGLTexture private () extends js.Object + +class WebGLUniformLocation private () extends js.Object + +class WebGLActiveInfo private () extends js.Object { + def size: js.Number = ??? + def `type`: js.Number = ??? + def name: js.String = ??? +} + +class WebGLShaderPrecisionFormat private () extends js.Object { + def rangeMin: js.Number = ??? + def rangeMax: js.Number = ??? + def precision: js.Number = ??? +} + +object WebGLRenderingContext extends js.Object { + /* ClearBufferMask */ + val DEPTH_BUFFER_BIT = 0x00000100 + val STENCIL_BUFFER_BIT = 0x00000400 + val COLOR_BUFFER_BIT = 0x00004000 + + /* BeginMode */ + val POINTS = 0x0000 + val LINES = 0x0001 + val LINE_LOOP = 0x0002 + val LINE_STRIP = 0x0003 + val TRIANGLES = 0x0004 + val TRIANGLE_STRIP = 0x0005 + val TRIANGLE_FAN = 0x0006 + + /* AlphaFunction (not supported in ES20) */ + /* NEVER */ + /* LESS */ + /* EQUAL */ + /* LEQUAL */ + /* GREATER */ + /* NOTEQUAL */ + /* GEQUAL */ + /* ALWAYS */ + + /* BlendingFactorDest */ + val ZERO = 0 + val ONE = 1 + val SRC_COLOR = 0x0300 + val ONE_MINUS_SRC_COLOR = 0x0301 + val SRC_ALPHA = 0x0302 + val ONE_MINUS_SRC_ALPHA = 0x0303 + val DST_ALPHA = 0x0304 + val ONE_MINUS_DST_ALPHA = 0x0305 + + /* BlendingFactorSrc */ + /* ZERO */ + /* ONE */ + val DST_COLOR = 0x0306 + val ONE_MINUS_DST_COLOR = 0x0307 + val SRC_ALPHA_SATURATE = 0x0308 + /* SRC_ALPHA */ + /* ONE_MINUS_SRC_ALPHA */ + /* DST_ALPHA */ + /* ONE_MINUS_DST_ALPHA */ + + /* BlendEquationSeparate */ + val FUNC_ADD = 0x8006 + val BLEND_EQUATION = 0x8009 + val BLEND_EQUATION_RGB = 0x8009 /* same as BLEND_EQUATION */ + val BLEND_EQUATION_ALPHA = 0x883D + + /* BlendSubtract */ + val FUNC_SUBTRACT = 0x800A + val FUNC_REVERSE_SUBTRACT = 0x800B + + /* Separate Blend Functions */ + val BLEND_DST_RGB = 0x80C8 + val BLEND_SRC_RGB = 0x80C9 + val BLEND_DST_ALPHA = 0x80CA + val BLEND_SRC_ALPHA = 0x80CB + val CONSTANT_COLOR = 0x8001 + val ONE_MINUS_CONSTANT_COLOR = 0x8002 + val CONSTANT_ALPHA = 0x8003 + val ONE_MINUS_CONSTANT_ALPHA = 0x8004 + val BLEND_COLOR = 0x8005 + + /* Buffer Objects */ + val ARRAY_BUFFER = 0x8892 + val ELEMENT_ARRAY_BUFFER = 0x8893 + val ARRAY_BUFFER_BINDING = 0x8894 + val ELEMENT_ARRAY_BUFFER_BINDING = 0x8895 + + val STREAM_DRAW = 0x88E0 + val STATIC_DRAW = 0x88E4 + val DYNAMIC_DRAW = 0x88E8 + + val BUFFER_SIZE = 0x8764 + val BUFFER_USAGE = 0x8765 + + val CURRENT_VERTEX_ATTRIB = 0x8626 + + /* CullFaceMode */ + val FRONT = 0x0404 + val BACK = 0x0405 + val FRONT_AND_BACK = 0x0408 + + /* DepthFunction */ + /* NEVER */ + /* LESS */ + /* EQUAL */ + /* LEQUAL */ + /* GREATER */ + /* NOTEQUAL */ + /* GEQUAL */ + /* ALWAYS */ + + /* EnableCap */ + /* TEXTURE_2D */ + val CULL_FACE = 0x0B44 + val BLEND = 0x0BE2 + val DITHER = 0x0BD0 + val STENCIL_TEST = 0x0B90 + val DEPTH_TEST = 0x0B71 + val SCISSOR_TEST = 0x0C11 + val POLYGON_OFFSET_FILL = 0x8037 + val SAMPLE_ALPHA_TO_COVERAGE = 0x809E + val SAMPLE_COVERAGE = 0x80A0 + + /* ErrorCode */ + val NO_ERROR = 0 + val INVALID_ENUM = 0x0500 + val INVALID_VALUE = 0x0501 + val INVALID_OPERATION = 0x0502 + val OUT_OF_MEMORY = 0x0505 + + /* FrontFaceDirection */ + val CW = 0x0900 + val CCW = 0x0901 + + /* GetPName */ + val LINE_WIDTH = 0x0B21 + val ALIASED_POINT_SIZE_RANGE = 0x846D + val ALIASED_LINE_WIDTH_RANGE = 0x846E + val CULL_FACE_MODE = 0x0B45 + val FRONT_FACE = 0x0B46 + val DEPTH_RANGE = 0x0B70 + val DEPTH_WRITEMASK = 0x0B72 + val DEPTH_CLEAR_VALUE = 0x0B73 + val DEPTH_FUNC = 0x0B74 + val STENCIL_CLEAR_VALUE = 0x0B91 + val STENCIL_FUNC = 0x0B92 + val STENCIL_FAIL = 0x0B94 + val STENCIL_PASS_DEPTH_FAIL = 0x0B95 + val STENCIL_PASS_DEPTH_PASS = 0x0B96 + val STENCIL_REF = 0x0B97 + val STENCIL_VALUE_MASK = 0x0B93 + val STENCIL_WRITEMASK = 0x0B98 + val STENCIL_BACK_FUNC = 0x8800 + val STENCIL_BACK_FAIL = 0x8801 + val STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802 + val STENCIL_BACK_PASS_DEPTH_PASS = 0x8803 + val STENCIL_BACK_REF = 0x8CA3 + val STENCIL_BACK_VALUE_MASK = 0x8CA4 + val STENCIL_BACK_WRITEMASK = 0x8CA5 + val VIEWPORT = 0x0BA2 + val SCISSOR_BOX = 0x0C10 + /* SCISSOR_TEST */ + val COLOR_CLEAR_VALUE = 0x0C22 + val COLOR_WRITEMASK = 0x0C23 + val UNPACK_ALIGNMENT = 0x0CF5 + val PACK_ALIGNMENT = 0x0D05 + val MAX_TEXTURE_SIZE = 0x0D33 + val MAX_VIEWPORT_DIMS = 0x0D3A + val SUBPIXEL_BITS = 0x0D50 + val RED_BITS = 0x0D52 + val GREEN_BITS = 0x0D53 + val BLUE_BITS = 0x0D54 + val ALPHA_BITS = 0x0D55 + val DEPTH_BITS = 0x0D56 + val STENCIL_BITS = 0x0D57 + val POLYGON_OFFSET_UNITS = 0x2A00 + /* POLYGON_OFFSET_FILL */ + val POLYGON_OFFSET_FACTOR = 0x8038 + val TEXTURE_BINDING_2D = 0x8069 + val SAMPLE_BUFFERS = 0x80A8 + val SAMPLES = 0x80A9 + val SAMPLE_COVERAGE_VALUE = 0x80AA + val SAMPLE_COVERAGE_INVERT = 0x80AB + + /* GetTextureParameter */ + /* TEXTURE_MAG_FILTER */ + /* TEXTURE_MIN_FILTER */ + /* TEXTURE_WRAP_S */ + /* TEXTURE_WRAP_T */ + + val COMPRESSED_TEXTURE_FORMATS = 0x86A3 + + /* HintMode */ + val DONT_CARE = 0x1100 + val FASTEST = 0x1101 + val NICEST = 0x1102 + + /* HintTarget */ + val GENERATE_MIPMAP_HINT = 0x8192 + + /* DataType */ + val BYTE = 0x1400 + val UNSIGNED_BYTE = 0x1401 + val SHORT = 0x1402 + val UNSIGNED_SHORT = 0x1403 + val INT = 0x1404 + val UNSIGNED_INT = 0x1405 + val FLOAT = 0x1406 + + /* PixelFormat */ + val DEPTH_COMPONENT = 0x1902 + val ALPHA = 0x1906 + val RGB = 0x1907 + val RGBA = 0x1908 + val LUMINANCE = 0x1909 + val LUMINANCE_ALPHA = 0x190A + + /* PixelType */ + /* UNSIGNED_BYTE */ + val UNSIGNED_SHORT_4_4_4_4 = 0x8033 + val UNSIGNED_SHORT_5_5_5_1 = 0x8034 + val UNSIGNED_SHORT_5_6_5 = 0x8363 + + /* Shaders */ + val FRAGMENT_SHADER = 0x8B30 + val VERTEX_SHADER = 0x8B31 + val MAX_VERTEX_ATTRIBS = 0x8869 + val MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB + val MAX_VARYING_VECTORS = 0x8DFC + val MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D + val MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C + val MAX_TEXTURE_IMAGE_UNITS = 0x8872 + val MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD + val SHADER_TYPE = 0x8B4F + val DELETE_STATUS = 0x8B80 + val LINK_STATUS = 0x8B82 + val VALIDATE_STATUS = 0x8B83 + val ATTACHED_SHADERS = 0x8B85 + val ACTIVE_UNIFORMS = 0x8B86 + val ACTIVE_ATTRIBUTES = 0x8B89 + val SHADING_LANGUAGE_VERSION = 0x8B8C + val CURRENT_PROGRAM = 0x8B8D + + /* StencilFunction */ + val NEVER = 0x0200 + val LESS = 0x0201 + val EQUAL = 0x0202 + val LEQUAL = 0x0203 + val GREATER = 0x0204 + val NOTEQUAL = 0x0205 + val GEQUAL = 0x0206 + val ALWAYS = 0x0207 + + /* StencilOp */ + /* ZERO */ + val KEEP = 0x1E00 + val REPLACE = 0x1E01 + val INCR = 0x1E02 + val DECR = 0x1E03 + val INVERT = 0x150A + val INCR_WRAP = 0x8507 + val DECR_WRAP = 0x8508 + + /* StringName */ + val VENDOR = 0x1F00 + val RENDERER = 0x1F01 + val VERSION = 0x1F02 + + /* TextureMagFilter */ + val NEAREST = 0x2600 + val LINEAR = 0x2601 + + /* TextureMinFilter */ + /* NEAREST */ + /* LINEAR */ + val NEAREST_MIPMAP_NEAREST = 0x2700 + val LINEAR_MIPMAP_NEAREST = 0x2701 + val NEAREST_MIPMAP_LINEAR = 0x2702 + val LINEAR_MIPMAP_LINEAR = 0x2703 + + /* TextureParameterName */ + val TEXTURE_MAG_FILTER = 0x2800 + val TEXTURE_MIN_FILTER = 0x2801 + val TEXTURE_WRAP_S = 0x2802 + val TEXTURE_WRAP_T = 0x2803 + + /* TextureTarget */ + val TEXTURE_2D = 0x0DE1 + val TEXTURE = 0x1702 + + val TEXTURE_CUBE_MAP = 0x8513 + val TEXTURE_BINDING_CUBE_MAP = 0x8514 + val TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515 + val TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516 + val TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517 + val TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518 + val TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519 + val TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A + val MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C + + /* TextureUnit */ + val TEXTURE0 = 0x84C0 + val TEXTURE1 = 0x84C1 + val TEXTURE2 = 0x84C2 + val TEXTURE3 = 0x84C3 + val TEXTURE4 = 0x84C4 + val TEXTURE5 = 0x84C5 + val TEXTURE6 = 0x84C6 + val TEXTURE7 = 0x84C7 + val TEXTURE8 = 0x84C8 + val TEXTURE9 = 0x84C9 + val TEXTURE10 = 0x84CA + val TEXTURE11 = 0x84CB + val TEXTURE12 = 0x84CC + val TEXTURE13 = 0x84CD + val TEXTURE14 = 0x84CE + val TEXTURE15 = 0x84CF + val TEXTURE16 = 0x84D0 + val TEXTURE17 = 0x84D1 + val TEXTURE18 = 0x84D2 + val TEXTURE19 = 0x84D3 + val TEXTURE20 = 0x84D4 + val TEXTURE21 = 0x84D5 + val TEXTURE22 = 0x84D6 + val TEXTURE23 = 0x84D7 + val TEXTURE24 = 0x84D8 + val TEXTURE25 = 0x84D9 + val TEXTURE26 = 0x84DA + val TEXTURE27 = 0x84DB + val TEXTURE28 = 0x84DC + val TEXTURE29 = 0x84DD + val TEXTURE30 = 0x84DE + val TEXTURE31 = 0x84DF + val ACTIVE_TEXTURE = 0x84E0 + + /* TextureWrapMode */ + val REPEAT = 0x2901 + val CLAMP_TO_EDGE = 0x812F + val MIRRORED_REPEAT = 0x8370 + + /* Uniform Types */ + val FLOAT_VEC2 = 0x8B50 + val FLOAT_VEC3 = 0x8B51 + val FLOAT_VEC4 = 0x8B52 + val INT_VEC2 = 0x8B53 + val INT_VEC3 = 0x8B54 + val INT_VEC4 = 0x8B55 + val BOOL = 0x8B56 + val BOOL_VEC2 = 0x8B57 + val BOOL_VEC3 = 0x8B58 + val BOOL_VEC4 = 0x8B59 + val FLOAT_MAT2 = 0x8B5A + val FLOAT_MAT3 = 0x8B5B + val FLOAT_MAT4 = 0x8B5C + val SAMPLER_2D = 0x8B5E + val SAMPLER_CUBE = 0x8B60 + + /* Vertex Arrays */ + val VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622 + val VERTEX_ATTRIB_ARRAY_SIZE = 0x8623 + val VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624 + val VERTEX_ATTRIB_ARRAY_TYPE = 0x8625 + val VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A + val VERTEX_ATTRIB_ARRAY_POINTER = 0x8645 + val VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F + + /* Shader Source */ + val COMPILE_STATUS = 0x8B81 + + /* Shader Precision-Specified Types */ + val LOW_FLOAT = 0x8DF0 + val MEDIUM_FLOAT = 0x8DF1 + val HIGH_FLOAT = 0x8DF2 + val LOW_INT = 0x8DF3 + val MEDIUM_INT = 0x8DF4 + val HIGH_INT = 0x8DF5 + + /* Framebuffer Object. */ + val FRAMEBUFFER = 0x8D40 + val RENDERBUFFER = 0x8D41 + + val RGBA4 = 0x8056 + val RGB5_A1 = 0x8057 + val RGB565 = 0x8D62 + val DEPTH_COMPONENT16 = 0x81A5 + val STENCIL_INDEX = 0x1901 + val STENCIL_INDEX8 = 0x8D48 + val DEPTH_STENCIL = 0x84F9 + + val RENDERBUFFER_WIDTH = 0x8D42 + val RENDERBUFFER_HEIGHT = 0x8D43 + val RENDERBUFFER_INTERNAL_FORMAT = 0x8D44 + val RENDERBUFFER_RED_SIZE = 0x8D50 + val RENDERBUFFER_GREEN_SIZE = 0x8D51 + val RENDERBUFFER_BLUE_SIZE = 0x8D52 + val RENDERBUFFER_ALPHA_SIZE = 0x8D53 + val RENDERBUFFER_DEPTH_SIZE = 0x8D54 + val RENDERBUFFER_STENCIL_SIZE = 0x8D55 + + val FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0 + val FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1 + val FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2 + val FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3 + + val COLOR_ATTACHMENT0 = 0x8CE0 + val DEPTH_ATTACHMENT = 0x8D00 + val STENCIL_ATTACHMENT = 0x8D20 + val DEPTH_STENCIL_ATTACHMENT = 0x821A + + val NONE = 0 + + val FRAMEBUFFER_COMPLETE = 0x8CD5 + val FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6 + val FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7 + val FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9 + val FRAMEBUFFER_UNSUPPORTED = 0x8CDD + + val FRAMEBUFFER_BINDING = 0x8CA6 + val RENDERBUFFER_BINDING = 0x8CA7 + val MAX_RENDERBUFFER_SIZE = 0x84E8 + + val INVALID_FRAMEBUFFER_OPERATION = 0x0506 + + /* WebGL-specific enums */ + val UNPACK_FLIP_Y_WEBGL = 0x9240 + val UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241 + val CONTEXT_LOST_WEBGL = 0x9242 + val UNPACK_COLORSPACE_CONVERSION_WEBGL = 0x9243 + val BROWSER_DEFAULT_WEBGL = 0x9244 +} + +class WebGLRenderingContext extends js.Object { + /* ClearBufferMask */ + val canvas: HTMLCanvasElement = ??? + val drawingBufferWidth: js.Number = ??? + val drawingBufferHeight: js.Number = ??? + + def getContextAttributes(): WebGLContextAttributes = ??? + def isContextLost(): js.Boolean = ??? + def getSupportedExtensions(): js.Array[String] = ??? + def getExtension(): js.Any = ??? + + def activeTexture(texture: js.Number): Unit = ??? + def attachShader(program: WebGLProgram, shader: WebGLShader): Unit = ??? + def bindAttribLocation(program: WebGLProgram, index: js.Number, name: js.String): Unit = ??? + def bindBuffer(target: js.Number, buffer: WebGLBuffer): Unit = ??? + def bindFramebuffer(target: js.Number, framebuffer: WebGLFramebuffer): Unit = ??? + def bindRenderbuffer(target: js.Number, renderbuffer: WebGLRenderbuffer): Unit = ??? + def bindTexture(target: js.Number, texture: WebGLTexture): Unit = ??? + def blendColor(red: js.Number, green: js.Number, blue: js.Number, alpha: js.Number): Unit = ??? + def blendEquation(mode: js.Number): Unit = ??? + def blendEquationSeparate(modeRGB: js.Number, modeAlpha: js.Number): Unit = ??? + def blendFunc(sfactor: js.Number, dfactor: js.Number): Unit = ??? + def blendFuncSeparate(sfactor: js.Number, dfactor: js.Number): Unit = ??? + def blendFuncSeparate(srcRGB: js.Number, dstRGB: js.Number, srcAlpha: js.Number, dstAlpha: js.Number): Unit = ??? + def bufferData(target: js.Number, size: js.Number, usage: js.Number): Unit = ??? + def bufferData(target: js.Number, size: ArrayBufferView, usage: js.Number): Unit = ??? + def bufferData(target: js.Number, size: ArrayBuffer, usage: js.Number): Unit = ??? + + def checkFramebufferStatus(target: js.Number): js.Number = ??? + def clear(mask: js.Number): Unit = ??? + def clearColor(red: js.Number, green: js.Number, blue: js.Number, alpha: js.Number): Unit = ??? + def clearDepth(depth: js.Number): Unit = ??? + def clearStencil(s: js.Number): Unit = ??? + def colorMask(red: js.Boolean, green: js.Boolean, blue: js.Boolean, alpha: js.Boolean): Unit = ??? + def compileShader(shader: WebGLShader): Unit = ??? + def compressedTexImage2D(target: js.Number, level: js.Number, internalformat: js.Number, width: js.Number, height: js.Number, border: js.Number, data: ArrayBufferView): Unit = ??? + def compressedTexSubImage2D(target: js.Number, level: js.Number, xoffset: js.Number, yoffset: js.Number, width: js.Number, height: js.Number, format: js.Number, data: ArrayBufferView): Unit = ??? + def copyTexImage2D(target: js.Number, level: js.Number, internalformat: js.Number, x: js.Number, y: js.Number, width: js.Number, height: js.Number, border: js.Number): Unit = ??? + def copyTexSubImage2D(target: js.Number, level: js.Number, xoffset: js.Number, yoffset: js.Number, x: js.Number, y: js.Number, width: js.Number, height: js.Number): Unit = ??? + + def createBuffer(): WebGLBuffer = ??? + def createFramebuffer(): WebGLFramebuffer = ??? + def createProgram(): WebGLProgram = ??? + def createRenderBuffer(): WebGLRenderbuffer = ??? + def createShader(`type`: js.Number): WebGLShader = ??? + def createTexture(): WebGLTexture = ??? + + def cullFace(mode: js.Number): Unit = ??? + + def deleteBuffer(buffer: WebGLBuffer): Unit = ??? + def deleteFramebuffer(framebuffer: WebGLFramebuffer): Unit = ??? + def deleteProgram(program: WebGLProgram): Unit = ??? + def deleteRenderbuffer(renderbuffer: WebGLRenderbuffer): Unit = ??? + def deleteShader(shader: WebGLShader): Unit = ??? + def deleteTexture(texture: WebGLTexture): Unit = ??? + + def depthFunc(func: js.Number): Unit = ??? + def depthMask(flag: js.Boolean): Unit = ??? + def depthRange(zNear: js.Number, zFar: js.Number): Unit = ??? + def detatchShader(program: WebGLProgram, shader: WebGLShader): Unit = ??? + def disable(cap: js.Number): Unit = ??? + def disableVertexAttribArray(index: js.Number): Unit = ??? + def drawArrays(mode: js.Number, first: js.Number, count: js.Number): Unit = ??? + def drawElements(mode: js.Number, count: js.Number, `type`: js.Number, offset: js.Number): Unit = ??? + + def enable(cap: js.Number): Unit = ??? + def enableVertexAttribArray(index: js.Number): Unit = ??? + def finish(): Unit = ??? + def flush(): Unit = ??? + def framebufferRenderbuffer(target: js.Number, attachment: js.Number, renderbuffertarget: js.Number, renderbuffer: WebGLRenderbuffer): Unit = ??? + def framebufferTexture2D(target: js.Number, attachment: js.Number, textarget: js.Number, texture: WebGLTexture, level: js.Number): Unit = ??? + def frontFace(mode: js.Number): Unit = ??? + + def generateMipmap(target: js.Number): Unit = ??? + + def getActiveAttrib(program: WebGLProgram, index: js.Number): Unit = ??? + def getActiveUniform(program: WebGLProgram, index: js.Number): Unit = ??? + def getAttachedShaders(program: WebGLProgram): js.Array[WebGLShader] = ??? + + def getAttribLocation(program: WebGLProgram, name: js.String): js.Number = ??? + + def getBufferParameter(target: js.Number, pname: js.Number): js.Any = ??? + def getParameter(pname: js.Number): js.Any = ??? + + def getError(): js.Number = ??? + + def getFramebufferAttachmentParameter(target: js.Number, attachment: js.Number, pname: js.Number): js.Any = ??? + def getProgramParameter(program: WebGLProgram, pname: js.Number): js.Any = ??? + def getProgramInfoLog(program: WebGLProgram): js.String = ??? + def getRenderbufferParameter(target: js.Number, pname: js.Number): js.Any = ??? + def getShaderParameter(shader: WebGLShader, pname: js.Number): js.Any = ??? + def getShaderPrecisionFormat(shadertype: js.Number, precisiontype: js.Number): WebGLShaderPrecisionFormat = ??? + def getShaderInfoLog(shader: WebGLShader): js.String = ??? + + def getShaderSource(shader: WebGLShader): js.String = ??? + + def getTexParameter(target: js.Number, pname: js.Number): js.Any = ??? + + def getUniform(program: WebGLProgram, location: WebGLUniformLocation): js.Any = ??? + + def getUniformLocation(program: WebGLProgram, name: js.String): WebGLUniformLocation = ??? + + def getVertexAttrib(index: js.Number, pname: js.Number): js.Any = ??? + + def getVertexAttribOffset(index: js.Number, pname: js.Number): js.Any = ??? + + def hint(target: js.Number, mode: js.Number): js.Any = ??? + + def isBuffer(buffer: js.Any): js.Boolean = ??? + def isEnabled(cap: js.Number): js.Boolean = ??? + def isFramebuffer(framebuffer: js.Any): js.Boolean = ??? + def isProgram(program: js.Any): js.Boolean = ??? + def isRenderbuffer(renderbuffer: js.Any): js.Boolean = ??? + def isShader(shader: js.Any): js.Boolean = ??? + def isTexture(texture: js.Any): js.Boolean = ??? + def lineWidth(width: js.Number): Unit = ??? + def linkProgram(program: WebGLProgram): Unit = ??? + def pixelStorei(pname: js.Number, param: js.Number): Unit = ??? + def polygonOffset(factor: js.Number, units: js.Number): Unit = ??? + def readPixels(x: js.Number, y: js.Number, width: js.Number, height: js.Number, format: js.Number, `type`: js.Number, pixels: ArrayBufferView): Unit = ??? + def renderbufferStorage(target: js.Number, internalformat: js.Number, width: js.Number, height: js.Number): Unit = ??? + def sampleCoverage(value: js.Number, invert: js.Boolean): Unit = ??? + def scissor(x: js.Number, y: js.Number, width: js.Number, height: js.Number): Unit = ??? + + def shaderSource(shader: WebGLShader, source: js.String): Unit = ??? + + def stencilFunc(func: js.Number, ref: js.Number, mask: js.Number): Unit = ??? + def stencilFuncSeparate(face: js.Number, func: js.Number, ref: js.Number, mask: js.Number): Unit = ??? + def stencilMask(mask: js.Number): Unit = ??? + def stencilMaskSeperate(face: js.Number, mask: js.Number): Unit = ??? + def stencilOp(fail: js.Number, zfail: js.Number, zpass: js.Number): Unit = ??? + def stencilOpSeperate(face: js.Number, fail: js.Number, zfail: js.Number, zpass: js.Number): Unit = ??? + + def texImage2D(target: js.Number, level: js.Number, internalformat: js.Number, width: js.Number, height: js.Number, border: js.Number, format: js.Number, `type`: js.Number, pixels: ArrayBufferView): Unit = ??? + def texImage2D(target: js.Number, level: js.Number, internalformat: js.Number, format: js.Number, `type`: js.Number, pixels: ImageData): Unit = ??? + def texImage2D(target: js.Number, level: js.Number, internalformat: js.Number, format: js.Number, `type`: js.Number, pixels: HTMLImageElement): Unit = ??? + def texImage2D(target: js.Number, level: js.Number, internalformat: js.Number, format: js.Number, `type`: js.Number, pixels: HTMLCanvasElement): Unit = ??? + def texImage2D(target: js.Number, level: js.Number, internalformat: js.Number, format: js.Number, `type`: js.Number, pixels: HTMLVideoElement): Unit = ??? + + def texParameterf(target: js.Number, pname: js.Number, param: js.Number): Unit = ??? + def texParameteri(target: js.Number, pname: js.Number, param: js.Number): Unit = ??? + + def texSubImage2D(target: js.Number, level: js.Number, xoffset: js.Number, yoffset: js.Number, width: js.Number, height: js.Number, format: js.Number, `type`: js.Number, pixels: ArrayBufferView): Unit = ??? + def texSubImage2D(target: js.Number, level: js.Number, xoffset: js.Number, yoffset: js.Number, format: js.Number, `type`: js.Number, pixels: ImageData): Unit = ??? + def texSubImage2D(target: js.Number, level: js.Number, xoffset: js.Number, yoffset: js.Number, format: js.Number, `type`: js.Number, pixels: HTMLImageElement): Unit = ??? + def texSubImage2D(target: js.Number, level: js.Number, xoffset: js.Number, yoffset: js.Number, format: js.Number, `type`: js.Number, pixels: HTMLCanvasElement): Unit = ??? + def texSubImage2D(target: js.Number, level: js.Number, xoffset: js.Number, yoffset: js.Number, format: js.Number, `type`: js.Number, pixels: HTMLVideoElement): Unit = ??? + + def uniform1f(location: WebGLUniformLocation, x: js.Number): Unit = ??? + def uniform1fv(location: WebGLUniformLocation, v: Float32Array): Unit = ??? + def uniform1fv(location: WebGLUniformLocation, v: js.Array[js.Number]): Unit = ??? + def uniform1i(location: WebGLUniformLocation, x: js.Number): Unit = ??? + def uniform1iv(location: WebGLUniformLocation, v: Int32Array): Unit = ??? + def uniform1iv(location: WebGLUniformLocation, v: js.Array[js.Number]): Unit = ??? + + def uniform2f(location: WebGLUniformLocation, x: js.Number, y: js.Number): Unit = ??? + def uniform2fv(location: WebGLUniformLocation, v: Float32Array): Unit = ??? + def uniform2fv(location: WebGLUniformLocation, v: js.Array[js.Number]): Unit = ??? + def uniform2i(location: WebGLUniformLocation, x: js.Number, y: js.Number): Unit = ??? + def uniform2iv(location: WebGLUniformLocation, v: Int32Array): Unit = ??? + def uniform2iv(location: WebGLUniformLocation, v: js.Array[js.Number]): Unit = ??? + + def uniform3f(location: WebGLUniformLocation, x: js.Number, y: js.Number, z: js.Number): Unit = ??? + def uniform3fv(location: WebGLUniformLocation, v: Float32Array): Unit = ??? + def uniform3fv(location: WebGLUniformLocation, v: js.Array[js.Number]): Unit = ??? + def uniform3i(location: WebGLUniformLocation, x: js.Number, y: js.Number, z: js.Number): Unit = ??? + def uniform3iv(location: WebGLUniformLocation, v: Int32Array): Unit = ??? + def uniform3iv(location: WebGLUniformLocation, v: js.Array[js.Number]): Unit = ??? + + def uniform4f(location: WebGLUniformLocation, x: js.Number, y: js.Number, z: js.Number, w: js.Number): Unit = ??? + def uniform4fv(location: WebGLUniformLocation, v: Float32Array): Unit = ??? + def uniform4fv(location: WebGLUniformLocation, v: js.Array[js.Number]): Unit = ??? + def uniform4i(location: WebGLUniformLocation, x: js.Number, y: js.Number, z: js.Number, w: js.Number): Unit = ??? + def uniform4iv(location: WebGLUniformLocation, v: Int32Array): Unit = ??? + def uniform4iv(location: WebGLUniformLocation, v: js.Array[js.Number]): Unit = ??? + + def uniformMatrix2fv(location: WebGLUniformLocation, transpose: js.Boolean, value: Float32Array): Unit = ??? + def uniformMatrix2fv(location: WebGLUniformLocation, transpose: js.Boolean, value: js.Array[js.Number]): Unit = ??? + def uniformMatrix3fv(location: WebGLUniformLocation, transpose: js.Boolean, value: Float32Array): Unit = ??? + def uniformMatrix3fv(location: WebGLUniformLocation, transpose: js.Boolean, value: js.Array[js.Number]): Unit = ??? + def uniformMatrix4fv(location: WebGLUniformLocation, transpose: js.Boolean, value: Float32Array): Unit = ??? + def uniformMatrix4fv(location: WebGLUniformLocation, transpose: js.Boolean, value: js.Array[js.Number]): Unit = ??? + + def useProgram(program: WebGLProgram): Unit = ??? + def validateProgram(program: WebGLProgram): Unit = ??? + + def vertexAttrib1f(indx: js.Number, x: js.Number): Unit = ??? + def vertexAttrib1fv(indx: js.Number, values: Float32Array): Unit = ??? + def vertexAttrib1fv(indx: js.Number, values: js.Array[js.Number]): Unit = ??? + + def vertexAttrib2f(indx: js.Number, x: js.Number, y: js.Number): Unit = ??? + def vertexAttrib2fv(indx: js.Number, values: Float32Array): Unit = ??? + def vertexAttrib2fv(indx: js.Number, values: js.Array[js.Number]): Unit = ??? + + def vertexAttrib3f(indx: js.Number, x: js.Number, y: js.Number, z: js.Number): Unit = ??? + def vertexAttrib3fv(indx: js.Number, values: Float32Array): Unit = ??? + def vertexAttrib3fv(indx: js.Number, values: js.Array[js.Number]): Unit = ??? + + def vertexAttrib4f(indx: js.Number, x: js.Number, y: js.Number, z: js.Number, w: js.Number): Unit = ??? + def vertexAttrib4fv(indx: js.Number, values: Float32Array): Unit = ??? + def vertexAttrib4fv(indx: js.Number, values: js.Array[js.Number]): Unit = ??? + + def vertexAttribPointer(indx: js.Number, size: js.Number, `type`: js.Number, normalized: js.Boolean, stride: js.Number, offset: js.Number): Unit = ??? + + def viewport(x: js.Number, y: js.Number, width: js.Number, height: js.Number): Unit = ??? +} From 48f7675d7735c2fddb013743d1977305d2610b1f Mon Sep 17 00:00:00 2001 From: Matt Seddon Date: Mon, 24 Mar 2014 00:38:53 +0000 Subject: [PATCH 2/2] Nearly all documentation, minor bugfixes. --- .../scala/org/scalajs/dom/TypedArrays.scala | 555 ++++- src/main/scala/org/scalajs/dom/WebGL.scala | 2203 ++++++++++++++--- 2 files changed, 2401 insertions(+), 357 deletions(-) diff --git a/src/main/scala/org/scalajs/dom/TypedArrays.scala b/src/main/scala/org/scalajs/dom/TypedArrays.scala index 8a13af3fe..4b6be56f4 100644 --- a/src/main/scala/org/scalajs/dom/TypedArrays.scala +++ b/src/main/scala/org/scalajs/dom/TypedArrays.scala @@ -1,5 +1,5 @@ -/** - * Copyright (C) 2014 Matt Seddon. This source is donated in full to the EPFL scala-js-dom project. +/* + * Copyright (C) 2014 Matt Seddon. This source is donated in full to the scala-js-dom project. * * Based on https://www.khronos.org/registry/typedarray/specs/1.0/ */ @@ -8,9 +8,28 @@ package org.scalajs.dom import scala.scalajs.js import scala.scalajs.js.annotation._ +/** + * An ArrayBuffer is an underlying buffer of bytes, which views such as [[Int8Array]] use for underlying storage. + */ class ArrayBuffer extends js.Object { + /** + * The length, in bytes, of this ArrayBuffer. + */ def byteLength: js.Number = ??? + + /** + * Returns an ArrayBufferView of this ArrayBuffer, limited to the specified range. + * + * @param begin The start index, in bytes, into this ArrayBuffer. + * @param end The end index, in bytes, into this ArrayBuffer. + */ def slice(begin: js.Number, end: js.Number): ArrayBufferView = ??? + + /** + * Returns an ArrayBufferView of this ArrayBuffer, starting at `start`. + * + * @param begin The start index, in bytes, into this ArrayBuffer. + */ def slice(begin: js.Number): ArrayBufferView = ??? } @@ -19,226 +38,684 @@ object ArrayBuffer { } trait ArrayBufferView extends js.Object { - def buffer: ArrayBuffer = ??? + /** + * The source buffer for this view. + */ + val buffer: ArrayBuffer = ??? + + /** + * The offset into the source array buffer this view starts at. + */ def byteOffset: js.Number = ??? + + /** + * The length, in bytes of this view. + */ def byteLength: js.Number = ??? } /** * Defines common functionality across all typed arrays. - * NOTE: This is just a utility and should probably be - * re-jigged so as not to pollute the org.scalajs.dom package somehow. */ -trait TypedArrayCommon[T] extends js.Object { +trait TypedArray[T] extends js.Object { @JSBracketAccess def apply(index: js.Number): js.Number = ??? @JSBracketAccess def update(index: js.Number, value: js.Number): Unit = ??? + /** + * Copies the contents of `array` into this array, starting at `offset`. + */ def set(array: T, offset: js.Number): Unit = ??? + + /** + * Copies the contents of `array` into this array, starting at 0. + */ def set(array: T): Unit = ??? + + /** + * Copies the contents of `array` into this array, starting at `offset`. + */ def set(array: js.Array[js.Number], offset: js.Number): Unit = ??? + + /** + * Copies the contents of `array` into this array, starting at 0. + */ def set(array: js.Array[js.Number]): Unit = ??? - def subarray(start: js.Number, end: js.Number): T = ??? + /** + * Returns a new view of this typed array. from `begin` to `end` inclusive. + */ + def subarray(begin: js.Number, end: js.Number): T = ??? + + /** + * Returns a new view of this typed array. from `begin` to the end. + */ + def subarray(begin: js.Number): T = ??? } +/** + * An array of signed bytes. + */ class Int8Array private () extends js.Object with ArrayBufferView - with TypedArrayCommon[Int8Array] { + with TypedArray[Int8Array] { + + /** + * Construct a new array of the given length, with contents initialized to 0. The underlying ArrayBuffer is newly created. + */ def this(length: js.Number) = this() + + /** + * Construct a new array with a copy of the provided array. The underlying ArrayBuffer is newly created. + */ def this(array: Int8Array) = this() - def this(array: js.Array[js.Number]) = this() + + /** + * Construct a new array with a copy of the provided array. The underlying ArrayBuffer is newly created. + */ + def this(array: js.Array[js.Number]) = this() + + /** + * Construct a new array with `buffer` as storage. + */ def this(buffer: ArrayBuffer) = this() + + /** + * Construct a new array with `buffer` as storage, using a view from the specified `byteOffset`. + */ def this(buffer: ArrayBuffer, byteOffset: js.Number) = this() + + /** + * Construct a new array with `buffer` as storage, using a view from the specified `byteOffset` with the given `length`. + */ def this(buffer: ArrayBuffer, byteOffset: js.Number, length: js.Number) = this() } object Int8Array extends js.Object { - val BYTES_PER_ELEMENT: js.Number = 1 + /** + * The number of bytes per element in an array of this type (1). + */ + val BYTES_PER_ELEMENT: js.Number = ??? } +/** + * An array of unsigned bytes. + */ class Uint8Array private () extends js.Object with ArrayBufferView - with TypedArrayCommon[Uint8Array] { + with TypedArray[Uint8Array] { + /** + * Construct a new array of the given length, with contents initialized to 0. The underlying ArrayBuffer is newly created. + */ def this(length: js.Number) = this() + + /** + * Construct a new array with a copy of the provided array. The underlying ArrayBuffer is newly created. + */ def this(array: Uint8Array) = this() + + /** + * Construct a new array with a copy of the provided array. The underlying ArrayBuffer is newly created. + */ def this(array: js.Array[js.Number]) = this() + + /** + * Construct a new array with `buffer` as storage. + */ def this(buffer: ArrayBuffer) = this() + + /** + * Construct a new array with `buffer` as storage, using a view from the specified `byteOffset`. + */ def this(buffer: ArrayBuffer, byteOffset: js.Number) = this() + + /** + * Construct a new array with `buffer` as storage, using a view from the specified `byteOffset` with the given `length`. + */ def this(buffer: ArrayBuffer, byteOffset: js.Number, length: js.Number) = this() } object Uint8Array extends js.Object { - val BYTES_PER_ELEMENT: js.Number = 1 + /** + * The number of bytes per element in an array of this type (1). + */ + val BYTES_PER_ELEMENT: js.Number = ??? } +/** + * An array of clamped unsigned bytes. + */ class Uint8ClampedArray private () extends js.Object with ArrayBufferView - with TypedArrayCommon[Uint8ClampedArray]{ + with TypedArray[Uint8ClampedArray]{ + /** + * Construct a new array of the given length, with contents initialized to 0. The underlying ArrayBuffer is newly created. + */ def this(length: js.Number) = this() + + /** + * Construct a new array with a copy of the provided array. The underlying ArrayBuffer is newly created. + */ def this(array: Uint8ClampedArray) = this() - def this(array: js.Array[js.Number]) = this() + + /** + * Construct a new array with a copy of the provided array. The underlying ArrayBuffer is newly created. + */ + def this(array: js.Array[js.Number]) = this() + + /** + * Construct a new array with `buffer` as storage. + */ def this(buffer: ArrayBuffer) = this() + + /** + * Construct a new array with `buffer` as storage, using a view from the specified `byteOffset`. + */ def this(buffer: ArrayBuffer, byteOffset: js.Number) = this() + + /** + * Construct a new array with `buffer` as storage, using a view from the specified `byteOffset` with the given `length`. + */ def this(buffer: ArrayBuffer, byteOffset: js.Number, length: js.Number) = this() } object Uint8ClampedArray extends js.Object { - val BYTES_PER_ELEMENT: js.Number = 1 + /** + * The number of bytes per element in an array of this type (1). + */ + val BYTES_PER_ELEMENT: js.Number = ??? } +/** + * An array of signed short integers. + */ class Int16Array private () extends js.Object with ArrayBufferView - with TypedArrayCommon[Int16Array] { + with TypedArray[Int16Array] { + /** + * Construct a new array of the given length, with contents initialized to 0. The underlying ArrayBuffer is newly created. + */ def this(length: js.Number) = this() + + /** + * Construct a new array with a copy of the provided array. The underlying ArrayBuffer is newly created. + */ def this(array: Int16Array) = this() - def this(array: js.Array[js.Number]) = this() + + /** + * Construct a new array with a copy of the provided array. The underlying ArrayBuffer is newly created. + */ + def this(array: js.Array[js.Number]) = this() + + /** + * Construct a new array with `buffer` as storage. + */ def this(buffer: ArrayBuffer) = this() + + /** + * Construct a new array with `buffer` as storage, using a view from the specified `byteOffset`. + */ def this(buffer: ArrayBuffer, byteOffset: js.Number) = this() + + /** + * Construct a new array with `buffer` as storage, using a view from the specified `byteOffset` with the given `length`. + */ def this(buffer: ArrayBuffer, byteOffset: js.Number, length: js.Number) = this() } object Int16Array extends js.Object { - val BYTES_PER_ELEMENT: js.Number = 2 + /** + * The number of bytes per element in an array of this type (2). + */ + val BYTES_PER_ELEMENT: js.Number = ??? } +/** + * An array of unsigned short integers. + */ class Uint16Array private () extends js.Object with ArrayBufferView - with TypedArrayCommon[Uint16Array] { + with TypedArray[Uint16Array] { + /** + * Construct a new array of the given length, with contents initialized to 0. The underlying ArrayBuffer is newly created. + */ def this(length: js.Number) = this() + + /** + * Construct a new array with a copy of the provided array. The underlying ArrayBuffer is newly created. + */ def this(array: Uint16Array) = this() + + /** + * Construct a new array with a copy of the provided array. The underlying ArrayBuffer is newly created. + */ def this(array: js.Array[js.Number]) = this() + + /** + * Construct a new array with `buffer` as storage. + */ def this(buffer: ArrayBuffer) = this() + + /** + * Construct a new array with `buffer` as storage, using a view from the specified `byteOffset`. + */ def this(buffer: ArrayBuffer, byteOffset: js.Number) = this() + + /** + * Construct a new array with `buffer` as storage, using a view from the specified `byteOffset` with the given `length`. + */ def this(buffer: ArrayBuffer, byteOffset: js.Number, length: js.Number) = this() } object Uint16Array extends js.Object { + /** + * The number of bytes per element in an array of this type (2). + */ val BYTES_PER_ELEMENT: js.Number = 2 } +/** + * An array of clamped unsigned short integers. + */ class Uint16ClampedArray private () extends js.Object with ArrayBufferView - with TypedArrayCommon[Uint16ClampedArray] { + with TypedArray[Uint16ClampedArray] { + /** + * Construct a new array of the given length, with contents initialized to 0. The underlying ArrayBuffer is newly created. + */ def this(length: js.Number) = this() + + /** + * Construct a new array with a copy of the provided array. The underlying ArrayBuffer is newly created. + */ def this(array: Uint16ClampedArray) = this() - def this(array: js.Array[js.Number]) = this() + + /** + * Construct a new array with a copy of the provided array. The underlying ArrayBuffer is newly created. + */ + def this(array: js.Array[js.Number]) = this() + + /** + * Construct a new array with `buffer` as storage. + */ def this(buffer: ArrayBuffer) = this() + + /** + * Construct a new array with `buffer` as storage, using a view from the specified `byteOffset`. + */ def this(buffer: ArrayBuffer, byteOffset: js.Number) = this() + + /** + * Construct a new array with `buffer` as storage, using a view from the specified `byteOffset` with the given `length`. + */ def this(buffer: ArrayBuffer, byteOffset: js.Number, length: js.Number) = this() } object Uint16ClampedArray extends js.Object { - val BYTES_PER_ELEMENT: js.Number = 2 + /** + * The number of bytes per element in an array of this type (2). + */ + val BYTES_PER_ELEMENT: js.Number = ??? } +/** + * An array of signed integers. + */ class Int32Array private () extends js.Object with ArrayBufferView - with TypedArrayCommon[Int32Array] { + with TypedArray[Int32Array] { + /** + * Construct a new array of the given length, with contents initialized to 0. The underlying ArrayBuffer is newly created. + */ def this(length: js.Number) = this() + + /** + * Construct a new array with a copy of the provided array. The underlying ArrayBuffer is newly created. + */ def this(array: Int32Array) = this() - def this(array: js.Array[js.Number]) = this() + + /** + * Construct a new array with a copy of the provided array. The underlying ArrayBuffer is newly created. + */ + def this(array: js.Array[js.Number]) = this() + + /** + * Construct a new array with `buffer` as storage. + */ def this(buffer: ArrayBuffer) = this() + + /** + * Construct a new array with `buffer` as storage, using a view from the specified `byteOffset`. + */ def this(buffer: ArrayBuffer, byteOffset: js.Number) = this() + + /** + * Construct a new array with `buffer` as storage, using a view from the specified `byteOffset` with the given `length`. + */ def this(buffer: ArrayBuffer, byteOffset: js.Number, length: js.Number) = this() } object Int32Array extends js.Object { - val BYTES_PER_ELEMENT: js.Number = 4 + /** The number of bytes per element in an array of this type (4). */ + val BYTES_PER_ELEMENT: js.Number = ??? } +/** + * An array of unsigned integers. + */ class Uint32Array private () extends js.Object with ArrayBufferView - with TypedArrayCommon[Uint32Array] { + with TypedArray[Uint32Array] { + /** + * Construct a new array of the given length, with contents initialized to 0. The underlying ArrayBuffer is newly created. + */ def this(length: js.Number) = this() + + /** + * Construct a new array with a copy of the provided array. The underlying ArrayBuffer is newly created. + */ def this(array: Uint32Array) = this() - def this(array: js.Array[js.Number]) = this() + + /** + * Construct a new array with a copy of the provided array. The underlying ArrayBuffer is newly created. + */ + def this(array: js.Array[js.Number]) = this() + + /** + * Construct a new array with `buffer` as storage. + */ def this(buffer: ArrayBuffer) = this() + + /** + * Construct a new array with `buffer` as storage, using a view from the specified `byteOffset`. + */ def this(buffer: ArrayBuffer, byteOffset: js.Number) = this() + + /** + * Construct a new array with `buffer` as storage, using a view from the specified `byteOffset` with the given `length`. + */ def this(buffer: ArrayBuffer, byteOffset: js.Number, length: js.Number) = this() } object Uint32Array extends js.Object { - val BYTES_PER_ELEMENT: js.Number = 4 + /** + * The number of bytes per element in an array of this type (4). + */ + val BYTES_PER_ELEMENT: js.Number = ??? } +/** + * An array of clamped unsigned integers. + */ class Uint32ClampedArray private () extends js.Object with ArrayBufferView - with TypedArrayCommon[Uint32ClampedArray] { + with TypedArray[Uint32ClampedArray] { + /** + * Construct a new array of the given length, with contents initialized to 0. The underlying ArrayBuffer is newly created. + */ def this(length: js.Number) = this() - def this(array: Uint32ClampedArray) = this() - def this(array: js.Array[js.Number]) = this() + + /** + * Construct a new array with a copy of the provided array. The underlying ArrayBuffer is newly created. + */ + def this(array: Uint32Array) = this() + + /** + * Construct a new array with a copy of the provided array. The underlying ArrayBuffer is newly created. + */ + def this(array: js.Array[js.Number]) = this() + + /** + * Construct a new array with `buffer` as storage. + */ def this(buffer: ArrayBuffer) = this() + + /** + * Construct a new array with `buffer` as storage, using a view from the specified `byteOffset`. + */ def this(buffer: ArrayBuffer, byteOffset: js.Number) = this() + + /** + * Construct a new array with `buffer` as storage, using a view from the specified `byteOffset` with the given `length`. + */ def this(buffer: ArrayBuffer, byteOffset: js.Number, length: js.Number) = this() } object Uint32ClampedArray extends js.Object { - val BYTES_PER_ELEMENT: js.Number = 4 + /** + * The number of bytes per element in an array of this type (4). + */ + val BYTES_PER_ELEMENT: js.Number = ??? } +/** + * An array of 32 bit IEEE-754 floating point numbers. + */ class Float32Array private () extends js.Object with ArrayBufferView - with TypedArrayCommon[Float32Array] { - + with TypedArray[Float32Array] { + /** + * Construct a new array of the given length, with contents initialized to 0. The underlying ArrayBuffer is newly created. + */ def this(length: js.Number) = this() + + /** + * Construct a new array with a copy of the provided array. The underlying ArrayBuffer is newly created. + */ def this(array: Float32Array) = this() - def this(array: js.Array[js.Number]) = this() + + /** + * Construct a new array with a copy of the provided array. The underlying ArrayBuffer is newly created. + */ + def this(array: js.Array[js.Number]) = this() + + /** + * Construct a new array with `buffer` as storage. + */ def this(buffer: ArrayBuffer) = this() + + /** + * Construct a new array with `buffer` as storage, using a view from the specified `byteOffset`. + */ def this(buffer: ArrayBuffer, byteOffset: js.Number) = this() + + /** + * Construct a new array with `buffer` as storage, using a view from the specified `byteOffset` with the given `length`. + */ def this(buffer: ArrayBuffer, byteOffset: js.Number, length: js.Number) = this() } object Float32Array extends js.Object { - val BYTES_PER_ELEMENT: js.Number = 4 + /** + * The number of bytes per element in an array of this type (4). + */ + val BYTES_PER_ELEMENT: js.Number = ??? } +/** + * An array of 64 bit IEEE-754 floating point numbers. + */ class Float64Array private () extends js.Object with ArrayBufferView - with TypedArrayCommon[Float64Array] { + with TypedArray[Float64Array] { + /** + * Construct a new array of the given length, with contents initialized to 0. The underlying ArrayBuffer is newly created. + */ def this(length: js.Number) = this() + + /** + * Construct a new array with a copy of the provided array. The underlying ArrayBuffer is newly created. + */ def this(array: Float64Array) = this() - def this(array: js.Array[js.Number]) = this() + + /** + * Construct a new array with a copy of the provided array. The underlying ArrayBuffer is newly created. + */ + def this(array: js.Array[js.Number]) = this() + + /** + * Construct a new array with `buffer` as storage. + */ def this(buffer: ArrayBuffer) = this() + + /** + * Construct a new array with `buffer` as storage, using a view from the specified `byteOffset`. + */ def this(buffer: ArrayBuffer, byteOffset: js.Number) = this() + + /** + * Construct a new array with `buffer` as storage, using a view from the specified `byteOffset` with the given `length`. + */ def this(buffer: ArrayBuffer, byteOffset: js.Number, length: js.Number) = this() } object Float64Array extends js.Object { - val BYTES_PER_ELEMENT: js.Number = 8 + /** The number of bytes per element in an array of this type (8). */ + val BYTES_PER_ELEMENT: js.Number = ??? } class DataView(buffer: ArrayBuffer, byteOffset: js.Number, byteLength: js.Number) extends js.Object with ArrayBufferView { + + /** + * Returns the signed 8-bit integer at `byteOffset`. + */ def getInt8(byteOffset: js.Number): js.Number = ??? + + /** + * Returns the unsigned 8-bit integer at `byteOffset`. + */ def getUint8(byteOffset: js.Number): js.Number = ??? + + /** + * Returns the signed 16-bit integer at byteOffset. + */ def getInt16(byteOffset: js.Number): js.Number = ??? + + /** + * Returns the signed 16-bit integer at `byteOffset`, if `littleEndian` uses little endian, otherwise uses big endian. + */ def getInt16(byteOffset: js.Number, littleEndian: js.Boolean): js.Number = ??? + + /** + * Returns the unsigned 16-bit integer at `byteOffset`. + */ def getUint16(byteOffset: js.Number): js.Number = ??? + + /** + * Returns the unsigned 16-bit integer at `byteOffset`, if `littleEndian` uses little endian, otherwise uses big endian. + */ def getUint16(byteOffset: js.Number, littleEndian: js.Boolean): js.Number = ??? + + /** + * Returns the signed 32-bit integer at `byteOffset`. + */ def getInt32(byteOffset: js.Number): js.Number = ??? + + /** + * Returns the signed 32-bit integer at `byteOffset`, if `littleEndian` uses little endian, otherwise uses big endian. + */ def getInt32(byteOffset: js.Number, littleEndian: js.Boolean): js.Number = ??? + + /** + * Returns the unsigned 32-bit integer at `byteOffset`. + */ def getUint32(byteOffset: js.Number): js.Number = ??? + + /** + * Returns the unsigned 32-bit integer at `byteOffset`, if `littleEndian` uses little endian, otherwise uses big endian. + */ def getUint32(byteOffset: js.Number, littleEndian: js.Boolean): js.Number = ??? + + /** + * Returns the 32-bit IEEE-754 float at `byteOffset`. + */ def getFloat32(byteOffset: js.Number): js.Number = ??? + + /** + * Returns the 32-bit IEEE-754 float at `byteOffset`, if `littleEndian` uses little endian, otherwise uses big endian. + */ def getFloat32(byteOffset: js.Number, littleEndian: js.Boolean): js.Number = ??? + + /** + * Returns the 64-bit IEEE-754 float at `byteOffset`. + */ def getFloat64(byteOffset: js.Number): js.Number = ??? + + /** + * Returns the 64-bit IEEE-754 float at `byteOffset`, if `littleEndian` uses little endian, otherwise uses big endian. + */ def getFloat64(byteOffset: js.Number, littleEndian: js.Boolean): js.Number = ??? + /** + * Sets the signed byte at `byteOffset` to `value`. + */ def setInt8(byteOffset: js.Number, value: js.Number): js.Number = ??? + + /** + * Sets the unsigned byte at `byteOffset` to `value`. + */ def setUint8(byteOffset: js.Number, value: js.Number): js.Number = ??? + + /** + * Sets the signed short at `byteOffset` to `value`. + */ def setInt16(byteOffset: js.Number, value: js.Number): js.Number = ??? + + /** + * Sets the signed short at `byteOffset` to `value`. If `littleEndian` is `true`, uses little-endian, otherwise uses big-endian. + */ def setInt16(byteOffset: js.Number, value: js.Number, littleEndian: js.Boolean): js.Number = ??? + + /** + * Sets the unsigned short at `byteOffset` to `value`. + */ def setUint16(byteOffset: js.Number, value: js.Number): js.Number = ??? + + /** + * Sets the unsigned short at `byteOffset` to `value`. If `littleEndian` is `true`, uses little-endian, otherwise uses big-endian. + */ def setUint16(byteOffset: js.Number, value: js.Number, littleEndian: js.Boolean): js.Number = ??? + + /** + * Sets the signed integer at `byteOffset` to `value`. + */ def setInt32(byteOffset: js.Number, value: js.Number): js.Number = ??? + + /** + * Sets the signed integer at `byteOffset` to `value`. If `littleEndian` is `true`, uses little-endian, otherwise uses big-endian. + */ def setInt32(byteOffset: js.Number, value: js.Number, littleEndian: js.Boolean): js.Number = ??? + + /** + * Sets the unsigned integer at `byteOffset` to `value`. + */ def setUint32(byteOffset: js.Number, value: js.Number): js.Number = ??? + + /** + * Sets the unsigned integer at `byteOffset` to `value`. If `littleEndian` is `true`, uses little-endian, otherwise uses big-endian. + */ def setUint32(byteOffset: js.Number, value: js.Number, littleEndian: js.Boolean): js.Number = ??? + + /** + * Sets the 32-bit IEEE 754 float at `byteOffset` to `value`. + */ def setFloat32(byteOffset: js.Number, value: js.Number): js.Number = ??? + + /** + * Sets the 32-bit IEEE 754 float at `byteOffset` to `value`. If `littleEndian` is `true`, uses little-endian, otherwise uses big-endian. + */ def setFloat32(byteOffset: js.Number, value: js.Number, littleEndian: js.Boolean): js.Number = ??? + + /** + * Sets the 64-bit IEEE 754 float at `byteOffset` to `value`. + */ def setFloat64(byteOffset: js.Number, value: js.Number): js.Number = ??? + + /** + * Sets the 64-bit IEEE 754 float at `byteOffset` to `value`. If `littleEndian` is `true`, uses little-endian, otherwise uses big-endian. + */ def setFloat64(byteOffset: js.Number, value: js.Number, littleEndian: js.Boolean): js.Number = ??? } diff --git a/src/main/scala/org/scalajs/dom/WebGL.scala b/src/main/scala/org/scalajs/dom/WebGL.scala index cbc22f594..0ed0b0564 100644 --- a/src/main/scala/org/scalajs/dom/WebGL.scala +++ b/src/main/scala/org/scalajs/dom/WebGL.scala @@ -1,5 +1,5 @@ -/** - * Copyright (C) 2014 Matt Seddon. This source is donated in full to the EPFL scala-js-dom project. +/* + * Copyright (C) 2014 Matt Seddon. This source is donated in full to the scala-js-dom project. * * Based on https://www.khronos.org/registry/webgl/specs/1.0/ */ @@ -9,55 +9,193 @@ package org.scalajs.dom import scala.scalajs.js import js.annotation._ +/** + * Contains drawing surface attributes. + */ class WebGLContextAttributes extends js.Object { + /** + * When `true`, the drawing buffer has an alpha channel. + */ var alpha: js.Boolean = ??? + /** + * When `true`, the drawing buffer has a depth buffer of at least 16 bits. + */ var depth: js.Boolean = ??? + /** + * When `true`, the drawing buffer has a stencil buffer of at least 8 bits. + */ var stencil: js.Boolean = ??? + /** + * When `true` and antialiasing is supported, the drawing buffer will use an antialiasing method if it's choice. + */ var antialias: js.Boolean = ??? + /** + * When `true` the page compositor assumes the buffer's contents is premultiplied. Used for sensible transparency when using + * WebGL canvases for overlays. + */ var premultipliedAlpha: js.Boolean = ??? + /** + * When `true`, the drawing buffer is preserved after rendering, otherwise it is cleared. On some implementations preserving the drawing buffer + * can dramatically impact performance. + */ var preserveDrawingBuffer: js.Boolean = ??? } +/** + * An opaque type representing a WebGL buffer. + */ class WebGLBuffer private () extends js.Object +/** + * An opaque type representing a WebGL framebuffer. + */ class WebGLFramebuffer private () extends js.Object +/** + * An opaque type representing a WebGL program. + */ class WebGLProgram private () extends js.Object +/** + * An opaque type representing a WebGL renderbuffer. + */ class WebGLRenderbuffer private () extends js.Object +/** + * An opaque type representing a WebGL shader. + */ class WebGLShader private () extends js.Object +/** + * An opaque type representing a WebGL texture. + */ class WebGLTexture private () extends js.Object +/** + * An opaque type representing a WebGL uniform location. + */ class WebGLUniformLocation private () extends js.Object +/** + * Holds information returned by [[WebGLRenderingContext#getActiveAttrib]] and [[WebGLRenderingContext#getActiveUniform]]. + */ class WebGLActiveInfo private () extends js.Object { - def size: js.Number = ??? - def `type`: js.Number = ??? - def name: js.String = ??? + /** + * The size of the requested variable. + */ + val size: js.Number = ??? + /** + * The type of the requested variable. + */ + val `type`: js.Number = ??? + /** + * The name of the requested variable. + */ + val name: js.String = ??? } +/** + * Represents information about the implementation's precision for given parameters. See [[WebGLRenderingContext#getShaderPrecisionFormat]]. + */ class WebGLShaderPrecisionFormat private () extends js.Object { - def rangeMin: js.Number = ??? - def rangeMax: js.Number = ??? - def precision: js.Number = ??? + /** + * The base 2 log of the absolute value of the minimum value that can be represented. + */ + val rangeMin: js.Number = ??? + + /** + * The base 2 log of the absolute value of the maximum value that can be represented. + */ + val rangeMax: js.Number = ??? + + /** + * The number of bits of precision that can be represented. For integer formats this value is always 0. + */ + val precision: js.Number = ??? } +/** + * WebGLRenderingContext objects expose the WebGLRenderingContext interface, the principal interface in WebGL + * which provides special properties and methods to manipulate the 3D content rendered in an HTML canvas element. + * + * MDN + */ object WebGLRenderingContext extends js.Object { - /* ClearBufferMask */ - val DEPTH_BUFFER_BIT = 0x00000100 - val STENCIL_BUFFER_BIT = 0x00000400 - val COLOR_BUFFER_BIT = 0x00004000 + /** + * Specifies the depth buffer should be cleared. + * @see [[WebGLRenderingContext#clear]] + */ + val DEPTH_BUFFER_BIT: js.Number = ??? + + /** + * Specifies the stencil buffer should be cleared. + * @see [[WebGLRenderingContext#clear]] + */ + val STENCIL_BUFFER_BIT: js.Number = ??? + + /** + * Specifies the color buffer should be cleared. + * @see [[WebGLRenderingContext#clear]] + */ + val COLOR_BUFFER_BIT: js.Number = ??? /* BeginMode */ - val POINTS = 0x0000 - val LINES = 0x0001 - val LINE_LOOP = 0x0002 - val LINE_STRIP = 0x0003 - val TRIANGLES = 0x0004 - val TRIANGLE_STRIP = 0x0005 - val TRIANGLE_FAN = 0x0006 + /** + * Specifies the elements should be drawn as points. + * + * @see [[WebGLRenderingContext#drawArrays]] + * @see [[WebGLRenderingContext#drawElements]] + */ + val POINTS: js.Number = ??? + + /** + * Specifies the elements should be drawn as lines. + * + * @see [[WebGLRenderingContext#drawArrays]] + * @see [[WebGLRenderingContext#drawElements]] + */ + val LINES: js.Number = ??? + + /** + * Specifies the elements should be drawn as a line loop. + * + * @see [[WebGLRenderingContext#drawArrays]] + * @see [[WebGLRenderingContext#drawElements]] + */ + val LINE_LOOP: js.Number = ??? + + /** + * Specifies the elements should be drawn as a line strip. + * + * @see [[WebGLRenderingContext#drawArrays]] + * @see [[WebGLRenderingContext#drawElements]] + */ + val LINE_STRIP: js.Number = ??? + + /** + * Specifies the elements should be drawn as triangles. + * + * @see [[WebGLRenderingContext#drawArrays]] + * @see [[WebGLRenderingContext#drawElements]] + */ + val TRIANGLES: js.Number = ??? + + /** + * Specifies the elements should be drawn as a triangle strip. + * + * @see [[WebGLRenderingContext#drawArrays]] + * @see [[WebGLRenderingContext#drawElements]] + */ + val TRIANGLE_STRIP: js.Number = ??? + + + /** + * Specifies the elements should be drawn as a triangle fan. + * + * @see [[WebGLRenderingContext#drawArrays]] + * @see [[WebGLRenderingContext#drawElements]] + */ + val TRIANGLE_FAN: js.Number = ??? /* AlphaFunction (not supported in ES20) */ /* NEVER */ @@ -72,64 +210,75 @@ object WebGLRenderingContext extends js.Object { /* BlendingFactorDest */ val ZERO = 0 val ONE = 1 - val SRC_COLOR = 0x0300 - val ONE_MINUS_SRC_COLOR = 0x0301 - val SRC_ALPHA = 0x0302 - val ONE_MINUS_SRC_ALPHA = 0x0303 - val DST_ALPHA = 0x0304 - val ONE_MINUS_DST_ALPHA = 0x0305 + val SRC_COLOR: js.Number = ??? + val ONE_MINUS_SRC_COLOR: js.Number = ??? + val SRC_ALPHA: js.Number = ??? + val ONE_MINUS_SRC_ALPHA: js.Number = ??? + val DST_ALPHA: js.Number = ??? + val ONE_MINUS_DST_ALPHA: js.Number = ??? /* BlendingFactorSrc */ /* ZERO */ /* ONE */ - val DST_COLOR = 0x0306 - val ONE_MINUS_DST_COLOR = 0x0307 - val SRC_ALPHA_SATURATE = 0x0308 + val DST_COLOR: js.Number = ??? + val ONE_MINUS_DST_COLOR: js.Number = ??? + val SRC_ALPHA_SATURATE: js.Number = ??? /* SRC_ALPHA */ /* ONE_MINUS_SRC_ALPHA */ /* DST_ALPHA */ /* ONE_MINUS_DST_ALPHA */ /* BlendEquationSeparate */ - val FUNC_ADD = 0x8006 - val BLEND_EQUATION = 0x8009 - val BLEND_EQUATION_RGB = 0x8009 /* same as BLEND_EQUATION */ - val BLEND_EQUATION_ALPHA = 0x883D + val FUNC_ADD: js.Number = ??? + val BLEND_EQUATION: js.Number = ??? + val BLEND_EQUATION_RGB: js.Number = ??? /* same as BLEND_EQUATION */ + val BLEND_EQUATION_ALPHA: js.Number = ??? /* BlendSubtract */ - val FUNC_SUBTRACT = 0x800A - val FUNC_REVERSE_SUBTRACT = 0x800B + val FUNC_SUBTRACT: js.Number = ??? + val FUNC_REVERSE_SUBTRACT: js.Number = ??? /* Separate Blend Functions */ - val BLEND_DST_RGB = 0x80C8 - val BLEND_SRC_RGB = 0x80C9 - val BLEND_DST_ALPHA = 0x80CA - val BLEND_SRC_ALPHA = 0x80CB - val CONSTANT_COLOR = 0x8001 - val ONE_MINUS_CONSTANT_COLOR = 0x8002 - val CONSTANT_ALPHA = 0x8003 - val ONE_MINUS_CONSTANT_ALPHA = 0x8004 - val BLEND_COLOR = 0x8005 + val BLEND_DST_RGB: js.Number = ??? + val BLEND_SRC_RGB: js.Number = ??? + val BLEND_DST_ALPHA: js.Number = ??? + val BLEND_SRC_ALPHA: js.Number = ??? + val CONSTANT_COLOR: js.Number = ??? + val ONE_MINUS_CONSTANT_COLOR: js.Number = ??? + val CONSTANT_ALPHA: js.Number = ??? + val ONE_MINUS_CONSTANT_ALPHA: js.Number = ??? + val BLEND_COLOR: js.Number = ??? /* Buffer Objects */ - val ARRAY_BUFFER = 0x8892 - val ELEMENT_ARRAY_BUFFER = 0x8893 - val ARRAY_BUFFER_BINDING = 0x8894 - val ELEMENT_ARRAY_BUFFER_BINDING = 0x8895 + val ARRAY_BUFFER: js.Number = ??? + val ELEMENT_ARRAY_BUFFER: js.Number = ??? + val ARRAY_BUFFER_BINDING: js.Number = ??? + val ELEMENT_ARRAY_BUFFER_BINDING: js.Number = ??? - val STREAM_DRAW = 0x88E0 - val STATIC_DRAW = 0x88E4 - val DYNAMIC_DRAW = 0x88E8 + val STREAM_DRAW: js.Number = ??? + val STATIC_DRAW: js.Number = ??? + val DYNAMIC_DRAW: js.Number = ??? - val BUFFER_SIZE = 0x8764 - val BUFFER_USAGE = 0x8765 + val BUFFER_SIZE: js.Number = ??? + val BUFFER_USAGE: js.Number = ??? - val CURRENT_VERTEX_ATTRIB = 0x8626 + val CURRENT_VERTEX_ATTRIB: js.Number = ??? /* CullFaceMode */ - val FRONT = 0x0404 - val BACK = 0x0405 - val FRONT_AND_BACK = 0x0408 + /** + * Specifies front faces. + */ + val FRONT: js.Number = ??? + + /** + * Specifies back faces. + */ + val BACK: js.Number = ??? + + /** + * Specifies both front and back faces. + */ + val FRONT_AND_BACK: js.Number = ??? /* DepthFunction */ /* NEVER */ @@ -143,76 +292,127 @@ object WebGLRenderingContext extends js.Object { /* EnableCap */ /* TEXTURE_2D */ - val CULL_FACE = 0x0B44 - val BLEND = 0x0BE2 - val DITHER = 0x0BD0 - val STENCIL_TEST = 0x0B90 - val DEPTH_TEST = 0x0B71 - val SCISSOR_TEST = 0x0C11 - val POLYGON_OFFSET_FILL = 0x8037 - val SAMPLE_ALPHA_TO_COVERAGE = 0x809E - val SAMPLE_COVERAGE = 0x80A0 + /** + * Capability to enable/disable backface culling. + */ + val CULL_FACE: js.Number = ??? + /** + * Capability to enable/disable blending. + */ + val BLEND: js.Number = ??? + + /** + * Capability to enable/disable dithering. + */ + val DITHER: js.Number = ??? + + /** + * Capability to enable/disable the stencil test. + */ + val STENCIL_TEST: js.Number = ??? + + /** + * Capability to enable/disable the depth test. + */ + val DEPTH_TEST: js.Number = ??? + + /** + * Capability to enable/disable the scissor test. + */ + val SCISSOR_TEST: js.Number = ??? + + /** + * Capability to enable/disable polygon offset. + */ + val POLYGON_OFFSET_FILL: js.Number = ??? + val SAMPLE_ALPHA_TO_COVERAGE: js.Number = ??? + val SAMPLE_COVERAGE: js.Number = ??? /* ErrorCode */ + /** + * No error has occurred. + */ val NO_ERROR = 0 - val INVALID_ENUM = 0x0500 - val INVALID_VALUE = 0x0501 - val INVALID_OPERATION = 0x0502 - val OUT_OF_MEMORY = 0x0505 + + /** + * An invalid enumerated name has been passed to an API function. + */ + val INVALID_ENUM: js.Number = ??? + + /** + * An invalid value has been passed to an API function. + */ + val INVALID_VALUE: js.Number = ??? + + /** + * The requested operation is not valid. + */ + val INVALID_OPERATION: js.Number = ??? + + /** + * The operation requested could not be completed because it ran out of memory. + */ + val OUT_OF_MEMORY: js.Number = ??? /* FrontFaceDirection */ - val CW = 0x0900 - val CCW = 0x0901 + /** + * Clockwise wound triangles are front-facing. + */ + val CW: js.Number = ??? + /** + * Counter-Clockwise wound triangles are front-facing. + */ + val CCW: js.Number = ??? /* GetPName */ - val LINE_WIDTH = 0x0B21 - val ALIASED_POINT_SIZE_RANGE = 0x846D - val ALIASED_LINE_WIDTH_RANGE = 0x846E - val CULL_FACE_MODE = 0x0B45 - val FRONT_FACE = 0x0B46 - val DEPTH_RANGE = 0x0B70 - val DEPTH_WRITEMASK = 0x0B72 - val DEPTH_CLEAR_VALUE = 0x0B73 - val DEPTH_FUNC = 0x0B74 - val STENCIL_CLEAR_VALUE = 0x0B91 - val STENCIL_FUNC = 0x0B92 - val STENCIL_FAIL = 0x0B94 - val STENCIL_PASS_DEPTH_FAIL = 0x0B95 - val STENCIL_PASS_DEPTH_PASS = 0x0B96 - val STENCIL_REF = 0x0B97 - val STENCIL_VALUE_MASK = 0x0B93 - val STENCIL_WRITEMASK = 0x0B98 - val STENCIL_BACK_FUNC = 0x8800 - val STENCIL_BACK_FAIL = 0x8801 - val STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802 - val STENCIL_BACK_PASS_DEPTH_PASS = 0x8803 - val STENCIL_BACK_REF = 0x8CA3 - val STENCIL_BACK_VALUE_MASK = 0x8CA4 - val STENCIL_BACK_WRITEMASK = 0x8CA5 - val VIEWPORT = 0x0BA2 - val SCISSOR_BOX = 0x0C10 + val LINE_WIDTH: js.Number = ??? + val ALIASED_POINT_SIZE_RANGE: js.Number = ??? + val ALIASED_LINE_WIDTH_RANGE: js.Number = ??? + val CULL_FACE_MODE: js.Number = ??? + val FRONT_FACE: js.Number = ??? + val DEPTH_RANGE: js.Number = ??? + val DEPTH_WRITEMASK: js.Number = ??? + val DEPTH_CLEAR_VALUE: js.Number = ??? + val DEPTH_FUNC: js.Number = ??? + val STENCIL_CLEAR_VALUE: js.Number = ??? + val STENCIL_FUNC: js.Number = ??? + val STENCIL_FAIL: js.Number = ??? + val STENCIL_PASS_DEPTH_FAIL: js.Number = ??? + val STENCIL_PASS_DEPTH_PASS: js.Number = ??? + val STENCIL_REF: js.Number = ??? + val STENCIL_VALUE_MASK: js.Number = ??? + val STENCIL_WRITEMASK: js.Number = ??? + val STENCIL_BACK_FUNC: js.Number = ??? + val STENCIL_BACK_FAIL: js.Number = ??? + val STENCIL_BACK_PASS_DEPTH_FAIL: js.Number = ??? + val STENCIL_BACK_PASS_DEPTH_PASS: js.Number = ??? + val STENCIL_BACK_REF: js.Number = ??? + val STENCIL_BACK_VALUE_MASK: js.Number = ??? + val STENCIL_BACK_WRITEMASK: js.Number = ??? + val VIEWPORT: js.Number = ??? + val SCISSOR_BOX: js.Number = ??? /* SCISSOR_TEST */ - val COLOR_CLEAR_VALUE = 0x0C22 - val COLOR_WRITEMASK = 0x0C23 - val UNPACK_ALIGNMENT = 0x0CF5 - val PACK_ALIGNMENT = 0x0D05 - val MAX_TEXTURE_SIZE = 0x0D33 - val MAX_VIEWPORT_DIMS = 0x0D3A - val SUBPIXEL_BITS = 0x0D50 - val RED_BITS = 0x0D52 - val GREEN_BITS = 0x0D53 - val BLUE_BITS = 0x0D54 - val ALPHA_BITS = 0x0D55 - val DEPTH_BITS = 0x0D56 - val STENCIL_BITS = 0x0D57 - val POLYGON_OFFSET_UNITS = 0x2A00 + val COLOR_CLEAR_VALUE: js.Number = ??? + val COLOR_WRITEMASK: js.Number = ??? + val UNPACK_ALIGNMENT: js.Number = ??? + val PACK_ALIGNMENT: js.Number = ??? + val MAX_TEXTURE_SIZE: js.Number = ??? + val MAX_VIEWPORT_DIMS: js.Number = ??? + val SUBPIXEL_BITS: js.Number = ??? + val RED_BITS: js.Number = ??? + val GREEN_BITS: js.Number = ??? + val BLUE_BITS: js.Number = ??? + val ALPHA_BITS: js.Number = ??? + val DEPTH_BITS: js.Number = ??? + val STENCIL_BITS: js.Number = ??? + val POLYGON_OFFSET_UNITS: js.Number = ??? /* POLYGON_OFFSET_FILL */ - val POLYGON_OFFSET_FACTOR = 0x8038 - val TEXTURE_BINDING_2D = 0x8069 - val SAMPLE_BUFFERS = 0x80A8 - val SAMPLES = 0x80A9 - val SAMPLE_COVERAGE_VALUE = 0x80AA - val SAMPLE_COVERAGE_INVERT = 0x80AB + val POLYGON_OFFSET_FACTOR: js.Number = ??? + val TEXTURE_BINDING_2D: js.Number = ??? + val SAMPLE_BUFFERS: js.Number = ??? + val SAMPLES: js.Number = ??? + val SAMPLE_COVERAGE_VALUE: js.Number = ??? + val SAMPLE_COVERAGE_INVERT: js.Number = ??? /* GetTextureParameter */ /* TEXTURE_MAG_FILTER */ @@ -220,450 +420,1817 @@ object WebGLRenderingContext extends js.Object { /* TEXTURE_WRAP_S */ /* TEXTURE_WRAP_T */ - val COMPRESSED_TEXTURE_FORMATS = 0x86A3 + val COMPRESSED_TEXTURE_FORMATS: js.Number = ??? /* HintMode */ - val DONT_CARE = 0x1100 - val FASTEST = 0x1101 - val NICEST = 0x1102 + val DONT_CARE: js.Number = ??? + val FASTEST: js.Number = ??? + val NICEST: js.Number = ??? /* HintTarget */ - val GENERATE_MIPMAP_HINT = 0x8192 + val GENERATE_MIPMAP_HINT: js.Number = ??? /* DataType */ - val BYTE = 0x1400 - val UNSIGNED_BYTE = 0x1401 - val SHORT = 0x1402 - val UNSIGNED_SHORT = 0x1403 - val INT = 0x1404 - val UNSIGNED_INT = 0x1405 - val FLOAT = 0x1406 + val BYTE: js.Number = ??? + val UNSIGNED_BYTE: js.Number = ??? + val SHORT: js.Number = ??? + val UNSIGNED_SHORT: js.Number = ??? + val INT: js.Number = ??? + val UNSIGNED_INT: js.Number = ??? + val FLOAT: js.Number = ??? /* PixelFormat */ - val DEPTH_COMPONENT = 0x1902 - val ALPHA = 0x1906 - val RGB = 0x1907 - val RGBA = 0x1908 - val LUMINANCE = 0x1909 - val LUMINANCE_ALPHA = 0x190A + val DEPTH_COMPONENT: js.Number = ??? + val ALPHA: js.Number = ??? + val RGB: js.Number = ??? + val RGBA: js.Number = ??? + val LUMINANCE: js.Number = ??? + val LUMINANCE_ALPHA: js.Number = ??? /* PixelType */ /* UNSIGNED_BYTE */ - val UNSIGNED_SHORT_4_4_4_4 = 0x8033 - val UNSIGNED_SHORT_5_5_5_1 = 0x8034 - val UNSIGNED_SHORT_5_6_5 = 0x8363 + val UNSIGNED_SHORT_4_4_4_4: js.Number = ??? + val UNSIGNED_SHORT_5_5_5_1: js.Number = ??? + val UNSIGNED_SHORT_5_6_5: js.Number = ??? /* Shaders */ - val FRAGMENT_SHADER = 0x8B30 - val VERTEX_SHADER = 0x8B31 - val MAX_VERTEX_ATTRIBS = 0x8869 - val MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB - val MAX_VARYING_VECTORS = 0x8DFC - val MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D - val MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C - val MAX_TEXTURE_IMAGE_UNITS = 0x8872 - val MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD - val SHADER_TYPE = 0x8B4F - val DELETE_STATUS = 0x8B80 - val LINK_STATUS = 0x8B82 - val VALIDATE_STATUS = 0x8B83 - val ATTACHED_SHADERS = 0x8B85 - val ACTIVE_UNIFORMS = 0x8B86 - val ACTIVE_ATTRIBUTES = 0x8B89 - val SHADING_LANGUAGE_VERSION = 0x8B8C - val CURRENT_PROGRAM = 0x8B8D + val FRAGMENT_SHADER: js.Number = ??? + val VERTEX_SHADER: js.Number = ??? + val MAX_VERTEX_ATTRIBS: js.Number = ??? + val MAX_VERTEX_UNIFORM_VECTORS: js.Number = ??? + val MAX_VARYING_VECTORS: js.Number = ??? + val MAX_COMBINED_TEXTURE_IMAGE_UNITS: js.Number = ??? + val MAX_VERTEX_TEXTURE_IMAGE_UNITS: js.Number = ??? + val MAX_TEXTURE_IMAGE_UNITS: js.Number = ??? + val MAX_FRAGMENT_UNIFORM_VECTORS: js.Number = ??? + val SHADER_TYPE: js.Number = ??? + val DELETE_STATUS: js.Number = ??? + val LINK_STATUS: js.Number = ??? + val VALIDATE_STATUS: js.Number = ??? + val ATTACHED_SHADERS: js.Number = ??? + val ACTIVE_UNIFORMS: js.Number = ??? + val ACTIVE_ATTRIBUTES: js.Number = ??? + val SHADING_LANGUAGE_VERSION: js.Number = ??? + val CURRENT_PROGRAM: js.Number = ??? /* StencilFunction */ - val NEVER = 0x0200 - val LESS = 0x0201 - val EQUAL = 0x0202 - val LEQUAL = 0x0203 - val GREATER = 0x0204 - val NOTEQUAL = 0x0205 - val GEQUAL = 0x0206 - val ALWAYS = 0x0207 + val NEVER: js.Number = ??? + val LESS: js.Number = ??? + val EQUAL: js.Number = ??? + val LEQUAL: js.Number = ??? + val GREATER: js.Number = ??? + val NOTEQUAL: js.Number = ??? + val GEQUAL: js.Number = ??? + val ALWAYS: js.Number = ??? /* StencilOp */ /* ZERO */ - val KEEP = 0x1E00 - val REPLACE = 0x1E01 - val INCR = 0x1E02 - val DECR = 0x1E03 - val INVERT = 0x150A - val INCR_WRAP = 0x8507 - val DECR_WRAP = 0x8508 + val KEEP: js.Number = ??? + val REPLACE: js.Number = ??? + val INCR: js.Number = ??? + val DECR: js.Number = ??? + val INVERT: js.Number = ??? + val INCR_WRAP: js.Number = ??? + val DECR_WRAP: js.Number = ??? /* StringName */ - val VENDOR = 0x1F00 - val RENDERER = 0x1F01 - val VERSION = 0x1F02 + val VENDOR: js.Number = ??? + val RENDERER: js.Number = ??? + val VERSION: js.Number = ??? /* TextureMagFilter */ - val NEAREST = 0x2600 - val LINEAR = 0x2601 + /** Specifies nearest neighbour interpolation. */ + val NEAREST: js.Number = ??? + /** Specifies linear interpolation. */ + val LINEAR: js.Number = ??? /* TextureMinFilter */ /* NEAREST */ /* LINEAR */ - val NEAREST_MIPMAP_NEAREST = 0x2700 - val LINEAR_MIPMAP_NEAREST = 0x2701 - val NEAREST_MIPMAP_LINEAR = 0x2702 - val LINEAR_MIPMAP_LINEAR = 0x2703 + /** + * Specifies nearest neighbour interpolation on the nearest mipmap level. + */ + val NEAREST_MIPMAP_NEAREST: js.Number = ??? + + /** + * Specifies linear interpolation on the nearest mipmap level. + */ + val LINEAR_MIPMAP_NEAREST: js.Number = ??? + + /** + * Specifies nearest neighbour interpolation, linearly blending between mipmap levels. + */ + val NEAREST_MIPMAP_LINEAR: js.Number = ??? + + /** + * Specifies linear interpolation linearly blending between mipmap levels. + */ + val LINEAR_MIPMAP_LINEAR: js.Number = ??? /* TextureParameterName */ - val TEXTURE_MAG_FILTER = 0x2800 - val TEXTURE_MIN_FILTER = 0x2801 - val TEXTURE_WRAP_S = 0x2802 - val TEXTURE_WRAP_T = 0x2803 + /** + * The texture magnification filter. + * + * Can be one of [[NEAREST]] or [[LINEAR]]. + */ + val TEXTURE_MAG_FILTER: js.Number = ??? + + /** + * The texture minification filter. + * + * Can be one of [[NEAREST]], [[LINEAR]], [[NEAREST_MIPMAP_NEAREST]], [[LINEAR_MIPMAP_NEAREST]], + * [[NEAREST_MIPMAP_LINEAR]], [[LINEAR_MIPMAP_LINEAR]]. + */ + + val TEXTURE_MIN_FILTER: js.Number = ??? + + /** + * The horizontal texture wrap mode. + * + * Can be one of [[REPEAT]], [[CLAMP_TO_EDGE]], [[MIRRORED_REPEAT]]. + */ + val TEXTURE_WRAP_S: js.Number = ??? + + /** + * The vertical texture wrap. + * + * Can be one of [[REPEAT]], [[CLAMP_TO_EDGE]], [[MIRRORED_REPEAT]]. + */ + val TEXTURE_WRAP_T: js.Number = ??? /* TextureTarget */ - val TEXTURE_2D = 0x0DE1 - val TEXTURE = 0x1702 - - val TEXTURE_CUBE_MAP = 0x8513 - val TEXTURE_BINDING_CUBE_MAP = 0x8514 - val TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515 - val TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516 - val TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517 - val TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518 - val TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519 - val TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A - val MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C + /** + * The target for a simple 2 dimensional texture. + */ + val TEXTURE_2D: js.Number = ??? + val TEXTURE: js.Number = ??? + + /** + * The target for a cube mapped texture. + */ + val TEXTURE_CUBE_MAP: js.Number = ??? + val TEXTURE_BINDING_CUBE_MAP: js.Number = ??? + val TEXTURE_CUBE_MAP_POSITIVE_X: js.Number = ??? + val TEXTURE_CUBE_MAP_NEGATIVE_X: js.Number = ??? + val TEXTURE_CUBE_MAP_POSITIVE_Y: js.Number = ??? + val TEXTURE_CUBE_MAP_NEGATIVE_Y: js.Number = ??? + val TEXTURE_CUBE_MAP_POSITIVE_Z: js.Number = ??? + val TEXTURE_CUBE_MAP_NEGATIVE_Z: js.Number = ??? + val MAX_CUBE_MAP_TEXTURE_SIZE: js.Number = ??? /* TextureUnit */ - val TEXTURE0 = 0x84C0 - val TEXTURE1 = 0x84C1 - val TEXTURE2 = 0x84C2 - val TEXTURE3 = 0x84C3 - val TEXTURE4 = 0x84C4 - val TEXTURE5 = 0x84C5 - val TEXTURE6 = 0x84C6 - val TEXTURE7 = 0x84C7 - val TEXTURE8 = 0x84C8 - val TEXTURE9 = 0x84C9 - val TEXTURE10 = 0x84CA - val TEXTURE11 = 0x84CB - val TEXTURE12 = 0x84CC - val TEXTURE13 = 0x84CD - val TEXTURE14 = 0x84CE - val TEXTURE15 = 0x84CF - val TEXTURE16 = 0x84D0 - val TEXTURE17 = 0x84D1 - val TEXTURE18 = 0x84D2 - val TEXTURE19 = 0x84D3 - val TEXTURE20 = 0x84D4 - val TEXTURE21 = 0x84D5 - val TEXTURE22 = 0x84D6 - val TEXTURE23 = 0x84D7 - val TEXTURE24 = 0x84D8 - val TEXTURE25 = 0x84D9 - val TEXTURE26 = 0x84DA - val TEXTURE27 = 0x84DB - val TEXTURE28 = 0x84DC - val TEXTURE29 = 0x84DD - val TEXTURE30 = 0x84DE - val TEXTURE31 = 0x84DF - val ACTIVE_TEXTURE = 0x84E0 + /** Identifies texture unit 0. This texture unit is guaranteed to exist. */ + val TEXTURE0: js.Number = ??? + + /** Identifies texture unit 1. This texture unit is guaranteed to exist. */ + val TEXTURE1: js.Number = ??? + + /** Identifies texture unit 2. This texture unit is guaranteed to exist. */ + val TEXTURE2: js.Number = ??? + + /** Identifies texture unit 3. This texture unit is guaranteed to exist. */ + val TEXTURE3: js.Number = ??? + + /** Identifies texture unit 4. This texture unit is guaranteed to exist. */ + val TEXTURE4: js.Number = ??? + + /** Identifies texture unit 5. This texture unit is guaranteed to exist. */ + val TEXTURE5: js.Number = ??? + + /** Identifies texture unit 6. This texture unit is guaranteed to exist. */ + val TEXTURE6: js.Number = ??? + + /** Identifies texture unit 7. This texture unit is guaranteed to exist. */ + val TEXTURE7: js.Number = ??? + + /** Identifies texture unit 8. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_UNITS before using it. */ + val TEXTURE8: js.Number = ??? + + /** Identifies texture unit 9. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_UNITS before using it. */ + val TEXTURE9: js.Number = ??? + + /** Identifies texture unit 10. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_UNITS before using it. */ + val TEXTURE10: js.Number = ??? + + /** Identifies texture unit 11. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_UNITS before using it. */ + val TEXTURE11: js.Number = ??? + + /** Identifies texture unit 12. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_UNITS before using it. */ + val TEXTURE12: js.Number = ??? + + /** Identifies texture unit 13. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_UNITS before using it. */ + val TEXTURE13: js.Number = ??? + + /** Identifies texture unit 14. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_UNITS before using it. */ + val TEXTURE14: js.Number = ??? + + /** Identifies texture unit 15. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_UNITS before using it. */ + val TEXTURE15: js.Number = ??? + + /** Identifies texture unit 16. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_UNITS before using it. */ + val TEXTURE16: js.Number = ??? + + /** Identifies texture unit 17. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_UNITS before using it. */ + val TEXTURE17: js.Number = ??? + + /** Identifies texture unit 18. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_UNITS before using it. */ + val TEXTURE18: js.Number = ??? + + /** Identifies texture unit 19. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_UNITS before using it. */ + val TEXTURE19: js.Number = ??? + + /** Identifies texture unit 20. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_UNITS before using it. */ + val TEXTURE20: js.Number = ??? + + /** Identifies texture unit 21. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_UNITS before using it. */ + val TEXTURE21: js.Number = ??? + + /** Identifies texture unit 22. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_UNITS before using it. */ + val TEXTURE22: js.Number = ??? + + /** Identifies texture unit 23. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_UNITS before using it. */ + val TEXTURE23: js.Number = ??? + + /** Identifies texture unit 24. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_UNITS before using it. */ + val TEXTURE24: js.Number = ??? + + /** Identifies texture unit 25. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_UNITS before using it. */ + val TEXTURE25: js.Number = ??? + + /** Identifies texture unit 26. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_UNITS before using it. */ + val TEXTURE26: js.Number = ??? + + /** Identifies texture unit 27. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_UNITS before using it. */ + val TEXTURE27: js.Number = ??? + + /** Identifies texture unit 28. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_UNITS before using it. */ + val TEXTURE28: js.Number = ??? + + /** Identifies texture unit 29. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_UNITS before using it. */ + val TEXTURE29: js.Number = ??? + + /** Identifies texture unit 30. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_UNITS before using it. */ + val TEXTURE30: js.Number = ??? + + /** Identifies texture unit 31. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_UNITS before using it. */ + val TEXTURE31: js.Number = ??? + + /** The currently active texture unit. */ + val ACTIVE_TEXTURE: js.Number = ??? /* TextureWrapMode */ - val REPEAT = 0x2901 - val CLAMP_TO_EDGE = 0x812F - val MIRRORED_REPEAT = 0x8370 + /** + * Repeat the texture along this axis. + */ + val REPEAT: js.Number = ??? + /** + * Clamp the texture along this axis. The colour of the edge pixels will be replicated to infinity. + */ + val CLAMP_TO_EDGE: js.Number = ??? + /** + * Repeat the texture along this axis, mirroring it each step. + */ + val MIRRORED_REPEAT: js.Number = ??? /* Uniform Types */ - val FLOAT_VEC2 = 0x8B50 - val FLOAT_VEC3 = 0x8B51 - val FLOAT_VEC4 = 0x8B52 - val INT_VEC2 = 0x8B53 - val INT_VEC3 = 0x8B54 - val INT_VEC4 = 0x8B55 - val BOOL = 0x8B56 - val BOOL_VEC2 = 0x8B57 - val BOOL_VEC3 = 0x8B58 - val BOOL_VEC4 = 0x8B59 - val FLOAT_MAT2 = 0x8B5A - val FLOAT_MAT3 = 0x8B5B - val FLOAT_MAT4 = 0x8B5C - val SAMPLER_2D = 0x8B5E - val SAMPLER_CUBE = 0x8B60 + val FLOAT_VEC2: js.Number = ??? + val FLOAT_VEC3: js.Number = ??? + val FLOAT_VEC4: js.Number = ??? + val INT_VEC2: js.Number = ??? + val INT_VEC3: js.Number = ??? + val INT_VEC4: js.Number = ??? + val BOOL: js.Number = ??? + val BOOL_VEC2: js.Number = ??? + val BOOL_VEC3: js.Number = ??? + val BOOL_VEC4: js.Number = ??? + val FLOAT_MAT2: js.Number = ??? + val FLOAT_MAT3: js.Number = ??? + val FLOAT_MAT4: js.Number = ??? + val SAMPLER_2D: js.Number = ??? + val SAMPLER_CUBE: js.Number = ??? /* Vertex Arrays */ - val VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622 - val VERTEX_ATTRIB_ARRAY_SIZE = 0x8623 - val VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624 - val VERTEX_ATTRIB_ARRAY_TYPE = 0x8625 - val VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A - val VERTEX_ATTRIB_ARRAY_POINTER = 0x8645 - val VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F + val VERTEX_ATTRIB_ARRAY_ENABLED: js.Number = ??? + val VERTEX_ATTRIB_ARRAY_SIZE: js.Number = ??? + val VERTEX_ATTRIB_ARRAY_STRIDE: js.Number = ??? + val VERTEX_ATTRIB_ARRAY_TYPE: js.Number = ??? + val VERTEX_ATTRIB_ARRAY_NORMALIZED: js.Number = ??? + val VERTEX_ATTRIB_ARRAY_POINTER: js.Number = ??? + val VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: js.Number = ??? /* Shader Source */ - val COMPILE_STATUS = 0x8B81 + val COMPILE_STATUS: js.Number = ??? /* Shader Precision-Specified Types */ - val LOW_FLOAT = 0x8DF0 - val MEDIUM_FLOAT = 0x8DF1 - val HIGH_FLOAT = 0x8DF2 - val LOW_INT = 0x8DF3 - val MEDIUM_INT = 0x8DF4 - val HIGH_INT = 0x8DF5 + /** + * Specifies a low precision float. + */ + val LOW_FLOAT: js.Number = ??? + /** + * Specifies a medium precision float. + */ + val MEDIUM_FLOAT: js.Number = ??? + /** + * Specifies a high precision float. + */ + val HIGH_FLOAT: js.Number = ??? + /** + * Specifies a low precision integer. + */ + val LOW_INT: js.Number = ??? + /** + * Specifies a medium precision float. + */ + val MEDIUM_INT: js.Number = ??? + /** + * Specifies a high precision float. + */ + val HIGH_INT: js.Number = ??? /* Framebuffer Object. */ - val FRAMEBUFFER = 0x8D40 - val RENDERBUFFER = 0x8D41 - - val RGBA4 = 0x8056 - val RGB5_A1 = 0x8057 - val RGB565 = 0x8D62 - val DEPTH_COMPONENT16 = 0x81A5 - val STENCIL_INDEX = 0x1901 - val STENCIL_INDEX8 = 0x8D48 - val DEPTH_STENCIL = 0x84F9 - - val RENDERBUFFER_WIDTH = 0x8D42 - val RENDERBUFFER_HEIGHT = 0x8D43 - val RENDERBUFFER_INTERNAL_FORMAT = 0x8D44 - val RENDERBUFFER_RED_SIZE = 0x8D50 - val RENDERBUFFER_GREEN_SIZE = 0x8D51 - val RENDERBUFFER_BLUE_SIZE = 0x8D52 - val RENDERBUFFER_ALPHA_SIZE = 0x8D53 - val RENDERBUFFER_DEPTH_SIZE = 0x8D54 - val RENDERBUFFER_STENCIL_SIZE = 0x8D55 - - val FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0 - val FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1 - val FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2 - val FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3 - - val COLOR_ATTACHMENT0 = 0x8CE0 - val DEPTH_ATTACHMENT = 0x8D00 - val STENCIL_ATTACHMENT = 0x8D20 - val DEPTH_STENCIL_ATTACHMENT = 0x821A + /** + * The framebuffer target. + */ + val FRAMEBUFFER: js.Number = ??? + + /** + * The renderbuffer target. + */ + val RENDERBUFFER: js.Number = ??? + + val RGBA4: js.Number = ??? + val RGB5_A1: js.Number = ??? + val RGB565: js.Number = ??? + val DEPTH_COMPONENT16: js.Number = ??? + val STENCIL_INDEX: js.Number = ??? + val STENCIL_INDEX8: js.Number = ??? + val DEPTH_STENCIL: js.Number = ??? + + val RENDERBUFFER_WIDTH: js.Number = ??? + val RENDERBUFFER_HEIGHT: js.Number = ??? + val RENDERBUFFER_INTERNAL_FORMAT: js.Number = ??? + val RENDERBUFFER_RED_SIZE: js.Number = ??? + val RENDERBUFFER_GREEN_SIZE: js.Number = ??? + val RENDERBUFFER_BLUE_SIZE: js.Number = ??? + val RENDERBUFFER_ALPHA_SIZE: js.Number = ??? + val RENDERBUFFER_DEPTH_SIZE: js.Number = ??? + val RENDERBUFFER_STENCIL_SIZE: js.Number = ??? + + val FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: js.Number = ??? + val FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: js.Number = ??? + val FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: js.Number = ??? + val FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: js.Number = ??? + + val COLOR_ATTACHMENT0: js.Number = ??? + val DEPTH_ATTACHMENT: js.Number = ??? + val STENCIL_ATTACHMENT: js.Number = ??? + val DEPTH_STENCIL_ATTACHMENT: js.Number = ??? val NONE = 0 - val FRAMEBUFFER_COMPLETE = 0x8CD5 - val FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6 - val FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7 - val FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9 - val FRAMEBUFFER_UNSUPPORTED = 0x8CDD + val FRAMEBUFFER_COMPLETE: js.Number = ??? + val FRAMEBUFFER_INCOMPLETE_ATTACHMENT: js.Number = ??? + val FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: js.Number = ??? + val FRAMEBUFFER_INCOMPLETE_DIMENSIONS: js.Number = ??? + val FRAMEBUFFER_UNSUPPORTED: js.Number = ??? - val FRAMEBUFFER_BINDING = 0x8CA6 - val RENDERBUFFER_BINDING = 0x8CA7 - val MAX_RENDERBUFFER_SIZE = 0x84E8 + val FRAMEBUFFER_BINDING: js.Number = ??? + val RENDERBUFFER_BINDING: js.Number = ??? + val MAX_RENDERBUFFER_SIZE: js.Number = ??? - val INVALID_FRAMEBUFFER_OPERATION = 0x0506 + val INVALID_FRAMEBUFFER_OPERATION: js.Number = ??? /* WebGL-specific enums */ - val UNPACK_FLIP_Y_WEBGL = 0x9240 - val UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241 - val CONTEXT_LOST_WEBGL = 0x9242 - val UNPACK_COLORSPACE_CONVERSION_WEBGL = 0x9243 - val BROWSER_DEFAULT_WEBGL = 0x9244 + val UNPACK_FLIP_Y_WEBGL: js.Number = ??? + val UNPACK_PREMULTIPLY_ALPHA_WEBGL: js.Number = ??? + val CONTEXT_LOST_WEBGL: js.Number = ??? + val UNPACK_COLORSPACE_CONVERSION_WEBGL: js.Number = ??? + val BROWSER_DEFAULT_WEBGL: js.Number = ??? } class WebGLRenderingContext extends js.Object { - /* ClearBufferMask */ + /** + * The canvas object this WebGLRenderingContext is associated with. + */ val canvas: HTMLCanvasElement = ??? + + /** + * The actual width of the drawing buffer. + * This may be different than the underlying HTMLCanvasElement width. + */ val drawingBufferWidth: js.Number = ??? + + /** + * The actual height of the drawing buffer. + * This may be different than the underlying HTMLCanvasElement height. + */ val drawingBufferHeight: js.Number = ??? + /** + * Returns `null` if [[isContextLost]] would return `false`, otherwise returns a copy of the context parameters. + */ def getContextAttributes(): WebGLContextAttributes = ??? + + /** + * Returns `true` if the context has been lost, `false` otherwise. + */ def isContextLost(): js.Boolean = ??? + + /** + * Returns an array of strings naming supported WebGL extensions. + */ def getSupportedExtensions(): js.Array[String] = ??? - def getExtension(): js.Any = ??? + /** + * Returns an object for the named extension, or `null` if no such extension exists. + * + * @param name the name of the extension + */ + def getExtension(name: js.String): js.Any = ??? + + /** + * Selects the active texture unit. + * + * @param texture an integer specifying the texture unit to make active. Must be in 0 .. MAX_COMBINED_TEXTURE_UNITS-1 + */ def activeTexture(texture: js.Number): Unit = ??? + + /** + * Attaches a shader (fragment or vertex) to a [[WebGLProgram]]. + */ def attachShader(program: WebGLProgram, shader: WebGLShader): Unit = ??? + + /** + * Associates a vertex attribute index with a named attribute variable. + */ def bindAttribLocation(program: WebGLProgram, index: js.Number, name: js.String): Unit = ??? + + /** + * Loads a a target into a [[WebGLBuffer]]. + * + * @param target the target to bind the buffer to. May be [[WebGLRenderingContext.ARRAY_BUFFER]] or [[WebGLRenderingContext.ELEMENT_ARRAY_BUFFER]] + */ def bindBuffer(target: js.Number, buffer: WebGLBuffer): Unit = ??? + + /** + * Loads a a target into a [[WebGLFramebuffer]]. + * + * @param target the target to bind the framebuffer to. Must be [[WebGLRenderingContext.FRAMEBUFFER]]. + * @param framebuffer a framebuffer object, or null to bind the default framebuffer. + */ def bindFramebuffer(target: js.Number, framebuffer: WebGLFramebuffer): Unit = ??? + + /** + * Loads a a target into a [[WebGLRenderbuffer]]. + * + * @param target target to bind to, must be [[WebGLRenderingContext.RENDERBUFFER]] + * @param renderbuffer the renderbuffer to bind. If `null`, any object bound to `target` us unbound. + */ def bindRenderbuffer(target: js.Number, renderbuffer: WebGLRenderbuffer): Unit = ??? + + /** + * Loads a the active texture unit into a [[WebGLTexture]]. + * + * @param target the target to bind to. Must be [[WebGLRenderingContext.TEXTURE_2D]] or [[WebGLRenderingContext.TEXTURE_CUBE_MAP]] + * @param texture the texture to bind. + */ def bindTexture(target: js.Number, texture: WebGLTexture): Unit = ??? + + /** + * Sets the blend color used in [[WebGLRenderingContext.BLEND_COLOR]]. + */ def blendColor(red: js.Number, green: js.Number, blue: js.Number, alpha: js.Number): Unit = ??? + + /** + * Specifies the equation used for RGB and Alpha blending. + * + * @param mode blend equation to use. Can be one of [[WebGLRenderingContext.FUNC_ADD]], [[WebGLRenderingContext.FUNC_SUBTRACT]], or [[WebGLRenderingContext.FUNC_REVERSE_SUBTRACT]] + */ def blendEquation(mode: js.Number): Unit = ??? + + /** + * Specifies the equation used for RGB and Alpha blending separately. + * + * @param modeRGB blend equation to use for RGB components. Can be one of [[WebGLRenderingContext.FUNC_ADD]], [[WebGLRenderingContext.FUNC_SUBTRACT]], or [[WebGLRenderingContext.FUNC_REVERSE_SUBTRACT]] + * @param modeAlpha blend equation to use for alpha components. Can be one of [[WebGLRenderingContext.FUNC_ADD]], [[WebGLRenderingContext.FUNC_SUBTRACT]], or [[WebGLRenderingContext.FUNC_REVERSE_SUBTRACT]] + */ def blendEquationSeparate(modeRGB: js.Number, modeAlpha: js.Number): Unit = ??? + + /** + * Specifies how the blending factors are computed for source and destination pixels. + * + * @param sfactor The source blending factors. May be one of [[WebGLRenderingContext.ZERO]], [[WebGLRenderingContext.ONE]], [[WebGLRenderingContext.SRC_COLOR]], + * [[WebGLRenderingContext.ONE_MINUS_SRC_COLOR]], [[WebGLRenderingContext.DST_COLOR]], [[WebGLRenderingContext.ONE_MINUS_DST_COLOR]], [[WebGLRenderingContext.SRC_ALPHA]], + * [[WebGLRenderingContext.ONE_MINUS_SRC_ALPHA]], [[WebGLRenderingContext.DST_ALPHA]], [[WebGLRenderingContext.ONE_MINUS_DST_ALPHA]], [[WebGLRenderingContext.CONSTANT_COLOR]], + * [[WebGLRenderingContext.ONE_MINUS_CONSTANT_COLOR]], [[WebGLRenderingContext.CONSTANT_ALPHA]], [[WebGLRenderingContext.ONE_MINUS_CONSTANT_ALPHA]], + * or [[WebGLRenderingContext.SRC_ALPHA_SATURATE]]. Initially this value is [[WebGLRenderingContext.ONE]]. + * @param dfactor The destination blending factors. May be one of [[WebGLRenderingContext.ZERO]], [[WebGLRenderingContext.ONE]], [[WebGLRenderingContext.SRC_COLOR]], + * [[WebGLRenderingContext.ONE_MINUS_SRC_COLOR]], [[WebGLRenderingContext.DST_COLOR]], [[WebGLRenderingContext.ONE_MINUS_DST_COLOR]], [[WebGLRenderingContext.SRC_ALPHA]], + * [[WebGLRenderingContext.ONE_MINUS_SRC_ALPHA]], [[WebGLRenderingContext.DST_ALPHA]], [[WebGLRenderingContext.ONE_MINUS_DST_ALPHA]], [[WebGLRenderingContext.CONSTANT_COLOR]], + * ` ONE_MINUS_CONSTANT_COLOR`, [[WebGLRenderingContext.CONSTANT_ALPHA]], or [[WebGLRenderingContext.ONE_MINUS_CONSTANT_ALPHA]]. + * This value is initially [[WebGLRenderingContext.ZERO]]. + */ def blendFunc(sfactor: js.Number, dfactor: js.Number): Unit = ??? - def blendFuncSeparate(sfactor: js.Number, dfactor: js.Number): Unit = ??? + + /** + * Specifies how the blending factors are computed for source and destination pixels, separately for alpha and RGB. + * + * @param srcRGB The source blending factor for RGB. May be one of [[WebGLRenderingContext.ZERO]], [[WebGLRenderingContext.ONE]], [[WebGLRenderingContext.SRC_COLOR]], + * [[WebGLRenderingContext.ONE_MINUS_SRC_COLOR]], [[WebGLRenderingContext.DST_COLOR]], [[WebGLRenderingContext.ONE_MINUS_DST_COLOR]], [[WebGLRenderingContext.SRC_ALPHA]], + * [[WebGLRenderingContext.ONE_MINUS_SRC_ALPHA]], [[WebGLRenderingContext.DST_ALPHA]], [[WebGLRenderingContext.ONE_MINUS_DST_ALPHA]], [[WebGLRenderingContext.CONSTANT_COLOR]], + * [[WebGLRenderingContext.ONE_MINUS_CONSTANT_COLOR]], [[WebGLRenderingContext.CONSTANT_ALPHA]], [[WebGLRenderingContext.ONE_MINUS_CONSTANT_ALPHA]], + * or [[WebGLRenderingContext.SRC_ALPHA_SATURATE]]. Initially this value is [[WebGLRenderingContext.ONE]]. + * @param dstRGB The destination blending factor for RGB. May be one of [[WebGLRenderingContext.ZERO]], [[WebGLRenderingContext.ONE]], [[WebGLRenderingContext.SRC_COLOR]], + * [[WebGLRenderingContext.ONE_MINUS_SRC_COLOR]], [[WebGLRenderingContext.DST_COLOR]], [[WebGLRenderingContext.ONE_MINUS_DST_COLOR]], [[WebGLRenderingContext.SRC_ALPHA]], + * [[WebGLRenderingContext.ONE_MINUS_SRC_ALPHA]], [[WebGLRenderingContext.DST_ALPHA]], [[WebGLRenderingContext.ONE_MINUS_DST_ALPHA]], [[WebGLRenderingContext.CONSTANT_COLOR]], + * ` ONE_MINUS_CONSTANT_COLOR`, [[WebGLRenderingContext.CONSTANT_ALPHA]], or [[WebGLRenderingContext.ONE_MINUS_CONSTANT_ALPHA]]. + * This value is initially [[WebGLRenderingContext.ZERO]]. + * @param srcAlpha The source blending factor for Alpha. Accepted values are the same as srcRGB. + * The initial value is [[WebGLRenderingContext.ONE]]. + * @param dstAlpha The destination blending factor for Alpha. Accepted values are the same as srcRGB. + * The initial value is [[WebGLRenderingContext.ZERO]]. + */ def blendFuncSeparate(srcRGB: js.Number, dstRGB: js.Number, srcAlpha: js.Number, dstAlpha: js.Number): Unit = ??? + + /** + * Sets the size of the bound [[WebGLBuffer]] for the given `target`. The contents of the buffer are cleared to 0. + * @param target The target to resize. May be [[WebGLRenderingContext.ARRAY_BUFFER]] or [[WebGLRenderingContext.ELEMENT_ARRAY_BUFFER]]. + * @param size The size of the new buffer + * @param usage The specified usage for this buffer. May be [[WebGLRenderingContext.STREAM_DRAW]], [[WebGLRenderingContext.STATIC_DRAW]] or [[WebGLRenderingContext.DYNAMIC_DRAW]]. + */ def bufferData(target: js.Number, size: js.Number, usage: js.Number): Unit = ??? - def bufferData(target: js.Number, size: ArrayBufferView, usage: js.Number): Unit = ??? - def bufferData(target: js.Number, size: ArrayBuffer, usage: js.Number): Unit = ??? + + /** + * Resizes the bound [[WebGLBuffer]] for the given `target` to the size of the passed buffer, and replaces its contents with the contents of the buffer. + * @param target The target to resize. May be [[WebGLRenderingContext.ARRAY_BUFFER]] or [[WebGLRenderingContext.ELEMENT_ARRAY_BUFFER]]. + * @param data the source data for the new buffer. + * @param usage The specified usage for this buffer. May be [[WebGLRenderingContext.STREAM_DRAW]], [[WebGLRenderingContext.STATIC_DRAW]] or [[WebGLRenderingContext.DYNAMIC_DRAW]]. + */ + def bufferData(target: js.Number, data: ArrayBufferView, usage: js.Number): Unit = ??? + + /** + * Resizes the bound [[WebGLBuffer]] for the given `target` to the size of the passed buffer, and replaces its contents with the contents of the buffer. + * + * @param target The target to resize. May be [[WebGLRenderingContext.ARRAY_BUFFER]] or [[WebGLRenderingContext.ELEMENT_ARRAY_BUFFER]]. + * @param data the source data for the new buffer. + * @param usage The specified usage for this buffer. May be [[WebGLRenderingContext.STREAM_DRAW]], [[WebGLRenderingContext.STATIC_DRAW]] or [[WebGLRenderingContext.DYNAMIC_DRAW]]. + */ + def bufferData(target: js.Number, data: ArrayBuffer, usage: js.Number): Unit = ??? + /** + * Returns the completeness status for the framebuffer. + * + * The possible results are: + * + * - [[WebGLRenderingContext.FRAMEBUFFER_COMPLETE]] - the framebuffer is complete. + * - [[WebGLRenderingContext.FRAMEBUFFER_INCOMPLETE_ATTACHMENT]] - one or more attachment points are not complete in the framebuffer. + * - [[WebGLRenderingContext.FRAMEBUFFER_INCOMPLETE_DIMENSIONS]] - one or more attached images do not have a specified width and height. + * - [[WebGLRenderingContext.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT]] - there are no images attached to the framebuffer. + * - [[WebGLRenderingContext.FRAMEBUFFER_UNSUPPORTED]] - the attached image format combinations are not supported on this platform. + * + * @param target the target framebuffer object, must be [[WebGLRenderingContext.FRAMEBUFFER]]. + * @return the framebuffer status. + */ def checkFramebufferStatus(target: js.Number): js.Number = ??? + + /** + * Clears the buffers specified in `mask` with the current [[WebGLRenderingContext#clearColor]], [[WebGLRenderingContext#clearDepth]] and [[WebGLRenderingContext#clearStencil]]. + * + * @param mask The buffers to clear, a bitmask of one or more of [[WebGLRenderingContext.COLOR_BUFFER_BIT]], [[WebGLRenderingContext.DEPTH_BUFFER_BIT]] and [[WebGLRenderingContext.STENCIL_BUFFER_BIT]]. + */ def clear(mask: js.Number): Unit = ??? + + /** + * Sets the clear color to use with [[WebGLRenderingContext#clear]]. + */ def clearColor(red: js.Number, green: js.Number, blue: js.Number, alpha: js.Number): Unit = ??? + + /** + * Sets the clear depth to use with [[WebGLRenderingContext#clear]]. + */ def clearDepth(depth: js.Number): Unit = ??? + + /** + * Sets the stencil value to use with [[WebGLRenderingContext#clear]]. + */ def clearStencil(s: js.Number): Unit = ??? + + /** + * Enable and disable writing to the given channels. For each channel, `true` will allow writing, `false` will prevent it. + */ def colorMask(red: js.Boolean, green: js.Boolean, blue: js.Boolean, alpha: js.Boolean): Unit = ??? + + /** + * Compiles the provided shader. + * + * The [[WebGLRenderingContext#getShaderParameter]] can be used to determine if this operation succeeded. + */ def compileShader(shader: WebGLShader): Unit = ??? + + + /** + * Loads a 2-dimensional texture into a texture unit, compressed with the specified algorithm. + * + * @param target the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] + * @param level the mipmap level of detail. 0 is the base image. + * @param internalformat the format of the compressed data. + * @param width the width of the texture image. + * @param height the height of the texture image. + * @param border the border width. Must be 0. + * @param data the compressed image data. + */ def compressedTexImage2D(target: js.Number, level: js.Number, internalformat: js.Number, width: js.Number, height: js.Number, border: js.Number, data: ArrayBufferView): Unit = ??? + + /** + * Loads a 2-dimensional texture subimage into a texture unit, compressed with the specified algorithm. + * + * @param target the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] + * @param level the mipmap level of detail. 0 is the base image. + * @param internalformat the format of the compressed data. + * @param xoffset the x texel offset into the texture image. + * @param yoffset the y texel offset into the texture image. + * @param width the width of the texture image. + * @param height the height of the texture image. + * @param data the compressed image data. + */ def compressedTexSubImage2D(target: js.Number, level: js.Number, xoffset: js.Number, yoffset: js.Number, width: js.Number, height: js.Number, format: js.Number, data: ArrayBufferView): Unit = ??? + + /** + * Loads a 2-dimensional texture into a texture unit from the current framebuffer. + * + * @param target the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] + * @param level the mipmap level of detail. 0 is the base image. + * @param internalformat the format of the data. May be [[WebGLRenderingContext.ALPHA]], [[WebGLRenderingContext.LUMINANCE]], [[WebGLRenderingContext.LUMINANCE_ALPHA]], [[WebGLRenderingContext.RGB]], or [[WebGLRenderingContext.RGBA]]. + * @param x the window coordinates of the lower left corner of the framebuffer. + * @param y the window coordinates of the lower left corner of the framebuffer. + * @param width the width of the texture image. + * @param height the height of the texture image. + * @param border the border width. Must be 0. + */ def copyTexImage2D(target: js.Number, level: js.Number, internalformat: js.Number, x: js.Number, y: js.Number, width: js.Number, height: js.Number, border: js.Number): Unit = ??? + + /** + * Loads a 2-dimensional texture subimage into a texture unit from the current framebuffer. + * + * @param target the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] + * @param level the mipmap level of detail. 0 is the base image. + * @param internalformat the format of the data. May be [[WebGLRenderingContext.ALPHA]], [[WebGLRenderingContext.LUMINANCE]], [[WebGLRenderingContext.LUMINANCE_ALPHA]], [[WebGLRenderingContext.RGB]], or [[WebGLRenderingContext.RGBA]]. + * @param xoffset the x texel offset into the texture image. + * @param yoffset the y texel offset into the texture image. + * @param x the window coordinates of the lower left corner of the framebuffer. + * @param y the window coordinates of the lower left corner of the framebuffer. + * @param width the width of the texture image. + * @param height the height of the texture image. + */ def copyTexSubImage2D(target: js.Number, level: js.Number, xoffset: js.Number, yoffset: js.Number, x: js.Number, y: js.Number, width: js.Number, height: js.Number): Unit = ??? + /** + * Creates a new [[WebGLBuffer]]. + */ def createBuffer(): WebGLBuffer = ??? + + /** + * Creates a new [[WebGLFramebuffer]]. + */ def createFramebuffer(): WebGLFramebuffer = ??? + + /** + * Creates a new [[WebGLProgram]]. + */ def createProgram(): WebGLProgram = ??? + + /** + * Creates a new [[WebGLRenderbuffer]]. + */ def createRenderBuffer(): WebGLRenderbuffer = ??? + + /** + * Creates a new [[WebGLShader]]. + */ def createShader(`type`: js.Number): WebGLShader = ??? + + /** + * Creates a new [[WebGLTexture]]. + */ def createTexture(): WebGLTexture = ??? + /** + * Set the culling mode for front and back facing polygons. + * + * @param mode the culling mode, may be [[WebGLRenderingContext.FRONT]], [[WebGLRenderingContext.BACK]] or [[WebGLRenderingContext.FRONT_AND_BACK]]. + * When [[WebGLRenderingContext.FRONT_AND_BACK]] is set, no triangles are drawn, however lines and points will. + */ def cullFace(mode: js.Number): Unit = ??? + /** + * Flags the specified [[WebGLBuffer]] for deletion. When it is no longer used by the WebGL system it + * will be deleted. + * + * ''Note'': garbage collection will also delete the buffer, it is not mandatory to call this method. + */ def deleteBuffer(buffer: WebGLBuffer): Unit = ??? + + /** + * Flags the specified [[WebGLFramebuffer]] for deletion. When it is no longer used by the WebGL system it + * will be deleted. + * + * ''Note'': garbage collection will also delete the framebuffer, it is not mandatory to call this method. + */ def deleteFramebuffer(framebuffer: WebGLFramebuffer): Unit = ??? + + /** + * Flags the specified [[WebGLProgram]] for deletion. When it is no longer used by the WebGL system it + * will be deleted. + * + * ''Note'': garbage collection will also delete the program, it is not mandatory to call this method. + */ def deleteProgram(program: WebGLProgram): Unit = ??? + + /** + * Flags the specified [[WebGLRenderbuffer]] for deletion. When it is no longer used by the WebGL system it + * will be deleted. + * + * ''Note'': garbage collection will also delete the renderbuffer, it is not mandatory to call this method. + */ def deleteRenderbuffer(renderbuffer: WebGLRenderbuffer): Unit = ??? + + /** + * Flags the specified [[WebGLShader]] for deletion. When it is no longer used by the WebGL system it + * will be deleted. + * + * ''Note'': garbage collection will also delete the shader, it is not mandatory to call this method. + */ def deleteShader(shader: WebGLShader): Unit = ??? + + /** + * Flags the specified [[WebGLTexture]] for deletion. When it is no longer used by the WebGL system it + * will be deleted. + * + * ''Note'': garbage collection will also delete the texture, it is not mandatory to call this method. + */ def deleteTexture(texture: WebGLTexture): Unit = ??? + /** + * Set the function used to discard fragments. When depth testing is enabled, the fragment depth is compared with + * the current depth, and is allowed onto the framebuffer. + * + * @param func the function to allow the fragment to be drawn. Values are [[WebGLRenderingContext.NEVER]], [[WebGLRenderingContext.LESS]], [[WebGLRenderingContext.EQUAL]], [[WebGLRenderingContext.LEQUAL]] + * [[WebGLRenderingContext.GREATER]], [[WebGLRenderingContext.NOTEQUAL]], [[WebGLRenderingContext.GEQUAL]], and [[WebGLRenderingContext.ALWAYS]]. + */ def depthFunc(func: js.Number): Unit = ??? + + /** + * Enables/disables writing to the depth buffer. + * + * @param flag when `false`, depth writing is disabled, otherwise it is enabled. + */ def depthMask(flag: js.Boolean): Unit = ??? + + /** + * Sets the mapping from normalized device coordinates to window coordinates. + * "normalized device coordinates" in this context really means "normalized depth map values". + * + * ''note'' there is no requirement that zNear < zFar. + * + * Both parameters are clamped to -1 .. 1 + * @param zNear the near clipping plane, initially 0. + * @param zFar the far clipping plane, initially 1 + */ def depthRange(zNear: js.Number, zFar: js.Number): Unit = ??? - def detatchShader(program: WebGLProgram, shader: WebGLShader): Unit = ??? + + /** + * Detaches a [[WebGLShader]] from a [[WebGLProgram]]. + * + * If the shader has been flagged as deleted by a call to [[WebGLRenderingContext#deleteShader]], it will be deleted. + */ + def detachShader(program: WebGLProgram, shader: WebGLShader): Unit = ??? + + /** + * Disables a GL capability. + * + * @param cap the capability to disable. May be [[WebGLRenderingContext.BLEND]], [[WebGLRenderingContext.CULL_FACE]], + * [[WebGLRenderingContext.DEPTH_TEST]], [[WebGLRenderingContext.DITHER]], [[WebGLRenderingContext.POLYGON_OFFSET_FILL]], + * [[WebGLRenderingContext.SAMPLE_ALPHA_TO_COVERAGE]], [[WebGLRenderingContext.SAMPLE_COVERAGE]], + * [[WebGLRenderingContext.SCISSOR_TEST]], or [[WebGLRenderingContext.STENCIL_TEST]]. + */ def disable(cap: js.Number): Unit = ??? + + /** + * Disables the generic vertex attribute array specified by index. + */ def disableVertexAttribArray(index: js.Number): Unit = ??? + + /** + * Renders the primitives in the active arrays. + * + * @param mode the kind of primitives to render. May be [[WebGLRenderingContext.POINTS]], [[WebGLRenderingContext.LINES]], [[WebGLRenderingContext.LINE_STRIP]], [[WebGLRenderingContext.LINE_LOOP]], [[WebGLRenderingContext.TRIANGLES]], [[WebGLRenderingContext.TRIANGLE_STRIP]], [[WebGLRenderingContext.TRIANGLE_FAN]], or [[WebGLRenderingContext.TRIANGLES]] + * @param first the starting index into the arrays. + * @param count the number of indices to draw. + */ def drawArrays(mode: js.Number, first: js.Number, count: js.Number): Unit = ??? + + /** + * Renders the primitives in the active arrays using an [[WebGLRenderingContext.ELEMENT_ARRAY_BUFFER]] to index them. + * + * @param mode the kind of primitives to render. May be [[WebGLRenderingContext.POINTS]], [[WebGLRenderingContext.LINES]], + * [[WebGLRenderingContext.LINE_STRIP]], [[WebGLRenderingContext.LINE_LOOP]], [[WebGLRenderingContext.TRIANGLES]], + * [[WebGLRenderingContext.TRIANGLE_STRIP]], [[WebGLRenderingContext.TRIANGLE_FAN]], + * or [[WebGLRenderingContext.TRIANGLES]] + * @param count the number of elements to render. + * @param type the type of index value in the [[WebGLRenderingContext.ELEMENT_ARRAY_BUFFER]]. May be + * [[WebGLRenderingContext.UNSIGNED_BYTE]] or [[WebGLRenderingContext.UNSIGNED_SHORT]] + * @param offset the offset into the [[WebGLRenderingContext.ELEMENT_ARRAY_BUFFER]] to begin drawing from. + */ def drawElements(mode: js.Number, count: js.Number, `type`: js.Number, offset: js.Number): Unit = ??? + /** + * Enables a GL capability. + * + * @param cap the capability to enable. May be [[WebGLRenderingContext.BLEND]], [[WebGLRenderingContext.CULL_FACE]], + * [[WebGLRenderingContext.DEPTH_TEST]], [[WebGLRenderingContext.DITHER]], [[WebGLRenderingContext.POLYGON_OFFSET_FILL]], + * [[WebGLRenderingContext.SAMPLE_ALPHA_TO_COVERAGE]], [[WebGLRenderingContext.SAMPLE_COVERAGE]], + * [[WebGLRenderingContext.SCISSOR_TEST]], or [[WebGLRenderingContext.STENCIL_TEST]]. + */ def enable(cap: js.Number): Unit = ??? + + /** + * Enables the generic vertex attribute array specified by index. + */ def enableVertexAttribArray(index: js.Number): Unit = ??? + + /** + * Block until all GL execution is complete. + */ def finish(): Unit = ??? + + /** + * Force all pending GL execution to complete as soon as possible. + */ def flush(): Unit = ??? + + /** + * Attach a [[WebGLRenderbuffer]] to a [[WebGLFramebuffer]]. + * + * @param target must be [[WebGLRenderingContext.FRAMEBUFFER]] + * @param attachment the attachment point on the framebuffer to attach the renderbuffer. May be [[WebGLRenderingContext.COLOR_ATTACHMENT0]], + * [[WebGLRenderingContext.DEPTH_ATTACHMENT]], [[WebGLRenderingContext.STENCIL_ATTACHMENT]], or + * [[WebGLRenderingContext.DEPTH_STENCIL_ATTACHMENT]]. + * @param renderbuffertarget must be [[WebGLRenderingContext.RENDERBUFFER]] + * @param renderbuffer the renderbuffer to attach. + */ def framebufferRenderbuffer(target: js.Number, attachment: js.Number, renderbuffertarget: js.Number, renderbuffer: WebGLRenderbuffer): Unit = ??? + + /** + * Attach a [[WebGLTexture]] to a [[WebGLFramebuffer]]. + * + * @param target must be [[WebGLRenderingContext.FRAMEBUFFER]] + * @param attachment the attachment point on the framebuffer to attach the texture. May be [[WebGLRenderingContext.COLOR_ATTACHMENT0]], [[WebGLRenderingContext.DEPTH_ATTACHMENT]], [[WebGLRenderingContext.STENCIL_ATTACHMENT]], or [[WebGLRenderingContext.DEPTH_STENCIL_ATTACHMENT]]. + * @param textarget the texture target. May be [[WebGLRenderingContext.TEXTURE_2D]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] + * @param texture the texture to be attached + * @param level the miplevel to be attached + */ def framebufferTexture2D(target: js.Number, attachment: js.Number, textarget: js.Number, texture: WebGLTexture, level: js.Number): Unit = ??? + + /** + * Specifies the winding that is considered front-facing for the purposes of CULL_FACE. + * + * @param mode The winding to consider front-facing. May be [[WebGLRenderingContext.CW]] or [[WebGLRenderingContext.CCW]] + */ def frontFace(mode: js.Number): Unit = ??? + /** + * Generate the complete set of mipmaps for the active texture derived from level 0. + * + * @param target the texture target, may be [[WebGLRenderingContext.TEXTURE_2D]] or [[WebGLRenderingContext.TEXTURE_CUBE_MAP]]. + */ def generateMipmap(target: js.Number): Unit = ??? - def getActiveAttrib(program: WebGLProgram, index: js.Number): Unit = ??? + /** + * Returns a new [[WebGLActiveInfo]] object describing the given attribute at `index`. + */ + def getActiveAttrib(program: WebGLProgram, index: js.Number): WebGLActiveInfo = ??? + + /** + * Returns a new [[WebGLActiveInfo]] object describing the given uniform at `index`. + */ def getActiveUniform(program: WebGLProgram, index: js.Number): Unit = ??? + + /** + * Returns a new array containing the shaders attached to the given program. + */ def getAttachedShaders(program: WebGLProgram): js.Array[WebGLShader] = ??? + /** + * Returns the index of the named attribute, or -1 on error. + */ def getAttribLocation(program: WebGLProgram, name: js.String): js.Number = ??? - def getBufferParameter(target: js.Number, pname: js.Number): js.Any = ??? + /** + * Returns the value of the requested parameter for a buffer. + * + * @param target must be [[WebGLRenderingContext.ARRAY_BUFFER]] or [[WebGLRenderingContext.ELEMENT_ARRAY_BUFFER]] + * @param value the buffer parameter to retrieve, may be [[WebGLRenderingContext.BUFFER_SIZE]] or [[WebGLRenderingContext.BUFFER_USAGE]] + * + */ + def getBufferParameter(target: js.Number, pname: js.Number): js.Number = ??? + + /** + * Returns the value for the given `pname`. Returns a value who's type depends on the requested parameter. + * + * @param pname The parameter to query. May be [[WebGLRenderingContext.ACTIVE_TEXTURE]], [[WebGLRenderingContext.ALIASED_LINE_WIDTH_RANGE]], [[WebGLRenderingContext.ALIASED_POINT_SIZE_RANGE]], + * [[WebGLRenderingContext.ALPHA_BITS]], [[WebGLRenderingContext.ARRAY_BUFFER_BINDING]], [[WebGLRenderingContext.BLEND]], [[WebGLRenderingContext.BLEND_COLOR]], [[WebGLRenderingContext.BLEND_DST_ALPHA]], [[WebGLRenderingContext.BLEND_DST_RGB]], + * [[WebGLRenderingContext.BLEND_EQUATION_ALPHA]], [[WebGLRenderingContext.BLEND_EQUATION_RGB]], [[WebGLRenderingContext.BLEND_SRC_ALPHA]], [[WebGLRenderingContext.BLEND_SRC_RGB]], [[WebGLRenderingContext.BLUE_BITS]], [[WebGLRenderingContext.COLOR_CLEAR_VALUE]], + * [[WebGLRenderingContext.COLOR_WRITEMASK]], [[WebGLRenderingContext.COMPRESSED_TEXTURE_FORMATS]], [[WebGLRenderingContext.CULL_FACE]], [[WebGLRenderingContext.CULL_FACE_MODE]], [[WebGLRenderingContext.CURRENT_PROGRAM]], [[WebGLRenderingContext.DEPTH_BITS]], + * [[WebGLRenderingContext.DEPTH_CLEAR_VALUE]], [[WebGLRenderingContext.DEPTH_FUNC]], `DEPTH-RANGE`, [[WebGLRenderingContext.DEPTH_TEST]], [[WebGLRenderingContext.DEPTH_WRITEMASK]], [[WebGLRenderingContext.DITHER]], [[WebGLRenderingContext.ELEMENT_ARRAY_BUFFER_BINDING]], + * [[WebGLRenderingContext.FRAMEBUFFER_BINDING]], [[WebGLRenderingContext.FRONT_FACE]], [[WebGLRenderingContext.GENERATE_MIPMAP_HINT]], [[WebGLRenderingContext.GREEN_BITS]], [[WebGLRenderingContext.LINE_WIDTH]], [[WebGLRenderingContext.MAX_COMBINED_TEXTURE_IMAGE_UNITS]], + * [[WebGLRenderingContext.MAX_CUBE_MAP_TEXTURE_SIZE]], [[WebGLRenderingContext.MAX_FRAGMENT_UNIFORM_VECTORS]], [[WebGLRenderingContext.MAX_RENDERBUFFER_SIZE]], [[WebGLRenderingContext.MAX_TEXTURE_IMAGE_UNITS]], [[WebGLRenderingContext.MAX_TEXTURE_SIZE]], + * [[WebGLRenderingContext.MAX_VARYING_VECTORS]], [[WebGLRenderingContext.MAX_VERTEX_ATTRIBS]], [[WebGLRenderingContext.MAX_VERTEX_TEXTURE_IMAGE_UNITS]], [[WebGLRenderingContext.MAX_VERTEX_UNIFORM_VECTORS]], + * [[WebGLRenderingContext.MAX_VIEWPORT_DIMS]], [[WebGLRenderingContext.PACK_ALIGNMENT]], [[WebGLRenderingContext.POLYGON_OFFSET_FACTOR]], [[WebGLRenderingContext.POLYGON_OFFSET_FILL]], [[WebGLRenderingContext.POLYGON_OFFSET_UNITS]], + * [[WebGLRenderingContext.RED_BITS]], [[WebGLRenderingContext.RENDERBUFFER_BINDING]], [[WebGLRenderingContext.RENDERER]], [[WebGLRenderingContext.SAMPLE_BUFFERS]], [[WebGLRenderingContext.SAMPLE_COVERAGE_INVERT]], [[WebGLRenderingContext.SAMPLE_COVERAGE_VALUE]], + * [[WebGLRenderingContext.SAMPLES]], [[WebGLRenderingContext.SCISSOR_BOX]], [[WebGLRenderingContext.SCISSOR_TEST]], [[WebGLRenderingContext.SHADING_LANGUAGE_VERSION]], [[WebGLRenderingContext.STENCIL_BACK_FAIL]], [[WebGLRenderingContext.STENCIL_BACK_FUNC]], + * [[WebGLRenderingContext.STENCIL_BACK_PASS_DEPTH_FAIL]], [[WebGLRenderingContext.STENCIL_BACK_PASS_DEPTH_PASS]], [[WebGLRenderingContext.STENCIL_BACK_REF]], [[WebGLRenderingContext.STENCIL_BACK_VALUE_MASK]], + * [[WebGLRenderingContext.STENCIL_BACK_WRITEMASK]], [[WebGLRenderingContext.STENCIL_BITS]], [[WebGLRenderingContext.STENCIL_CLEAR_VALUE]], [[WebGLRenderingContext.STENCIL_FAIL]], [[WebGLRenderingContext.STENCIL_FUNC]], [[WebGLRenderingContext.STENCIL_PASS_DEPTH_FAIL]], + * [[WebGLRenderingContext.STENCIL_PASS_DEPTH_PASS]], [[WebGLRenderingContext.STENCIL_REF]], [[WebGLRenderingContext.STENCIL_TEST]], [[WebGLRenderingContext.STENCIL_VALUE_MASK]], [[WebGLRenderingContext.STENCIL_WRITEMASK]], [[WebGLRenderingContext.SUBPIXEL_BITS]], + * [[WebGLRenderingContext.TEXTURE_BINDING_2D]], [[WebGLRenderingContext.TEXTURE_BINDING_CUBE_MAP]], [[WebGLRenderingContext.UNPACK_ALIGNMENT]], [[WebGLRenderingContext.UNPACK_COLORSPACE_CONVERSION_WEBGL]], [[WebGLRenderingContext.UNPACK_FLIP_Y_WEBGL]], + * [[WebGLRenderingContext.UNPACK_PREMULTIPLY_ALPHA_WEBGL]], [[WebGLRenderingContext.VENDOR]], [[WebGLRenderingContext.VERSION]] or [[WebGLRenderingContext.VIEWPORT]]. + */ def getParameter(pname: js.Number): js.Any = ??? + /** + * Returns the error value, and resets the error to [[WebGLRenderingContext.NO_ERROR]]. + * + * Only the first error is recorded, new errors are not stored until the error value is reset + * to [[WebGLRenderingContext.NO_ERROR]] by a call to this method. + * + * @return the error code. One of [[WebGLRenderingContext.NO_ERROR]], [[WebGLRenderingContext.INVALID_ENUM]], [[WebGLRenderingContext.INVALID_VALUE]], [[WebGLRenderingContext.INVALID_OPERATION]], [[WebGLRenderingContext.INVALID_FRAMEBUFFER_OPERATION]], or [[WebGLRenderingContext.OUT_OF_MEMORY]]. + */ def getError(): js.Number = ??? - + + /** + * Returns the value for the given parameter name on for the target and attachment. + * The return type is dependent on the requested parameter. + * + * @param target must be FRAMEBUFFER + * @param attachment the attachment to examine. May be [[WebGLRenderingContext.COLOR_ATTACHMENT0]], [[WebGLRenderingContext.DEPTH_ATTACHMENT]], + * [[WebGLRenderingContext.STENCIL_ATTACHMENT]], or [[WebGLRenderingContext.DEPTH_STENCIL_ATTACHMENT]]. + * @param pname the framebuffer attachment parameter. May be [[WebGLRenderingContext.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE]], + * [[WebGLRenderingContext.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME]], [[WebGLRenderingContext.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL]], or + * [[WebGLRenderingContext.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE]] + */ def getFramebufferAttachmentParameter(target: js.Number, attachment: js.Number, pname: js.Number): js.Any = ??? + + /** + * Returns the value for the given parameter name for the program. + * The return type is dependent on the requested parameter. + * + * @param program the program to query. + * @param pname the parameter to get, may be one of [[WebGLRenderingContext.DELETE_STATUS]], [[WebGLRenderingContext.LINK_STATUS]], + * [[WebGLRenderingContext.VALIDATE_STATUS]], [[WebGLRenderingContext.ATTACHED_SHADERS]], + * [[WebGLRenderingContext.ACTIVE_ATTRIBUTES]], or [[WebGLRenderingContext.ACTIVE_UNIFORMS]]. + */ def getProgramParameter(program: WebGLProgram, pname: js.Number): js.Any = ??? + + /** + * Returns a string containing information about the last link or validation operation for a program. + */ def getProgramInfoLog(program: WebGLProgram): js.String = ??? + + /** + * Returns the value of a parameter on the active renderbuffer. + * The return type is dependent on the requested parameter. + * + * @param target must be [[WebGLRenderingContext.RENDERBUFFER]] + * @param pname the parameter to query, may be [[WebGLRenderingContext.RENDERBUFFER_WIDTH]], + * [[WebGLRenderingContext.RENDERBUFFER_HEIGHT]], [[WebGLRenderingContext.RENDERBUFFER_INTERNAL_FORMAT]], + * [[WebGLRenderingContext.RENDERBUFFER_RED_SIZE]], [[WebGLRenderingContext.RENDERBUFFER_GREEN_SIZE]], + * [[WebGLRenderingContext.RENDERBUFFER_BLUE_SIZE]], [[WebGLRenderingContext.RENDERBUFFER_ALPHA_SIZE]], + * [[WebGLRenderingContext.RENDERBUFFER_STENCIL_SIZE]], or [[WebGLRenderingContext.RENDERBUFFER_DEPTH_SIZE]] + */ def getRenderbufferParameter(target: js.Number, pname: js.Number): js.Any = ??? + + /** + * Returns the value of a parameter on the specified [[WebGLShader]]. + * The return type is dependent on the requested parameter. + * + * @param shader the shader to query + * @param pname the parameter to get, may be one of [[WebGLRenderingContext.SHADER_TYPE]], + * [[WebGLRenderingContext.DELETE_STATUS]] or [[WebGLRenderingContext.COMPILE_STATUS]] + * + */ def getShaderParameter(shader: WebGLShader, pname: js.Number): js.Any = ??? + + /** + * Returns a new [[WebGLShaderPrecisionFormat]] for the given shader type and precision type. + * + * @param shadertype the type of shader, may be [[WebGLRenderingContext.FRAGMENT_SHADER]] or [[WebGLRenderingContext.VERTEX_SHADER]]. + * @param precisiontype the precision type to query, may be [[WebGLRenderingContext.LOW_FLOAT]], + * [[WebGLRenderingContext.MEDIUM_FLOAT]], [[WebGLRenderingContext.HIGH_FLOAT]], [[WebGLRenderingContext.LOW_INT]], + * [[WebGLRenderingContext.MEDIUM_INT]], or [[WebGLRenderingContext.HIGH_INT]]. + */ def getShaderPrecisionFormat(shadertype: js.Number, precisiontype: js.Number): WebGLShaderPrecisionFormat = ??? + + /** + * Returns the information log from the last compile of the shader. + */ def getShaderInfoLog(shader: WebGLShader): js.String = ??? + /** + * Returns the source of the given shader. + */ def getShaderSource(shader: WebGLShader): js.String = ??? + /** + * Returns the value of the given texture parameter on the target of the active texture. + * + * @param target the target to query. May be either [[WebGLRenderingContext.TEXTURE_2D]] or `TEXTURE_CUBE_MAP'. + * @param pname the parameter to query. May be either [[WebGLRenderingContext.TEXTURE_MAG_FILTER]], + * [[WebGLRenderingContext.TEXTURE_MIN_FILTER]], [[WebGLRenderingContext.TEXTURE_WRAP_S]], + * or [[WebGLRenderingContext.TEXTURE_WRAP_T]]. + */ def getTexParameter(target: js.Number, pname: js.Number): js.Any = ??? - + + /** + * Returns the value of the uniform in the given program and location. The return type is dependent + * on the uniform type. + */ def getUniform(program: WebGLProgram, location: WebGLUniformLocation): js.Any = ??? + /** + * Returns a new [[WebGLUniformLocation]] that represents the location of the given uniform in the specified program. + * If the uniform does not exist, or another error occurs, returns `null`. + */ def getUniformLocation(program: WebGLProgram, name: js.String): WebGLUniformLocation = ??? + /** + * Returns the value of the named parameter for a given vertex attribute index. + * + * @param index the index of the vertex attribute to query. + * @param pname the requested parameter, may be [[WebGLRenderingContext.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING]], + * [[WebGLRenderingContext.VERTEX_ATTRIB_ARRAY_ENABLED]], [[WebGLRenderingContext.VERTEX_ATTRIB_ARRAY_SIZE]], + * [[WebGLRenderingContext.VERTEX_ATTRIB_ARRAY_STRIDE]], [[WebGLRenderingContext.VERTEX_ATTRIB_ARRAY_TYPE]], + * [[WebGLRenderingContext.VERTEX_ATTRIB_ARRAY_NORMALIZED]], [[WebGLRenderingContext.CURRENT_VERTEX_ATTRIB]] + * + */ def getVertexAttrib(index: js.Number, pname: js.Number): js.Any = ??? - - def getVertexAttribOffset(index: js.Number, pname: js.Number): js.Any = ??? - + /** + * Returns the offset of the vertex attribute. + * + * @param index the index of the vertex attribute to retrieve + * @param pname must be [[WebGLRenderingContext.VERTEX_ATTRIB_ARRAY_POINTER]] + */ + def getVertexAttribOffset(index: js.Number, pname: js.Number): js.Number = ??? + + /** + * Specifies implementation specific hints. + * + * @param target the hint to specify. Must be [[WebGLRenderingContext.GENERATE_MIPMAP_HINT]] + * @param mode the desired mode. Must be one of [[WebGLRenderingContext.FASTEST]], + * [[WebGLRenderingContext.NICEST]], or [[WebGLRenderingContext.DONT_CARE]]. + */ def hint(target: js.Number, mode: js.Number): js.Any = ??? + /** + * Returns `true` if the `buffer` is valid, `false` otherwise. + */ def isBuffer(buffer: js.Any): js.Boolean = ??? + + /** + * Returns `true` if the specified capability is enabled, `false` otherwise. + * @see [[WebGLRenderingContext#enable]] + */ def isEnabled(cap: js.Number): js.Boolean = ??? + + /** + * Returns `true` if the `framebuffer` is valid, `false` otherwise. + */ def isFramebuffer(framebuffer: js.Any): js.Boolean = ??? + + /** + * Returns `true` if the `program` is valid, `false` otherwise. + */ def isProgram(program: js.Any): js.Boolean = ??? + + /** + * Returns `true` if the `renderbuffer` is valid, `false` otherwise. + */ def isRenderbuffer(renderbuffer: js.Any): js.Boolean = ??? + + /** + * Returns `true` if the `shader` is valid, `false` otherwise. + */ def isShader(shader: js.Any): js.Boolean = ??? + + /** + * Returns `true` if the `texture` is valid, `false` otherwise. + */ def isTexture(texture: js.Any): js.Boolean = ??? + + /** + * Specifies the line width. + */ def lineWidth(width: js.Number): Unit = ??? + + /** + * Attempts to link the specified [[WebGLProgram]]. + */ def linkProgram(program: WebGLProgram): Unit = ??? + + /** + * Sets the pixel store mode, used when copying image data such as framebuffers or textures. + * + * @param pname the property to change. May be one of [[WebGLRenderingContext.PACK_ALIGNMENT]], + * [[WebGLRenderingContext.UNPACK_ALIGNMENT]], [[WebGLRenderingContext.UNPACK_FLIP_Y_WEBGL]], + * [[WebGLRenderingContext.UNPACK_PREMULTIPLY_ALPHA_WEBGL]] or [[WebGLRenderingContext.UNPACK_COLORSPACE_CONVERSION_WEBGL]]. + */ def pixelStorei(pname: js.Number, param: js.Number): Unit = ??? + + /** + * Specifies the polygon offset. When [[WebGLRenderingContext.POLYGON_OFFSET_FILL]] is enabled, depth values for a fragment have an offset applied + * to them, calculated as `factor`*DZ + r*`units`, where DZ is the change in z based on the polygon's screen area, and r is the minimum value that + * is guaranteed produce a measurable offset. + */ def polygonOffset(factor: js.Number, units: js.Number): Unit = ??? + + /** + * Reads pixels from the framebuffer into `pixels`. + * + * @param x the x coordinate of the bottom left of the area to read. + * @param y the y coordinate of the bottom left of the area to read. + * @param width the width of the area to read. + * @param height the height of the area to read. + * @param format the format of the desired output. Must be one of [[WebGLRenderingContext.UNSIGNED_BYTE]], + * [[WebGLRenderingContext.UNSIGNED_SHORT_4_4_4_4]], [[WebGLRenderingContext.UNSIGNED_SHORT_5_5_5_1]], + * [[WebGLRenderingContext.UNSIGNED_SHORT_5_6_5]] + */ def readPixels(x: js.Number, y: js.Number, width: js.Number, height: js.Number, format: js.Number, `type`: js.Number, pixels: ArrayBufferView): Unit = ??? + + /** + * Create renderbuffer image storage. + * + * Initializes the renderbuffer to use the new storage format, replacing any previous store. + * + * @param target must be [[WebGLRenderingContext.RENDERBUFFER]] + * @param internalformat specifies the format of the renderbuffer. May be one of [[WebGLRenderingContext.RGBA4]], [[WebGLRenderingContext.RGB565]], + * [[WebGLRenderingContext.RGB5_A1]], [[WebGLRenderingContext.DEPTH_COMPONENT16]], [[WebGLRenderingContext.STENCIL_INDEX8]] or + * [[WebGLRenderingContext.DEPTH_STENCIL]]. + */ def renderbufferStorage(target: js.Number, internalformat: js.Number, width: js.Number, height: js.Number): Unit = ??? + + /** + * Sets the sampling coverage parameters for primitive antialiasing. + * + * The OpenGL multisampling algorithm is too involved to concisely explain here. + * Please consult [[http://www.opengl.org/registry/specs/SGIS/multisample.txt]]. + * + * @param value the sample coverage value, clamped to 0..1. + * @param invert if true, the mask will be bitwise-inverted. + */ def sampleCoverage(value: js.Number, invert: js.Boolean): Unit = ??? + + /** + * Sets the scissor rectangle. When [[WebGLRenderingContext.SCISSOR_TEST]] is enabled, rendering will be restricted to this rectangle. + */ def scissor(x: js.Number, y: js.Number, width: js.Number, height: js.Number): Unit = ??? + /** + * Sets the GLSL source for the given shader. + */ def shaderSource(shader: WebGLShader, source: js.String): Unit = ??? + /** + * Sets the stencil test for front and back faces. + * @param func the test function. One of [[WebGLRenderingContext.NEVER]], [[WebGLRenderingContext.LESS]], + * [[WebGLRenderingContext.LEQUAL]], [[WebGLRenderingContext.GREATER]], [[WebGLRenderingContext.GEQUAL]], + * [[WebGLRenderingContext.EQUAL]], [[WebGLRenderingContext.NOTEQUAL]], and [[WebGLRenderingContext.ALWAYS]] + * @param ref the reference value to test against in the stencil buffer + * @param mask mask that is ANDed with `ref` and the tested value and stored in the stencil buffer. + */ def stencilFunc(func: js.Number, ref: js.Number, mask: js.Number): Unit = ??? + + /** + * Sets the stencil test for the given face type. + * @param face the face(s) to configure the test for. May be [[WebGLRenderingContext.FRONT]], [[WebGLRenderingContext.BACK]] + * or [[WebGLRenderingContext.FRONT_AND_BACK]]. + * @param func the test function. One of [[WebGLRenderingContext.NEVER]], [[WebGLRenderingContext.LESS]], + * [[WebGLRenderingContext.LEQUAL]], [[WebGLRenderingContext.GREATER]], [[WebGLRenderingContext.GEQUAL]], + * [[WebGLRenderingContext.EQUAL]], [[WebGLRenderingContext.NOTEQUAL]], and [[WebGLRenderingContext.ALWAYS]] + * @param ref the reference value to test against in the stencil buffer + * @param mask mask that is ANDed with `ref` and the tested value and stored in the stencil buffer. + */ def stencilFuncSeparate(face: js.Number, func: js.Number, ref: js.Number, mask: js.Number): Unit = ??? + + /** + * Configure which bits in the stencil buffer may be written to by front or back faces. + * @param mask the write mask. Set bits are allowed to be written to the corresponding stencil buffer bit. + */ def stencilMask(mask: js.Number): Unit = ??? + + /** + * Configure which bits in the stencil buffer may be written to by the given face type. + * @param face the face(s) to configure the mask for. May be [[WebGLRenderingContext.FRONT]], [[WebGLRenderingContext.BACK]] + * or [[WebGLRenderingContext.FRONT_AND_BACK]]. + * @param mask the write mask. Set bits are allowed to be written to the corresponding stencil buffer bit. + */ def stencilMaskSeperate(face: js.Number, mask: js.Number): Unit = ??? + + /** + * Configure the effect of a stencil or depth test failing for front or back faces. + * + * @param fail the effect of the stencil test failing. May be one of + * [[WebGLRenderingContext.KEEP]], [[WebGLRenderingContext.ZERO]], [[WebGLRenderingContext.REPLACE]], + * [[WebGLRenderingContext.INCR]], [[WebGLRenderingContext.INCR_WRAP]], [[WebGLRenderingContext.DECR]], + * [[WebGLRenderingContext.DECR_WRAP]], and [[WebGLRenderingContext.INVERT]] + * + * @param zfail the effect of the stencil test passing but the depth test failing. Parameters are as fail. + * @param zpass the effect of the stencil test failing but the depth test passing. Parameters are as fail. + */ def stencilOp(fail: js.Number, zfail: js.Number, zpass: js.Number): Unit = ??? + + /** + * Configure the effect of a stencil or depth test failing for the specified faces. + * + * @param face the face(s) to configure the stencil operation for. May be [[WebGLRenderingContext.FRONT]], [[WebGLRenderingContext.BACK]] + * or [[WebGLRenderingContext.FRONT_AND_BACK]]. + * @param fail the effect of the stencil test failing. May be one of + * [[WebGLRenderingContext.KEEP]], [[WebGLRenderingContext.ZERO]], [[WebGLRenderingContext.REPLACE]], + * [[WebGLRenderingContext.INCR]], [[WebGLRenderingContext.INCR_WRAP]], [[WebGLRenderingContext.DECR]], + * [[WebGLRenderingContext.DECR_WRAP]], and [[WebGLRenderingContext.INVERT]] + * + * @param zfail the effect of the stencil test passing but the depth test failing. Parameters are as fail. + * @param zpass the effect of the stencil test failing but the depth test passing. Parameters are as fail. + */ def stencilOpSeperate(face: js.Number, fail: js.Number, zfail: js.Number, zpass: js.Number): Unit = ??? + /** + * Loads a 2-dimensional texture into a texture unit from source data. + * + * @param target the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] + * @param level the mipmap level of detail. 0 is the base image. + * @param internalformat the format the image is stored in. + * @param width the width of the texture image. + * @param height the height of the texture image. + * @param border the border width. Must be 0. + * @param pixels the source image data. + */ def texImage2D(target: js.Number, level: js.Number, internalformat: js.Number, width: js.Number, height: js.Number, border: js.Number, format: js.Number, `type`: js.Number, pixels: ArrayBufferView): Unit = ??? + + /** + * Loads a 2-dimensional texture into a texture unit from an ImageData object. + * + * @param target the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] + * @param level the mipmap level of detail. 0 is the base image. + * @param internalformat the format to store the image. + * @param width the width of the texture image. + * @param height the height of the texture image. + * @param border the border width. Must be 0. + * @param pixels the source image data. + */ def texImage2D(target: js.Number, level: js.Number, internalformat: js.Number, format: js.Number, `type`: js.Number, pixels: ImageData): Unit = ??? + + /** + * Loads a 2-dimensional texture into a texture unit from an HTMLImageElement object. + * + * @param target the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] + * @param level the mipmap level of detail. 0 is the base image. + * @param internalformat the format to store the image. + * @param width the width of the texture image. + * @param height the height of the texture image. + * @param border the border width. Must be 0. + * @param pixels the source image data. + */ def texImage2D(target: js.Number, level: js.Number, internalformat: js.Number, format: js.Number, `type`: js.Number, pixels: HTMLImageElement): Unit = ??? + + /** + * Loads a 2-dimensional texture into a texture unit from an HTMLCanvasElement object. + * + * @param target the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] + * @param level the mipmap level of detail. 0 is the base image. + * @param internalformat the format to store the image. + * @param width the width of the texture image. + * @param height the height of the texture image. + * @param border the border width. Must be 0. + * @param pixels the source image data. + */ def texImage2D(target: js.Number, level: js.Number, internalformat: js.Number, format: js.Number, `type`: js.Number, pixels: HTMLCanvasElement): Unit = ??? + + /** + * Loads a 2-dimensional texture into a texture unit from an HTMLVideoElement object. + * + * @param target the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] + * @param level the mipmap level of detail. 0 is the base image. + * @param internalformat the format to store the image. + * @param width the width of the texture image. + * @param height the height of the texture image. + * @param border the border width. Must be 0. + * @param pixels the source image data. + */ def texImage2D(target: js.Number, level: js.Number, internalformat: js.Number, format: js.Number, `type`: js.Number, pixels: HTMLVideoElement): Unit = ??? + /** + * Sets the texture parameter for the active texture unit. + * + * @param target the texture target to configure. May be [[WebGLRenderingContext.TEXTURE_2D]] or [[WebGLRenderingContext.TEXTURE_CUBE_MAP]] + * @param pname the parameter to change. May be [[WebGLRenderingContext.TEXTURE_MIN_FILTER]], [[WebGLRenderingContext.TEXTURE_MAG_FILTER]] + * [[WebGLRenderingContext.TEXTURE_WRAP_S]], or [[WebGLRenderingContext.TEXTURE_WRAP_T]] + * @param param the value to set. See the corresponding parameters for valid values. + */ def texParameterf(target: js.Number, pname: js.Number, param: js.Number): Unit = ??? + + /** + * Sets the texture parameter for the active texture unit. + * + * @param target the texture target to configure. May be [[WebGLRenderingContext.TEXTURE_2D]] or [[WebGLRenderingContext.TEXTURE_CUBE_MAP]] + * @param pname the parameter to change. May be [[WebGLRenderingContext.TEXTURE_MIN_FILTER]], [[WebGLRenderingContext.TEXTURE_MAG_FILTER]] + * [[WebGLRenderingContext.TEXTURE_WRAP_S]], or [[WebGLRenderingContext.TEXTURE_WRAP_T]] + * @param param the value to set. See the corresponding parameters for valid values. + */ def texParameteri(target: js.Number, pname: js.Number, param: js.Number): Unit = ??? + /** + * Loads a 2-dimensional texture subimage into a texture unit from an [[ArrayBufferView]]. + * + * @param target the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] + * @param level the mipmap level of detail. 0 is the base image. + * @param internalformat the format of the image data. + * @param xoffset the x texel offset into the texture image. + * @param yoffset the y texel offset into the texture image. + * @param width the width of the texture image. + * @param height the height of the texture image. + * @param pixels the image data. + */ def texSubImage2D(target: js.Number, level: js.Number, xoffset: js.Number, yoffset: js.Number, width: js.Number, height: js.Number, format: js.Number, `type`: js.Number, pixels: ArrayBufferView): Unit = ??? + + /** + * Loads a 2-dimensional texture subimage into a texture unit from an `ImageData` object. + * + * @param target the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] + * @param level the mipmap level of detail. 0 is the base image. + * @param internalformat desired the format of the image data. + * @param xoffset the x texel offset into the texture image. + * @param yoffset the y texel offset into the texture image. + * @param width the width of the texture image. + * @param height the height of the texture image. + * @param pixels the image data. + */ def texSubImage2D(target: js.Number, level: js.Number, xoffset: js.Number, yoffset: js.Number, format: js.Number, `type`: js.Number, pixels: ImageData): Unit = ??? + + /** + * Loads a 2-dimensional texture subimage into a texture unit from an `HTMLImageElement`. + * + * @param target the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] + * @param level the mipmap level of detail. 0 is the base image. + * @param internalformat desired the format of the image data. + * @param xoffset the x texel offset into the texture image. + * @param yoffset the y texel offset into the texture image. + * @param width the width of the texture image. + * @param height the height of the texture image. + * @param pixels the image data. + */ def texSubImage2D(target: js.Number, level: js.Number, xoffset: js.Number, yoffset: js.Number, format: js.Number, `type`: js.Number, pixels: HTMLImageElement): Unit = ??? + + /** + * Loads a 2-dimensional texture subimage into a texture unit from an `HTMLCanvasElement`. + * + * @param target the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] + * @param level the mipmap level of detail. 0 is the base image. + * @param internalformat desired the format of the image data. + * @param xoffset the x texel offset into the texture image. + * @param yoffset the y texel offset into the texture image. + * @param width the width of the texture image. + * @param height the height of the texture image. + * @param pixels the image data. + */ def texSubImage2D(target: js.Number, level: js.Number, xoffset: js.Number, yoffset: js.Number, format: js.Number, `type`: js.Number, pixels: HTMLCanvasElement): Unit = ??? + + /** + * Loads a 2-dimensional texture subimage into a texture unit from an `HTMLVideoElement`. + * + * @param target the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] + * @param level the mipmap level of detail. 0 is the base image. + * @param internalformat desired the format of the image data. + * @param xoffset the x texel offset into the texture image. + * @param yoffset the y texel offset into the texture image. + * @param width the width of the texture image. + * @param height the height of the texture image. + * @param pixels the image data. + */ def texSubImage2D(target: js.Number, level: js.Number, xoffset: js.Number, yoffset: js.Number, format: js.Number, `type`: js.Number, pixels: HTMLVideoElement): Unit = ??? + /** + * Loads a a scalar float into a [[WebGLUniformLocation]]. + * + * @param location the location to bind. + * @param x the scalar to bind to. + */ def uniform1f(location: WebGLUniformLocation, x: js.Number): Unit = ??? + + /** + * Loads a a scalar float into a [[WebGLUniformLocation]]. + * + * @param location the location to bind. + * @param v a [[Float32Array]] to bind to + */ def uniform1fv(location: WebGLUniformLocation, v: Float32Array): Unit = ??? + + /** + * Loads a a scalar float into a [[WebGLUniformLocation]]. + * + * @param location the location to bind. + * @param v a js.Array to bind to. + */ def uniform1fv(location: WebGLUniformLocation, v: js.Array[js.Number]): Unit = ??? + + /** + * Loads a a scalar integer into a [[WebGLUniformLocation]]. + * + * @param location the location to bind. + * @param x the scalar to bind to. + */ def uniform1i(location: WebGLUniformLocation, x: js.Number): Unit = ??? + + /** + * Loads a a scalar integer into a [[WebGLUniformLocation]]. + * + * @param location the location to bind. + * @param v an [[Int32Array]] to bind to + */ def uniform1iv(location: WebGLUniformLocation, v: Int32Array): Unit = ??? + + /** + * Loads a a scalar integer into a [[WebGLUniformLocation]]. + * + * @param location the location to bind. + * @param v a js.Array to bind to + */ def uniform1iv(location: WebGLUniformLocation, v: js.Array[js.Number]): Unit = ??? + /** + * Loads a a 2-vector of floats into a [[WebGLUniformLocation]]. + * + * @param location the location to bind. + * @param x the first float component + * @param y the second float component + */ def uniform2f(location: WebGLUniformLocation, x: js.Number, y: js.Number): Unit = ??? + + /** + * Loads a a 2-vector of floats into a [[WebGLUniformLocation]]. + * + * @param location the location to bind. + * @param v a [[Float32Array]] to bind to + */ def uniform2fv(location: WebGLUniformLocation, v: Float32Array): Unit = ??? + + /** + * Loads a a 2-vector of floats + * + * @param location the location to bind into a [[WebGLUniformLocation]]. + * @param v a js.Array to bind to. + */ def uniform2fv(location: WebGLUniformLocation, v: js.Array[js.Number]): Unit = ??? + + /** + * Loads a a 2-vector of integers into a [[WebGLUniformLocation]]. + * + * @param location the location to bind. + * @param x the first integer component + * @param y the second integer component + */ def uniform2i(location: WebGLUniformLocation, x: js.Number, y: js.Number): Unit = ??? + + /** + * Loads a a 2-vector of integers into a [[WebGLUniformLocation]]. + * + * @param location the location to bind. + * @param v an [[Int32Array]] to bind to + */ def uniform2iv(location: WebGLUniformLocation, v: Int32Array): Unit = ??? + + /** + * Loads a a 2-vector of integers into a [[WebGLUniformLocation]]. + * + * @param location the location to bind. + * @param v a js.Array to bind to + */ def uniform2iv(location: WebGLUniformLocation, v: js.Array[js.Number]): Unit = ??? + /** + * Loads a a 3-vector of floats into a [[WebGLUniformLocation]]. + * + * @param location the location to bind. + * @param x the first float component. + * @param y the second float component. + * @param z the third float component. + */ def uniform3f(location: WebGLUniformLocation, x: js.Number, y: js.Number, z: js.Number): Unit = ??? + + /** + * Loads a a 3-vector of floats into a [[WebGLUniformLocation]]. + * + * @param location the location to bind. + * @param v a [[Float32Array]] to bind to + */ def uniform3fv(location: WebGLUniformLocation, v: Float32Array): Unit = ??? + + /** + * Loads a a 3-vector of floats into a [[WebGLUniformLocation]]. + * + * @param location the location to bind. + * @param v a js.Array to bind to. + */ def uniform3fv(location: WebGLUniformLocation, v: js.Array[js.Number]): Unit = ??? + + /** + * Loads a a 3-vector of integers into a [[WebGLUniformLocation]]. + * + * @param location the location to bind. + * @param x the first integer component + * @param y the second integer component + * @param z the third integer component + */ def uniform3i(location: WebGLUniformLocation, x: js.Number, y: js.Number, z: js.Number): Unit = ??? + + /** + * Loads a a 3-vector of integers into a [[WebGLUniformLocation]]. + * + * @param location the location to bind. + * @param v an [[Int32Array]] to bind to + */ def uniform3iv(location: WebGLUniformLocation, v: Int32Array): Unit = ??? + + /** + * Loads a a 3-vector of integers into a [[WebGLUniformLocation]]. + * + * @param location the location to bind. + * @param v a js.Array to bind to + */ def uniform3iv(location: WebGLUniformLocation, v: js.Array[js.Number]): Unit = ??? + /** + * Loads a a 4-vector of floats into a [[WebGLUniformLocation]]. + * + * @param location the location to bind. + * @param x the first float component. + * @param y the second float component. + * @param z the third float component. + * @param w the fourth float component. + */ def uniform4f(location: WebGLUniformLocation, x: js.Number, y: js.Number, z: js.Number, w: js.Number): Unit = ??? + + /** + * Loads a a 4-vector of floats into a [[WebGLUniformLocation]]. + * + * @param location the location to bind. + * @param v a [[Float32Array]] to bind to + */ def uniform4fv(location: WebGLUniformLocation, v: Float32Array): Unit = ??? + + /** + * Loads a a 4-vector of floats into a [[WebGLUniformLocation]]. + * + * @param location the location to bind. + * @param v a js.Array to bind to. + */ def uniform4fv(location: WebGLUniformLocation, v: js.Array[js.Number]): Unit = ??? + + /** + * Loads a a 4-vector of integers into a [[WebGLUniformLocation]]. + * + * @param location the location to bind. + * @param x the first integer component + * @param y the second integer component + * @param z the third integer component + * @param w the third integer component + */ def uniform4i(location: WebGLUniformLocation, x: js.Number, y: js.Number, z: js.Number, w: js.Number): Unit = ??? + + /** + * Loads a a 4-vector of integers into a [[WebGLUniformLocation]]. + * + * @param location the location to bind. + * @param v an [[Int32Array]] to bind to + */ def uniform4iv(location: WebGLUniformLocation, v: Int32Array): Unit = ??? + + /** + * Loads a a 4-vector of integers into a [[WebGLUniformLocation]]. + * + * @param location the location to bind. + * @param v a js.Array to bind to + */ def uniform4iv(location: WebGLUniformLocation, v: js.Array[js.Number]): Unit = ??? + /** + * Loads a a 4x2 matrix into a [[WebGLUniformLocation]]. + * + * @param location the location to bind. + * @param transpose if `true`, the matrix will loaded into the uniform transposed. + * @param value the source [[Float32Array]] containing the matrix data. + */ def uniformMatrix2fv(location: WebGLUniformLocation, transpose: js.Boolean, value: Float32Array): Unit = ??? + + /** + * Loads a a 4x2 matrix into a [[WebGLUniformLocation]]. + * + * @param location the location to bind. + * @param transpose if `true`, the matrix will loaded into the uniform transposed. + * @param value the source `js.Array` containing the matrix data. + */ def uniformMatrix2fv(location: WebGLUniformLocation, transpose: js.Boolean, value: js.Array[js.Number]): Unit = ??? + + /** + * Loads a a 4x3 matrix into a [[WebGLUniformLocation]]. + * + * @param location the location to bind. + * @param transpose if `true`, the matrix will loaded into the uniform transposed. + * @param value the source [[Float32Array]] containing the matrix data. + */ def uniformMatrix3fv(location: WebGLUniformLocation, transpose: js.Boolean, value: Float32Array): Unit = ??? + + /** + * Loads a a 4x3 matrix into a [[WebGLUniformLocation]]. + * + * @param location the location to bind. + * @param transpose if `true`, the matrix will loaded into the uniform transposed. + * @param value the source `js.Array` containing the matrix data. + */ def uniformMatrix3fv(location: WebGLUniformLocation, transpose: js.Boolean, value: js.Array[js.Number]): Unit = ??? + + /** + * Loads a a 4x4 matrix into a [[WebGLUniformLocation]]. + * + * @param location the location to bind. + * @param transpose if `true`, the matrix will loaded into the uniform transposed. + * @param value the source [[Float32Array]] containing the matrix data. + */ def uniformMatrix4fv(location: WebGLUniformLocation, transpose: js.Boolean, value: Float32Array): Unit = ??? + + /** + * Loads a a 4x4 matrix into a [[WebGLUniformLocation]]. + * + * @param location the location to bind. + * @param transpose if `true`, the matrix will loaded into the uniform transposed. + * @param value the source `js.Array` containing the matrix data. + */ def uniformMatrix4fv(location: WebGLUniformLocation, transpose: js.Boolean, value: js.Array[js.Number]): Unit = ??? + /** + * Makes a [[WebGLProgram]] become the active program. + */ def useProgram(program: WebGLProgram): Unit = ??? + + /** + * Validates a [[WebGLProgram]]. + */ def validateProgram(program: WebGLProgram): Unit = ??? + /** + * Loads a scalar into a vertex attribute. + * + * @param indx the index of the attribute. + * @param x the scalar to load. + */ def vertexAttrib1f(indx: js.Number, x: js.Number): Unit = ??? + + /** + * Loads a scalar into a vertex attribute. + * + * @param indx the index of the attribute. + * @param values the source array for the attribute. + */ def vertexAttrib1fv(indx: js.Number, values: Float32Array): Unit = ??? + + /** + * Loads a scalar into a vertex attribute. + * + * @param indx the index of the attribute. + * @param values the source array for the attribute. + */ def vertexAttrib1fv(indx: js.Number, values: js.Array[js.Number]): Unit = ??? + /** + * Loads a 2-vector into a vertex attribute. + * + * @param indx the index of the attribute. + * @param x the first component. + * @param y the second component. + */ def vertexAttrib2f(indx: js.Number, x: js.Number, y: js.Number): Unit = ??? + + /** + * Loads a 2-vector into a vertex attribute. + * + * @param indx the index of the attribute. + * @param values the source array for the attribute. + */ def vertexAttrib2fv(indx: js.Number, values: Float32Array): Unit = ??? + + /** + * Loads a 2-vector into a vertex attribute. + * + * @param indx the index of the attribute. + * @param values the source array for the attribute. + */ def vertexAttrib2fv(indx: js.Number, values: js.Array[js.Number]): Unit = ??? + /** + * Loads a 3-vector into a vertex attribute. + * + * @param indx the index of the attribute. + * @param x the first component. + * @param y the second component. + * @param z the third component. + */ def vertexAttrib3f(indx: js.Number, x: js.Number, y: js.Number, z: js.Number): Unit = ??? + + /** + * Loads a 3-vector into a vertex attribute. + * + * @param indx the index of the attribute. + * @param values the source array for the attribute. + */ def vertexAttrib3fv(indx: js.Number, values: Float32Array): Unit = ??? + + /** + * Loads a 3-vector into a vertex attribute. + * + * @param indx the index of the attribute. + * @param values the source array for the attribute. + */ def vertexAttrib3fv(indx: js.Number, values: js.Array[js.Number]): Unit = ??? + /** + * Loads a 4-vector into a vertex attribute. + * + * @param indx the index of the attribute. + * @param x the first component. + * @param y the second component. + * @param z the third component. + * @param w the fourth component. + */ def vertexAttrib4f(indx: js.Number, x: js.Number, y: js.Number, z: js.Number, w: js.Number): Unit = ??? + + /** + * Loads a 4-vector into a vertex attribute. + * + * @param indx the index of the attribute. + * @param values the source array for the attribute. + */ def vertexAttrib4fv(indx: js.Number, values: Float32Array): Unit = ??? + + /** + * Loads a 4-vector into a vertex attribute. + * + * @param indx the index of the attribute. + * @param values the source array for the attribute. + */ def vertexAttrib4fv(indx: js.Number, values: js.Array[js.Number]): Unit = ??? + /** + * Defines an array of generic vertex attribute data. + * + * @param indx the index of the attribute + * @param size the number of components per attribute. Must be 1..4 + * @param type the datatype for each component, may be [[WebGLRenderingContext.BYTE]], [[WebGLRenderingContext.UNSIGNED_BYTE]], + * [[WebGLRenderingContext.SHORT]], [[WebGLRenderingContext.UNSIGNED_SHORT]], or + * [[WebGLRenderingContext.FLOAT]]. + * @param normalized if `true`, values are normalized on access, otherwise they are converted to fixed point values on access. + * @param stride the gap between attributes. 0 would be packed together. + * @param offset the offset to the first component in the array. + */ def vertexAttribPointer(indx: js.Number, size: js.Number, `type`: js.Number, normalized: js.Boolean, stride: js.Number, offset: js.Number): Unit = ??? + /** + * Sets the OpenGL viewport to render within. + */ def viewport(x: js.Number, y: js.Number, width: js.Number, height: js.Number): Unit = ??? }