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