Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
michael@0 | 4 | * You can obtain one at http://mozilla.org/MPL/2.0/. |
michael@0 | 5 | * |
michael@0 | 6 | * The origin of this IDL file is |
michael@0 | 7 | * https://www.khronos.org/registry/webgl/specs/latest/webgl.idl |
michael@0 | 8 | * |
michael@0 | 9 | * Copyright © 2012 Khronos Group |
michael@0 | 10 | */ |
michael@0 | 11 | |
michael@0 | 12 | // WebGL IDL definitions scraped from the Khronos specification: |
michael@0 | 13 | // https://www.khronos.org/registry/webgl/specs/latest/ |
michael@0 | 14 | // |
michael@0 | 15 | // This IDL depends on the typed array specification defined at: |
michael@0 | 16 | // https://www.khronos.org/registry/typedarray/specs/latest/typedarrays.idl |
michael@0 | 17 | |
michael@0 | 18 | typedef unsigned long GLenum; |
michael@0 | 19 | typedef boolean GLboolean; |
michael@0 | 20 | typedef unsigned long GLbitfield; |
michael@0 | 21 | typedef byte GLbyte; /* 'byte' should be a signed 8 bit type. */ |
michael@0 | 22 | typedef short GLshort; |
michael@0 | 23 | typedef long GLint; |
michael@0 | 24 | typedef long GLsizei; |
michael@0 | 25 | typedef long long GLintptr; |
michael@0 | 26 | typedef long long GLsizeiptr; |
michael@0 | 27 | // Ideally the typedef below would use 'unsigned byte', but that doesn't currently exist in Web IDL. |
michael@0 | 28 | typedef octet GLubyte; /* 'octet' should be an unsigned 8 bit type. */ |
michael@0 | 29 | typedef unsigned short GLushort; |
michael@0 | 30 | typedef unsigned long GLuint; |
michael@0 | 31 | typedef unrestricted float GLfloat; |
michael@0 | 32 | typedef unrestricted float GLclampf; |
michael@0 | 33 | |
michael@0 | 34 | dictionary WebGLContextAttributes { |
michael@0 | 35 | // boolean alpha = true; |
michael@0 | 36 | // We deviate from the spec here. |
michael@0 | 37 | // If alpha isn't specified, we rely on a pref ("webgl.default-no-alpha") |
michael@0 | 38 | boolean alpha; |
michael@0 | 39 | boolean depth = true; |
michael@0 | 40 | boolean stencil = false; |
michael@0 | 41 | boolean antialias = true; |
michael@0 | 42 | boolean premultipliedAlpha = true; |
michael@0 | 43 | boolean preserveDrawingBuffer = false; |
michael@0 | 44 | }; |
michael@0 | 45 | |
michael@0 | 46 | interface WebGLBuffer { |
michael@0 | 47 | }; |
michael@0 | 48 | |
michael@0 | 49 | interface WebGLFramebuffer { |
michael@0 | 50 | }; |
michael@0 | 51 | |
michael@0 | 52 | interface WebGLProgram { |
michael@0 | 53 | }; |
michael@0 | 54 | |
michael@0 | 55 | interface WebGLRenderbuffer { |
michael@0 | 56 | }; |
michael@0 | 57 | |
michael@0 | 58 | interface WebGLShader { |
michael@0 | 59 | }; |
michael@0 | 60 | |
michael@0 | 61 | interface WebGLTexture { |
michael@0 | 62 | }; |
michael@0 | 63 | |
michael@0 | 64 | interface WebGLUniformLocation { |
michael@0 | 65 | }; |
michael@0 | 66 | |
michael@0 | 67 | interface WebGLVertexArray { |
michael@0 | 68 | }; |
michael@0 | 69 | |
michael@0 | 70 | interface WebGLActiveInfo { |
michael@0 | 71 | readonly attribute GLint size; |
michael@0 | 72 | readonly attribute GLenum type; |
michael@0 | 73 | readonly attribute DOMString name; |
michael@0 | 74 | }; |
michael@0 | 75 | |
michael@0 | 76 | interface WebGLShaderPrecisionFormat { |
michael@0 | 77 | readonly attribute GLint rangeMin; |
michael@0 | 78 | readonly attribute GLint rangeMax; |
michael@0 | 79 | readonly attribute GLint precision; |
michael@0 | 80 | }; |
michael@0 | 81 | |
michael@0 | 82 | interface WebGLRenderingContext { |
michael@0 | 83 | |
michael@0 | 84 | /* ClearBufferMask */ |
michael@0 | 85 | const GLenum DEPTH_BUFFER_BIT = 0x00000100; |
michael@0 | 86 | const GLenum STENCIL_BUFFER_BIT = 0x00000400; |
michael@0 | 87 | const GLenum COLOR_BUFFER_BIT = 0x00004000; |
michael@0 | 88 | |
michael@0 | 89 | /* BeginMode */ |
michael@0 | 90 | const GLenum POINTS = 0x0000; |
michael@0 | 91 | const GLenum LINES = 0x0001; |
michael@0 | 92 | const GLenum LINE_LOOP = 0x0002; |
michael@0 | 93 | const GLenum LINE_STRIP = 0x0003; |
michael@0 | 94 | const GLenum TRIANGLES = 0x0004; |
michael@0 | 95 | const GLenum TRIANGLE_STRIP = 0x0005; |
michael@0 | 96 | const GLenum TRIANGLE_FAN = 0x0006; |
michael@0 | 97 | |
michael@0 | 98 | /* AlphaFunction (not supported in ES20) */ |
michael@0 | 99 | /* NEVER */ |
michael@0 | 100 | /* LESS */ |
michael@0 | 101 | /* EQUAL */ |
michael@0 | 102 | /* LEQUAL */ |
michael@0 | 103 | /* GREATER */ |
michael@0 | 104 | /* NOTEQUAL */ |
michael@0 | 105 | /* GEQUAL */ |
michael@0 | 106 | /* ALWAYS */ |
michael@0 | 107 | |
michael@0 | 108 | /* BlendingFactorDest */ |
michael@0 | 109 | const GLenum ZERO = 0; |
michael@0 | 110 | const GLenum ONE = 1; |
michael@0 | 111 | const GLenum SRC_COLOR = 0x0300; |
michael@0 | 112 | const GLenum ONE_MINUS_SRC_COLOR = 0x0301; |
michael@0 | 113 | const GLenum SRC_ALPHA = 0x0302; |
michael@0 | 114 | const GLenum ONE_MINUS_SRC_ALPHA = 0x0303; |
michael@0 | 115 | const GLenum DST_ALPHA = 0x0304; |
michael@0 | 116 | const GLenum ONE_MINUS_DST_ALPHA = 0x0305; |
michael@0 | 117 | |
michael@0 | 118 | /* BlendingFactorSrc */ |
michael@0 | 119 | /* ZERO */ |
michael@0 | 120 | /* ONE */ |
michael@0 | 121 | const GLenum DST_COLOR = 0x0306; |
michael@0 | 122 | const GLenum ONE_MINUS_DST_COLOR = 0x0307; |
michael@0 | 123 | const GLenum SRC_ALPHA_SATURATE = 0x0308; |
michael@0 | 124 | /* SRC_ALPHA */ |
michael@0 | 125 | /* ONE_MINUS_SRC_ALPHA */ |
michael@0 | 126 | /* DST_ALPHA */ |
michael@0 | 127 | /* ONE_MINUS_DST_ALPHA */ |
michael@0 | 128 | |
michael@0 | 129 | /* BlendEquationSeparate */ |
michael@0 | 130 | const GLenum FUNC_ADD = 0x8006; |
michael@0 | 131 | const GLenum BLEND_EQUATION = 0x8009; |
michael@0 | 132 | const GLenum BLEND_EQUATION_RGB = 0x8009; /* same as BLEND_EQUATION */ |
michael@0 | 133 | const GLenum BLEND_EQUATION_ALPHA = 0x883D; |
michael@0 | 134 | |
michael@0 | 135 | /* BlendSubtract */ |
michael@0 | 136 | const GLenum FUNC_SUBTRACT = 0x800A; |
michael@0 | 137 | const GLenum FUNC_REVERSE_SUBTRACT = 0x800B; |
michael@0 | 138 | |
michael@0 | 139 | /* Separate Blend Functions */ |
michael@0 | 140 | const GLenum BLEND_DST_RGB = 0x80C8; |
michael@0 | 141 | const GLenum BLEND_SRC_RGB = 0x80C9; |
michael@0 | 142 | const GLenum BLEND_DST_ALPHA = 0x80CA; |
michael@0 | 143 | const GLenum BLEND_SRC_ALPHA = 0x80CB; |
michael@0 | 144 | const GLenum CONSTANT_COLOR = 0x8001; |
michael@0 | 145 | const GLenum ONE_MINUS_CONSTANT_COLOR = 0x8002; |
michael@0 | 146 | const GLenum CONSTANT_ALPHA = 0x8003; |
michael@0 | 147 | const GLenum ONE_MINUS_CONSTANT_ALPHA = 0x8004; |
michael@0 | 148 | const GLenum BLEND_COLOR = 0x8005; |
michael@0 | 149 | |
michael@0 | 150 | /* Buffer Objects */ |
michael@0 | 151 | const GLenum ARRAY_BUFFER = 0x8892; |
michael@0 | 152 | const GLenum ELEMENT_ARRAY_BUFFER = 0x8893; |
michael@0 | 153 | const GLenum ARRAY_BUFFER_BINDING = 0x8894; |
michael@0 | 154 | const GLenum ELEMENT_ARRAY_BUFFER_BINDING = 0x8895; |
michael@0 | 155 | |
michael@0 | 156 | const GLenum STREAM_DRAW = 0x88E0; |
michael@0 | 157 | const GLenum STATIC_DRAW = 0x88E4; |
michael@0 | 158 | const GLenum DYNAMIC_DRAW = 0x88E8; |
michael@0 | 159 | |
michael@0 | 160 | const GLenum BUFFER_SIZE = 0x8764; |
michael@0 | 161 | const GLenum BUFFER_USAGE = 0x8765; |
michael@0 | 162 | |
michael@0 | 163 | const GLenum CURRENT_VERTEX_ATTRIB = 0x8626; |
michael@0 | 164 | |
michael@0 | 165 | /* CullFaceMode */ |
michael@0 | 166 | const GLenum FRONT = 0x0404; |
michael@0 | 167 | const GLenum BACK = 0x0405; |
michael@0 | 168 | const GLenum FRONT_AND_BACK = 0x0408; |
michael@0 | 169 | |
michael@0 | 170 | /* DepthFunction */ |
michael@0 | 171 | /* NEVER */ |
michael@0 | 172 | /* LESS */ |
michael@0 | 173 | /* EQUAL */ |
michael@0 | 174 | /* LEQUAL */ |
michael@0 | 175 | /* GREATER */ |
michael@0 | 176 | /* NOTEQUAL */ |
michael@0 | 177 | /* GEQUAL */ |
michael@0 | 178 | /* ALWAYS */ |
michael@0 | 179 | |
michael@0 | 180 | /* EnableCap */ |
michael@0 | 181 | /* TEXTURE_2D */ |
michael@0 | 182 | const GLenum CULL_FACE = 0x0B44; |
michael@0 | 183 | const GLenum BLEND = 0x0BE2; |
michael@0 | 184 | const GLenum DITHER = 0x0BD0; |
michael@0 | 185 | const GLenum STENCIL_TEST = 0x0B90; |
michael@0 | 186 | const GLenum DEPTH_TEST = 0x0B71; |
michael@0 | 187 | const GLenum SCISSOR_TEST = 0x0C11; |
michael@0 | 188 | const GLenum POLYGON_OFFSET_FILL = 0x8037; |
michael@0 | 189 | const GLenum SAMPLE_ALPHA_TO_COVERAGE = 0x809E; |
michael@0 | 190 | const GLenum SAMPLE_COVERAGE = 0x80A0; |
michael@0 | 191 | |
michael@0 | 192 | /* ErrorCode */ |
michael@0 | 193 | const GLenum NO_ERROR = 0; |
michael@0 | 194 | const GLenum INVALID_ENUM = 0x0500; |
michael@0 | 195 | const GLenum INVALID_VALUE = 0x0501; |
michael@0 | 196 | const GLenum INVALID_OPERATION = 0x0502; |
michael@0 | 197 | const GLenum OUT_OF_MEMORY = 0x0505; |
michael@0 | 198 | |
michael@0 | 199 | /* FrontFaceDirection */ |
michael@0 | 200 | const GLenum CW = 0x0900; |
michael@0 | 201 | const GLenum CCW = 0x0901; |
michael@0 | 202 | |
michael@0 | 203 | /* GetPName */ |
michael@0 | 204 | const GLenum LINE_WIDTH = 0x0B21; |
michael@0 | 205 | const GLenum ALIASED_POINT_SIZE_RANGE = 0x846D; |
michael@0 | 206 | const GLenum ALIASED_LINE_WIDTH_RANGE = 0x846E; |
michael@0 | 207 | const GLenum CULL_FACE_MODE = 0x0B45; |
michael@0 | 208 | const GLenum FRONT_FACE = 0x0B46; |
michael@0 | 209 | const GLenum DEPTH_RANGE = 0x0B70; |
michael@0 | 210 | const GLenum DEPTH_WRITEMASK = 0x0B72; |
michael@0 | 211 | const GLenum DEPTH_CLEAR_VALUE = 0x0B73; |
michael@0 | 212 | const GLenum DEPTH_FUNC = 0x0B74; |
michael@0 | 213 | const GLenum STENCIL_CLEAR_VALUE = 0x0B91; |
michael@0 | 214 | const GLenum STENCIL_FUNC = 0x0B92; |
michael@0 | 215 | const GLenum STENCIL_FAIL = 0x0B94; |
michael@0 | 216 | const GLenum STENCIL_PASS_DEPTH_FAIL = 0x0B95; |
michael@0 | 217 | const GLenum STENCIL_PASS_DEPTH_PASS = 0x0B96; |
michael@0 | 218 | const GLenum STENCIL_REF = 0x0B97; |
michael@0 | 219 | const GLenum STENCIL_VALUE_MASK = 0x0B93; |
michael@0 | 220 | const GLenum STENCIL_WRITEMASK = 0x0B98; |
michael@0 | 221 | const GLenum STENCIL_BACK_FUNC = 0x8800; |
michael@0 | 222 | const GLenum STENCIL_BACK_FAIL = 0x8801; |
michael@0 | 223 | const GLenum STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802; |
michael@0 | 224 | const GLenum STENCIL_BACK_PASS_DEPTH_PASS = 0x8803; |
michael@0 | 225 | const GLenum STENCIL_BACK_REF = 0x8CA3; |
michael@0 | 226 | const GLenum STENCIL_BACK_VALUE_MASK = 0x8CA4; |
michael@0 | 227 | const GLenum STENCIL_BACK_WRITEMASK = 0x8CA5; |
michael@0 | 228 | const GLenum VIEWPORT = 0x0BA2; |
michael@0 | 229 | const GLenum SCISSOR_BOX = 0x0C10; |
michael@0 | 230 | /* SCISSOR_TEST */ |
michael@0 | 231 | const GLenum COLOR_CLEAR_VALUE = 0x0C22; |
michael@0 | 232 | const GLenum COLOR_WRITEMASK = 0x0C23; |
michael@0 | 233 | const GLenum UNPACK_ALIGNMENT = 0x0CF5; |
michael@0 | 234 | const GLenum PACK_ALIGNMENT = 0x0D05; |
michael@0 | 235 | const GLenum MAX_TEXTURE_SIZE = 0x0D33; |
michael@0 | 236 | const GLenum MAX_VIEWPORT_DIMS = 0x0D3A; |
michael@0 | 237 | const GLenum SUBPIXEL_BITS = 0x0D50; |
michael@0 | 238 | const GLenum RED_BITS = 0x0D52; |
michael@0 | 239 | const GLenum GREEN_BITS = 0x0D53; |
michael@0 | 240 | const GLenum BLUE_BITS = 0x0D54; |
michael@0 | 241 | const GLenum ALPHA_BITS = 0x0D55; |
michael@0 | 242 | const GLenum DEPTH_BITS = 0x0D56; |
michael@0 | 243 | const GLenum STENCIL_BITS = 0x0D57; |
michael@0 | 244 | const GLenum POLYGON_OFFSET_UNITS = 0x2A00; |
michael@0 | 245 | /* POLYGON_OFFSET_FILL */ |
michael@0 | 246 | const GLenum POLYGON_OFFSET_FACTOR = 0x8038; |
michael@0 | 247 | const GLenum TEXTURE_BINDING_2D = 0x8069; |
michael@0 | 248 | const GLenum SAMPLE_BUFFERS = 0x80A8; |
michael@0 | 249 | const GLenum SAMPLES = 0x80A9; |
michael@0 | 250 | const GLenum SAMPLE_COVERAGE_VALUE = 0x80AA; |
michael@0 | 251 | const GLenum SAMPLE_COVERAGE_INVERT = 0x80AB; |
michael@0 | 252 | |
michael@0 | 253 | /* GetTextureParameter */ |
michael@0 | 254 | /* TEXTURE_MAG_FILTER */ |
michael@0 | 255 | /* TEXTURE_MIN_FILTER */ |
michael@0 | 256 | /* TEXTURE_WRAP_S */ |
michael@0 | 257 | /* TEXTURE_WRAP_T */ |
michael@0 | 258 | |
michael@0 | 259 | const GLenum COMPRESSED_TEXTURE_FORMATS = 0x86A3; |
michael@0 | 260 | |
michael@0 | 261 | /* HintMode */ |
michael@0 | 262 | const GLenum DONT_CARE = 0x1100; |
michael@0 | 263 | const GLenum FASTEST = 0x1101; |
michael@0 | 264 | const GLenum NICEST = 0x1102; |
michael@0 | 265 | |
michael@0 | 266 | /* HintTarget */ |
michael@0 | 267 | const GLenum GENERATE_MIPMAP_HINT = 0x8192; |
michael@0 | 268 | |
michael@0 | 269 | /* DataType */ |
michael@0 | 270 | const GLenum BYTE = 0x1400; |
michael@0 | 271 | const GLenum UNSIGNED_BYTE = 0x1401; |
michael@0 | 272 | const GLenum SHORT = 0x1402; |
michael@0 | 273 | const GLenum UNSIGNED_SHORT = 0x1403; |
michael@0 | 274 | const GLenum INT = 0x1404; |
michael@0 | 275 | const GLenum UNSIGNED_INT = 0x1405; |
michael@0 | 276 | const GLenum FLOAT = 0x1406; |
michael@0 | 277 | |
michael@0 | 278 | /* PixelFormat */ |
michael@0 | 279 | const GLenum DEPTH_COMPONENT = 0x1902; |
michael@0 | 280 | const GLenum ALPHA = 0x1906; |
michael@0 | 281 | const GLenum RGB = 0x1907; |
michael@0 | 282 | const GLenum RGBA = 0x1908; |
michael@0 | 283 | const GLenum LUMINANCE = 0x1909; |
michael@0 | 284 | const GLenum LUMINANCE_ALPHA = 0x190A; |
michael@0 | 285 | |
michael@0 | 286 | /* PixelType */ |
michael@0 | 287 | /* UNSIGNED_BYTE */ |
michael@0 | 288 | const GLenum UNSIGNED_SHORT_4_4_4_4 = 0x8033; |
michael@0 | 289 | const GLenum UNSIGNED_SHORT_5_5_5_1 = 0x8034; |
michael@0 | 290 | const GLenum UNSIGNED_SHORT_5_6_5 = 0x8363; |
michael@0 | 291 | |
michael@0 | 292 | /* Shaders */ |
michael@0 | 293 | const GLenum FRAGMENT_SHADER = 0x8B30; |
michael@0 | 294 | const GLenum VERTEX_SHADER = 0x8B31; |
michael@0 | 295 | const GLenum MAX_VERTEX_ATTRIBS = 0x8869; |
michael@0 | 296 | const GLenum MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB; |
michael@0 | 297 | const GLenum MAX_VARYING_VECTORS = 0x8DFC; |
michael@0 | 298 | const GLenum MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D; |
michael@0 | 299 | const GLenum MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C; |
michael@0 | 300 | const GLenum MAX_TEXTURE_IMAGE_UNITS = 0x8872; |
michael@0 | 301 | const GLenum MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD; |
michael@0 | 302 | const GLenum SHADER_TYPE = 0x8B4F; |
michael@0 | 303 | const GLenum DELETE_STATUS = 0x8B80; |
michael@0 | 304 | const GLenum LINK_STATUS = 0x8B82; |
michael@0 | 305 | const GLenum VALIDATE_STATUS = 0x8B83; |
michael@0 | 306 | const GLenum ATTACHED_SHADERS = 0x8B85; |
michael@0 | 307 | const GLenum ACTIVE_UNIFORMS = 0x8B86; |
michael@0 | 308 | const GLenum ACTIVE_ATTRIBUTES = 0x8B89; |
michael@0 | 309 | const GLenum SHADING_LANGUAGE_VERSION = 0x8B8C; |
michael@0 | 310 | const GLenum CURRENT_PROGRAM = 0x8B8D; |
michael@0 | 311 | |
michael@0 | 312 | /* StencilFunction */ |
michael@0 | 313 | const GLenum NEVER = 0x0200; |
michael@0 | 314 | const GLenum LESS = 0x0201; |
michael@0 | 315 | const GLenum EQUAL = 0x0202; |
michael@0 | 316 | const GLenum LEQUAL = 0x0203; |
michael@0 | 317 | const GLenum GREATER = 0x0204; |
michael@0 | 318 | const GLenum NOTEQUAL = 0x0205; |
michael@0 | 319 | const GLenum GEQUAL = 0x0206; |
michael@0 | 320 | const GLenum ALWAYS = 0x0207; |
michael@0 | 321 | |
michael@0 | 322 | /* StencilOp */ |
michael@0 | 323 | /* ZERO */ |
michael@0 | 324 | const GLenum KEEP = 0x1E00; |
michael@0 | 325 | const GLenum REPLACE = 0x1E01; |
michael@0 | 326 | const GLenum INCR = 0x1E02; |
michael@0 | 327 | const GLenum DECR = 0x1E03; |
michael@0 | 328 | const GLenum INVERT = 0x150A; |
michael@0 | 329 | const GLenum INCR_WRAP = 0x8507; |
michael@0 | 330 | const GLenum DECR_WRAP = 0x8508; |
michael@0 | 331 | |
michael@0 | 332 | /* StringName */ |
michael@0 | 333 | const GLenum VENDOR = 0x1F00; |
michael@0 | 334 | const GLenum RENDERER = 0x1F01; |
michael@0 | 335 | const GLenum VERSION = 0x1F02; |
michael@0 | 336 | |
michael@0 | 337 | /* TextureMagFilter */ |
michael@0 | 338 | const GLenum NEAREST = 0x2600; |
michael@0 | 339 | const GLenum LINEAR = 0x2601; |
michael@0 | 340 | |
michael@0 | 341 | /* TextureMinFilter */ |
michael@0 | 342 | /* NEAREST */ |
michael@0 | 343 | /* LINEAR */ |
michael@0 | 344 | const GLenum NEAREST_MIPMAP_NEAREST = 0x2700; |
michael@0 | 345 | const GLenum LINEAR_MIPMAP_NEAREST = 0x2701; |
michael@0 | 346 | const GLenum NEAREST_MIPMAP_LINEAR = 0x2702; |
michael@0 | 347 | const GLenum LINEAR_MIPMAP_LINEAR = 0x2703; |
michael@0 | 348 | |
michael@0 | 349 | /* TextureParameterName */ |
michael@0 | 350 | const GLenum TEXTURE_MAG_FILTER = 0x2800; |
michael@0 | 351 | const GLenum TEXTURE_MIN_FILTER = 0x2801; |
michael@0 | 352 | const GLenum TEXTURE_WRAP_S = 0x2802; |
michael@0 | 353 | const GLenum TEXTURE_WRAP_T = 0x2803; |
michael@0 | 354 | |
michael@0 | 355 | /* TextureTarget */ |
michael@0 | 356 | const GLenum TEXTURE_2D = 0x0DE1; |
michael@0 | 357 | const GLenum TEXTURE = 0x1702; |
michael@0 | 358 | |
michael@0 | 359 | const GLenum TEXTURE_CUBE_MAP = 0x8513; |
michael@0 | 360 | const GLenum TEXTURE_BINDING_CUBE_MAP = 0x8514; |
michael@0 | 361 | const GLenum TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515; |
michael@0 | 362 | const GLenum TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516; |
michael@0 | 363 | const GLenum TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517; |
michael@0 | 364 | const GLenum TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518; |
michael@0 | 365 | const GLenum TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519; |
michael@0 | 366 | const GLenum TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A; |
michael@0 | 367 | const GLenum MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C; |
michael@0 | 368 | |
michael@0 | 369 | /* TextureUnit */ |
michael@0 | 370 | const GLenum TEXTURE0 = 0x84C0; |
michael@0 | 371 | const GLenum TEXTURE1 = 0x84C1; |
michael@0 | 372 | const GLenum TEXTURE2 = 0x84C2; |
michael@0 | 373 | const GLenum TEXTURE3 = 0x84C3; |
michael@0 | 374 | const GLenum TEXTURE4 = 0x84C4; |
michael@0 | 375 | const GLenum TEXTURE5 = 0x84C5; |
michael@0 | 376 | const GLenum TEXTURE6 = 0x84C6; |
michael@0 | 377 | const GLenum TEXTURE7 = 0x84C7; |
michael@0 | 378 | const GLenum TEXTURE8 = 0x84C8; |
michael@0 | 379 | const GLenum TEXTURE9 = 0x84C9; |
michael@0 | 380 | const GLenum TEXTURE10 = 0x84CA; |
michael@0 | 381 | const GLenum TEXTURE11 = 0x84CB; |
michael@0 | 382 | const GLenum TEXTURE12 = 0x84CC; |
michael@0 | 383 | const GLenum TEXTURE13 = 0x84CD; |
michael@0 | 384 | const GLenum TEXTURE14 = 0x84CE; |
michael@0 | 385 | const GLenum TEXTURE15 = 0x84CF; |
michael@0 | 386 | const GLenum TEXTURE16 = 0x84D0; |
michael@0 | 387 | const GLenum TEXTURE17 = 0x84D1; |
michael@0 | 388 | const GLenum TEXTURE18 = 0x84D2; |
michael@0 | 389 | const GLenum TEXTURE19 = 0x84D3; |
michael@0 | 390 | const GLenum TEXTURE20 = 0x84D4; |
michael@0 | 391 | const GLenum TEXTURE21 = 0x84D5; |
michael@0 | 392 | const GLenum TEXTURE22 = 0x84D6; |
michael@0 | 393 | const GLenum TEXTURE23 = 0x84D7; |
michael@0 | 394 | const GLenum TEXTURE24 = 0x84D8; |
michael@0 | 395 | const GLenum TEXTURE25 = 0x84D9; |
michael@0 | 396 | const GLenum TEXTURE26 = 0x84DA; |
michael@0 | 397 | const GLenum TEXTURE27 = 0x84DB; |
michael@0 | 398 | const GLenum TEXTURE28 = 0x84DC; |
michael@0 | 399 | const GLenum TEXTURE29 = 0x84DD; |
michael@0 | 400 | const GLenum TEXTURE30 = 0x84DE; |
michael@0 | 401 | const GLenum TEXTURE31 = 0x84DF; |
michael@0 | 402 | const GLenum ACTIVE_TEXTURE = 0x84E0; |
michael@0 | 403 | |
michael@0 | 404 | /* TextureWrapMode */ |
michael@0 | 405 | const GLenum REPEAT = 0x2901; |
michael@0 | 406 | const GLenum CLAMP_TO_EDGE = 0x812F; |
michael@0 | 407 | const GLenum MIRRORED_REPEAT = 0x8370; |
michael@0 | 408 | |
michael@0 | 409 | /* Uniform Types */ |
michael@0 | 410 | const GLenum FLOAT_VEC2 = 0x8B50; |
michael@0 | 411 | const GLenum FLOAT_VEC3 = 0x8B51; |
michael@0 | 412 | const GLenum FLOAT_VEC4 = 0x8B52; |
michael@0 | 413 | const GLenum INT_VEC2 = 0x8B53; |
michael@0 | 414 | const GLenum INT_VEC3 = 0x8B54; |
michael@0 | 415 | const GLenum INT_VEC4 = 0x8B55; |
michael@0 | 416 | const GLenum BOOL = 0x8B56; |
michael@0 | 417 | const GLenum BOOL_VEC2 = 0x8B57; |
michael@0 | 418 | const GLenum BOOL_VEC3 = 0x8B58; |
michael@0 | 419 | const GLenum BOOL_VEC4 = 0x8B59; |
michael@0 | 420 | const GLenum FLOAT_MAT2 = 0x8B5A; |
michael@0 | 421 | const GLenum FLOAT_MAT3 = 0x8B5B; |
michael@0 | 422 | const GLenum FLOAT_MAT4 = 0x8B5C; |
michael@0 | 423 | const GLenum SAMPLER_2D = 0x8B5E; |
michael@0 | 424 | const GLenum SAMPLER_CUBE = 0x8B60; |
michael@0 | 425 | |
michael@0 | 426 | /* Vertex Arrays */ |
michael@0 | 427 | const GLenum VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622; |
michael@0 | 428 | const GLenum VERTEX_ATTRIB_ARRAY_SIZE = 0x8623; |
michael@0 | 429 | const GLenum VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624; |
michael@0 | 430 | const GLenum VERTEX_ATTRIB_ARRAY_TYPE = 0x8625; |
michael@0 | 431 | const GLenum VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A; |
michael@0 | 432 | const GLenum VERTEX_ATTRIB_ARRAY_POINTER = 0x8645; |
michael@0 | 433 | const GLenum VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F; |
michael@0 | 434 | |
michael@0 | 435 | /* Shader Source */ |
michael@0 | 436 | const GLenum COMPILE_STATUS = 0x8B81; |
michael@0 | 437 | |
michael@0 | 438 | /* Shader Precision-Specified Types */ |
michael@0 | 439 | const GLenum LOW_FLOAT = 0x8DF0; |
michael@0 | 440 | const GLenum MEDIUM_FLOAT = 0x8DF1; |
michael@0 | 441 | const GLenum HIGH_FLOAT = 0x8DF2; |
michael@0 | 442 | const GLenum LOW_INT = 0x8DF3; |
michael@0 | 443 | const GLenum MEDIUM_INT = 0x8DF4; |
michael@0 | 444 | const GLenum HIGH_INT = 0x8DF5; |
michael@0 | 445 | |
michael@0 | 446 | /* Framebuffer Object. */ |
michael@0 | 447 | const GLenum FRAMEBUFFER = 0x8D40; |
michael@0 | 448 | const GLenum RENDERBUFFER = 0x8D41; |
michael@0 | 449 | |
michael@0 | 450 | const GLenum RGBA4 = 0x8056; |
michael@0 | 451 | const GLenum RGB5_A1 = 0x8057; |
michael@0 | 452 | const GLenum RGB565 = 0x8D62; |
michael@0 | 453 | const GLenum DEPTH_COMPONENT16 = 0x81A5; |
michael@0 | 454 | const GLenum STENCIL_INDEX = 0x1901; |
michael@0 | 455 | const GLenum STENCIL_INDEX8 = 0x8D48; |
michael@0 | 456 | const GLenum DEPTH_STENCIL = 0x84F9; |
michael@0 | 457 | |
michael@0 | 458 | const GLenum RENDERBUFFER_WIDTH = 0x8D42; |
michael@0 | 459 | const GLenum RENDERBUFFER_HEIGHT = 0x8D43; |
michael@0 | 460 | const GLenum RENDERBUFFER_INTERNAL_FORMAT = 0x8D44; |
michael@0 | 461 | const GLenum RENDERBUFFER_RED_SIZE = 0x8D50; |
michael@0 | 462 | const GLenum RENDERBUFFER_GREEN_SIZE = 0x8D51; |
michael@0 | 463 | const GLenum RENDERBUFFER_BLUE_SIZE = 0x8D52; |
michael@0 | 464 | const GLenum RENDERBUFFER_ALPHA_SIZE = 0x8D53; |
michael@0 | 465 | const GLenum RENDERBUFFER_DEPTH_SIZE = 0x8D54; |
michael@0 | 466 | const GLenum RENDERBUFFER_STENCIL_SIZE = 0x8D55; |
michael@0 | 467 | |
michael@0 | 468 | const GLenum FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0; |
michael@0 | 469 | const GLenum FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1; |
michael@0 | 470 | const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2; |
michael@0 | 471 | const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3; |
michael@0 | 472 | |
michael@0 | 473 | const GLenum COLOR_ATTACHMENT0 = 0x8CE0; |
michael@0 | 474 | const GLenum DEPTH_ATTACHMENT = 0x8D00; |
michael@0 | 475 | const GLenum STENCIL_ATTACHMENT = 0x8D20; |
michael@0 | 476 | const GLenum DEPTH_STENCIL_ATTACHMENT = 0x821A; |
michael@0 | 477 | |
michael@0 | 478 | const GLenum NONE = 0; |
michael@0 | 479 | |
michael@0 | 480 | const GLenum FRAMEBUFFER_COMPLETE = 0x8CD5; |
michael@0 | 481 | const GLenum FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6; |
michael@0 | 482 | const GLenum FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7; |
michael@0 | 483 | const GLenum FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9; |
michael@0 | 484 | const GLenum FRAMEBUFFER_UNSUPPORTED = 0x8CDD; |
michael@0 | 485 | |
michael@0 | 486 | const GLenum FRAMEBUFFER_BINDING = 0x8CA6; |
michael@0 | 487 | const GLenum RENDERBUFFER_BINDING = 0x8CA7; |
michael@0 | 488 | const GLenum MAX_RENDERBUFFER_SIZE = 0x84E8; |
michael@0 | 489 | |
michael@0 | 490 | const GLenum INVALID_FRAMEBUFFER_OPERATION = 0x0506; |
michael@0 | 491 | |
michael@0 | 492 | /* WebGL-specific enums */ |
michael@0 | 493 | const GLenum UNPACK_FLIP_Y_WEBGL = 0x9240; |
michael@0 | 494 | const GLenum UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241; |
michael@0 | 495 | const GLenum CONTEXT_LOST_WEBGL = 0x9242; |
michael@0 | 496 | const GLenum UNPACK_COLORSPACE_CONVERSION_WEBGL = 0x9243; |
michael@0 | 497 | const GLenum BROWSER_DEFAULT_WEBGL = 0x9244; |
michael@0 | 498 | |
michael@0 | 499 | // The canvas might actually be null in some cases, apparently. |
michael@0 | 500 | readonly attribute HTMLCanvasElement? canvas; |
michael@0 | 501 | readonly attribute GLsizei drawingBufferWidth; |
michael@0 | 502 | readonly attribute GLsizei drawingBufferHeight; |
michael@0 | 503 | |
michael@0 | 504 | [WebGLHandlesContextLoss] WebGLContextAttributes? getContextAttributes(); |
michael@0 | 505 | [WebGLHandlesContextLoss] boolean isContextLost(); |
michael@0 | 506 | |
michael@0 | 507 | sequence<DOMString>? getSupportedExtensions(); |
michael@0 | 508 | |
michael@0 | 509 | [Throws] |
michael@0 | 510 | object? getExtension(DOMString name); |
michael@0 | 511 | |
michael@0 | 512 | void activeTexture(GLenum texture); |
michael@0 | 513 | void attachShader(WebGLProgram? program, WebGLShader? shader); |
michael@0 | 514 | void bindAttribLocation(WebGLProgram? program, GLuint index, DOMString name); |
michael@0 | 515 | void bindBuffer(GLenum target, WebGLBuffer? buffer); |
michael@0 | 516 | void bindFramebuffer(GLenum target, WebGLFramebuffer? framebuffer); |
michael@0 | 517 | void bindRenderbuffer(GLenum target, WebGLRenderbuffer? renderbuffer); |
michael@0 | 518 | void bindTexture(GLenum target, WebGLTexture? texture); |
michael@0 | 519 | void blendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); |
michael@0 | 520 | void blendEquation(GLenum mode); |
michael@0 | 521 | void blendEquationSeparate(GLenum modeRGB, GLenum modeAlpha); |
michael@0 | 522 | void blendFunc(GLenum sfactor, GLenum dfactor); |
michael@0 | 523 | void blendFuncSeparate(GLenum srcRGB, GLenum dstRGB, |
michael@0 | 524 | GLenum srcAlpha, GLenum dstAlpha); |
michael@0 | 525 | |
michael@0 | 526 | void bufferData(GLenum target, GLsizeiptr size, GLenum usage); |
michael@0 | 527 | void bufferData(GLenum target, ArrayBufferView data, GLenum usage); |
michael@0 | 528 | void bufferData(GLenum target, ArrayBuffer? data, GLenum usage); |
michael@0 | 529 | void bufferSubData(GLenum target, GLintptr offset, ArrayBufferView data); |
michael@0 | 530 | void bufferSubData(GLenum target, GLintptr offset, ArrayBuffer? data); |
michael@0 | 531 | |
michael@0 | 532 | [WebGLHandlesContextLoss] GLenum checkFramebufferStatus(GLenum target); |
michael@0 | 533 | void clear(GLbitfield mask); |
michael@0 | 534 | void clearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); |
michael@0 | 535 | void clearDepth(GLclampf depth); |
michael@0 | 536 | void clearStencil(GLint s); |
michael@0 | 537 | void colorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); |
michael@0 | 538 | void compileShader(WebGLShader? shader); |
michael@0 | 539 | |
michael@0 | 540 | void compressedTexImage2D(GLenum target, GLint level, GLenum internalformat, |
michael@0 | 541 | GLsizei width, GLsizei height, GLint border, |
michael@0 | 542 | ArrayBufferView data); |
michael@0 | 543 | void compressedTexSubImage2D(GLenum target, GLint level, |
michael@0 | 544 | GLint xoffset, GLint yoffset, |
michael@0 | 545 | GLsizei width, GLsizei height, GLenum format, |
michael@0 | 546 | ArrayBufferView data); |
michael@0 | 547 | |
michael@0 | 548 | void copyTexImage2D(GLenum target, GLint level, GLenum internalformat, |
michael@0 | 549 | GLint x, GLint y, GLsizei width, GLsizei height, |
michael@0 | 550 | GLint border); |
michael@0 | 551 | void copyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, |
michael@0 | 552 | GLint x, GLint y, GLsizei width, GLsizei height); |
michael@0 | 553 | |
michael@0 | 554 | WebGLBuffer? createBuffer(); |
michael@0 | 555 | WebGLFramebuffer? createFramebuffer(); |
michael@0 | 556 | WebGLProgram? createProgram(); |
michael@0 | 557 | WebGLRenderbuffer? createRenderbuffer(); |
michael@0 | 558 | WebGLShader? createShader(GLenum type); |
michael@0 | 559 | WebGLTexture? createTexture(); |
michael@0 | 560 | |
michael@0 | 561 | void cullFace(GLenum mode); |
michael@0 | 562 | |
michael@0 | 563 | void deleteBuffer(WebGLBuffer? buffer); |
michael@0 | 564 | void deleteFramebuffer(WebGLFramebuffer? framebuffer); |
michael@0 | 565 | void deleteProgram(WebGLProgram? program); |
michael@0 | 566 | void deleteRenderbuffer(WebGLRenderbuffer? renderbuffer); |
michael@0 | 567 | void deleteShader(WebGLShader? shader); |
michael@0 | 568 | void deleteTexture(WebGLTexture? texture); |
michael@0 | 569 | |
michael@0 | 570 | void depthFunc(GLenum func); |
michael@0 | 571 | void depthMask(GLboolean flag); |
michael@0 | 572 | void depthRange(GLclampf zNear, GLclampf zFar); |
michael@0 | 573 | void detachShader(WebGLProgram? program, WebGLShader? shader); |
michael@0 | 574 | void disable(GLenum cap); |
michael@0 | 575 | void disableVertexAttribArray(GLuint index); |
michael@0 | 576 | void drawArrays(GLenum mode, GLint first, GLsizei count); |
michael@0 | 577 | void drawElements(GLenum mode, GLsizei count, GLenum type, GLintptr offset); |
michael@0 | 578 | |
michael@0 | 579 | void enable(GLenum cap); |
michael@0 | 580 | void enableVertexAttribArray(GLuint index); |
michael@0 | 581 | void finish(); |
michael@0 | 582 | void flush(); |
michael@0 | 583 | void framebufferRenderbuffer(GLenum target, GLenum attachment, |
michael@0 | 584 | GLenum renderbuffertarget, |
michael@0 | 585 | WebGLRenderbuffer? renderbuffer); |
michael@0 | 586 | void framebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, |
michael@0 | 587 | WebGLTexture? texture, GLint level); |
michael@0 | 588 | void frontFace(GLenum mode); |
michael@0 | 589 | |
michael@0 | 590 | void generateMipmap(GLenum target); |
michael@0 | 591 | |
michael@0 | 592 | [NewObject] |
michael@0 | 593 | WebGLActiveInfo? getActiveAttrib(WebGLProgram? program, GLuint index); |
michael@0 | 594 | [NewObject] |
michael@0 | 595 | WebGLActiveInfo? getActiveUniform(WebGLProgram? program, GLuint index); |
michael@0 | 596 | |
michael@0 | 597 | sequence<WebGLShader>? getAttachedShaders(WebGLProgram? program); |
michael@0 | 598 | |
michael@0 | 599 | [WebGLHandlesContextLoss] GLint getAttribLocation(WebGLProgram? program, DOMString name); |
michael@0 | 600 | |
michael@0 | 601 | any getBufferParameter(GLenum target, GLenum pname); |
michael@0 | 602 | [Throws] |
michael@0 | 603 | any getParameter(GLenum pname); |
michael@0 | 604 | |
michael@0 | 605 | [WebGLHandlesContextLoss] GLenum getError(); |
michael@0 | 606 | |
michael@0 | 607 | [Throws] |
michael@0 | 608 | any getFramebufferAttachmentParameter(GLenum target, GLenum attachment, |
michael@0 | 609 | GLenum pname); |
michael@0 | 610 | any getProgramParameter(WebGLProgram? program, GLenum pname); |
michael@0 | 611 | DOMString? getProgramInfoLog(WebGLProgram? program); |
michael@0 | 612 | any getRenderbufferParameter(GLenum target, GLenum pname); |
michael@0 | 613 | any getShaderParameter(WebGLShader? shader, GLenum pname); |
michael@0 | 614 | |
michael@0 | 615 | [NewObject] |
michael@0 | 616 | WebGLShaderPrecisionFormat? getShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype); |
michael@0 | 617 | |
michael@0 | 618 | DOMString? getShaderInfoLog(WebGLShader? shader); |
michael@0 | 619 | |
michael@0 | 620 | DOMString? getShaderSource(WebGLShader? shader); |
michael@0 | 621 | |
michael@0 | 622 | any getTexParameter(GLenum target, GLenum pname); |
michael@0 | 623 | |
michael@0 | 624 | any getUniform(WebGLProgram? program, WebGLUniformLocation? location); |
michael@0 | 625 | |
michael@0 | 626 | [NewObject] |
michael@0 | 627 | WebGLUniformLocation? getUniformLocation(WebGLProgram? program, DOMString name); |
michael@0 | 628 | |
michael@0 | 629 | [Throws] |
michael@0 | 630 | any getVertexAttrib(GLuint index, GLenum pname); |
michael@0 | 631 | |
michael@0 | 632 | [WebGLHandlesContextLoss] GLsizeiptr getVertexAttribOffset(GLuint index, GLenum pname); |
michael@0 | 633 | |
michael@0 | 634 | void hint(GLenum target, GLenum mode); |
michael@0 | 635 | [WebGLHandlesContextLoss] GLboolean isBuffer(WebGLBuffer? buffer); |
michael@0 | 636 | [WebGLHandlesContextLoss] GLboolean isEnabled(GLenum cap); |
michael@0 | 637 | [WebGLHandlesContextLoss] GLboolean isFramebuffer(WebGLFramebuffer? framebuffer); |
michael@0 | 638 | [WebGLHandlesContextLoss] GLboolean isProgram(WebGLProgram? program); |
michael@0 | 639 | [WebGLHandlesContextLoss] GLboolean isRenderbuffer(WebGLRenderbuffer? renderbuffer); |
michael@0 | 640 | [WebGLHandlesContextLoss] GLboolean isShader(WebGLShader? shader); |
michael@0 | 641 | [WebGLHandlesContextLoss] GLboolean isTexture(WebGLTexture? texture); |
michael@0 | 642 | void lineWidth(GLfloat width); |
michael@0 | 643 | void linkProgram(WebGLProgram? program); |
michael@0 | 644 | void pixelStorei(GLenum pname, GLint param); |
michael@0 | 645 | void polygonOffset(GLfloat factor, GLfloat units); |
michael@0 | 646 | |
michael@0 | 647 | [Throws] |
michael@0 | 648 | void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, |
michael@0 | 649 | GLenum format, GLenum type, ArrayBufferView? pixels); |
michael@0 | 650 | |
michael@0 | 651 | void renderbufferStorage(GLenum target, GLenum internalformat, |
michael@0 | 652 | GLsizei width, GLsizei height); |
michael@0 | 653 | void sampleCoverage(GLclampf value, GLboolean invert); |
michael@0 | 654 | void scissor(GLint x, GLint y, GLsizei width, GLsizei height); |
michael@0 | 655 | |
michael@0 | 656 | void shaderSource(WebGLShader? shader, DOMString source); |
michael@0 | 657 | |
michael@0 | 658 | void stencilFunc(GLenum func, GLint ref, GLuint mask); |
michael@0 | 659 | void stencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask); |
michael@0 | 660 | void stencilMask(GLuint mask); |
michael@0 | 661 | void stencilMaskSeparate(GLenum face, GLuint mask); |
michael@0 | 662 | void stencilOp(GLenum fail, GLenum zfail, GLenum zpass); |
michael@0 | 663 | void stencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass); |
michael@0 | 664 | |
michael@0 | 665 | |
michael@0 | 666 | [Throws] |
michael@0 | 667 | void texImage2D(GLenum target, GLint level, GLenum internalformat, |
michael@0 | 668 | GLsizei width, GLsizei height, GLint border, GLenum format, |
michael@0 | 669 | GLenum type, ArrayBufferView? pixels); |
michael@0 | 670 | [Throws] |
michael@0 | 671 | void texImage2D(GLenum target, GLint level, GLenum internalformat, |
michael@0 | 672 | GLenum format, GLenum type, ImageData? pixels); |
michael@0 | 673 | [Throws] |
michael@0 | 674 | void texImage2D(GLenum target, GLint level, GLenum internalformat, |
michael@0 | 675 | GLenum format, GLenum type, HTMLImageElement image); // May throw DOMException |
michael@0 | 676 | [Throws] |
michael@0 | 677 | void texImage2D(GLenum target, GLint level, GLenum internalformat, |
michael@0 | 678 | GLenum format, GLenum type, HTMLCanvasElement canvas); // May throw DOMException |
michael@0 | 679 | [Throws] |
michael@0 | 680 | void texImage2D(GLenum target, GLint level, GLenum internalformat, |
michael@0 | 681 | GLenum format, GLenum type, HTMLVideoElement video); // May throw DOMException |
michael@0 | 682 | |
michael@0 | 683 | void texParameterf(GLenum target, GLenum pname, GLfloat param); |
michael@0 | 684 | void texParameteri(GLenum target, GLenum pname, GLint param); |
michael@0 | 685 | |
michael@0 | 686 | [Throws] |
michael@0 | 687 | void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, |
michael@0 | 688 | GLsizei width, GLsizei height, |
michael@0 | 689 | GLenum format, GLenum type, ArrayBufferView? pixels); |
michael@0 | 690 | [Throws] |
michael@0 | 691 | void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, |
michael@0 | 692 | GLenum format, GLenum type, ImageData? pixels); |
michael@0 | 693 | [Throws] |
michael@0 | 694 | void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, |
michael@0 | 695 | GLenum format, GLenum type, HTMLImageElement image); // May throw DOMException |
michael@0 | 696 | [Throws] |
michael@0 | 697 | void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, |
michael@0 | 698 | GLenum format, GLenum type, HTMLCanvasElement canvas); // May throw DOMException |
michael@0 | 699 | [Throws] |
michael@0 | 700 | void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, |
michael@0 | 701 | GLenum format, GLenum type, HTMLVideoElement video); // May throw DOMException |
michael@0 | 702 | |
michael@0 | 703 | void uniform1f(WebGLUniformLocation? location, GLfloat x); |
michael@0 | 704 | void uniform1fv(WebGLUniformLocation? location, Float32Array v); |
michael@0 | 705 | void uniform1fv(WebGLUniformLocation? location, sequence<GLfloat> v); |
michael@0 | 706 | void uniform1i(WebGLUniformLocation? location, GLint x); |
michael@0 | 707 | void uniform1iv(WebGLUniformLocation? location, Int32Array v); |
michael@0 | 708 | void uniform1iv(WebGLUniformLocation? location, sequence<long> v); |
michael@0 | 709 | void uniform2f(WebGLUniformLocation? location, GLfloat x, GLfloat y); |
michael@0 | 710 | void uniform2fv(WebGLUniformLocation? location, Float32Array v); |
michael@0 | 711 | void uniform2fv(WebGLUniformLocation? location, sequence<GLfloat> v); |
michael@0 | 712 | void uniform2i(WebGLUniformLocation? location, GLint x, GLint y); |
michael@0 | 713 | void uniform2iv(WebGLUniformLocation? location, Int32Array v); |
michael@0 | 714 | void uniform2iv(WebGLUniformLocation? location, sequence<long> v); |
michael@0 | 715 | void uniform3f(WebGLUniformLocation? location, GLfloat x, GLfloat y, GLfloat z); |
michael@0 | 716 | void uniform3fv(WebGLUniformLocation? location, Float32Array v); |
michael@0 | 717 | void uniform3fv(WebGLUniformLocation? location, sequence<GLfloat> v); |
michael@0 | 718 | void uniform3i(WebGLUniformLocation? location, GLint x, GLint y, GLint z); |
michael@0 | 719 | void uniform3iv(WebGLUniformLocation? location, Int32Array v); |
michael@0 | 720 | void uniform3iv(WebGLUniformLocation? location, sequence<long> v); |
michael@0 | 721 | void uniform4f(WebGLUniformLocation? location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); |
michael@0 | 722 | void uniform4fv(WebGLUniformLocation? location, Float32Array v); |
michael@0 | 723 | void uniform4fv(WebGLUniformLocation? location, sequence<GLfloat> v); |
michael@0 | 724 | void uniform4i(WebGLUniformLocation? location, GLint x, GLint y, GLint z, GLint w); |
michael@0 | 725 | void uniform4iv(WebGLUniformLocation? location, Int32Array v); |
michael@0 | 726 | void uniform4iv(WebGLUniformLocation? location, sequence<long> v); |
michael@0 | 727 | |
michael@0 | 728 | void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, |
michael@0 | 729 | Float32Array value); |
michael@0 | 730 | void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, |
michael@0 | 731 | sequence<GLfloat> value); |
michael@0 | 732 | void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, |
michael@0 | 733 | Float32Array value); |
michael@0 | 734 | void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, |
michael@0 | 735 | sequence<GLfloat> value); |
michael@0 | 736 | void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, |
michael@0 | 737 | Float32Array value); |
michael@0 | 738 | void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, |
michael@0 | 739 | sequence<GLfloat> value); |
michael@0 | 740 | |
michael@0 | 741 | void useProgram(WebGLProgram? program); |
michael@0 | 742 | void validateProgram(WebGLProgram? program); |
michael@0 | 743 | |
michael@0 | 744 | void vertexAttrib1f(GLuint indx, GLfloat x); |
michael@0 | 745 | void vertexAttrib1fv(GLuint indx, Float32Array values); |
michael@0 | 746 | void vertexAttrib1fv(GLuint indx, sequence<GLfloat> values); |
michael@0 | 747 | void vertexAttrib2f(GLuint indx, GLfloat x, GLfloat y); |
michael@0 | 748 | void vertexAttrib2fv(GLuint indx, Float32Array values); |
michael@0 | 749 | void vertexAttrib2fv(GLuint indx, sequence<GLfloat> values); |
michael@0 | 750 | void vertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z); |
michael@0 | 751 | void vertexAttrib3fv(GLuint indx, Float32Array values); |
michael@0 | 752 | void vertexAttrib3fv(GLuint indx, sequence<GLfloat> values); |
michael@0 | 753 | void vertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w); |
michael@0 | 754 | void vertexAttrib4fv(GLuint indx, Float32Array values); |
michael@0 | 755 | void vertexAttrib4fv(GLuint indx, sequence<GLfloat> values); |
michael@0 | 756 | void vertexAttribPointer(GLuint indx, GLint size, GLenum type, |
michael@0 | 757 | GLboolean normalized, GLsizei stride, GLintptr offset); |
michael@0 | 758 | |
michael@0 | 759 | void viewport(GLint x, GLint y, GLsizei width, GLsizei height); |
michael@0 | 760 | }; |
michael@0 | 761 | |
michael@0 | 762 | /*[Constructor(DOMString type, optional WebGLContextEventInit eventInit)] |
michael@0 | 763 | interface WebGLContextEvent : Event { |
michael@0 | 764 | readonly attribute DOMString statusMessage; |
michael@0 | 765 | };*/ |
michael@0 | 766 | |
michael@0 | 767 | // EventInit is defined in the DOM4 specification. |
michael@0 | 768 | /*dictionary WebGLContextEventInit : EventInit { |
michael@0 | 769 | DOMString statusMessage; |
michael@0 | 770 | };*/ |
michael@0 | 771 | |
michael@0 | 772 | |
michael@0 | 773 | // specific extension interfaces |
michael@0 | 774 | |
michael@0 | 775 | [NoInterfaceObject] |
michael@0 | 776 | interface WebGLExtensionCompressedTextureS3TC |
michael@0 | 777 | { |
michael@0 | 778 | const GLenum COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0; |
michael@0 | 779 | const GLenum COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1; |
michael@0 | 780 | const GLenum COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2; |
michael@0 | 781 | const GLenum COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3; |
michael@0 | 782 | }; |
michael@0 | 783 | |
michael@0 | 784 | [NoInterfaceObject] |
michael@0 | 785 | interface WebGLExtensionCompressedTextureATC |
michael@0 | 786 | { |
michael@0 | 787 | const GLenum COMPRESSED_RGB_ATC_WEBGL = 0x8C92; |
michael@0 | 788 | const GLenum COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL = 0x8C93; |
michael@0 | 789 | const GLenum COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL = 0x87EE; |
michael@0 | 790 | }; |
michael@0 | 791 | |
michael@0 | 792 | [NoInterfaceObject] |
michael@0 | 793 | interface WebGLExtensionCompressedTextureETC1 |
michael@0 | 794 | { |
michael@0 | 795 | const GLenum COMPRESSED_RGB_ETC1_WEBGL = 0x8D64; |
michael@0 | 796 | }; |
michael@0 | 797 | |
michael@0 | 798 | [NoInterfaceObject] |
michael@0 | 799 | interface WebGLExtensionCompressedTexturePVRTC |
michael@0 | 800 | { |
michael@0 | 801 | const GLenum COMPRESSED_RGB_PVRTC_4BPPV1 = 0x8C00; |
michael@0 | 802 | const GLenum COMPRESSED_RGB_PVRTC_2BPPV1 = 0x8C01; |
michael@0 | 803 | const GLenum COMPRESSED_RGBA_PVRTC_4BPPV1 = 0x8C02; |
michael@0 | 804 | const GLenum COMPRESSED_RGBA_PVRTC_2BPPV1 = 0x8C03; |
michael@0 | 805 | }; |
michael@0 | 806 | |
michael@0 | 807 | [NoInterfaceObject] |
michael@0 | 808 | interface WebGLExtensionDebugRendererInfo |
michael@0 | 809 | { |
michael@0 | 810 | const GLenum UNMASKED_VENDOR_WEBGL = 0x9245; |
michael@0 | 811 | const GLenum UNMASKED_RENDERER_WEBGL = 0x9246; |
michael@0 | 812 | }; |
michael@0 | 813 | |
michael@0 | 814 | [NoInterfaceObject] |
michael@0 | 815 | interface WebGLExtensionDebugShaders |
michael@0 | 816 | { |
michael@0 | 817 | DOMString getTranslatedShaderSource(WebGLShader? shader); |
michael@0 | 818 | }; |
michael@0 | 819 | |
michael@0 | 820 | [NoInterfaceObject] |
michael@0 | 821 | interface WebGLExtensionDepthTexture |
michael@0 | 822 | { |
michael@0 | 823 | const GLenum UNSIGNED_INT_24_8_WEBGL = 0x84FA; |
michael@0 | 824 | }; |
michael@0 | 825 | |
michael@0 | 826 | [NoInterfaceObject] |
michael@0 | 827 | interface WebGLExtensionElementIndexUint |
michael@0 | 828 | { |
michael@0 | 829 | }; |
michael@0 | 830 | |
michael@0 | 831 | [NoInterfaceObject] |
michael@0 | 832 | interface WebGLExtensionFragDepth |
michael@0 | 833 | { |
michael@0 | 834 | }; |
michael@0 | 835 | |
michael@0 | 836 | [NoInterfaceObject] |
michael@0 | 837 | interface WebGLExtensionLoseContext { |
michael@0 | 838 | void loseContext(); |
michael@0 | 839 | void restoreContext(); |
michael@0 | 840 | }; |
michael@0 | 841 | |
michael@0 | 842 | [NoInterfaceObject] |
michael@0 | 843 | interface WebGLExtensionTextureFilterAnisotropic |
michael@0 | 844 | { |
michael@0 | 845 | const GLenum TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE; |
michael@0 | 846 | const GLenum MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF; |
michael@0 | 847 | }; |
michael@0 | 848 | |
michael@0 | 849 | [NoInterfaceObject] |
michael@0 | 850 | interface WebGLExtensionSRGB |
michael@0 | 851 | { |
michael@0 | 852 | const GLenum SRGB_EXT = 0x8C40; |
michael@0 | 853 | const GLenum SRGB_ALPHA_EXT = 0x8C42; |
michael@0 | 854 | const GLenum SRGB8_ALPHA8_EXT = 0x8C43; |
michael@0 | 855 | const GLenum FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT = 0x8210; |
michael@0 | 856 | }; |
michael@0 | 857 | |
michael@0 | 858 | [NoInterfaceObject] |
michael@0 | 859 | interface WebGLExtensionStandardDerivatives { |
michael@0 | 860 | const GLenum FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8B8B; |
michael@0 | 861 | }; |
michael@0 | 862 | |
michael@0 | 863 | [NoInterfaceObject] |
michael@0 | 864 | interface WebGLExtensionTextureFloat |
michael@0 | 865 | { |
michael@0 | 866 | }; |
michael@0 | 867 | |
michael@0 | 868 | [NoInterfaceObject] |
michael@0 | 869 | interface WebGLExtensionDrawBuffers { |
michael@0 | 870 | const GLenum COLOR_ATTACHMENT0_WEBGL = 0x8CE0; |
michael@0 | 871 | const GLenum COLOR_ATTACHMENT1_WEBGL = 0x8CE1; |
michael@0 | 872 | const GLenum COLOR_ATTACHMENT2_WEBGL = 0x8CE2; |
michael@0 | 873 | const GLenum COLOR_ATTACHMENT3_WEBGL = 0x8CE3; |
michael@0 | 874 | const GLenum COLOR_ATTACHMENT4_WEBGL = 0x8CE4; |
michael@0 | 875 | const GLenum COLOR_ATTACHMENT5_WEBGL = 0x8CE5; |
michael@0 | 876 | const GLenum COLOR_ATTACHMENT6_WEBGL = 0x8CE6; |
michael@0 | 877 | const GLenum COLOR_ATTACHMENT7_WEBGL = 0x8CE7; |
michael@0 | 878 | const GLenum COLOR_ATTACHMENT8_WEBGL = 0x8CE8; |
michael@0 | 879 | const GLenum COLOR_ATTACHMENT9_WEBGL = 0x8CE9; |
michael@0 | 880 | const GLenum COLOR_ATTACHMENT10_WEBGL = 0x8CEA; |
michael@0 | 881 | const GLenum COLOR_ATTACHMENT11_WEBGL = 0x8CEB; |
michael@0 | 882 | const GLenum COLOR_ATTACHMENT12_WEBGL = 0x8CEC; |
michael@0 | 883 | const GLenum COLOR_ATTACHMENT13_WEBGL = 0x8CED; |
michael@0 | 884 | const GLenum COLOR_ATTACHMENT14_WEBGL = 0x8CEE; |
michael@0 | 885 | const GLenum COLOR_ATTACHMENT15_WEBGL = 0x8CEF; |
michael@0 | 886 | |
michael@0 | 887 | const GLenum DRAW_BUFFER0_WEBGL = 0x8825; |
michael@0 | 888 | const GLenum DRAW_BUFFER1_WEBGL = 0x8826; |
michael@0 | 889 | const GLenum DRAW_BUFFER2_WEBGL = 0x8827; |
michael@0 | 890 | const GLenum DRAW_BUFFER3_WEBGL = 0x8828; |
michael@0 | 891 | const GLenum DRAW_BUFFER4_WEBGL = 0x8829; |
michael@0 | 892 | const GLenum DRAW_BUFFER5_WEBGL = 0x882A; |
michael@0 | 893 | const GLenum DRAW_BUFFER6_WEBGL = 0x882B; |
michael@0 | 894 | const GLenum DRAW_BUFFER7_WEBGL = 0x882C; |
michael@0 | 895 | const GLenum DRAW_BUFFER8_WEBGL = 0x882D; |
michael@0 | 896 | const GLenum DRAW_BUFFER9_WEBGL = 0x882E; |
michael@0 | 897 | const GLenum DRAW_BUFFER10_WEBGL = 0x882F; |
michael@0 | 898 | const GLenum DRAW_BUFFER11_WEBGL = 0x8830; |
michael@0 | 899 | const GLenum DRAW_BUFFER12_WEBGL = 0x8831; |
michael@0 | 900 | const GLenum DRAW_BUFFER13_WEBGL = 0x8832; |
michael@0 | 901 | const GLenum DRAW_BUFFER14_WEBGL = 0x8833; |
michael@0 | 902 | const GLenum DRAW_BUFFER15_WEBGL = 0x8834; |
michael@0 | 903 | |
michael@0 | 904 | const GLenum MAX_COLOR_ATTACHMENTS_WEBGL = 0x8CDF; |
michael@0 | 905 | const GLenum MAX_DRAW_BUFFERS_WEBGL = 0x8824; |
michael@0 | 906 | |
michael@0 | 907 | void drawBuffersWEBGL(sequence<GLenum> buffers); |
michael@0 | 908 | }; |
michael@0 | 909 | |
michael@0 | 910 | [NoInterfaceObject] |
michael@0 | 911 | interface WebGLExtensionTextureFloatLinear |
michael@0 | 912 | { |
michael@0 | 913 | }; |
michael@0 | 914 | |
michael@0 | 915 | [NoInterfaceObject] |
michael@0 | 916 | interface WebGLExtensionTextureHalfFloat |
michael@0 | 917 | { |
michael@0 | 918 | const GLenum HALF_FLOAT_OES = 0x8D61; |
michael@0 | 919 | }; |
michael@0 | 920 | |
michael@0 | 921 | [NoInterfaceObject] |
michael@0 | 922 | interface WebGLExtensionTextureHalfFloatLinear |
michael@0 | 923 | { |
michael@0 | 924 | }; |
michael@0 | 925 | |
michael@0 | 926 | [NoInterfaceObject] |
michael@0 | 927 | interface WebGLExtensionColorBufferFloat |
michael@0 | 928 | { |
michael@0 | 929 | const GLenum RGBA32F_EXT = 0x8814; |
michael@0 | 930 | const GLenum RGB32F_EXT = 0x8815; |
michael@0 | 931 | const GLenum FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT = 0x8211; |
michael@0 | 932 | const GLenum UNSIGNED_NORMALIZED_EXT = 0x8C17; |
michael@0 | 933 | }; |
michael@0 | 934 | |
michael@0 | 935 | [NoInterfaceObject] |
michael@0 | 936 | interface WebGLExtensionColorBufferHalfFloat |
michael@0 | 937 | { |
michael@0 | 938 | const GLenum RGBA16F_EXT = 0x881A; |
michael@0 | 939 | const GLenum RGB16F_EXT = 0x881B; |
michael@0 | 940 | const GLenum FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT = 0x8211; |
michael@0 | 941 | const GLenum UNSIGNED_NORMALIZED_EXT = 0x8C17; |
michael@0 | 942 | }; |
michael@0 | 943 | |
michael@0 | 944 | [NoInterfaceObject] |
michael@0 | 945 | interface WebGLExtensionVertexArray { |
michael@0 | 946 | const GLenum VERTEX_ARRAY_BINDING_OES = 0x85B5; |
michael@0 | 947 | |
michael@0 | 948 | WebGLVertexArray? createVertexArrayOES(); |
michael@0 | 949 | void deleteVertexArrayOES(WebGLVertexArray? arrayObject); |
michael@0 | 950 | [WebGLHandlesContextLoss] GLboolean isVertexArrayOES(WebGLVertexArray? arrayObject); |
michael@0 | 951 | void bindVertexArrayOES(WebGLVertexArray? arrayObject); |
michael@0 | 952 | }; |
michael@0 | 953 | |
michael@0 | 954 | [NoInterfaceObject] |
michael@0 | 955 | interface WebGLExtensionInstancedArrays { |
michael@0 | 956 | const GLenum VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE = 0x88FE; |
michael@0 | 957 | |
michael@0 | 958 | void drawArraysInstancedANGLE(GLenum mode, GLint first, GLsizei count, GLsizei primcount); |
michael@0 | 959 | void drawElementsInstancedANGLE(GLenum mode, GLsizei count, GLenum type, GLintptr offset, GLsizei primcount); |
michael@0 | 960 | void vertexAttribDivisorANGLE(GLuint index, GLuint divisor); |
michael@0 | 961 | }; |