webgl1.idl (33999B)
1 // GENERATED CONTENT - DO NOT EDIT 2 // Content was automatically extracted by Reffy into webref 3 // (https://github.com/w3c/webref) 4 // Source: WebGL Specification (https://registry.khronos.org/webgl/specs/latest/1.0/) 5 6 typedef unsigned long GLenum; 7 typedef boolean GLboolean; 8 typedef unsigned long GLbitfield; 9 typedef byte GLbyte; /* 'byte' should be a signed 8 bit type. */ 10 typedef short GLshort; 11 typedef long GLint; 12 typedef long GLsizei; 13 typedef long long GLintptr; 14 typedef long long GLsizeiptr; 15 // Ideally the typedef below would use 'unsigned byte', but that doesn't currently exist in Web IDL. 16 typedef octet GLubyte; /* 'octet' should be an unsigned 8 bit type. */ 17 typedef unsigned short GLushort; 18 typedef unsigned long GLuint; 19 typedef unrestricted float GLfloat; 20 typedef unrestricted float GLclampf; 21 22 // The power preference settings are documented in the WebGLContextAttributes 23 // section of the specification. 24 enum WebGLPowerPreference { "default", "low-power", "high-performance" }; 25 26 dictionary WebGLContextAttributes { 27 boolean alpha = true; 28 boolean depth = true; 29 boolean stencil = false; 30 boolean antialias = true; 31 boolean premultipliedAlpha = true; 32 boolean preserveDrawingBuffer = false; 33 WebGLPowerPreference powerPreference = "default"; 34 boolean failIfMajorPerformanceCaveat = false; 35 boolean desynchronized = false; 36 }; 37 38 [Exposed=(Window,Worker)] 39 interface WebGLObject { 40 attribute USVString label; 41 }; 42 43 [Exposed=(Window,Worker)] 44 interface WebGLBuffer : WebGLObject { 45 }; 46 47 [Exposed=(Window,Worker)] 48 interface WebGLFramebuffer : WebGLObject { 49 }; 50 51 [Exposed=(Window,Worker)] 52 interface WebGLProgram : WebGLObject { 53 }; 54 55 [Exposed=(Window,Worker)] 56 interface WebGLRenderbuffer : WebGLObject { 57 }; 58 59 [Exposed=(Window,Worker)] 60 interface WebGLShader : WebGLObject { 61 }; 62 63 [Exposed=(Window,Worker)] 64 interface WebGLTexture : WebGLObject { 65 }; 66 67 [Exposed=(Window,Worker)] 68 interface WebGLUniformLocation { 69 }; 70 71 [Exposed=(Window,Worker)] 72 interface WebGLActiveInfo { 73 readonly attribute GLint size; 74 readonly attribute GLenum type; 75 readonly attribute DOMString name; 76 }; 77 78 [Exposed=(Window,Worker)] 79 interface WebGLShaderPrecisionFormat { 80 readonly attribute GLint rangeMin; 81 readonly attribute GLint rangeMax; 82 readonly attribute GLint precision; 83 }; 84 85 typedef (ImageBitmap or 86 ImageData or 87 HTMLImageElement or 88 HTMLCanvasElement or 89 HTMLVideoElement or 90 OffscreenCanvas or 91 VideoFrame) TexImageSource; 92 93 typedef ([AllowShared] Float32Array or sequence<GLfloat>) Float32List; 94 typedef ([AllowShared] Int32Array or sequence<GLint>) Int32List; 95 96 interface mixin WebGLRenderingContextBase 97 { 98 99 /* ClearBufferMask */ 100 const GLenum DEPTH_BUFFER_BIT = 0x00000100; 101 const GLenum STENCIL_BUFFER_BIT = 0x00000400; 102 const GLenum COLOR_BUFFER_BIT = 0x00004000; 103 104 /* BeginMode */ 105 const GLenum POINTS = 0x0000; 106 const GLenum LINES = 0x0001; 107 const GLenum LINE_LOOP = 0x0002; 108 const GLenum LINE_STRIP = 0x0003; 109 const GLenum TRIANGLES = 0x0004; 110 const GLenum TRIANGLE_STRIP = 0x0005; 111 const GLenum TRIANGLE_FAN = 0x0006; 112 113 /* AlphaFunction (not supported in ES20) */ 114 /* NEVER */ 115 /* LESS */ 116 /* EQUAL */ 117 /* LEQUAL */ 118 /* GREATER */ 119 /* NOTEQUAL */ 120 /* GEQUAL */ 121 /* ALWAYS */ 122 123 /* BlendingFactorDest */ 124 const GLenum ZERO = 0; 125 const GLenum ONE = 1; 126 const GLenum SRC_COLOR = 0x0300; 127 const GLenum ONE_MINUS_SRC_COLOR = 0x0301; 128 const GLenum SRC_ALPHA = 0x0302; 129 const GLenum ONE_MINUS_SRC_ALPHA = 0x0303; 130 const GLenum DST_ALPHA = 0x0304; 131 const GLenum ONE_MINUS_DST_ALPHA = 0x0305; 132 133 /* BlendingFactorSrc */ 134 /* ZERO */ 135 /* ONE */ 136 const GLenum DST_COLOR = 0x0306; 137 const GLenum ONE_MINUS_DST_COLOR = 0x0307; 138 const GLenum SRC_ALPHA_SATURATE = 0x0308; 139 /* SRC_ALPHA */ 140 /* ONE_MINUS_SRC_ALPHA */ 141 /* DST_ALPHA */ 142 /* ONE_MINUS_DST_ALPHA */ 143 144 /* BlendEquationSeparate */ 145 const GLenum FUNC_ADD = 0x8006; 146 const GLenum BLEND_EQUATION = 0x8009; 147 const GLenum BLEND_EQUATION_RGB = 0x8009; /* same as BLEND_EQUATION */ 148 const GLenum BLEND_EQUATION_ALPHA = 0x883D; 149 150 /* BlendSubtract */ 151 const GLenum FUNC_SUBTRACT = 0x800A; 152 const GLenum FUNC_REVERSE_SUBTRACT = 0x800B; 153 154 /* Separate Blend Functions */ 155 const GLenum BLEND_DST_RGB = 0x80C8; 156 const GLenum BLEND_SRC_RGB = 0x80C9; 157 const GLenum BLEND_DST_ALPHA = 0x80CA; 158 const GLenum BLEND_SRC_ALPHA = 0x80CB; 159 const GLenum CONSTANT_COLOR = 0x8001; 160 const GLenum ONE_MINUS_CONSTANT_COLOR = 0x8002; 161 const GLenum CONSTANT_ALPHA = 0x8003; 162 const GLenum ONE_MINUS_CONSTANT_ALPHA = 0x8004; 163 const GLenum BLEND_COLOR = 0x8005; 164 165 /* Buffer Objects */ 166 const GLenum ARRAY_BUFFER = 0x8892; 167 const GLenum ELEMENT_ARRAY_BUFFER = 0x8893; 168 const GLenum ARRAY_BUFFER_BINDING = 0x8894; 169 const GLenum ELEMENT_ARRAY_BUFFER_BINDING = 0x8895; 170 171 const GLenum STREAM_DRAW = 0x88E0; 172 const GLenum STATIC_DRAW = 0x88E4; 173 const GLenum DYNAMIC_DRAW = 0x88E8; 174 175 const GLenum BUFFER_SIZE = 0x8764; 176 const GLenum BUFFER_USAGE = 0x8765; 177 178 const GLenum CURRENT_VERTEX_ATTRIB = 0x8626; 179 180 /* CullFaceMode */ 181 const GLenum FRONT = 0x0404; 182 const GLenum BACK = 0x0405; 183 const GLenum FRONT_AND_BACK = 0x0408; 184 185 /* DepthFunction */ 186 /* NEVER */ 187 /* LESS */ 188 /* EQUAL */ 189 /* LEQUAL */ 190 /* GREATER */ 191 /* NOTEQUAL */ 192 /* GEQUAL */ 193 /* ALWAYS */ 194 195 /* EnableCap */ 196 /* TEXTURE_2D */ 197 const GLenum CULL_FACE = 0x0B44; 198 const GLenum BLEND = 0x0BE2; 199 const GLenum DITHER = 0x0BD0; 200 const GLenum STENCIL_TEST = 0x0B90; 201 const GLenum DEPTH_TEST = 0x0B71; 202 const GLenum SCISSOR_TEST = 0x0C11; 203 const GLenum POLYGON_OFFSET_FILL = 0x8037; 204 const GLenum SAMPLE_ALPHA_TO_COVERAGE = 0x809E; 205 const GLenum SAMPLE_COVERAGE = 0x80A0; 206 207 /* ErrorCode */ 208 const GLenum NO_ERROR = 0; 209 const GLenum INVALID_ENUM = 0x0500; 210 const GLenum INVALID_VALUE = 0x0501; 211 const GLenum INVALID_OPERATION = 0x0502; 212 const GLenum OUT_OF_MEMORY = 0x0505; 213 214 /* FrontFaceDirection */ 215 const GLenum CW = 0x0900; 216 const GLenum CCW = 0x0901; 217 218 /* GetPName */ 219 const GLenum LINE_WIDTH = 0x0B21; 220 const GLenum ALIASED_POINT_SIZE_RANGE = 0x846D; 221 const GLenum ALIASED_LINE_WIDTH_RANGE = 0x846E; 222 const GLenum CULL_FACE_MODE = 0x0B45; 223 const GLenum FRONT_FACE = 0x0B46; 224 const GLenum DEPTH_RANGE = 0x0B70; 225 const GLenum DEPTH_WRITEMASK = 0x0B72; 226 const GLenum DEPTH_CLEAR_VALUE = 0x0B73; 227 const GLenum DEPTH_FUNC = 0x0B74; 228 const GLenum STENCIL_CLEAR_VALUE = 0x0B91; 229 const GLenum STENCIL_FUNC = 0x0B92; 230 const GLenum STENCIL_FAIL = 0x0B94; 231 const GLenum STENCIL_PASS_DEPTH_FAIL = 0x0B95; 232 const GLenum STENCIL_PASS_DEPTH_PASS = 0x0B96; 233 const GLenum STENCIL_REF = 0x0B97; 234 const GLenum STENCIL_VALUE_MASK = 0x0B93; 235 const GLenum STENCIL_WRITEMASK = 0x0B98; 236 const GLenum STENCIL_BACK_FUNC = 0x8800; 237 const GLenum STENCIL_BACK_FAIL = 0x8801; 238 const GLenum STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802; 239 const GLenum STENCIL_BACK_PASS_DEPTH_PASS = 0x8803; 240 const GLenum STENCIL_BACK_REF = 0x8CA3; 241 const GLenum STENCIL_BACK_VALUE_MASK = 0x8CA4; 242 const GLenum STENCIL_BACK_WRITEMASK = 0x8CA5; 243 const GLenum VIEWPORT = 0x0BA2; 244 const GLenum SCISSOR_BOX = 0x0C10; 245 /* SCISSOR_TEST */ 246 const GLenum COLOR_CLEAR_VALUE = 0x0C22; 247 const GLenum COLOR_WRITEMASK = 0x0C23; 248 const GLenum UNPACK_ALIGNMENT = 0x0CF5; 249 const GLenum PACK_ALIGNMENT = 0x0D05; 250 const GLenum MAX_TEXTURE_SIZE = 0x0D33; 251 const GLenum MAX_VIEWPORT_DIMS = 0x0D3A; 252 const GLenum SUBPIXEL_BITS = 0x0D50; 253 const GLenum RED_BITS = 0x0D52; 254 const GLenum GREEN_BITS = 0x0D53; 255 const GLenum BLUE_BITS = 0x0D54; 256 const GLenum ALPHA_BITS = 0x0D55; 257 const GLenum DEPTH_BITS = 0x0D56; 258 const GLenum STENCIL_BITS = 0x0D57; 259 const GLenum POLYGON_OFFSET_UNITS = 0x2A00; 260 /* POLYGON_OFFSET_FILL */ 261 const GLenum POLYGON_OFFSET_FACTOR = 0x8038; 262 const GLenum TEXTURE_BINDING_2D = 0x8069; 263 const GLenum SAMPLE_BUFFERS = 0x80A8; 264 const GLenum SAMPLES = 0x80A9; 265 const GLenum SAMPLE_COVERAGE_VALUE = 0x80AA; 266 const GLenum SAMPLE_COVERAGE_INVERT = 0x80AB; 267 268 /* GetTextureParameter */ 269 /* TEXTURE_MAG_FILTER */ 270 /* TEXTURE_MIN_FILTER */ 271 /* TEXTURE_WRAP_S */ 272 /* TEXTURE_WRAP_T */ 273 274 const GLenum COMPRESSED_TEXTURE_FORMATS = 0x86A3; 275 276 /* HintMode */ 277 const GLenum DONT_CARE = 0x1100; 278 const GLenum FASTEST = 0x1101; 279 const GLenum NICEST = 0x1102; 280 281 /* HintTarget */ 282 const GLenum GENERATE_MIPMAP_HINT = 0x8192; 283 284 /* DataType */ 285 const GLenum BYTE = 0x1400; 286 const GLenum UNSIGNED_BYTE = 0x1401; 287 const GLenum SHORT = 0x1402; 288 const GLenum UNSIGNED_SHORT = 0x1403; 289 const GLenum INT = 0x1404; 290 const GLenum UNSIGNED_INT = 0x1405; 291 const GLenum FLOAT = 0x1406; 292 293 /* PixelFormat */ 294 const GLenum DEPTH_COMPONENT = 0x1902; 295 const GLenum ALPHA = 0x1906; 296 const GLenum RGB = 0x1907; 297 const GLenum RGBA = 0x1908; 298 const GLenum LUMINANCE = 0x1909; 299 const GLenum LUMINANCE_ALPHA = 0x190A; 300 301 /* PixelType */ 302 /* UNSIGNED_BYTE */ 303 const GLenum UNSIGNED_SHORT_4_4_4_4 = 0x8033; 304 const GLenum UNSIGNED_SHORT_5_5_5_1 = 0x8034; 305 const GLenum UNSIGNED_SHORT_5_6_5 = 0x8363; 306 307 /* Shaders */ 308 const GLenum FRAGMENT_SHADER = 0x8B30; 309 const GLenum VERTEX_SHADER = 0x8B31; 310 const GLenum MAX_VERTEX_ATTRIBS = 0x8869; 311 const GLenum MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB; 312 const GLenum MAX_VARYING_VECTORS = 0x8DFC; 313 const GLenum MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D; 314 const GLenum MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C; 315 const GLenum MAX_TEXTURE_IMAGE_UNITS = 0x8872; 316 const GLenum MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD; 317 const GLenum SHADER_TYPE = 0x8B4F; 318 const GLenum DELETE_STATUS = 0x8B80; 319 const GLenum LINK_STATUS = 0x8B82; 320 const GLenum VALIDATE_STATUS = 0x8B83; 321 const GLenum ATTACHED_SHADERS = 0x8B85; 322 const GLenum ACTIVE_UNIFORMS = 0x8B86; 323 const GLenum ACTIVE_ATTRIBUTES = 0x8B89; 324 const GLenum SHADING_LANGUAGE_VERSION = 0x8B8C; 325 const GLenum CURRENT_PROGRAM = 0x8B8D; 326 327 /* StencilFunction */ 328 const GLenum NEVER = 0x0200; 329 const GLenum LESS = 0x0201; 330 const GLenum EQUAL = 0x0202; 331 const GLenum LEQUAL = 0x0203; 332 const GLenum GREATER = 0x0204; 333 const GLenum NOTEQUAL = 0x0205; 334 const GLenum GEQUAL = 0x0206; 335 const GLenum ALWAYS = 0x0207; 336 337 /* StencilOp */ 338 /* ZERO */ 339 const GLenum KEEP = 0x1E00; 340 const GLenum REPLACE = 0x1E01; 341 const GLenum INCR = 0x1E02; 342 const GLenum DECR = 0x1E03; 343 const GLenum INVERT = 0x150A; 344 const GLenum INCR_WRAP = 0x8507; 345 const GLenum DECR_WRAP = 0x8508; 346 347 /* StringName */ 348 const GLenum VENDOR = 0x1F00; 349 const GLenum RENDERER = 0x1F01; 350 const GLenum VERSION = 0x1F02; 351 352 /* TextureMagFilter */ 353 const GLenum NEAREST = 0x2600; 354 const GLenum LINEAR = 0x2601; 355 356 /* TextureMinFilter */ 357 /* NEAREST */ 358 /* LINEAR */ 359 const GLenum NEAREST_MIPMAP_NEAREST = 0x2700; 360 const GLenum LINEAR_MIPMAP_NEAREST = 0x2701; 361 const GLenum NEAREST_MIPMAP_LINEAR = 0x2702; 362 const GLenum LINEAR_MIPMAP_LINEAR = 0x2703; 363 364 /* TextureParameterName */ 365 const GLenum TEXTURE_MAG_FILTER = 0x2800; 366 const GLenum TEXTURE_MIN_FILTER = 0x2801; 367 const GLenum TEXTURE_WRAP_S = 0x2802; 368 const GLenum TEXTURE_WRAP_T = 0x2803; 369 370 /* TextureTarget */ 371 const GLenum TEXTURE_2D = 0x0DE1; 372 const GLenum TEXTURE = 0x1702; 373 374 const GLenum TEXTURE_CUBE_MAP = 0x8513; 375 const GLenum TEXTURE_BINDING_CUBE_MAP = 0x8514; 376 const GLenum TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515; 377 const GLenum TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516; 378 const GLenum TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517; 379 const GLenum TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518; 380 const GLenum TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519; 381 const GLenum TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A; 382 const GLenum MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C; 383 384 /* TextureUnit */ 385 const GLenum TEXTURE0 = 0x84C0; 386 const GLenum TEXTURE1 = 0x84C1; 387 const GLenum TEXTURE2 = 0x84C2; 388 const GLenum TEXTURE3 = 0x84C3; 389 const GLenum TEXTURE4 = 0x84C4; 390 const GLenum TEXTURE5 = 0x84C5; 391 const GLenum TEXTURE6 = 0x84C6; 392 const GLenum TEXTURE7 = 0x84C7; 393 const GLenum TEXTURE8 = 0x84C8; 394 const GLenum TEXTURE9 = 0x84C9; 395 const GLenum TEXTURE10 = 0x84CA; 396 const GLenum TEXTURE11 = 0x84CB; 397 const GLenum TEXTURE12 = 0x84CC; 398 const GLenum TEXTURE13 = 0x84CD; 399 const GLenum TEXTURE14 = 0x84CE; 400 const GLenum TEXTURE15 = 0x84CF; 401 const GLenum TEXTURE16 = 0x84D0; 402 const GLenum TEXTURE17 = 0x84D1; 403 const GLenum TEXTURE18 = 0x84D2; 404 const GLenum TEXTURE19 = 0x84D3; 405 const GLenum TEXTURE20 = 0x84D4; 406 const GLenum TEXTURE21 = 0x84D5; 407 const GLenum TEXTURE22 = 0x84D6; 408 const GLenum TEXTURE23 = 0x84D7; 409 const GLenum TEXTURE24 = 0x84D8; 410 const GLenum TEXTURE25 = 0x84D9; 411 const GLenum TEXTURE26 = 0x84DA; 412 const GLenum TEXTURE27 = 0x84DB; 413 const GLenum TEXTURE28 = 0x84DC; 414 const GLenum TEXTURE29 = 0x84DD; 415 const GLenum TEXTURE30 = 0x84DE; 416 const GLenum TEXTURE31 = 0x84DF; 417 const GLenum ACTIVE_TEXTURE = 0x84E0; 418 419 /* TextureWrapMode */ 420 const GLenum REPEAT = 0x2901; 421 const GLenum CLAMP_TO_EDGE = 0x812F; 422 const GLenum MIRRORED_REPEAT = 0x8370; 423 424 /* Uniform Types */ 425 const GLenum FLOAT_VEC2 = 0x8B50; 426 const GLenum FLOAT_VEC3 = 0x8B51; 427 const GLenum FLOAT_VEC4 = 0x8B52; 428 const GLenum INT_VEC2 = 0x8B53; 429 const GLenum INT_VEC3 = 0x8B54; 430 const GLenum INT_VEC4 = 0x8B55; 431 const GLenum BOOL = 0x8B56; 432 const GLenum BOOL_VEC2 = 0x8B57; 433 const GLenum BOOL_VEC3 = 0x8B58; 434 const GLenum BOOL_VEC4 = 0x8B59; 435 const GLenum FLOAT_MAT2 = 0x8B5A; 436 const GLenum FLOAT_MAT3 = 0x8B5B; 437 const GLenum FLOAT_MAT4 = 0x8B5C; 438 const GLenum SAMPLER_2D = 0x8B5E; 439 const GLenum SAMPLER_CUBE = 0x8B60; 440 441 /* Vertex Arrays */ 442 const GLenum VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622; 443 const GLenum VERTEX_ATTRIB_ARRAY_SIZE = 0x8623; 444 const GLenum VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624; 445 const GLenum VERTEX_ATTRIB_ARRAY_TYPE = 0x8625; 446 const GLenum VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A; 447 const GLenum VERTEX_ATTRIB_ARRAY_POINTER = 0x8645; 448 const GLenum VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F; 449 450 /* Read Format */ 451 const GLenum IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A; 452 const GLenum IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B; 453 454 /* Shader Source */ 455 const GLenum COMPILE_STATUS = 0x8B81; 456 457 /* Shader Precision-Specified Types */ 458 const GLenum LOW_FLOAT = 0x8DF0; 459 const GLenum MEDIUM_FLOAT = 0x8DF1; 460 const GLenum HIGH_FLOAT = 0x8DF2; 461 const GLenum LOW_INT = 0x8DF3; 462 const GLenum MEDIUM_INT = 0x8DF4; 463 const GLenum HIGH_INT = 0x8DF5; 464 465 /* Framebuffer Object. */ 466 const GLenum FRAMEBUFFER = 0x8D40; 467 const GLenum RENDERBUFFER = 0x8D41; 468 469 const GLenum RGBA4 = 0x8056; 470 const GLenum RGB5_A1 = 0x8057; 471 const GLenum RGBA8 = 0x8058; 472 const GLenum RGB565 = 0x8D62; 473 const GLenum DEPTH_COMPONENT16 = 0x81A5; 474 const GLenum STENCIL_INDEX8 = 0x8D48; 475 const GLenum DEPTH_STENCIL = 0x84F9; 476 477 const GLenum RENDERBUFFER_WIDTH = 0x8D42; 478 const GLenum RENDERBUFFER_HEIGHT = 0x8D43; 479 const GLenum RENDERBUFFER_INTERNAL_FORMAT = 0x8D44; 480 const GLenum RENDERBUFFER_RED_SIZE = 0x8D50; 481 const GLenum RENDERBUFFER_GREEN_SIZE = 0x8D51; 482 const GLenum RENDERBUFFER_BLUE_SIZE = 0x8D52; 483 const GLenum RENDERBUFFER_ALPHA_SIZE = 0x8D53; 484 const GLenum RENDERBUFFER_DEPTH_SIZE = 0x8D54; 485 const GLenum RENDERBUFFER_STENCIL_SIZE = 0x8D55; 486 487 const GLenum FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0; 488 const GLenum FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1; 489 const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2; 490 const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3; 491 492 const GLenum COLOR_ATTACHMENT0 = 0x8CE0; 493 const GLenum DEPTH_ATTACHMENT = 0x8D00; 494 const GLenum STENCIL_ATTACHMENT = 0x8D20; 495 const GLenum DEPTH_STENCIL_ATTACHMENT = 0x821A; 496 497 const GLenum NONE = 0; 498 499 const GLenum FRAMEBUFFER_COMPLETE = 0x8CD5; 500 const GLenum FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6; 501 const GLenum FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7; 502 const GLenum FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9; 503 const GLenum FRAMEBUFFER_UNSUPPORTED = 0x8CDD; 504 505 const GLenum FRAMEBUFFER_BINDING = 0x8CA6; 506 const GLenum RENDERBUFFER_BINDING = 0x8CA7; 507 const GLenum MAX_RENDERBUFFER_SIZE = 0x84E8; 508 509 const GLenum INVALID_FRAMEBUFFER_OPERATION = 0x0506; 510 511 /* WebGL-specific enums */ 512 const GLenum UNPACK_FLIP_Y_WEBGL = 0x9240; 513 const GLenum UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241; 514 const GLenum CONTEXT_LOST_WEBGL = 0x9242; 515 const GLenum UNPACK_COLORSPACE_CONVERSION_WEBGL = 0x9243; 516 const GLenum BROWSER_DEFAULT_WEBGL = 0x9244; 517 518 readonly attribute (HTMLCanvasElement or OffscreenCanvas) canvas; 519 readonly attribute GLsizei drawingBufferWidth; 520 readonly attribute GLsizei drawingBufferHeight; 521 readonly attribute GLenum drawingBufferFormat; 522 523 /* Upon context creation, drawingBufferColorSpace and unpackColorSpace both 524 default to the value "srgb". */ 525 attribute PredefinedColorSpace drawingBufferColorSpace; 526 attribute PredefinedColorSpace unpackColorSpace; 527 528 [WebGLHandlesContextLoss] WebGLContextAttributes? getContextAttributes(); 529 [WebGLHandlesContextLoss] boolean isContextLost(); 530 531 sequence<DOMString>? getSupportedExtensions(); 532 object? getExtension(DOMString name); 533 534 undefined drawingBufferStorage(GLenum sizedFormat, unsigned long width, unsigned long height); 535 536 undefined activeTexture(GLenum texture); 537 undefined attachShader(WebGLProgram program, WebGLShader shader); 538 undefined bindAttribLocation(WebGLProgram program, GLuint index, DOMString name); 539 undefined bindBuffer(GLenum target, WebGLBuffer? buffer); 540 undefined bindFramebuffer(GLenum target, WebGLFramebuffer? framebuffer); 541 undefined bindRenderbuffer(GLenum target, WebGLRenderbuffer? renderbuffer); 542 undefined bindTexture(GLenum target, WebGLTexture? texture); 543 undefined blendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); 544 undefined blendEquation(GLenum mode); 545 undefined blendEquationSeparate(GLenum modeRGB, GLenum modeAlpha); 546 undefined blendFunc(GLenum sfactor, GLenum dfactor); 547 undefined blendFuncSeparate(GLenum srcRGB, GLenum dstRGB, 548 GLenum srcAlpha, GLenum dstAlpha); 549 550 [WebGLHandlesContextLoss] GLenum checkFramebufferStatus(GLenum target); 551 undefined clear(GLbitfield mask); 552 undefined clearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); 553 undefined clearDepth(GLclampf depth); 554 undefined clearStencil(GLint s); 555 undefined colorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); 556 undefined compileShader(WebGLShader shader); 557 558 undefined copyTexImage2D(GLenum target, GLint level, GLenum internalformat, 559 GLint x, GLint y, GLsizei width, GLsizei height, 560 GLint border); 561 undefined copyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, 562 GLint x, GLint y, GLsizei width, GLsizei height); 563 564 WebGLBuffer createBuffer(); 565 WebGLFramebuffer createFramebuffer(); 566 WebGLProgram createProgram(); 567 WebGLRenderbuffer createRenderbuffer(); 568 WebGLShader? createShader(GLenum type); 569 WebGLTexture createTexture(); 570 571 undefined cullFace(GLenum mode); 572 573 undefined deleteBuffer(WebGLBuffer? buffer); 574 undefined deleteFramebuffer(WebGLFramebuffer? framebuffer); 575 undefined deleteProgram(WebGLProgram? program); 576 undefined deleteRenderbuffer(WebGLRenderbuffer? renderbuffer); 577 undefined deleteShader(WebGLShader? shader); 578 undefined deleteTexture(WebGLTexture? texture); 579 580 undefined depthFunc(GLenum func); 581 undefined depthMask(GLboolean flag); 582 undefined depthRange(GLclampf zNear, GLclampf zFar); 583 undefined detachShader(WebGLProgram program, WebGLShader shader); 584 undefined disable(GLenum cap); 585 undefined disableVertexAttribArray(GLuint index); 586 undefined drawArrays(GLenum mode, GLint first, GLsizei count); 587 undefined drawElements(GLenum mode, GLsizei count, GLenum type, GLintptr offset); 588 589 undefined enable(GLenum cap); 590 undefined enableVertexAttribArray(GLuint index); 591 undefined finish(); 592 undefined flush(); 593 undefined framebufferRenderbuffer(GLenum target, GLenum attachment, 594 GLenum renderbuffertarget, 595 WebGLRenderbuffer? renderbuffer); 596 undefined framebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, 597 WebGLTexture? texture, GLint level); 598 undefined frontFace(GLenum mode); 599 600 undefined generateMipmap(GLenum target); 601 602 WebGLActiveInfo? getActiveAttrib(WebGLProgram program, GLuint index); 603 WebGLActiveInfo? getActiveUniform(WebGLProgram program, GLuint index); 604 sequence<WebGLShader>? getAttachedShaders(WebGLProgram program); 605 606 [WebGLHandlesContextLoss] GLint getAttribLocation(WebGLProgram program, DOMString name); 607 608 any getBufferParameter(GLenum target, GLenum pname); 609 any getParameter(GLenum pname); 610 611 [WebGLHandlesContextLoss] GLenum getError(); 612 613 any getFramebufferAttachmentParameter(GLenum target, GLenum attachment, 614 GLenum pname); 615 any getProgramParameter(WebGLProgram program, GLenum pname); 616 DOMString? getProgramInfoLog(WebGLProgram program); 617 any getRenderbufferParameter(GLenum target, GLenum pname); 618 any getShaderParameter(WebGLShader shader, GLenum pname); 619 WebGLShaderPrecisionFormat? getShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype); 620 DOMString? getShaderInfoLog(WebGLShader shader); 621 622 DOMString? getShaderSource(WebGLShader shader); 623 624 any getTexParameter(GLenum target, GLenum pname); 625 626 any getUniform(WebGLProgram program, WebGLUniformLocation location); 627 628 WebGLUniformLocation? getUniformLocation(WebGLProgram program, DOMString name); 629 630 any getVertexAttrib(GLuint index, GLenum pname); 631 632 [WebGLHandlesContextLoss] GLintptr getVertexAttribOffset(GLuint index, GLenum pname); 633 634 undefined hint(GLenum target, GLenum mode); 635 [WebGLHandlesContextLoss] GLboolean isBuffer(WebGLBuffer? buffer); 636 [WebGLHandlesContextLoss] GLboolean isEnabled(GLenum cap); 637 [WebGLHandlesContextLoss] GLboolean isFramebuffer(WebGLFramebuffer? framebuffer); 638 [WebGLHandlesContextLoss] GLboolean isProgram(WebGLProgram? program); 639 [WebGLHandlesContextLoss] GLboolean isRenderbuffer(WebGLRenderbuffer? renderbuffer); 640 [WebGLHandlesContextLoss] GLboolean isShader(WebGLShader? shader); 641 [WebGLHandlesContextLoss] GLboolean isTexture(WebGLTexture? texture); 642 undefined lineWidth(GLfloat width); 643 undefined linkProgram(WebGLProgram program); 644 undefined pixelStorei(GLenum pname, GLint param); 645 undefined polygonOffset(GLfloat factor, GLfloat units); 646 647 undefined renderbufferStorage(GLenum target, GLenum internalformat, 648 GLsizei width, GLsizei height); 649 undefined sampleCoverage(GLclampf value, GLboolean invert); 650 undefined scissor(GLint x, GLint y, GLsizei width, GLsizei height); 651 652 undefined shaderSource(WebGLShader shader, DOMString source); 653 654 undefined stencilFunc(GLenum func, GLint ref, GLuint mask); 655 undefined stencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask); 656 undefined stencilMask(GLuint mask); 657 undefined stencilMaskSeparate(GLenum face, GLuint mask); 658 undefined stencilOp(GLenum fail, GLenum zfail, GLenum zpass); 659 undefined stencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass); 660 661 undefined texParameterf(GLenum target, GLenum pname, GLfloat param); 662 undefined texParameteri(GLenum target, GLenum pname, GLint param); 663 664 undefined uniform1f(WebGLUniformLocation? location, GLfloat x); 665 undefined uniform2f(WebGLUniformLocation? location, GLfloat x, GLfloat y); 666 undefined uniform3f(WebGLUniformLocation? location, GLfloat x, GLfloat y, GLfloat z); 667 undefined uniform4f(WebGLUniformLocation? location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); 668 669 undefined uniform1i(WebGLUniformLocation? location, GLint x); 670 undefined uniform2i(WebGLUniformLocation? location, GLint x, GLint y); 671 undefined uniform3i(WebGLUniformLocation? location, GLint x, GLint y, GLint z); 672 undefined uniform4i(WebGLUniformLocation? location, GLint x, GLint y, GLint z, GLint w); 673 674 undefined useProgram(WebGLProgram? program); 675 undefined validateProgram(WebGLProgram program); 676 677 undefined vertexAttrib1f(GLuint index, GLfloat x); 678 undefined vertexAttrib2f(GLuint index, GLfloat x, GLfloat y); 679 undefined vertexAttrib3f(GLuint index, GLfloat x, GLfloat y, GLfloat z); 680 undefined vertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); 681 682 undefined vertexAttrib1fv(GLuint index, Float32List values); 683 undefined vertexAttrib2fv(GLuint index, Float32List values); 684 undefined vertexAttrib3fv(GLuint index, Float32List values); 685 undefined vertexAttrib4fv(GLuint index, Float32List values); 686 687 undefined vertexAttribPointer(GLuint index, GLint size, GLenum type, 688 GLboolean normalized, GLsizei stride, GLintptr offset); 689 690 undefined viewport(GLint x, GLint y, GLsizei width, GLsizei height); 691 }; 692 693 interface mixin WebGLRenderingContextOverloads 694 { 695 undefined bufferData(GLenum target, GLsizeiptr size, GLenum usage); 696 undefined bufferData(GLenum target, AllowSharedBufferSource? data, GLenum usage); 697 undefined bufferSubData(GLenum target, GLintptr offset, AllowSharedBufferSource data); 698 699 undefined compressedTexImage2D(GLenum target, GLint level, GLenum internalformat, 700 GLsizei width, GLsizei height, GLint border, 701 [AllowShared] ArrayBufferView data); 702 undefined compressedTexSubImage2D(GLenum target, GLint level, 703 GLint xoffset, GLint yoffset, 704 GLsizei width, GLsizei height, GLenum format, 705 [AllowShared] ArrayBufferView data); 706 707 undefined readPixels(GLint x, GLint y, GLsizei width, GLsizei height, 708 GLenum format, GLenum type, [AllowShared] ArrayBufferView? pixels); 709 710 undefined texImage2D(GLenum target, GLint level, GLint internalformat, 711 GLsizei width, GLsizei height, GLint border, GLenum format, 712 GLenum type, [AllowShared] ArrayBufferView? pixels); 713 undefined texImage2D(GLenum target, GLint level, GLint internalformat, 714 GLenum format, GLenum type, TexImageSource source); // May throw DOMException 715 716 undefined texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, 717 GLsizei width, GLsizei height, 718 GLenum format, GLenum type, [AllowShared] ArrayBufferView? pixels); 719 undefined texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, 720 GLenum format, GLenum type, TexImageSource source); // May throw DOMException 721 722 undefined uniform1fv(WebGLUniformLocation? location, Float32List v); 723 undefined uniform2fv(WebGLUniformLocation? location, Float32List v); 724 undefined uniform3fv(WebGLUniformLocation? location, Float32List v); 725 undefined uniform4fv(WebGLUniformLocation? location, Float32List v); 726 727 undefined uniform1iv(WebGLUniformLocation? location, Int32List v); 728 undefined uniform2iv(WebGLUniformLocation? location, Int32List v); 729 undefined uniform3iv(WebGLUniformLocation? location, Int32List v); 730 undefined uniform4iv(WebGLUniformLocation? location, Int32List v); 731 732 undefined uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, Float32List value); 733 undefined uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, Float32List value); 734 undefined uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, Float32List value); 735 }; 736 737 [Exposed=(Window,Worker)] 738 interface WebGLRenderingContext 739 { 740 }; 741 WebGLRenderingContext includes WebGLRenderingContextBase; 742 WebGLRenderingContext includes WebGLRenderingContextOverloads; 743 744 [Exposed=(Window,Worker)] 745 interface WebGLContextEvent : Event { 746 constructor(DOMString type, optional WebGLContextEventInit eventInit = {}); 747 readonly attribute DOMString statusMessage; 748 }; 749 750 // EventInit is defined in the DOM4 specification. 751 dictionary WebGLContextEventInit : EventInit { 752 DOMString statusMessage = ""; 753 };