1/* 2 * Copyright (C) 2009 Apple Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. 9 * 2. Redistributions in binary form must reproduce the above copyright 10 * notice, this list of conditions and the following disclaimer in the 11 * documentation and/or other materials provided with the distribution. 12 * 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 */ 25 26module html { 27 28 interface [ 29 Conditional=WEBGL, 30 InterfaceUUID=98fb48ae-7216-489c-862b-8e1217fc4443, 31 ImplementationUUID=ab4f0781-152f-450e-9546-5b3987491a54, 32 CustomMarkFunction, 33 DontCheckEnums 34 ] WebGLRenderingContext : CanvasRenderingContext { 35 36 /* ClearBufferMask */ 37 const unsigned int DEPTH_BUFFER_BIT = 0x00000100; 38 const unsigned int STENCIL_BUFFER_BIT = 0x00000400; 39 const unsigned int COLOR_BUFFER_BIT = 0x00004000; 40 41 /* BeginMode */ 42 const unsigned int POINTS = 0x0000; 43 const unsigned int LINES = 0x0001; 44 const unsigned int LINE_LOOP = 0x0002; 45 const unsigned int LINE_STRIP = 0x0003; 46 const unsigned int TRIANGLES = 0x0004; 47 const unsigned int TRIANGLE_STRIP = 0x0005; 48 const unsigned int TRIANGLE_FAN = 0x0006; 49 50 /* AlphaFunction (not supported in ES20) */ 51 /* NEVER */ 52 /* LESS */ 53 /* EQUAL */ 54 /* LEQUAL */ 55 /* GREATER */ 56 /* NOTEQUAL */ 57 /* GEQUAL */ 58 /* ALWAYS */ 59 60 /* BlendingFactorDest */ 61 const unsigned int ZERO = 0; 62 const unsigned int ONE = 1; 63 const unsigned int SRC_COLOR = 0x0300; 64 const unsigned int ONE_MINUS_SRC_COLOR = 0x0301; 65 const unsigned int SRC_ALPHA = 0x0302; 66 const unsigned int ONE_MINUS_SRC_ALPHA = 0x0303; 67 const unsigned int DST_ALPHA = 0x0304; 68 const unsigned int ONE_MINUS_DST_ALPHA = 0x0305; 69 70 /* BlendingFactorSrc */ 71 /* ZERO */ 72 /* ONE */ 73 const unsigned int DST_COLOR = 0x0306; 74 const unsigned int ONE_MINUS_DST_COLOR = 0x0307; 75 const unsigned int SRC_ALPHA_SATURATE = 0x0308; 76 /* SRC_ALPHA */ 77 /* ONE_MINUS_SRC_ALPHA */ 78 /* DST_ALPHA */ 79 /* ONE_MINUS_DST_ALPHA */ 80 81 /* BlendEquationSeparate */ 82 const unsigned int FUNC_ADD = 0x8006; 83 const unsigned int BLEND_EQUATION = 0x8009; 84 const unsigned int BLEND_EQUATION_RGB = 0x8009; /* same as BLEND_EQUATION */ 85 const unsigned int BLEND_EQUATION_ALPHA = 0x883D; 86 87 /* BlendSubtract */ 88 const unsigned int FUNC_SUBTRACT = 0x800A; 89 const unsigned int FUNC_REVERSE_SUBTRACT = 0x800B; 90 91 /* Separate Blend Functions */ 92 const unsigned int BLEND_DST_RGB = 0x80C8; 93 const unsigned int BLEND_SRC_RGB = 0x80C9; 94 const unsigned int BLEND_DST_ALPHA = 0x80CA; 95 const unsigned int BLEND_SRC_ALPHA = 0x80CB; 96 const unsigned int CONSTANT_COLOR = 0x8001; 97 const unsigned int ONE_MINUS_CONSTANT_COLOR = 0x8002; 98 const unsigned int CONSTANT_ALPHA = 0x8003; 99 const unsigned int ONE_MINUS_CONSTANT_ALPHA = 0x8004; 100 const unsigned int BLEND_COLOR = 0x8005; 101 102 /* Buffer Objects */ 103 const unsigned int ARRAY_BUFFER = 0x8892; 104 const unsigned int ELEMENT_ARRAY_BUFFER = 0x8893; 105 const unsigned int ARRAY_BUFFER_BINDING = 0x8894; 106 const unsigned int ELEMENT_ARRAY_BUFFER_BINDING = 0x8895; 107 108 const unsigned int STREAM_DRAW = 0x88E0; 109 const unsigned int STATIC_DRAW = 0x88E4; 110 const unsigned int DYNAMIC_DRAW = 0x88E8; 111 112 const unsigned int BUFFER_SIZE = 0x8764; 113 const unsigned int BUFFER_USAGE = 0x8765; 114 115 const unsigned int CURRENT_VERTEX_ATTRIB = 0x8626; 116 117 /* CullFaceMode */ 118 const unsigned int FRONT = 0x0404; 119 const unsigned int BACK = 0x0405; 120 const unsigned int FRONT_AND_BACK = 0x0408; 121 122 /* DepthFunction */ 123 /* NEVER */ 124 /* LESS */ 125 /* EQUAL */ 126 /* LEQUAL */ 127 /* GREATER */ 128 /* NOTEQUAL */ 129 /* GEQUAL */ 130 /* ALWAYS */ 131 132 /* EnableCap */ 133 const unsigned int TEXTURE_2D = 0x0DE1; 134 const unsigned int CULL_FACE = 0x0B44; 135 const unsigned int BLEND = 0x0BE2; 136 const unsigned int DITHER = 0x0BD0; 137 const unsigned int STENCIL_TEST = 0x0B90; 138 const unsigned int DEPTH_TEST = 0x0B71; 139 const unsigned int SCISSOR_TEST = 0x0C11; 140 const unsigned int POLYGON_OFFSET_FILL = 0x8037; 141 const unsigned int SAMPLE_ALPHA_TO_COVERAGE = 0x809E; 142 const unsigned int SAMPLE_COVERAGE = 0x80A0; 143 144 /* ErrorCode */ 145 const unsigned int NO_ERROR = 0; 146 const unsigned int INVALID_ENUM = 0x0500; 147 const unsigned int INVALID_VALUE = 0x0501; 148 const unsigned int INVALID_OPERATION = 0x0502; 149 const unsigned int OUT_OF_MEMORY = 0x0505; 150 151 /* FrontFaceDirection */ 152 const unsigned int CW = 0x0900; 153 const unsigned int CCW = 0x0901; 154 155 /* GetPName */ 156 const unsigned int LINE_WIDTH = 0x0B21; 157 const unsigned int ALIASED_POINT_SIZE_RANGE = 0x846D; 158 const unsigned int ALIASED_LINE_WIDTH_RANGE = 0x846E; 159 const unsigned int CULL_FACE_MODE = 0x0B45; 160 const unsigned int FRONT_FACE = 0x0B46; 161 const unsigned int DEPTH_RANGE = 0x0B70; 162 const unsigned int DEPTH_WRITEMASK = 0x0B72; 163 const unsigned int DEPTH_CLEAR_VALUE = 0x0B73; 164 const unsigned int DEPTH_FUNC = 0x0B74; 165 const unsigned int STENCIL_CLEAR_VALUE = 0x0B91; 166 const unsigned int STENCIL_FUNC = 0x0B92; 167 const unsigned int STENCIL_FAIL = 0x0B94; 168 const unsigned int STENCIL_PASS_DEPTH_FAIL = 0x0B95; 169 const unsigned int STENCIL_PASS_DEPTH_PASS = 0x0B96; 170 const unsigned int STENCIL_REF = 0x0B97; 171 const unsigned int STENCIL_VALUE_MASK = 0x0B93; 172 const unsigned int STENCIL_WRITEMASK = 0x0B98; 173 const unsigned int STENCIL_BACK_FUNC = 0x8800; 174 const unsigned int STENCIL_BACK_FAIL = 0x8801; 175 const unsigned int STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802; 176 const unsigned int STENCIL_BACK_PASS_DEPTH_PASS = 0x8803; 177 const unsigned int STENCIL_BACK_REF = 0x8CA3; 178 const unsigned int STENCIL_BACK_VALUE_MASK = 0x8CA4; 179 const unsigned int STENCIL_BACK_WRITEMASK = 0x8CA5; 180 const unsigned int VIEWPORT = 0x0BA2; 181 const unsigned int SCISSOR_BOX = 0x0C10; 182 /* SCISSOR_TEST */ 183 const unsigned int COLOR_CLEAR_VALUE = 0x0C22; 184 const unsigned int COLOR_WRITEMASK = 0x0C23; 185 const unsigned int UNPACK_ALIGNMENT = 0x0CF5; 186 const unsigned int PACK_ALIGNMENT = 0x0D05; 187 const unsigned int MAX_TEXTURE_SIZE = 0x0D33; 188 const unsigned int MAX_VIEWPORT_DIMS = 0x0D3A; 189 const unsigned int SUBPIXEL_BITS = 0x0D50; 190 const unsigned int RED_BITS = 0x0D52; 191 const unsigned int GREEN_BITS = 0x0D53; 192 const unsigned int BLUE_BITS = 0x0D54; 193 const unsigned int ALPHA_BITS = 0x0D55; 194 const unsigned int DEPTH_BITS = 0x0D56; 195 const unsigned int STENCIL_BITS = 0x0D57; 196 const unsigned int POLYGON_OFFSET_UNITS = 0x2A00; 197 /* POLYGON_OFFSET_FILL */ 198 const unsigned int POLYGON_OFFSET_FACTOR = 0x8038; 199 const unsigned int TEXTURE_BINDING_2D = 0x8069; 200 const unsigned int SAMPLE_BUFFERS = 0x80A8; 201 const unsigned int SAMPLES = 0x80A9; 202 const unsigned int SAMPLE_COVERAGE_VALUE = 0x80AA; 203 const unsigned int SAMPLE_COVERAGE_INVERT = 0x80AB; 204 205 /* GetTextureParameter */ 206 /* TEXTURE_MAG_FILTER */ 207 /* TEXTURE_MIN_FILTER */ 208 /* TEXTURE_WRAP_S */ 209 /* TEXTURE_WRAP_T */ 210 211 const unsigned int NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2; 212 const unsigned int COMPRESSED_TEXTURE_FORMATS = 0x86A3; 213 214 /* HintMode */ 215 const unsigned int DONT_CARE = 0x1100; 216 const unsigned int FASTEST = 0x1101; 217 const unsigned int NICEST = 0x1102; 218 219 /* HintTarget */ 220 const unsigned int GENERATE_MIPMAP_HINT = 0x8192; 221 222 /* DataType */ 223 const unsigned int BYTE = 0x1400; 224 const unsigned int UNSIGNED_BYTE = 0x1401; 225 const unsigned int SHORT = 0x1402; 226 const unsigned int UNSIGNED_SHORT = 0x1403; 227 const unsigned int INT = 0x1404; 228 const unsigned int UNSIGNED_INT = 0x1405; 229 const unsigned int FLOAT = 0x1406; 230 231 /* PixelFormat */ 232 const unsigned int DEPTH_COMPONENT = 0x1902; 233 const unsigned int ALPHA = 0x1906; 234 const unsigned int RGB = 0x1907; 235 const unsigned int RGBA = 0x1908; 236 const unsigned int LUMINANCE = 0x1909; 237 const unsigned int LUMINANCE_ALPHA = 0x190A; 238 239 /* PixelType */ 240 /* UNSIGNED_BYTE */ 241 const unsigned int UNSIGNED_SHORT_4_4_4_4 = 0x8033; 242 const unsigned int UNSIGNED_SHORT_5_5_5_1 = 0x8034; 243 const unsigned int UNSIGNED_SHORT_5_6_5 = 0x8363; 244 245 /* Shaders */ 246 const unsigned int FRAGMENT_SHADER = 0x8B30; 247 const unsigned int VERTEX_SHADER = 0x8B31; 248 const unsigned int MAX_VERTEX_ATTRIBS = 0x8869; 249 const unsigned int MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB; 250 const unsigned int MAX_VARYING_VECTORS = 0x8DFC; 251 const unsigned int MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D; 252 const unsigned int MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C; 253 const unsigned int MAX_TEXTURE_IMAGE_UNITS = 0x8872; 254 const unsigned int MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD; 255 const unsigned int SHADER_TYPE = 0x8B4F; 256 const unsigned int DELETE_STATUS = 0x8B80; 257 const unsigned int LINK_STATUS = 0x8B82; 258 const unsigned int VALIDATE_STATUS = 0x8B83; 259 const unsigned int ATTACHED_SHADERS = 0x8B85; 260 const unsigned int ACTIVE_UNIFORMS = 0x8B86; 261 const unsigned int ACTIVE_ATTRIBUTES = 0x8B89; 262 const unsigned int SHADING_LANGUAGE_VERSION = 0x8B8C; 263 const unsigned int CURRENT_PROGRAM = 0x8B8D; 264 265 /* StencilFunction */ 266 const unsigned int NEVER = 0x0200; 267 const unsigned int LESS = 0x0201; 268 const unsigned int EQUAL = 0x0202; 269 const unsigned int LEQUAL = 0x0203; 270 const unsigned int GREATER = 0x0204; 271 const unsigned int NOTEQUAL = 0x0205; 272 const unsigned int GEQUAL = 0x0206; 273 const unsigned int ALWAYS = 0x0207; 274 275 /* StencilOp */ 276 /* ZERO */ 277 const unsigned int KEEP = 0x1E00; 278 const unsigned int REPLACE = 0x1E01; 279 const unsigned int INCR = 0x1E02; 280 const unsigned int DECR = 0x1E03; 281 const unsigned int INVERT = 0x150A; 282 const unsigned int INCR_WRAP = 0x8507; 283 const unsigned int DECR_WRAP = 0x8508; 284 285 /* StringName */ 286 const unsigned int VENDOR = 0x1F00; 287 const unsigned int RENDERER = 0x1F01; 288 const unsigned int VERSION = 0x1F02; 289 290 /* TextureMagFilter */ 291 const unsigned int NEAREST = 0x2600; 292 const unsigned int LINEAR = 0x2601; 293 294 /* TextureMinFilter */ 295 /* NEAREST */ 296 /* LINEAR */ 297 const unsigned int NEAREST_MIPMAP_NEAREST = 0x2700; 298 const unsigned int LINEAR_MIPMAP_NEAREST = 0x2701; 299 const unsigned int NEAREST_MIPMAP_LINEAR = 0x2702; 300 const unsigned int LINEAR_MIPMAP_LINEAR = 0x2703; 301 302 /* TextureParameterName */ 303 const unsigned int TEXTURE_MAG_FILTER = 0x2800; 304 const unsigned int TEXTURE_MIN_FILTER = 0x2801; 305 const unsigned int TEXTURE_WRAP_S = 0x2802; 306 const unsigned int TEXTURE_WRAP_T = 0x2803; 307 308 /* TextureTarget */ 309 /* TEXTURE_2D */ 310 const unsigned int TEXTURE = 0x1702; 311 312 const unsigned int TEXTURE_CUBE_MAP = 0x8513; 313 const unsigned int TEXTURE_BINDING_CUBE_MAP = 0x8514; 314 const unsigned int TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515; 315 const unsigned int TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516; 316 const unsigned int TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517; 317 const unsigned int TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518; 318 const unsigned int TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519; 319 const unsigned int TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A; 320 const unsigned int MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C; 321 322 /* TextureUnit */ 323 const unsigned int TEXTURE0 = 0x84C0; 324 const unsigned int TEXTURE1 = 0x84C1; 325 const unsigned int TEXTURE2 = 0x84C2; 326 const unsigned int TEXTURE3 = 0x84C3; 327 const unsigned int TEXTURE4 = 0x84C4; 328 const unsigned int TEXTURE5 = 0x84C5; 329 const unsigned int TEXTURE6 = 0x84C6; 330 const unsigned int TEXTURE7 = 0x84C7; 331 const unsigned int TEXTURE8 = 0x84C8; 332 const unsigned int TEXTURE9 = 0x84C9; 333 const unsigned int TEXTURE10 = 0x84CA; 334 const unsigned int TEXTURE11 = 0x84CB; 335 const unsigned int TEXTURE12 = 0x84CC; 336 const unsigned int TEXTURE13 = 0x84CD; 337 const unsigned int TEXTURE14 = 0x84CE; 338 const unsigned int TEXTURE15 = 0x84CF; 339 const unsigned int TEXTURE16 = 0x84D0; 340 const unsigned int TEXTURE17 = 0x84D1; 341 const unsigned int TEXTURE18 = 0x84D2; 342 const unsigned int TEXTURE19 = 0x84D3; 343 const unsigned int TEXTURE20 = 0x84D4; 344 const unsigned int TEXTURE21 = 0x84D5; 345 const unsigned int TEXTURE22 = 0x84D6; 346 const unsigned int TEXTURE23 = 0x84D7; 347 const unsigned int TEXTURE24 = 0x84D8; 348 const unsigned int TEXTURE25 = 0x84D9; 349 const unsigned int TEXTURE26 = 0x84DA; 350 const unsigned int TEXTURE27 = 0x84DB; 351 const unsigned int TEXTURE28 = 0x84DC; 352 const unsigned int TEXTURE29 = 0x84DD; 353 const unsigned int TEXTURE30 = 0x84DE; 354 const unsigned int TEXTURE31 = 0x84DF; 355 const unsigned int ACTIVE_TEXTURE = 0x84E0; 356 357 /* TextureWrapMode */ 358 const unsigned int REPEAT = 0x2901; 359 const unsigned int CLAMP_TO_EDGE = 0x812F; 360 const unsigned int MIRRORED_REPEAT = 0x8370; 361 362 /* Uniform Types */ 363 const unsigned int FLOAT_VEC2 = 0x8B50; 364 const unsigned int FLOAT_VEC3 = 0x8B51; 365 const unsigned int FLOAT_VEC4 = 0x8B52; 366 const unsigned int INT_VEC2 = 0x8B53; 367 const unsigned int INT_VEC3 = 0x8B54; 368 const unsigned int INT_VEC4 = 0x8B55; 369 const unsigned int BOOL = 0x8B56; 370 const unsigned int BOOL_VEC2 = 0x8B57; 371 const unsigned int BOOL_VEC3 = 0x8B58; 372 const unsigned int BOOL_VEC4 = 0x8B59; 373 const unsigned int FLOAT_MAT2 = 0x8B5A; 374 const unsigned int FLOAT_MAT3 = 0x8B5B; 375 const unsigned int FLOAT_MAT4 = 0x8B5C; 376 const unsigned int SAMPLER_2D = 0x8B5E; 377 const unsigned int SAMPLER_CUBE = 0x8B60; 378 379 /* Vertex Arrays */ 380 const unsigned int VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622; 381 const unsigned int VERTEX_ATTRIB_ARRAY_SIZE = 0x8623; 382 const unsigned int VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624; 383 const unsigned int VERTEX_ATTRIB_ARRAY_TYPE = 0x8625; 384 const unsigned int VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A; 385 const unsigned int VERTEX_ATTRIB_ARRAY_POINTER = 0x8645; 386 const unsigned int VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F; 387 388 /* Shader Source */ 389 const unsigned int COMPILE_STATUS = 0x8B81; 390 const unsigned int SHADER_COMPILER = 0x8DFA; 391 392 /* Shader Precision-Specified Types */ 393 const unsigned int LOW_FLOAT = 0x8DF0; 394 const unsigned int MEDIUM_FLOAT = 0x8DF1; 395 const unsigned int HIGH_FLOAT = 0x8DF2; 396 const unsigned int LOW_INT = 0x8DF3; 397 const unsigned int MEDIUM_INT = 0x8DF4; 398 const unsigned int HIGH_INT = 0x8DF5; 399 400 /* Framebuffer Object. */ 401 const unsigned int FRAMEBUFFER = 0x8D40; 402 const unsigned int RENDERBUFFER = 0x8D41; 403 404 const unsigned int RGBA4 = 0x8056; 405 const unsigned int RGB5_A1 = 0x8057; 406 const unsigned int RGB565 = 0x8D62; 407 const unsigned int DEPTH_COMPONENT16 = 0x81A5; 408 const unsigned int STENCIL_INDEX = 0x1901; 409 const unsigned int STENCIL_INDEX8 = 0x8D48; 410 const unsigned int DEPTH_STENCIL = 0x84F9; 411 412 const unsigned int RENDERBUFFER_WIDTH = 0x8D42; 413 const unsigned int RENDERBUFFER_HEIGHT = 0x8D43; 414 const unsigned int RENDERBUFFER_INTERNAL_FORMAT = 0x8D44; 415 const unsigned int RENDERBUFFER_RED_SIZE = 0x8D50; 416 const unsigned int RENDERBUFFER_GREEN_SIZE = 0x8D51; 417 const unsigned int RENDERBUFFER_BLUE_SIZE = 0x8D52; 418 const unsigned int RENDERBUFFER_ALPHA_SIZE = 0x8D53; 419 const unsigned int RENDERBUFFER_DEPTH_SIZE = 0x8D54; 420 const unsigned int RENDERBUFFER_STENCIL_SIZE = 0x8D55; 421 422 const unsigned int FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0; 423 const unsigned int FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1; 424 const unsigned int FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2; 425 const unsigned int FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3; 426 427 const unsigned int COLOR_ATTACHMENT0 = 0x8CE0; 428 const unsigned int DEPTH_ATTACHMENT = 0x8D00; 429 const unsigned int STENCIL_ATTACHMENT = 0x8D20; 430 const unsigned int DEPTH_STENCIL_ATTACHMENT = 0x821A; 431 432 const unsigned int NONE = 0; 433 434 const unsigned int FRAMEBUFFER_COMPLETE = 0x8CD5; 435 const unsigned int FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6; 436 const unsigned int FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7; 437 const unsigned int FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9; 438 const unsigned int FRAMEBUFFER_UNSUPPORTED = 0x8CDD; 439 440 const unsigned int FRAMEBUFFER_BINDING = 0x8CA6; 441 const unsigned int RENDERBUFFER_BINDING = 0x8CA7; 442 const unsigned int MAX_RENDERBUFFER_SIZE = 0x84E8; 443 444 const unsigned int INVALID_FRAMEBUFFER_OPERATION = 0x0506; 445 446 /* WebGL-specific enums */ 447 const unsigned int UNPACK_FLIP_Y_WEBGL = 0x9240; 448 const unsigned int UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241; 449 const unsigned int CONTEXT_LOST_WEBGL = 0x9242; 450 const unsigned int UNPACK_COLORSPACE_CONVERSION_WEBGL = 0x9243; 451 const unsigned int BROWSER_DEFAULT_WEBGL = 0x9244; 452 453 [StrictTypeChecking] void activeTexture(in unsigned long texture) raises(DOMException); 454 [StrictTypeChecking] void attachShader(in WebGLProgram program, in WebGLShader shader) raises(DOMException); 455 [StrictTypeChecking] void bindAttribLocation(in WebGLProgram program, in unsigned long index, in DOMString name) raises(DOMException); 456 [StrictTypeChecking] void bindBuffer(in unsigned long target, in WebGLBuffer buffer) raises(DOMException); 457 [StrictTypeChecking] void bindFramebuffer(in unsigned long target, in WebGLFramebuffer framebuffer) raises(DOMException); 458 [StrictTypeChecking] void bindRenderbuffer(in unsigned long target, in WebGLRenderbuffer renderbuffer) raises(DOMException); 459 [StrictTypeChecking] void bindTexture(in unsigned long target, in WebGLTexture texture) raises(DOMException); 460 [StrictTypeChecking] void blendColor(in float red, in float green, in float blue, in float alpha); 461 [StrictTypeChecking] void blendEquation( in unsigned long mode ); 462 [StrictTypeChecking] void blendEquationSeparate(in unsigned long modeRGB, in unsigned long modeAlpha); 463 [StrictTypeChecking] void blendFunc(in unsigned long sfactor, in unsigned long dfactor); 464 [StrictTypeChecking] void blendFuncSeparate(in unsigned long srcRGB, in unsigned long dstRGB, in unsigned long srcAlpha, in unsigned long dstAlpha); 465 [StrictTypeChecking] void bufferData(in unsigned long target, in ArrayBuffer data, in unsigned long usage) raises (DOMException); 466 [StrictTypeChecking] void bufferData(in unsigned long target, in ArrayBufferView data, in unsigned long usage) raises (DOMException); 467 [StrictTypeChecking] void bufferData(in unsigned long target, in long size, in unsigned long usage) raises (DOMException); 468 [StrictTypeChecking] void bufferSubData(in unsigned long target, in long offset, in ArrayBuffer data) raises (DOMException); 469 [StrictTypeChecking] void bufferSubData(in unsigned long target, in long offset, in ArrayBufferView data) raises (DOMException); 470 471 [StrictTypeChecking] unsigned long checkFramebufferStatus(in unsigned long target); 472 [StrictTypeChecking] void clear(in unsigned long mask); 473 [StrictTypeChecking] void clearColor(in float red, in float green, in float blue, in float alpha); 474 [StrictTypeChecking] void clearDepth(in float depth); 475 [StrictTypeChecking] void clearStencil(in long s); 476 [StrictTypeChecking] void colorMask(in boolean red, in boolean green, in boolean blue, in boolean alpha); 477 [StrictTypeChecking] void compileShader(in WebGLShader shader) raises(DOMException); 478 479 //void compressedTexImage2D(in unsigned long target, in long level, in unsigned long internalformat, in unsigned long width, in unsigned long height, in long border, in unsigned long imageSize, const void* data); 480 //void compressedTexSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset, in unsigned long width, in unsigned long height, in unsigned long format, in unsigned long imageSize, const void* data); 481 482 [StrictTypeChecking] void copyTexImage2D(in unsigned long target, in long level, in unsigned long internalformat, in long x, in long y, in long width, in long height, in long border); 483 [StrictTypeChecking] void copyTexSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset, in long x, in long y, in long width, in long height); 484 485 [StrictTypeChecking] WebGLBuffer createBuffer(); 486 [StrictTypeChecking] WebGLFramebuffer createFramebuffer(); 487 [StrictTypeChecking] WebGLProgram createProgram(); 488 [StrictTypeChecking] WebGLRenderbuffer createRenderbuffer(); 489 [StrictTypeChecking] WebGLShader createShader(in unsigned long type) raises(DOMException); 490 [StrictTypeChecking] WebGLTexture createTexture(); 491 492 [StrictTypeChecking] void cullFace(in unsigned long mode); 493 494 [StrictTypeChecking] void deleteBuffer(in WebGLBuffer buffer); 495 [StrictTypeChecking] void deleteFramebuffer(in WebGLFramebuffer framebuffer); 496 [StrictTypeChecking] void deleteProgram(in WebGLProgram program); 497 [StrictTypeChecking] void deleteRenderbuffer(in WebGLRenderbuffer renderbuffer); 498 [StrictTypeChecking] void deleteShader(in WebGLShader shader); 499 [StrictTypeChecking] void deleteTexture(in WebGLTexture texture); 500 501 [StrictTypeChecking] void depthFunc(in unsigned long func); 502 [StrictTypeChecking] void depthMask(in boolean flag); 503 // FIXME: this differs from the current WebGL spec (depthRangef) 504 [StrictTypeChecking] void depthRange(in float zNear, in float zFar); 505 [StrictTypeChecking] void detachShader(in WebGLProgram program, in WebGLShader shader) raises(DOMException); 506 [StrictTypeChecking] void disable(in unsigned long cap); 507 [StrictTypeChecking] void disableVertexAttribArray(in unsigned long index) raises(DOMException); 508 [StrictTypeChecking] void drawArrays(in unsigned long mode, in long first, in long count) raises(DOMException); 509 [StrictTypeChecking] void drawElements(in unsigned long mode, in long count, in unsigned long type, in long offset) raises(DOMException); 510 511 [StrictTypeChecking] void enable(in unsigned long cap); 512 [StrictTypeChecking] void enableVertexAttribArray(in unsigned long index) raises(DOMException); 513 [StrictTypeChecking] void finish(); 514 [StrictTypeChecking] void flush(); 515 [StrictTypeChecking] void framebufferRenderbuffer(in unsigned long target, in unsigned long attachment, in unsigned long renderbuffertarget, in WebGLRenderbuffer renderbuffer) raises(DOMException); 516 [StrictTypeChecking] void framebufferTexture2D(in unsigned long target, in unsigned long attachment, in unsigned long textarget, in WebGLTexture texture, in long level) raises(DOMException); 517 [StrictTypeChecking] void frontFace(in unsigned long mode); 518 [StrictTypeChecking] void generateMipmap(in unsigned long target); 519 520 [StrictTypeChecking] WebGLActiveInfo getActiveAttrib(in WebGLProgram program, in unsigned long index) raises (DOMException); 521 [StrictTypeChecking] WebGLActiveInfo getActiveUniform(in WebGLProgram program, in unsigned long index) raises (DOMException); 522 523 [StrictTypeChecking, Custom] void getAttachedShaders(in WebGLProgram program) raises (DOMException); 524 525 [StrictTypeChecking] int getAttribLocation(in WebGLProgram program, in DOMString name); 526 527 // any getBufferParameter(in unsigned long target, in unsigned long pname) raises(DOMException); 528 [StrictTypeChecking, Custom] void getBufferParameter(); 529 530 [StrictTypeChecking] WebGLContextAttributes getContextAttributes(); 531 532 [StrictTypeChecking] unsigned long getError(); 533 534 // object getExtension(in DOMString name); 535 [StrictTypeChecking, Custom] void getExtension(in DOMString name); 536 537 // any getFramebufferAttachmentParameter(in unsigned long target, in unsigned long attachment, in unsigned long pname) raises(DOMException); 538 [StrictTypeChecking, Custom] void getFramebufferAttachmentParameter(); 539 // any getParameter(in unsigned long pname) raises(DOMException); 540 [StrictTypeChecking, Custom] void getParameter(); 541 // any getProgramParameter(in WebGLProgram program, in unsigned long pname) raises(DOMException); 542 [StrictTypeChecking, Custom] void getProgramParameter(); 543 [StrictTypeChecking, ConvertNullStringTo=Null] DOMString getProgramInfoLog(in WebGLProgram program) raises(DOMException); 544 // any getRenderbufferParameter(in unsigned long target, in unsigned long pname) raises(DOMException); 545 [StrictTypeChecking, Custom] void getRenderbufferParameter(); 546 // any getShaderParameter(in WebGLShader shader, in unsigned long pname) raises(DOMException); 547 [StrictTypeChecking, Custom] void getShaderParameter() raises(DOMException); 548 549 [StrictTypeChecking, ConvertNullStringTo=Null] DOMString getShaderInfoLog(in WebGLShader shader) raises(DOMException); 550 551 // TBD 552 // void glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision); 553 554 [StrictTypeChecking, ConvertNullStringTo=Null] DOMString getShaderSource(in WebGLShader shader) raises(DOMException); 555 556 // DOMString[] getSupportedExtensions() 557 [StrictTypeChecking, Custom] void getSupportedExtensions(); 558 559 // any getTexParameter(in unsigned long target, in unsigned long pname) raises(DOMException); 560 [StrictTypeChecking, Custom] void getTexParameter(); 561 562 // any getUniform(in WebGLProgram program, in WebGLUniformLocation location) raises(DOMException); 563 [StrictTypeChecking, Custom] void getUniform(); 564 565 [StrictTypeChecking] WebGLUniformLocation getUniformLocation(in WebGLProgram program, in DOMString name) raises(DOMException); 566 567 // any getVertexAttrib(in unsigned long index, in unsigned long pname) raises(DOMException); 568 [StrictTypeChecking, Custom] void getVertexAttrib(); 569 570 [StrictTypeChecking] long getVertexAttribOffset(in unsigned long index, in unsigned long pname); 571 572 [StrictTypeChecking] void hint(in unsigned long target, in unsigned long mode); 573 [StrictTypeChecking] boolean isBuffer(in WebGLBuffer buffer); 574 [StrictTypeChecking] boolean isContextLost(); 575 [StrictTypeChecking] boolean isEnabled(in unsigned long cap); 576 [StrictTypeChecking] boolean isFramebuffer(in WebGLFramebuffer framebuffer); 577 [StrictTypeChecking] boolean isProgram(in WebGLProgram program); 578 [StrictTypeChecking] boolean isRenderbuffer(in WebGLRenderbuffer renderbuffer); 579 [StrictTypeChecking] boolean isShader(in WebGLShader shader); 580 [StrictTypeChecking] boolean isTexture(in WebGLTexture texture); 581 [StrictTypeChecking] void lineWidth(in float width); 582 [StrictTypeChecking] void linkProgram(in WebGLProgram program) raises(DOMException); 583 [StrictTypeChecking] void pixelStorei(in unsigned long pname, in long param); 584 [StrictTypeChecking] void polygonOffset(in float factor, in float units); 585 586 [StrictTypeChecking] void readPixels(in long x, in long y, in long width, in long height, in unsigned long format, in unsigned long type, in ArrayBufferView pixels) raises(DOMException); 587 588 [StrictTypeChecking] void releaseShaderCompiler(); 589 [StrictTypeChecking] void renderbufferStorage(in unsigned long target, in unsigned long internalformat, in long width, in long height); 590 [StrictTypeChecking] void sampleCoverage(in float value, in boolean invert); 591 [StrictTypeChecking] void scissor(in long x, in long y, in long width, in long height); 592 [StrictTypeChecking] void shaderSource(in WebGLShader shader, in DOMString string) raises(DOMException); 593 [StrictTypeChecking] void stencilFunc(in unsigned long func, in long ref, in unsigned long mask); 594 [StrictTypeChecking] void stencilFuncSeparate(in unsigned long face, in unsigned long func, in long ref, in unsigned long mask); 595 [StrictTypeChecking] void stencilMask(in unsigned long mask); 596 [StrictTypeChecking] void stencilMaskSeparate(in unsigned long face, in unsigned long mask); 597 [StrictTypeChecking] void stencilOp(in unsigned long fail, in unsigned long zfail, in unsigned long zpass); 598 [StrictTypeChecking] void stencilOpSeparate(in unsigned long face, in unsigned long fail, in unsigned long zfail, in unsigned long zpass); 599 600 [StrictTypeChecking] void texParameterf(in unsigned long target, in unsigned long pname, in float param); 601 [StrictTypeChecking] void texParameteri(in unsigned long target, in unsigned long pname, in long param); 602 603 // Supported forms: 604 [StrictTypeChecking] void texImage2D(in unsigned long target, in long level, in unsigned long internalformat, in long width, in long height, 605 in long border, in unsigned long format, in unsigned long type, in ArrayBufferView pixels) raises (DOMException); 606 [StrictTypeChecking] void texImage2D(in unsigned long target, in long level, in unsigned long internalformat, 607 in unsigned long format, in unsigned long type, in ImageData pixels) raises (DOMException); 608 [StrictTypeChecking] void texImage2D(in unsigned long target, in long level, in unsigned long internalformat, 609 in unsigned long format, in unsigned long type, in HTMLImageElement image) raises (DOMException); 610 [StrictTypeChecking] void texImage2D(in unsigned long target, in long level, in unsigned long internalformat, 611 in unsigned long format, in unsigned long type, in HTMLCanvasElement canvas) raises (DOMException); 612#if defined(ENABLE_VIDEO) && ENABLE_VIDEO 613 [StrictTypeChecking] void texImage2D(in unsigned long target, in long level, in unsigned long internalformat, 614 in unsigned long format, in unsigned long type, in HTMLVideoElement video) raises (DOMException); 615#endif 616 617 [StrictTypeChecking] void texSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset, 618 in long width, in long height, 619 in unsigned long format, in unsigned long type, in ArrayBufferView pixels) raises (DOMException); 620 [StrictTypeChecking] void texSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset, 621 in unsigned long format, in unsigned long type, in ImageData pixels) raises (DOMException); 622 [StrictTypeChecking] void texSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset, 623 in unsigned long format, in unsigned long type, in HTMLImageElement image) raises (DOMException); 624 [StrictTypeChecking] void texSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset, 625 in unsigned long format, in unsigned long type, in HTMLCanvasElement canvas) raises (DOMException); 626#if defined(ENABLE_VIDEO) && ENABLE_VIDEO 627 [StrictTypeChecking] void texSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset, 628 in unsigned long format, in unsigned long type, in HTMLVideoElement video) raises (DOMException); 629#endif 630 631 [StrictTypeChecking] void uniform1f(in WebGLUniformLocation location, in float x) raises(DOMException); 632 [StrictTypeChecking, Custom] void uniform1fv(in WebGLUniformLocation location, in Float32Array v) raises(DOMException); 633 [StrictTypeChecking] void uniform1i(in WebGLUniformLocation location, in long x) raises(DOMException); 634 [StrictTypeChecking, Custom] void uniform1iv(in WebGLUniformLocation location, in Int32Array v) raises(DOMException); 635 [StrictTypeChecking] void uniform2f(in WebGLUniformLocation location, in float x, in float y) raises(DOMException); 636 [StrictTypeChecking, Custom] void uniform2fv(in WebGLUniformLocation location, in Float32Array v) raises(DOMException); 637 [StrictTypeChecking] void uniform2i(in WebGLUniformLocation location, in long x, in long y) raises(DOMException); 638 [StrictTypeChecking, Custom] void uniform2iv(in WebGLUniformLocation location, in Int32Array v) raises(DOMException); 639 [StrictTypeChecking] void uniform3f(in WebGLUniformLocation location, in float x, in float y, in float z) raises(DOMException); 640 [StrictTypeChecking, Custom] void uniform3fv(in WebGLUniformLocation location, in Float32Array v) raises(DOMException); 641 [StrictTypeChecking] void uniform3i(in WebGLUniformLocation location, in long x, in long y, in long z) raises(DOMException); 642 [StrictTypeChecking, Custom] void uniform3iv(in WebGLUniformLocation location, in Int32Array v) raises(DOMException); 643 [StrictTypeChecking] void uniform4f(in WebGLUniformLocation location, in float x, in float y, in float z, in float w) raises(DOMException); 644 [StrictTypeChecking, Custom] void uniform4fv(in WebGLUniformLocation location, in Float32Array v) raises(DOMException); 645 [StrictTypeChecking] void uniform4i(in WebGLUniformLocation location, in long x, in long y, in long z, in long w) raises(DOMException); 646 [StrictTypeChecking, Custom] void uniform4iv(in WebGLUniformLocation location, in Int32Array v) raises(DOMException); 647 648 [StrictTypeChecking, Custom] void uniformMatrix2fv(in WebGLUniformLocation location, in boolean transpose, in Float32Array array) raises(DOMException); 649 [StrictTypeChecking, Custom] void uniformMatrix3fv(in WebGLUniformLocation location, in boolean transpose, in Float32Array array) raises(DOMException); 650 [StrictTypeChecking, Custom] void uniformMatrix4fv(in WebGLUniformLocation location, in boolean transpose, in Float32Array array) raises(DOMException); 651 652 [StrictTypeChecking] void useProgram(in WebGLProgram program) raises(DOMException); 653 [StrictTypeChecking] void validateProgram(in WebGLProgram program) raises(DOMException); 654 655 [StrictTypeChecking] void vertexAttrib1f(in unsigned long indx, in float x); 656 [StrictTypeChecking, Custom] void vertexAttrib1fv(in unsigned long indx, in Float32Array values); 657 [StrictTypeChecking] void vertexAttrib2f(in unsigned long indx, in float x, in float y); 658 [StrictTypeChecking, Custom] void vertexAttrib2fv(in unsigned long indx, in Float32Array values); 659 [StrictTypeChecking] void vertexAttrib3f(in unsigned long indx, in float x, in float y, in float z); 660 [StrictTypeChecking, Custom] void vertexAttrib3fv(in unsigned long indx, in Float32Array values); 661 [StrictTypeChecking] void vertexAttrib4f(in unsigned long indx, in float x, in float y, in float z, in float w); 662 [StrictTypeChecking, Custom] void vertexAttrib4fv(in unsigned long indx, in Float32Array values); 663 [StrictTypeChecking] void vertexAttribPointer(in unsigned long indx, in long size, in unsigned long type, in boolean normalized, 664 in long stride, in long offset) raises(DOMException); 665 666 [StrictTypeChecking] void viewport(in long x, in long y, in long width, in long height); 667 }; 668} 669 670