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