1
2#[macro_use]
4extern crate stdweb;
5#[macro_use]
6extern crate serde_derive;
7#[macro_use]
8extern crate stdweb_derive;
9
10use self::stdweb::{Reference, Value, UnsafeTypedArray, JsSerialize, InstanceOf};
11use self::stdweb::unstable::{TryFrom, TryInto};
12use self::stdweb::web::{RenderingContext, TypedArray, ArrayBuffer};
13use self::stdweb::web::html_element::CanvasElement;
14
15type ConversionError = <Reference as TryFrom<Value>>::Error;
16
17pub trait AsTypedArray<'a, T> {
18 type Result: JsSerialize;
19
20 unsafe fn as_typed_array(self) -> Self::Result;
21}
22
23pub trait AsArrayBufferView<'a> {
24 type Result: JsSerialize;
25
26 unsafe fn as_array_buffer_view(self) -> Self::Result;
27}
28
29pub trait Extension: TryFrom<Value> {
30 const NAME: &'static str;
31}
32
33macro_rules! define_array {
34 ($elem:ty) => {
35 impl<'a> AsTypedArray<'a, $elem> for &'a TypedArray<$elem> {
36 type Result = Self;
37
38 unsafe fn as_typed_array(self) -> Self::Result { self }
39 }
40
41 impl<'a> AsTypedArray<'a, $elem> for &'a [$elem] {
42 type Result = UnsafeTypedArray<'a, $elem>;
43
44 unsafe fn as_typed_array(self) -> Self::Result { UnsafeTypedArray::new(self) }
45 }
46
47 impl<'a> AsArrayBufferView<'a> for &'a TypedArray<$elem> {
48 type Result = Self;
49
50 unsafe fn as_array_buffer_view(self) -> Self::Result { self }
51 }
52
53 impl<'a> AsArrayBufferView<'a> for &'a [$elem] {
54 type Result = UnsafeTypedArray<'a, $elem>;
55
56 unsafe fn as_array_buffer_view(self) -> Self::Result { UnsafeTypedArray::new(self) }
57 }
58 }
59}
60
61define_array!(i8);
62define_array!(u8);
63define_array!(i16);
64define_array!(u16);
65define_array!(i32);
66define_array!(u32);
67define_array!(f32);
68define_array!(f64);
69
70pub type Float32List = TypedArray<f32>;
71pub type GLbitfield = u32;
72pub type GLboolean = bool;
73pub type GLbyte = i8;
74pub type GLclampf = f32;
75pub type GLenum = u32;
76pub type GLfloat = f32;
77pub type GLint = i32;
78pub type GLint64 = i64;
79pub type GLintptr = i64;
80pub type GLshort = i16;
81pub type GLsizei = i32;
82pub type GLsizeiptr = i64;
83pub type GLubyte = u8;
84pub type GLuint = u32;
85pub type GLuint64 = u64;
86pub type GLushort = u16;
87pub type Int32List = TypedArray<i32>;
88pub type TexImageSource = Value;
89pub type Uint32List = TypedArray<u32>;
90
91#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
92pub enum WebGLPowerPreference {
93
94 #[serde(rename = "default")]
95 Default,
96
97 #[serde(rename = "high-performance")]
98 HighPerformance,
99
100 #[serde(rename = "low-power")]
101 LowPower,
102
103}
104js_deserializable!(WebGLPowerPreference);
105js_serializable!(WebGLPowerPreference);
106
107
108#[derive(Debug, Clone, Serialize, Deserialize)]
109pub struct WebGLContextAttributes {
110
111 alpha: GLboolean,
112
113 antialias: GLboolean,
114
115 depth: GLboolean,
116
117 #[serde(rename = "failIfMajorPerformanceCaveat")]
118 fail_if_major_performance_caveat: GLboolean,
119
120 #[serde(rename = "powerPreference")]
121 power_preference: WebGLPowerPreference,
122
123 #[serde(rename = "premultipliedAlpha")]
124 premultiplied_alpha: GLboolean,
125
126 #[serde(rename = "preserveDrawingBuffer")]
127 preserve_drawing_buffer: GLboolean,
128
129 stencil: GLboolean,
130
131}
132js_deserializable!(WebGLContextAttributes);
133js_serializable!(WebGLContextAttributes);
134
135
136#[derive(Debug, Clone, ReferenceType)]
137pub struct GLContext(Reference);
138
139impl GLContext {
140
141 pub const ACTIVE_ATTRIBUTES: GLenum = 35721;
142 pub const ACTIVE_TEXTURE: GLenum = 34016;
143 pub const ACTIVE_UNIFORMS: GLenum = 35718;
144 pub const ACTIVE_UNIFORM_BLOCKS: GLenum = 35382;
145 pub const ALIASED_LINE_WIDTH_RANGE: GLenum = 33902;
146 pub const ALIASED_POINT_SIZE_RANGE: GLenum = 33901;
147 pub const ALPHA: GLenum = 6406;
148 pub const ALPHA_BITS: GLenum = 3413;
149 pub const ALREADY_SIGNALED: GLenum = 37146;
150 pub const ALWAYS: GLenum = 519;
151 pub const ANY_SAMPLES_PASSED: GLenum = 35887;
152 pub const ANY_SAMPLES_PASSED_CONSERVATIVE: GLenum = 36202;
153 pub const ARRAY_BUFFER: GLenum = 34962;
154 pub const ARRAY_BUFFER_BINDING: GLenum = 34964;
155 pub const ATTACHED_SHADERS: GLenum = 35717;
156 pub const BACK: GLenum = 1029;
157 pub const BLEND: GLenum = 3042;
158 pub const BLEND_COLOR: GLenum = 32773;
159 pub const BLEND_DST_ALPHA: GLenum = 32970;
160 pub const BLEND_DST_RGB: GLenum = 32968;
161 pub const BLEND_EQUATION: GLenum = 32777;
162 pub const BLEND_EQUATION_ALPHA: GLenum = 34877;
163 pub const BLEND_EQUATION_RGB: GLenum = 32777;
164 pub const BLEND_SRC_ALPHA: GLenum = 32971;
165 pub const BLEND_SRC_RGB: GLenum = 32969;
166 pub const BLUE_BITS: GLenum = 3412;
167 pub const BOOL: GLenum = 35670;
168 pub const BOOL_VEC2: GLenum = 35671;
169 pub const BOOL_VEC3: GLenum = 35672;
170 pub const BOOL_VEC4: GLenum = 35673;
171 pub const BROWSER_DEFAULT_WEBGL: GLenum = 37444;
172 pub const BUFFER_SIZE: GLenum = 34660;
173 pub const BUFFER_USAGE: GLenum = 34661;
174 pub const BYTE: GLenum = 5120;
175 pub const CCW: GLenum = 2305;
176 pub const CLAMP_TO_EDGE: GLenum = 33071;
177 pub const COLOR: GLenum = 6144;
178 pub const COLOR_ATTACHMENT0: GLenum = 36064;
179 pub const COLOR_ATTACHMENT1: GLenum = 36065;
180 pub const COLOR_ATTACHMENT10: GLenum = 36074;
181 pub const COLOR_ATTACHMENT11: GLenum = 36075;
182 pub const COLOR_ATTACHMENT12: GLenum = 36076;
183 pub const COLOR_ATTACHMENT13: GLenum = 36077;
184 pub const COLOR_ATTACHMENT14: GLenum = 36078;
185 pub const COLOR_ATTACHMENT15: GLenum = 36079;
186 pub const COLOR_ATTACHMENT2: GLenum = 36066;
187 pub const COLOR_ATTACHMENT3: GLenum = 36067;
188 pub const COLOR_ATTACHMENT4: GLenum = 36068;
189 pub const COLOR_ATTACHMENT5: GLenum = 36069;
190 pub const COLOR_ATTACHMENT6: GLenum = 36070;
191 pub const COLOR_ATTACHMENT7: GLenum = 36071;
192 pub const COLOR_ATTACHMENT8: GLenum = 36072;
193 pub const COLOR_ATTACHMENT9: GLenum = 36073;
194 pub const COLOR_BUFFER_BIT: GLenum = 16384;
195 pub const COLOR_CLEAR_VALUE: GLenum = 3106;
196 pub const COLOR_WRITEMASK: GLenum = 3107;
197 pub const COMPARE_REF_TO_TEXTURE: GLenum = 34894;
198 pub const COMPILE_STATUS: GLenum = 35713;
199 pub const COMPRESSED_TEXTURE_FORMATS: GLenum = 34467;
200 pub const CONDITION_SATISFIED: GLenum = 37148;
201 pub const CONSTANT_ALPHA: GLenum = 32771;
202 pub const CONSTANT_COLOR: GLenum = 32769;
203 pub const CONTEXT_LOST_WEBGL: GLenum = 37442;
204 pub const COPY_READ_BUFFER: GLenum = 36662;
205 pub const COPY_READ_BUFFER_BINDING: GLenum = 36662;
206 pub const COPY_WRITE_BUFFER: GLenum = 36663;
207 pub const COPY_WRITE_BUFFER_BINDING: GLenum = 36663;
208 pub const CULL_FACE: GLenum = 2884;
209 pub const CULL_FACE_MODE: GLenum = 2885;
210 pub const CURRENT_PROGRAM: GLenum = 35725;
211 pub const CURRENT_QUERY: GLenum = 34917;
212 pub const CURRENT_VERTEX_ATTRIB: GLenum = 34342;
213 pub const CW: GLenum = 2304;
214 pub const DECR: GLenum = 7683;
215 pub const DECR_WRAP: GLenum = 34056;
216 pub const DELETE_STATUS: GLenum = 35712;
217 pub const DEPTH: GLenum = 6145;
218 pub const DEPTH24_STENCIL8: GLenum = 35056;
219 pub const DEPTH32F_STENCIL8: GLenum = 36013;
220 pub const DEPTH_ATTACHMENT: GLenum = 36096;
221 pub const DEPTH_BITS: GLenum = 3414;
222 pub const DEPTH_BUFFER_BIT: GLenum = 256;
223 pub const DEPTH_CLEAR_VALUE: GLenum = 2931;
224 pub const DEPTH_COMPONENT: GLenum = 6402;
225 pub const DEPTH_COMPONENT16: GLenum = 33189;
226 pub const DEPTH_COMPONENT24: GLenum = 33190;
227 pub const DEPTH_COMPONENT32F: GLenum = 36012;
228 pub const DEPTH_FUNC: GLenum = 2932;
229 pub const DEPTH_RANGE: GLenum = 2928;
230 pub const DEPTH_STENCIL: GLenum = 34041;
231 pub const DEPTH_STENCIL_ATTACHMENT: GLenum = 33306;
232 pub const DEPTH_TEST: GLenum = 2929;
233 pub const DEPTH_WRITEMASK: GLenum = 2930;
234 pub const DITHER: GLenum = 3024;
235 pub const DONT_CARE: GLenum = 4352;
236 pub const DRAW_BUFFER0: GLenum = 34853;
237 pub const DRAW_BUFFER1: GLenum = 34854;
238 pub const DRAW_BUFFER10: GLenum = 34863;
239 pub const DRAW_BUFFER11: GLenum = 34864;
240 pub const DRAW_BUFFER12: GLenum = 34865;
241 pub const DRAW_BUFFER13: GLenum = 34866;
242 pub const DRAW_BUFFER14: GLenum = 34867;
243 pub const DRAW_BUFFER15: GLenum = 34868;
244 pub const DRAW_BUFFER2: GLenum = 34855;
245 pub const DRAW_BUFFER3: GLenum = 34856;
246 pub const DRAW_BUFFER4: GLenum = 34857;
247 pub const DRAW_BUFFER5: GLenum = 34858;
248 pub const DRAW_BUFFER6: GLenum = 34859;
249 pub const DRAW_BUFFER7: GLenum = 34860;
250 pub const DRAW_BUFFER8: GLenum = 34861;
251 pub const DRAW_BUFFER9: GLenum = 34862;
252 pub const DRAW_FRAMEBUFFER: GLenum = 36009;
253 pub const DRAW_FRAMEBUFFER_BINDING: GLenum = 36006;
254 pub const DST_ALPHA: GLenum = 772;
255 pub const DST_COLOR: GLenum = 774;
256 pub const DYNAMIC_COPY: GLenum = 35050;
257 pub const DYNAMIC_DRAW: GLenum = 35048;
258 pub const DYNAMIC_READ: GLenum = 35049;
259 pub const ELEMENT_ARRAY_BUFFER: GLenum = 34963;
260 pub const ELEMENT_ARRAY_BUFFER_BINDING: GLenum = 34965;
261 pub const EQUAL: GLenum = 514;
262 pub const FASTEST: GLenum = 4353;
263 pub const FLOAT: GLenum = 5126;
264 pub const FLOAT_32_UNSIGNED_INT_24_8_REV: GLenum = 36269;
265 pub const FLOAT_MAT2: GLenum = 35674;
266 pub const FLOAT_MAT2X3: GLenum = 35685;
267 pub const FLOAT_MAT2X4: GLenum = 35686;
268 pub const FLOAT_MAT3: GLenum = 35675;
269 pub const FLOAT_MAT3X2: GLenum = 35687;
270 pub const FLOAT_MAT3X4: GLenum = 35688;
271 pub const FLOAT_MAT4: GLenum = 35676;
272 pub const FLOAT_MAT4X2: GLenum = 35689;
273 pub const FLOAT_MAT4X3: GLenum = 35690;
274 pub const FLOAT_VEC2: GLenum = 35664;
275 pub const FLOAT_VEC3: GLenum = 35665;
276 pub const FLOAT_VEC4: GLenum = 35666;
277 pub const FRAGMENT_SHADER: GLenum = 35632;
278 pub const FRAGMENT_SHADER_DERIVATIVE_HINT: GLenum = 35723;
279 pub const FRAMEBUFFER: GLenum = 36160;
280 pub const FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: GLenum = 33301;
281 pub const FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: GLenum = 33300;
282 pub const FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: GLenum = 33296;
283 pub const FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: GLenum = 33297;
284 pub const FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: GLenum = 33302;
285 pub const FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: GLenum = 33299;
286 pub const FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: GLenum = 36049;
287 pub const FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: GLenum = 36048;
288 pub const FRAMEBUFFER_ATTACHMENT_RED_SIZE: GLenum = 33298;
289 pub const FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: GLenum = 33303;
290 pub const FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: GLenum = 36051;
291 pub const FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: GLenum = 36052;
292 pub const FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: GLenum = 36050;
293 pub const FRAMEBUFFER_BINDING: GLenum = 36006;
294 pub const FRAMEBUFFER_COMPLETE: GLenum = 36053;
295 pub const FRAMEBUFFER_DEFAULT: GLenum = 33304;
296 pub const FRAMEBUFFER_INCOMPLETE_ATTACHMENT: GLenum = 36054;
297 pub const FRAMEBUFFER_INCOMPLETE_DIMENSIONS: GLenum = 36057;
298 pub const FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: GLenum = 36055;
299 pub const FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: GLenum = 36182;
300 pub const FRAMEBUFFER_UNSUPPORTED: GLenum = 36061;
301 pub const FRONT: GLenum = 1028;
302 pub const FRONT_AND_BACK: GLenum = 1032;
303 pub const FRONT_FACE: GLenum = 2886;
304 pub const FUNC_ADD: GLenum = 32774;
305 pub const FUNC_REVERSE_SUBTRACT: GLenum = 32779;
306 pub const FUNC_SUBTRACT: GLenum = 32778;
307 pub const GENERATE_MIPMAP_HINT: GLenum = 33170;
308 pub const GEQUAL: GLenum = 518;
309 pub const GREATER: GLenum = 516;
310 pub const GREEN_BITS: GLenum = 3411;
311 pub const HALF_FLOAT: GLenum = 5131;
312 pub const HIGH_FLOAT: GLenum = 36338;
313 pub const HIGH_INT: GLenum = 36341;
314 pub const IMPLEMENTATION_COLOR_READ_FORMAT: GLenum = 35739;
315 pub const IMPLEMENTATION_COLOR_READ_TYPE: GLenum = 35738;
316 pub const INCR: GLenum = 7682;
317 pub const INCR_WRAP: GLenum = 34055;
318 pub const INT: GLenum = 5124;
319 pub const INTERLEAVED_ATTRIBS: GLenum = 35980;
320 pub const INT_2_10_10_10_REV: GLenum = 36255;
321 pub const INT_SAMPLER_2D: GLenum = 36298;
322 pub const INT_SAMPLER_2D_ARRAY: GLenum = 36303;
323 pub const INT_SAMPLER_3D: GLenum = 36299;
324 pub const INT_SAMPLER_CUBE: GLenum = 36300;
325 pub const INT_VEC2: GLenum = 35667;
326 pub const INT_VEC3: GLenum = 35668;
327 pub const INT_VEC4: GLenum = 35669;
328 pub const INVALID_ENUM: GLenum = 1280;
329 pub const INVALID_FRAMEBUFFER_OPERATION: GLenum = 1286;
330 pub const INVALID_INDEX: GLenum = 4294967295;
331 pub const INVALID_OPERATION: GLenum = 1282;
332 pub const INVALID_VALUE: GLenum = 1281;
333 pub const INVERT: GLenum = 5386;
334 pub const KEEP: GLenum = 7680;
335 pub const LEQUAL: GLenum = 515;
336 pub const LESS: GLenum = 513;
337 pub const LINEAR: GLenum = 9729;
338 pub const LINEAR_MIPMAP_LINEAR: GLenum = 9987;
339 pub const LINEAR_MIPMAP_NEAREST: GLenum = 9985;
340 pub const LINES: GLenum = 1;
341 pub const LINE_LOOP: GLenum = 2;
342 pub const LINE_STRIP: GLenum = 3;
343 pub const LINE_WIDTH: GLenum = 2849;
344 pub const LINK_STATUS: GLenum = 35714;
345 pub const LOW_FLOAT: GLenum = 36336;
346 pub const LOW_INT: GLenum = 36339;
347 pub const LUMINANCE: GLenum = 6409;
348 pub const LUMINANCE_ALPHA: GLenum = 6410;
349 pub const MAX: GLenum = 32776;
350 pub const MAX_3D_TEXTURE_SIZE: GLenum = 32883;
351 pub const MAX_ARRAY_TEXTURE_LAYERS: GLenum = 35071;
352 pub const MAX_CLIENT_WAIT_TIMEOUT_WEBGL: GLenum = 37447;
353 pub const MAX_COLOR_ATTACHMENTS: GLenum = 36063;
354 pub const MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: GLenum = 35379;
355 pub const MAX_COMBINED_TEXTURE_IMAGE_UNITS: GLenum = 35661;
356 pub const MAX_COMBINED_UNIFORM_BLOCKS: GLenum = 35374;
357 pub const MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: GLenum = 35377;
358 pub const MAX_CUBE_MAP_TEXTURE_SIZE: GLenum = 34076;
359 pub const MAX_DRAW_BUFFERS: GLenum = 34852;
360 pub const MAX_ELEMENTS_INDICES: GLenum = 33001;
361 pub const MAX_ELEMENTS_VERTICES: GLenum = 33000;
362 pub const MAX_ELEMENT_INDEX: GLenum = 36203;
363 pub const MAX_FRAGMENT_INPUT_COMPONENTS: GLenum = 37157;
364 pub const MAX_FRAGMENT_UNIFORM_BLOCKS: GLenum = 35373;
365 pub const MAX_FRAGMENT_UNIFORM_COMPONENTS: GLenum = 35657;
366 pub const MAX_FRAGMENT_UNIFORM_VECTORS: GLenum = 36349;
367 pub const MAX_PROGRAM_TEXEL_OFFSET: GLenum = 35077;
368 pub const MAX_RENDERBUFFER_SIZE: GLenum = 34024;
369 pub const MAX_SAMPLES: GLenum = 36183;
370 pub const MAX_SERVER_WAIT_TIMEOUT: GLenum = 37137;
371 pub const MAX_TEXTURE_IMAGE_UNITS: GLenum = 34930;
372 pub const MAX_TEXTURE_LOD_BIAS: GLenum = 34045;
373 pub const MAX_TEXTURE_SIZE: GLenum = 3379;
374 pub const MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: GLenum = 35978;
375 pub const MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: GLenum = 35979;
376 pub const MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: GLenum = 35968;
377 pub const MAX_UNIFORM_BLOCK_SIZE: GLenum = 35376;
378 pub const MAX_UNIFORM_BUFFER_BINDINGS: GLenum = 35375;
379 pub const MAX_VARYING_COMPONENTS: GLenum = 35659;
380 pub const MAX_VARYING_VECTORS: GLenum = 36348;
381 pub const MAX_VERTEX_ATTRIBS: GLenum = 34921;
382 pub const MAX_VERTEX_OUTPUT_COMPONENTS: GLenum = 37154;
383 pub const MAX_VERTEX_TEXTURE_IMAGE_UNITS: GLenum = 35660;
384 pub const MAX_VERTEX_UNIFORM_BLOCKS: GLenum = 35371;
385 pub const MAX_VERTEX_UNIFORM_COMPONENTS: GLenum = 35658;
386 pub const MAX_VERTEX_UNIFORM_VECTORS: GLenum = 36347;
387 pub const MAX_VIEWPORT_DIMS: GLenum = 3386;
388 pub const MEDIUM_FLOAT: GLenum = 36337;
389 pub const MEDIUM_INT: GLenum = 36340;
390 pub const MIN: GLenum = 32775;
391 pub const MIN_PROGRAM_TEXEL_OFFSET: GLenum = 35076;
392 pub const MIRRORED_REPEAT: GLenum = 33648;
393 pub const NEAREST: GLenum = 9728;
394 pub const NEAREST_MIPMAP_LINEAR: GLenum = 9986;
395 pub const NEAREST_MIPMAP_NEAREST: GLenum = 9984;
396 pub const NEVER: GLenum = 512;
397 pub const NICEST: GLenum = 4354;
398 pub const NONE: GLenum = 0;
399 pub const NOTEQUAL: GLenum = 517;
400 pub const NO_ERROR: GLenum = 0;
401 pub const OBJECT_TYPE: GLenum = 37138;
402 pub const ONE: GLenum = 1;
403 pub const ONE_MINUS_CONSTANT_ALPHA: GLenum = 32772;
404 pub const ONE_MINUS_CONSTANT_COLOR: GLenum = 32770;
405 pub const ONE_MINUS_DST_ALPHA: GLenum = 773;
406 pub const ONE_MINUS_DST_COLOR: GLenum = 775;
407 pub const ONE_MINUS_SRC_ALPHA: GLenum = 771;
408 pub const ONE_MINUS_SRC_COLOR: GLenum = 769;
409 pub const OUT_OF_MEMORY: GLenum = 1285;
410 pub const PACK_ALIGNMENT: GLenum = 3333;
411 pub const PACK_ROW_LENGTH: GLenum = 3330;
412 pub const PACK_SKIP_PIXELS: GLenum = 3332;
413 pub const PACK_SKIP_ROWS: GLenum = 3331;
414 pub const PIXEL_PACK_BUFFER: GLenum = 35051;
415 pub const PIXEL_PACK_BUFFER_BINDING: GLenum = 35053;
416 pub const PIXEL_UNPACK_BUFFER: GLenum = 35052;
417 pub const PIXEL_UNPACK_BUFFER_BINDING: GLenum = 35055;
418 pub const POINTS: GLenum = 0;
419 pub const POLYGON_OFFSET_FACTOR: GLenum = 32824;
420 pub const POLYGON_OFFSET_FILL: GLenum = 32823;
421 pub const POLYGON_OFFSET_UNITS: GLenum = 10752;
422 pub const QUERY_RESULT: GLenum = 34918;
423 pub const QUERY_RESULT_AVAILABLE: GLenum = 34919;
424 pub const R11F_G11F_B10F: GLenum = 35898;
425 pub const R16F: GLenum = 33325;
426 pub const R16I: GLenum = 33331;
427 pub const R16UI: GLenum = 33332;
428 pub const R32F: GLenum = 33326;
429 pub const R32I: GLenum = 33333;
430 pub const R32UI: GLenum = 33334;
431 pub const R8: GLenum = 33321;
432 pub const R8I: GLenum = 33329;
433 pub const R8UI: GLenum = 33330;
434 pub const R8_SNORM: GLenum = 36756;
435 pub const RASTERIZER_DISCARD: GLenum = 35977;
436 pub const READ_BUFFER: GLenum = 3074;
437 pub const READ_FRAMEBUFFER: GLenum = 36008;
438 pub const READ_FRAMEBUFFER_BINDING: GLenum = 36010;
439 pub const RED: GLenum = 6403;
440 pub const RED_BITS: GLenum = 3410;
441 pub const RED_INTEGER: GLenum = 36244;
442 pub const RENDERBUFFER: GLenum = 36161;
443 pub const RENDERBUFFER_ALPHA_SIZE: GLenum = 36179;
444 pub const RENDERBUFFER_BINDING: GLenum = 36007;
445 pub const RENDERBUFFER_BLUE_SIZE: GLenum = 36178;
446 pub const RENDERBUFFER_DEPTH_SIZE: GLenum = 36180;
447 pub const RENDERBUFFER_GREEN_SIZE: GLenum = 36177;
448 pub const RENDERBUFFER_HEIGHT: GLenum = 36163;
449 pub const RENDERBUFFER_INTERNAL_FORMAT: GLenum = 36164;
450 pub const RENDERBUFFER_RED_SIZE: GLenum = 36176;
451 pub const RENDERBUFFER_SAMPLES: GLenum = 36011;
452 pub const RENDERBUFFER_STENCIL_SIZE: GLenum = 36181;
453 pub const RENDERBUFFER_WIDTH: GLenum = 36162;
454 pub const RENDERER: GLenum = 7937;
455 pub const REPEAT: GLenum = 10497;
456 pub const REPLACE: GLenum = 7681;
457 pub const RG: GLenum = 33319;
458 pub const RG16F: GLenum = 33327;
459 pub const RG16I: GLenum = 33337;
460 pub const RG16UI: GLenum = 33338;
461 pub const RG32F: GLenum = 33328;
462 pub const RG32I: GLenum = 33339;
463 pub const RG32UI: GLenum = 33340;
464 pub const RG8: GLenum = 33323;
465 pub const RG8I: GLenum = 33335;
466 pub const RG8UI: GLenum = 33336;
467 pub const RG8_SNORM: GLenum = 36757;
468 pub const RGB: GLenum = 6407;
469 pub const RGB10_A2: GLenum = 32857;
470 pub const RGB10_A2UI: GLenum = 36975;
471 pub const RGB16F: GLenum = 34843;
472 pub const RGB16I: GLenum = 36233;
473 pub const RGB16UI: GLenum = 36215;
474 pub const RGB32F: GLenum = 34837;
475 pub const RGB32I: GLenum = 36227;
476 pub const RGB32UI: GLenum = 36209;
477 pub const RGB565: GLenum = 36194;
478 pub const RGB5_A1: GLenum = 32855;
479 pub const RGB8: GLenum = 32849;
480 pub const RGB8I: GLenum = 36239;
481 pub const RGB8UI: GLenum = 36221;
482 pub const RGB8_SNORM: GLenum = 36758;
483 pub const RGB9_E5: GLenum = 35901;
484 pub const RGBA: GLenum = 6408;
485 pub const RGBA16F: GLenum = 34842;
486 pub const RGBA16I: GLenum = 36232;
487 pub const RGBA16UI: GLenum = 36214;
488 pub const RGBA32F: GLenum = 34836;
489 pub const RGBA32I: GLenum = 36226;
490 pub const RGBA32UI: GLenum = 36208;
491 pub const RGBA4: GLenum = 32854;
492 pub const RGBA8: GLenum = 32856;
493 pub const RGBA8I: GLenum = 36238;
494 pub const RGBA8UI: GLenum = 36220;
495 pub const RGBA8_SNORM: GLenum = 36759;
496 pub const RGBA_INTEGER: GLenum = 36249;
497 pub const RGB_INTEGER: GLenum = 36248;
498 pub const RG_INTEGER: GLenum = 33320;
499 pub const SAMPLER_2D: GLenum = 35678;
500 pub const SAMPLER_2D_ARRAY: GLenum = 36289;
501 pub const SAMPLER_2D_ARRAY_SHADOW: GLenum = 36292;
502 pub const SAMPLER_2D_SHADOW: GLenum = 35682;
503 pub const SAMPLER_3D: GLenum = 35679;
504 pub const SAMPLER_BINDING: GLenum = 35097;
505 pub const SAMPLER_CUBE: GLenum = 35680;
506 pub const SAMPLER_CUBE_SHADOW: GLenum = 36293;
507 pub const SAMPLES: GLenum = 32937;
508 pub const SAMPLE_ALPHA_TO_COVERAGE: GLenum = 32926;
509 pub const SAMPLE_BUFFERS: GLenum = 32936;
510 pub const SAMPLE_COVERAGE: GLenum = 32928;
511 pub const SAMPLE_COVERAGE_INVERT: GLenum = 32939;
512 pub const SAMPLE_COVERAGE_VALUE: GLenum = 32938;
513 pub const SCISSOR_BOX: GLenum = 3088;
514 pub const SCISSOR_TEST: GLenum = 3089;
515 pub const SEPARATE_ATTRIBS: GLenum = 35981;
516 pub const SHADER_TYPE: GLenum = 35663;
517 pub const SHADING_LANGUAGE_VERSION: GLenum = 35724;
518 pub const SHORT: GLenum = 5122;
519 pub const SIGNALED: GLenum = 37145;
520 pub const SIGNED_NORMALIZED: GLenum = 36764;
521 pub const SRC_ALPHA: GLenum = 770;
522 pub const SRC_ALPHA_SATURATE: GLenum = 776;
523 pub const SRC_COLOR: GLenum = 768;
524 pub const SRGB: GLenum = 35904;
525 pub const SRGB8: GLenum = 35905;
526 pub const SRGB8_ALPHA8: GLenum = 35907;
527 pub const STATIC_COPY: GLenum = 35046;
528 pub const STATIC_DRAW: GLenum = 35044;
529 pub const STATIC_READ: GLenum = 35045;
530 pub const STENCIL: GLenum = 6146;
531 pub const STENCIL_ATTACHMENT: GLenum = 36128;
532 pub const STENCIL_BACK_FAIL: GLenum = 34817;
533 pub const STENCIL_BACK_FUNC: GLenum = 34816;
534 pub const STENCIL_BACK_PASS_DEPTH_FAIL: GLenum = 34818;
535 pub const STENCIL_BACK_PASS_DEPTH_PASS: GLenum = 34819;
536 pub const STENCIL_BACK_REF: GLenum = 36003;
537 pub const STENCIL_BACK_VALUE_MASK: GLenum = 36004;
538 pub const STENCIL_BACK_WRITEMASK: GLenum = 36005;
539 pub const STENCIL_BITS: GLenum = 3415;
540 pub const STENCIL_BUFFER_BIT: GLenum = 1024;
541 pub const STENCIL_CLEAR_VALUE: GLenum = 2961;
542 pub const STENCIL_FAIL: GLenum = 2964;
543 pub const STENCIL_FUNC: GLenum = 2962;
544 pub const STENCIL_INDEX8: GLenum = 36168;
545 pub const STENCIL_PASS_DEPTH_FAIL: GLenum = 2965;
546 pub const STENCIL_PASS_DEPTH_PASS: GLenum = 2966;
547 pub const STENCIL_REF: GLenum = 2967;
548 pub const STENCIL_TEST: GLenum = 2960;
549 pub const STENCIL_VALUE_MASK: GLenum = 2963;
550 pub const STENCIL_WRITEMASK: GLenum = 2968;
551 pub const STREAM_COPY: GLenum = 35042;
552 pub const STREAM_DRAW: GLenum = 35040;
553 pub const STREAM_READ: GLenum = 35041;
554 pub const SUBPIXEL_BITS: GLenum = 3408;
555 pub const SYNC_CONDITION: GLenum = 37139;
556 pub const SYNC_FENCE: GLenum = 37142;
557 pub const SYNC_FLAGS: GLenum = 37141;
558 pub const SYNC_FLUSH_COMMANDS_BIT: GLenum = 1;
559 pub const SYNC_GPU_COMMANDS_COMPLETE: GLenum = 37143;
560 pub const SYNC_STATUS: GLenum = 37140;
561 pub const TEXTURE: GLenum = 5890;
562 pub const TEXTURE0: GLenum = 33984;
563 pub const TEXTURE1: GLenum = 33985;
564 pub const TEXTURE10: GLenum = 33994;
565 pub const TEXTURE11: GLenum = 33995;
566 pub const TEXTURE12: GLenum = 33996;
567 pub const TEXTURE13: GLenum = 33997;
568 pub const TEXTURE14: GLenum = 33998;
569 pub const TEXTURE15: GLenum = 33999;
570 pub const TEXTURE16: GLenum = 34000;
571 pub const TEXTURE17: GLenum = 34001;
572 pub const TEXTURE18: GLenum = 34002;
573 pub const TEXTURE19: GLenum = 34003;
574 pub const TEXTURE2: GLenum = 33986;
575 pub const TEXTURE20: GLenum = 34004;
576 pub const TEXTURE21: GLenum = 34005;
577 pub const TEXTURE22: GLenum = 34006;
578 pub const TEXTURE23: GLenum = 34007;
579 pub const TEXTURE24: GLenum = 34008;
580 pub const TEXTURE25: GLenum = 34009;
581 pub const TEXTURE26: GLenum = 34010;
582 pub const TEXTURE27: GLenum = 34011;
583 pub const TEXTURE28: GLenum = 34012;
584 pub const TEXTURE29: GLenum = 34013;
585 pub const TEXTURE3: GLenum = 33987;
586 pub const TEXTURE30: GLenum = 34014;
587 pub const TEXTURE31: GLenum = 34015;
588 pub const TEXTURE4: GLenum = 33988;
589 pub const TEXTURE5: GLenum = 33989;
590 pub const TEXTURE6: GLenum = 33990;
591 pub const TEXTURE7: GLenum = 33991;
592 pub const TEXTURE8: GLenum = 33992;
593 pub const TEXTURE9: GLenum = 33993;
594 pub const TEXTURE_2D: GLenum = 3553;
595 pub const TEXTURE_2D_ARRAY: GLenum = 35866;
596 pub const TEXTURE_3D: GLenum = 32879;
597 pub const TEXTURE_BASE_LEVEL: GLenum = 33084;
598 pub const TEXTURE_BINDING_2D: GLenum = 32873;
599 pub const TEXTURE_BINDING_2D_ARRAY: GLenum = 35869;
600 pub const TEXTURE_BINDING_3D: GLenum = 32874;
601 pub const TEXTURE_BINDING_CUBE_MAP: GLenum = 34068;
602 pub const TEXTURE_COMPARE_FUNC: GLenum = 34893;
603 pub const TEXTURE_COMPARE_MODE: GLenum = 34892;
604 pub const TEXTURE_CUBE_MAP: GLenum = 34067;
605 pub const TEXTURE_CUBE_MAP_NEGATIVE_X: GLenum = 34070;
606 pub const TEXTURE_CUBE_MAP_NEGATIVE_Y: GLenum = 34072;
607 pub const TEXTURE_CUBE_MAP_NEGATIVE_Z: GLenum = 34074;
608 pub const TEXTURE_CUBE_MAP_POSITIVE_X: GLenum = 34069;
609 pub const TEXTURE_CUBE_MAP_POSITIVE_Y: GLenum = 34071;
610 pub const TEXTURE_CUBE_MAP_POSITIVE_Z: GLenum = 34073;
611 pub const TEXTURE_IMMUTABLE_FORMAT: GLenum = 37167;
612 pub const TEXTURE_IMMUTABLE_LEVELS: GLenum = 33503;
613 pub const TEXTURE_MAG_FILTER: GLenum = 10240;
614 pub const TEXTURE_MAX_LEVEL: GLenum = 33085;
615 pub const TEXTURE_MAX_LOD: GLenum = 33083;
616 pub const TEXTURE_MIN_FILTER: GLenum = 10241;
617 pub const TEXTURE_MIN_LOD: GLenum = 33082;
618 pub const TEXTURE_WRAP_R: GLenum = 32882;
619 pub const TEXTURE_WRAP_S: GLenum = 10242;
620 pub const TEXTURE_WRAP_T: GLenum = 10243;
621 pub const TIMEOUT_EXPIRED: GLenum = 37147;
622 pub const TIMEOUT_IGNORED: GLint64 = -1;
623 pub const TRANSFORM_FEEDBACK: GLenum = 36386;
624 pub const TRANSFORM_FEEDBACK_ACTIVE: GLenum = 36388;
625 pub const TRANSFORM_FEEDBACK_BINDING: GLenum = 36389;
626 pub const TRANSFORM_FEEDBACK_BUFFER: GLenum = 35982;
627 pub const TRANSFORM_FEEDBACK_BUFFER_BINDING: GLenum = 35983;
628 pub const TRANSFORM_FEEDBACK_BUFFER_MODE: GLenum = 35967;
629 pub const TRANSFORM_FEEDBACK_BUFFER_SIZE: GLenum = 35973;
630 pub const TRANSFORM_FEEDBACK_BUFFER_START: GLenum = 35972;
631 pub const TRANSFORM_FEEDBACK_PAUSED: GLenum = 36387;
632 pub const TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: GLenum = 35976;
633 pub const TRANSFORM_FEEDBACK_VARYINGS: GLenum = 35971;
634 pub const TRIANGLES: GLenum = 4;
635 pub const TRIANGLE_FAN: GLenum = 6;
636 pub const TRIANGLE_STRIP: GLenum = 5;
637 pub const UNIFORM_ARRAY_STRIDE: GLenum = 35388;
638 pub const UNIFORM_BLOCK_ACTIVE_UNIFORMS: GLenum = 35394;
639 pub const UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: GLenum = 35395;
640 pub const UNIFORM_BLOCK_BINDING: GLenum = 35391;
641 pub const UNIFORM_BLOCK_DATA_SIZE: GLenum = 35392;
642 pub const UNIFORM_BLOCK_INDEX: GLenum = 35386;
643 pub const UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: GLenum = 35398;
644 pub const UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: GLenum = 35396;
645 pub const UNIFORM_BUFFER: GLenum = 35345;
646 pub const UNIFORM_BUFFER_BINDING: GLenum = 35368;
647 pub const UNIFORM_BUFFER_OFFSET_ALIGNMENT: GLenum = 35380;
648 pub const UNIFORM_BUFFER_SIZE: GLenum = 35370;
649 pub const UNIFORM_BUFFER_START: GLenum = 35369;
650 pub const UNIFORM_IS_ROW_MAJOR: GLenum = 35390;
651 pub const UNIFORM_MATRIX_STRIDE: GLenum = 35389;
652 pub const UNIFORM_OFFSET: GLenum = 35387;
653 pub const UNIFORM_SIZE: GLenum = 35384;
654 pub const UNIFORM_TYPE: GLenum = 35383;
655 pub const UNPACK_ALIGNMENT: GLenum = 3317;
656 pub const UNPACK_COLORSPACE_CONVERSION_WEBGL: GLenum = 37443;
657 pub const UNPACK_FLIP_Y_WEBGL: GLenum = 37440;
658 pub const UNPACK_IMAGE_HEIGHT: GLenum = 32878;
659 pub const UNPACK_PREMULTIPLY_ALPHA_WEBGL: GLenum = 37441;
660 pub const UNPACK_ROW_LENGTH: GLenum = 3314;
661 pub const UNPACK_SKIP_IMAGES: GLenum = 32877;
662 pub const UNPACK_SKIP_PIXELS: GLenum = 3316;
663 pub const UNPACK_SKIP_ROWS: GLenum = 3315;
664 pub const UNSIGNALED: GLenum = 37144;
665 pub const UNSIGNED_BYTE: GLenum = 5121;
666 pub const UNSIGNED_INT: GLenum = 5125;
667 pub const UNSIGNED_INT_10F_11F_11F_REV: GLenum = 35899;
668 pub const UNSIGNED_INT_24_8: GLenum = 34042;
669 pub const UNSIGNED_INT_2_10_10_10_REV: GLenum = 33640;
670 pub const UNSIGNED_INT_5_9_9_9_REV: GLenum = 35902;
671 pub const UNSIGNED_INT_SAMPLER_2D: GLenum = 36306;
672 pub const UNSIGNED_INT_SAMPLER_2D_ARRAY: GLenum = 36311;
673 pub const UNSIGNED_INT_SAMPLER_3D: GLenum = 36307;
674 pub const UNSIGNED_INT_SAMPLER_CUBE: GLenum = 36308;
675 pub const UNSIGNED_INT_VEC2: GLenum = 36294;
676 pub const UNSIGNED_INT_VEC3: GLenum = 36295;
677 pub const UNSIGNED_INT_VEC4: GLenum = 36296;
678 pub const UNSIGNED_NORMALIZED: GLenum = 35863;
679 pub const UNSIGNED_SHORT: GLenum = 5123;
680 pub const UNSIGNED_SHORT_4_4_4_4: GLenum = 32819;
681 pub const UNSIGNED_SHORT_5_5_5_1: GLenum = 32820;
682 pub const UNSIGNED_SHORT_5_6_5: GLenum = 33635;
683 pub const VALIDATE_STATUS: GLenum = 35715;
684 pub const VENDOR: GLenum = 7936;
685 pub const VERSION: GLenum = 7938;
686 pub const VERTEX_ARRAY_BINDING: GLenum = 34229;
687 pub const VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: GLenum = 34975;
688 pub const VERTEX_ATTRIB_ARRAY_DIVISOR: GLenum = 35070;
689 pub const VERTEX_ATTRIB_ARRAY_ENABLED: GLenum = 34338;
690 pub const VERTEX_ATTRIB_ARRAY_INTEGER: GLenum = 35069;
691 pub const VERTEX_ATTRIB_ARRAY_NORMALIZED: GLenum = 34922;
692 pub const VERTEX_ATTRIB_ARRAY_POINTER: GLenum = 34373;
693 pub const VERTEX_ATTRIB_ARRAY_SIZE: GLenum = 34339;
694 pub const VERTEX_ATTRIB_ARRAY_STRIDE: GLenum = 34340;
695 pub const VERTEX_ATTRIB_ARRAY_TYPE: GLenum = 34341;
696 pub const VERTEX_SHADER: GLenum = 35633;
697 pub const VIEWPORT: GLenum = 2978;
698 pub const WAIT_FAILED: GLenum = 37149;
699 pub const ZERO: GLenum = 0;
700
701 pub fn active_texture(&self, texture: GLenum) {
702 js!( @(no_return) @{self}.activeTexture(@{texture}); );
703 }
704
705 pub fn attach_shader(&self, program: &WebGLProgram, shader: &WebGLShader) {
706 js!( @(no_return) @{self}.attachShader(@{program}, @{shader}); );
707 }
708
709 pub fn begin_query(&self, target: GLenum, query: &WebGLQuery) {
710 js!( @(no_return) @{self}.beginQuery(@{target}, @{query}); );
711 }
712
713 pub fn begin_transform_feedback(&self, primitive_mode: GLenum) {
714 js!( @(no_return) @{self}.beginTransformFeedback(@{primitive_mode}); );
715 }
716
717 pub fn bind_attrib_location(&self, program: &WebGLProgram, index: GLuint, name: &str) {
718 js!( @(no_return) @{self}.bindAttribLocation(@{program}, @{index}, @{name}); );
719 }
720
721 pub fn bind_buffer(&self, target: GLenum, buffer: Option<&WebGLBuffer>) {
722 js!( @(no_return) @{self}.bindBuffer(@{target}, @{buffer}); );
723 }
724
725 pub fn bind_buffer_base(&self, target: GLenum, index: GLuint, buffer: Option<&WebGLBuffer>) {
726 js!( @(no_return) @{self}.bindBufferBase(@{target}, @{index}, @{buffer}); );
727 }
728
729 pub fn bind_buffer_range(&self, target: GLenum, index: GLuint, buffer: Option<&WebGLBuffer>, offset: GLintptr, size: GLsizeiptr) {
730 js!( @(no_return) @{self}.bindBufferRange(@{target}, @{index}, @{buffer}, @{(offset as f64)}, @{(size as f64)}); );
731 }
732
733 pub fn bind_framebuffer(&self, target: GLenum, framebuffer: Option<&WebGLFramebuffer>) {
734 js!( @(no_return) @{self}.bindFramebuffer(@{target}, @{framebuffer}); );
735 }
736
737 pub fn bind_renderbuffer(&self, target: GLenum, renderbuffer: Option<&WebGLRenderbuffer>) {
738 js!( @(no_return) @{self}.bindRenderbuffer(@{target}, @{renderbuffer}); );
739 }
740
741 pub fn bind_sampler(&self, unit: GLuint, sampler: Option<&WebGLSampler>) {
742 js!( @(no_return) @{self}.bindSampler(@{unit}, @{sampler}); );
743 }
744
745 pub fn bind_texture(&self, target: GLenum, texture: Option<&WebGLTexture>) {
746 js!( @(no_return) @{self}.bindTexture(@{target}, @{texture}); );
747 }
748
749 pub fn bind_transform_feedback(&self, target: GLenum, tf: Option<&WebGLTransformFeedback>) {
750 js!( @(no_return) @{self}.bindTransformFeedback(@{target}, @{tf}); );
751 }
752
753 pub fn bind_vertex_array(&self, array: Option<&WebGLVertexArrayObject>) {
754 js!( @(no_return) @{self}.bindVertexArray(@{array}); );
755 }
756
757 pub fn blend_color(&self, red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) {
758 js!( @(no_return) @{self}.blendColor(@{red}, @{green}, @{blue}, @{alpha}); );
759 }
760
761 pub fn blend_equation(&self, mode: GLenum) {
762 js!( @(no_return) @{self}.blendEquation(@{mode}); );
763 }
764
765 pub fn blend_equation_separate(&self, mode_rgb: GLenum, mode_alpha: GLenum) {
766 js!( @(no_return) @{self}.blendEquationSeparate(@{mode_rgb}, @{mode_alpha}); );
767 }
768
769 pub fn blend_func(&self, sfactor: GLenum, dfactor: GLenum) {
770 js!( @(no_return) @{self}.blendFunc(@{sfactor}, @{dfactor}); );
771 }
772
773 pub fn blend_func_separate(&self, src_rgb: GLenum, dst_rgb: GLenum, src_alpha: GLenum, dst_alpha: GLenum) {
774 js!( @(no_return) @{self}.blendFuncSeparate(@{src_rgb}, @{dst_rgb}, @{src_alpha}, @{dst_alpha}); );
775 }
776
777 pub fn blit_framebuffer(&self, src_x0: GLint, src_y0: GLint, src_x1: GLint, src_y1: GLint, dst_x0: GLint, dst_y0: GLint, dst_x1: GLint, dst_y1: GLint, mask: GLbitfield, filter: GLenum) {
778 js!( @(no_return) @{self}.blitFramebuffer(@{src_x0}, @{src_y0}, @{src_x1}, @{src_y1}, @{dst_x0}, @{dst_y0}, @{dst_x1}, @{dst_y1}, @{mask}, @{filter}); );
779 }
780
781 pub fn buffer_data(&self, target: GLenum, size: GLsizeiptr, usage: GLenum) {
782 js!( @(no_return) @{self}.bufferData(@{target}, @{(size as f64)}, @{usage}); );
783 }
784
785 pub fn buffer_data_1(&self, target: GLenum, src_data: Option<&ArrayBuffer>, usage: GLenum) {
786 js!( @(no_return) @{self}.bufferData(@{target}, @{src_data}, @{usage}); );
787 }
788
789 pub fn buffer_data_2<'a0, T0>(&self, target: GLenum, src_data: T0, usage: GLenum, src_offset: GLuint, length: GLuint) where T0: AsArrayBufferView<'a0> {
790 js!( @(no_return) @{self}.bufferData(@{target}, @{unsafe { src_data.as_array_buffer_view() }}, @{usage}, @{src_offset}, @{length}); );
791 }
792
793 pub fn buffer_sub_data(&self, target: GLenum, dst_byte_offset: GLintptr, src_data: &ArrayBuffer) {
794 js!( @(no_return) @{self}.bufferSubData(@{target}, @{(dst_byte_offset as f64)}, @{src_data}); );
795 }
796
797 pub fn buffer_sub_data_1<'a0, T0>(&self, target: GLenum, dst_byte_offset: GLintptr, src_data: T0, src_offset: GLuint, length: GLuint) where T0: AsArrayBufferView<'a0> {
798 js!( @(no_return) @{self}.bufferSubData(@{target}, @{(dst_byte_offset as f64)}, @{unsafe { src_data.as_array_buffer_view() }}, @{src_offset}, @{length}); );
799 }
800
801 pub fn canvas(&self) -> CanvasElement {
802 (js! { return @{self}.canvas; } ).try_into().unwrap()
803 }
804
805 pub fn check_framebuffer_status(&self, target: GLenum) -> GLenum {
806 (js! { return @{self}.checkFramebufferStatus(@{target}); } ).try_into().unwrap()
807 }
808
809 pub fn clear(&self, mask: GLbitfield) {
810 js!( @(no_return) @{self}.clear(@{mask}); );
811 }
812
813 pub fn clear_bufferfi(&self, buffer: GLenum, drawbuffer: GLint, depth: GLfloat, stencil: GLint) {
814 js!( @(no_return) @{self}.clearBufferfi(@{buffer}, @{drawbuffer}, @{depth}, @{stencil}); );
815 }
816
817 pub fn clear_bufferfv<'a0, T0>(&self, buffer: GLenum, drawbuffer: GLint, values: T0, src_offset: GLuint) where T0: AsTypedArray<'a0, f32> {
818 js!( @(no_return) @{self}.clearBufferfv(@{buffer}, @{drawbuffer}, @{unsafe { values.as_typed_array() }}, @{src_offset}); );
819 }
820
821 pub fn clear_bufferiv<'a0, T0>(&self, buffer: GLenum, drawbuffer: GLint, values: T0, src_offset: GLuint) where T0: AsTypedArray<'a0, i32> {
822 js!( @(no_return) @{self}.clearBufferiv(@{buffer}, @{drawbuffer}, @{unsafe { values.as_typed_array() }}, @{src_offset}); );
823 }
824
825 pub fn clear_bufferuiv<'a0, T0>(&self, buffer: GLenum, drawbuffer: GLint, values: T0, src_offset: GLuint) where T0: AsTypedArray<'a0, u32> {
826 js!( @(no_return) @{self}.clearBufferuiv(@{buffer}, @{drawbuffer}, @{unsafe { values.as_typed_array() }}, @{src_offset}); );
827 }
828
829 pub fn clear_color(&self, red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) {
830 js!( @(no_return) @{self}.clearColor(@{red}, @{green}, @{blue}, @{alpha}); );
831 }
832
833 pub fn clear_depth(&self, depth: GLclampf) {
834 js!( @(no_return) @{self}.clearDepth(@{depth}); );
835 }
836
837 pub fn clear_stencil(&self, s: GLint) {
838 js!( @(no_return) @{self}.clearStencil(@{s}); );
839 }
840
841 pub fn client_wait_sync(&self, sync: &WebGLSync, flags: GLbitfield, timeout: GLuint64) -> GLenum {
842 (js! { return @{self}.clientWaitSync(@{sync}, @{flags}, @{(timeout as f64)}); } ).try_into().unwrap()
843 }
844
845 pub fn color_mask(&self, red: GLboolean, green: GLboolean, blue: GLboolean, alpha: GLboolean) {
846 js!( @(no_return) @{self}.colorMask(@{red}, @{green}, @{blue}, @{alpha}); );
847 }
848
849 pub fn compile_shader(&self, shader: &WebGLShader) {
850 js!( @(no_return) @{self}.compileShader(@{shader}); );
851 }
852
853 pub fn compressed_tex_image2_d(&self, target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, image_size: GLsizei, offset: GLintptr) {
854 js!( @(no_return) @{self}.compressedTexImage2D(@{target}, @{level}, @{internalformat}, @{width}, @{height}, @{border}, @{image_size}, @{(offset as f64)}); );
855 }
856
857 pub fn compressed_tex_image2_d_1<'a0, T0>(&self, target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, src_data: T0, src_offset: GLuint, src_length_override: GLuint) where T0: AsArrayBufferView<'a0> {
858 js!( @(no_return) @{self}.compressedTexImage2D(@{target}, @{level}, @{internalformat}, @{width}, @{height}, @{border}, @{unsafe { src_data.as_array_buffer_view() }}, @{src_offset}, @{src_length_override}); );
859 }
860
861 pub fn compressed_tex_image2_d_2<'a0, T0>(&self, target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, data: T0) where T0: AsArrayBufferView<'a0> {
862 js!( @(no_return) @{self}.compressedTexImage2D(@{target}, @{level}, @{internalformat}, @{width}, @{height}, @{border}, @{unsafe { data.as_array_buffer_view() }}); );
863 }
864
865 pub fn compressed_tex_image3_d(&self, target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, image_size: GLsizei, offset: GLintptr) {
866 js!( @(no_return) @{self}.compressedTexImage3D(@{target}, @{level}, @{internalformat}, @{width}, @{height}, @{depth}, @{border}, @{image_size}, @{(offset as f64)}); );
867 }
868
869 pub fn compressed_tex_image3_d_1<'a0, T0>(&self, target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, src_data: T0, src_offset: GLuint, src_length_override: GLuint) where T0: AsArrayBufferView<'a0> {
870 js!( @(no_return) @{self}.compressedTexImage3D(@{target}, @{level}, @{internalformat}, @{width}, @{height}, @{depth}, @{border}, @{unsafe { src_data.as_array_buffer_view() }}, @{src_offset}, @{src_length_override}); );
871 }
872
873 pub fn compressed_tex_sub_image2_d(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, image_size: GLsizei, offset: GLintptr) {
874 js!( @(no_return) @{self}.compressedTexSubImage2D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{width}, @{height}, @{format}, @{image_size}, @{(offset as f64)}); );
875 }
876
877 pub fn compressed_tex_sub_image2_d_1<'a0, T0>(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, src_data: T0, src_offset: GLuint, src_length_override: GLuint) where T0: AsArrayBufferView<'a0> {
878 js!( @(no_return) @{self}.compressedTexSubImage2D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{width}, @{height}, @{format}, @{unsafe { src_data.as_array_buffer_view() }}, @{src_offset}, @{src_length_override}); );
879 }
880
881 pub fn compressed_tex_sub_image2_d_2<'a0, T0>(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, data: T0) where T0: AsArrayBufferView<'a0> {
882 js!( @(no_return) @{self}.compressedTexSubImage2D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{width}, @{height}, @{format}, @{unsafe { data.as_array_buffer_view() }}); );
883 }
884
885 pub fn compressed_tex_sub_image3_d(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, image_size: GLsizei, offset: GLintptr) {
886 js!( @(no_return) @{self}.compressedTexSubImage3D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{zoffset}, @{width}, @{height}, @{depth}, @{format}, @{image_size}, @{(offset as f64)}); );
887 }
888
889 pub fn compressed_tex_sub_image3_d_1<'a0, T0>(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, src_data: T0, src_offset: GLuint, src_length_override: GLuint) where T0: AsArrayBufferView<'a0> {
890 js!( @(no_return) @{self}.compressedTexSubImage3D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{zoffset}, @{width}, @{height}, @{depth}, @{format}, @{unsafe { src_data.as_array_buffer_view() }}, @{src_offset}, @{src_length_override}); );
891 }
892
893 pub fn copy_buffer_sub_data(&self, read_target: GLenum, write_target: GLenum, read_offset: GLintptr, write_offset: GLintptr, size: GLsizeiptr) {
894 js!( @(no_return) @{self}.copyBufferSubData(@{read_target}, @{write_target}, @{(read_offset as f64)}, @{(write_offset as f64)}, @{(size as f64)}); );
895 }
896
897 pub fn copy_tex_image2_d(&self, target: GLenum, level: GLint, internalformat: GLenum, x: GLint, y: GLint, width: GLsizei, height: GLsizei, border: GLint) {
898 js!( @(no_return) @{self}.copyTexImage2D(@{target}, @{level}, @{internalformat}, @{x}, @{y}, @{width}, @{height}, @{border}); );
899 }
900
901 pub fn copy_tex_sub_image2_d(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei) {
902 js!( @(no_return) @{self}.copyTexSubImage2D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{x}, @{y}, @{width}, @{height}); );
903 }
904
905 pub fn copy_tex_sub_image3_d(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei) {
906 js!( @(no_return) @{self}.copyTexSubImage3D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{zoffset}, @{x}, @{y}, @{width}, @{height}); );
907 }
908
909 pub fn create_buffer(&self, ) -> Option<WebGLBuffer> {
910 (js! { return @{self}.createBuffer(); } ).try_into().ok()
911 }
912
913 pub fn create_framebuffer(&self, ) -> Option<WebGLFramebuffer> {
914 (js! { return @{self}.createFramebuffer(); } ).try_into().ok()
915 }
916
917 pub fn create_program(&self, ) -> Option<WebGLProgram> {
918 (js! { return @{self}.createProgram(); } ).try_into().ok()
919 }
920
921 pub fn create_query(&self, ) -> Option<WebGLQuery> {
922 (js! { return @{self}.createQuery(); } ).try_into().ok()
923 }
924
925 pub fn create_renderbuffer(&self, ) -> Option<WebGLRenderbuffer> {
926 (js! { return @{self}.createRenderbuffer(); } ).try_into().ok()
927 }
928
929 pub fn create_sampler(&self, ) -> Option<WebGLSampler> {
930 (js! { return @{self}.createSampler(); } ).try_into().ok()
931 }
932
933 pub fn create_shader(&self, type_: GLenum) -> Option<WebGLShader> {
934 (js! { return @{self}.createShader(@{type_}); } ).try_into().ok()
935 }
936
937 pub fn create_texture(&self, ) -> Option<WebGLTexture> {
938 (js! { return @{self}.createTexture(); } ).try_into().ok()
939 }
940
941 pub fn create_transform_feedback(&self, ) -> Option<WebGLTransformFeedback> {
942 (js! { return @{self}.createTransformFeedback(); } ).try_into().ok()
943 }
944
945 pub fn create_vertex_array(&self, ) -> Option<WebGLVertexArrayObject> {
946 (js! { return @{self}.createVertexArray(); } ).try_into().ok()
947 }
948
949 pub fn cull_face(&self, mode: GLenum) {
950 js!( @(no_return) @{self}.cullFace(@{mode}); );
951 }
952
953 pub fn delete_buffer(&self, buffer: Option<&WebGLBuffer>) {
954 js!( @(no_return) @{self}.deleteBuffer(@{buffer}); );
955 }
956
957 pub fn delete_framebuffer(&self, framebuffer: Option<&WebGLFramebuffer>) {
958 js!( @(no_return) @{self}.deleteFramebuffer(@{framebuffer}); );
959 }
960
961 pub fn delete_program(&self, program: Option<&WebGLProgram>) {
962 js!( @(no_return) @{self}.deleteProgram(@{program}); );
963 }
964
965 pub fn delete_query(&self, query: Option<&WebGLQuery>) {
966 js!( @(no_return) @{self}.deleteQuery(@{query}); );
967 }
968
969 pub fn delete_renderbuffer(&self, renderbuffer: Option<&WebGLRenderbuffer>) {
970 js!( @(no_return) @{self}.deleteRenderbuffer(@{renderbuffer}); );
971 }
972
973 pub fn delete_sampler(&self, sampler: Option<&WebGLSampler>) {
974 js!( @(no_return) @{self}.deleteSampler(@{sampler}); );
975 }
976
977 pub fn delete_shader(&self, shader: Option<&WebGLShader>) {
978 js!( @(no_return) @{self}.deleteShader(@{shader}); );
979 }
980
981 pub fn delete_sync(&self, sync: Option<&WebGLSync>) {
982 js!( @(no_return) @{self}.deleteSync(@{sync}); );
983 }
984
985 pub fn delete_texture(&self, texture: Option<&WebGLTexture>) {
986 js!( @(no_return) @{self}.deleteTexture(@{texture}); );
987 }
988
989 pub fn delete_transform_feedback(&self, tf: Option<&WebGLTransformFeedback>) {
990 js!( @(no_return) @{self}.deleteTransformFeedback(@{tf}); );
991 }
992
993 pub fn delete_vertex_array(&self, vertex_array: Option<&WebGLVertexArrayObject>) {
994 js!( @(no_return) @{self}.deleteVertexArray(@{vertex_array}); );
995 }
996
997 pub fn depth_func(&self, func: GLenum) {
998 js!( @(no_return) @{self}.depthFunc(@{func}); );
999 }
1000
1001 pub fn depth_mask(&self, flag: GLboolean) {
1002 js!( @(no_return) @{self}.depthMask(@{flag}); );
1003 }
1004
1005 pub fn depth_range(&self, z_near: GLclampf, z_far: GLclampf) {
1006 js!( @(no_return) @{self}.depthRange(@{z_near}, @{z_far}); );
1007 }
1008
1009 pub fn detach_shader(&self, program: &WebGLProgram, shader: &WebGLShader) {
1010 js!( @(no_return) @{self}.detachShader(@{program}, @{shader}); );
1011 }
1012
1013 pub fn disable(&self, cap: GLenum) {
1014 js!( @(no_return) @{self}.disable(@{cap}); );
1015 }
1016
1017 pub fn disable_vertex_attrib_array(&self, index: GLuint) {
1018 js!( @(no_return) @{self}.disableVertexAttribArray(@{index}); );
1019 }
1020
1021 pub fn draw_arrays(&self, mode: GLenum, first: GLint, count: GLsizei) {
1022 js!( @(no_return) @{self}.drawArrays(@{mode}, @{first}, @{count}); );
1023 }
1024
1025 pub fn draw_arrays_instanced(&self, mode: GLenum, first: GLint, count: GLsizei, instance_count: GLsizei) {
1026 js!( @(no_return) @{self}.drawArraysInstanced(@{mode}, @{first}, @{count}, @{instance_count}); );
1027 }
1028
1029 pub fn draw_buffers(&self, buffers: &[GLenum]) {
1030 js!( @(no_return) @{self}.drawBuffers(@{buffers}); );
1031 }
1032
1033 pub fn draw_elements(&self, mode: GLenum, count: GLsizei, type_: GLenum, offset: GLintptr) {
1034 js!( @(no_return) @{self}.drawElements(@{mode}, @{count}, @{type_}, @{(offset as f64)}); );
1035 }
1036
1037 pub fn draw_elements_instanced(&self, mode: GLenum, count: GLsizei, type_: GLenum, offset: GLintptr, instance_count: GLsizei) {
1038 js!( @(no_return) @{self}.drawElementsInstanced(@{mode}, @{count}, @{type_}, @{(offset as f64)}, @{instance_count}); );
1039 }
1040
1041 pub fn draw_range_elements(&self, mode: GLenum, start: GLuint, end: GLuint, count: GLsizei, type_: GLenum, offset: GLintptr) {
1042 js!( @(no_return) @{self}.drawRangeElements(@{mode}, @{start}, @{end}, @{count}, @{type_}, @{(offset as f64)}); );
1043 }
1044
1045 pub fn drawing_buffer_height(&self) -> GLsizei {
1046 (js! { return @{self}.drawingBufferHeight; } ).try_into().unwrap()
1047 }
1048
1049 pub fn drawing_buffer_width(&self) -> GLsizei {
1050 (js! { return @{self}.drawingBufferWidth; } ).try_into().unwrap()
1051 }
1052
1053 pub fn enable(&self, cap: GLenum) {
1054 js!( @(no_return) @{self}.enable(@{cap}); );
1055 }
1056
1057 pub fn enable_vertex_attrib_array(&self, index: GLuint) {
1058 js!( @(no_return) @{self}.enableVertexAttribArray(@{index}); );
1059 }
1060
1061 pub fn end_query(&self, target: GLenum) {
1062 js!( @(no_return) @{self}.endQuery(@{target}); );
1063 }
1064
1065 pub fn end_transform_feedback(&self, ) {
1066 js!( @(no_return) @{self}.endTransformFeedback(); );
1067 }
1068
1069 pub fn fence_sync(&self, condition: GLenum, flags: GLbitfield) -> Option<WebGLSync> {
1070 (js! { return @{self}.fenceSync(@{condition}, @{flags}); } ).try_into().ok()
1071 }
1072
1073 pub fn finish(&self, ) {
1074 js!( @(no_return) @{self}.finish(); );
1075 }
1076
1077 pub fn flush(&self, ) {
1078 js!( @(no_return) @{self}.flush(); );
1079 }
1080
1081 pub fn framebuffer_renderbuffer(&self, target: GLenum, attachment: GLenum, renderbuffertarget: GLenum, renderbuffer: Option<&WebGLRenderbuffer>) {
1082 js!( @(no_return) @{self}.framebufferRenderbuffer(@{target}, @{attachment}, @{renderbuffertarget}, @{renderbuffer}); );
1083 }
1084
1085 pub fn framebuffer_texture2_d(&self, target: GLenum, attachment: GLenum, textarget: GLenum, texture: Option<&WebGLTexture>, level: GLint) {
1086 js!( @(no_return) @{self}.framebufferTexture2D(@{target}, @{attachment}, @{textarget}, @{texture}, @{level}); );
1087 }
1088
1089 pub fn framebuffer_texture_layer(&self, target: GLenum, attachment: GLenum, texture: Option<&WebGLTexture>, level: GLint, layer: GLint) {
1090 js!( @(no_return) @{self}.framebufferTextureLayer(@{target}, @{attachment}, @{texture}, @{level}, @{layer}); );
1091 }
1092
1093 pub fn front_face(&self, mode: GLenum) {
1094 js!( @(no_return) @{self}.frontFace(@{mode}); );
1095 }
1096
1097 pub fn generate_mipmap(&self, target: GLenum) {
1098 js!( @(no_return) @{self}.generateMipmap(@{target}); );
1099 }
1100
1101 pub fn get_active_attrib(&self, program: &WebGLProgram, index: GLuint) -> Option<WebGLActiveInfo> {
1102 (js! { return @{self}.getActiveAttrib(@{program}, @{index}); } ).try_into().ok()
1103 }
1104
1105 pub fn get_active_uniform(&self, program: &WebGLProgram, index: GLuint) -> Option<WebGLActiveInfo> {
1106 (js! { return @{self}.getActiveUniform(@{program}, @{index}); } ).try_into().ok()
1107 }
1108
1109 pub fn get_active_uniform_block_name(&self, program: &WebGLProgram, uniform_block_index: GLuint) -> Option<String> {
1110 (js! { return @{self}.getActiveUniformBlockName(@{program}, @{uniform_block_index}); } ).try_into().ok()
1111 }
1112
1113 pub fn get_active_uniform_block_parameter(&self, program: &WebGLProgram, uniform_block_index: GLuint, pname: GLenum) -> Value {
1114 (js! { return @{self}.getActiveUniformBlockParameter(@{program}, @{uniform_block_index}, @{pname}); } ).try_into().unwrap()
1115 }
1116
1117 pub fn get_active_uniforms(&self, program: &WebGLProgram, uniform_indices: &[GLuint], pname: GLenum) -> Value {
1118 (js! { return @{self}.getActiveUniforms(@{program}, @{uniform_indices}, @{pname}); } ).try_into().unwrap()
1119 }
1120
1121 pub fn get_attached_shaders(&self, program: &WebGLProgram) -> Option<Vec<WebGLShader>> {
1122 (js! { return @{self}.getAttachedShaders(@{program}); } ).try_into().ok()
1123 }
1124
1125 pub fn get_attrib_location(&self, program: &WebGLProgram, name: &str) -> GLint {
1126 (js! { return @{self}.getAttribLocation(@{program}, @{name}); } ).try_into().unwrap()
1127 }
1128
1129 pub fn get_buffer_parameter(&self, target: GLenum, pname: GLenum) -> Value {
1130 (js! { return @{self}.getBufferParameter(@{target}, @{pname}); } ).try_into().unwrap()
1131 }
1132
1133 pub fn get_buffer_sub_data<'a0, T0>(&self, target: GLenum, src_byte_offset: GLintptr, dst_buffer: T0, dst_offset: GLuint, length: GLuint) where T0: AsArrayBufferView<'a0> {
1134 js!( @(no_return) @{self}.getBufferSubData(@{target}, @{(src_byte_offset as f64)}, @{unsafe { dst_buffer.as_array_buffer_view() }}, @{dst_offset}, @{length}); );
1135 }
1136
1137 pub fn get_context_attributes(&self, ) -> Option<WebGLContextAttributes> {
1138 (js! { return @{self}.getContextAttributes(); } ).try_into().ok()
1139 }
1140
1141 pub fn get_error(&self, ) -> GLenum {
1142 (js! { return @{self}.getError(); } ).try_into().unwrap()
1143 }
1144
1145 pub fn get_extension<E: Extension>(&self) -> Option<E> {
1146 (js! { return @{self}.getExtension(@{E::NAME}); } ).try_into().ok()
1147 }
1148
1149 pub fn get_frag_data_location(&self, program: &WebGLProgram, name: &str) -> GLint {
1150 (js! { return @{self}.getFragDataLocation(@{program}, @{name}); } ).try_into().unwrap()
1151 }
1152
1153 pub fn get_framebuffer_attachment_parameter(&self, target: GLenum, attachment: GLenum, pname: GLenum) -> Value {
1154 (js! { return @{self}.getFramebufferAttachmentParameter(@{target}, @{attachment}, @{pname}); } ).try_into().unwrap()
1155 }
1156
1157 pub fn get_indexed_parameter(&self, target: GLenum, index: GLuint) -> Value {
1158 (js! { return @{self}.getIndexedParameter(@{target}, @{index}); } ).try_into().unwrap()
1159 }
1160
1161 pub fn get_internalformat_parameter(&self, target: GLenum, internalformat: GLenum, pname: GLenum) -> Value {
1162 (js! { return @{self}.getInternalformatParameter(@{target}, @{internalformat}, @{pname}); } ).try_into().unwrap()
1163 }
1164
1165 pub fn get_parameter(&self, pname: GLenum) -> Value {
1166 (js! { return @{self}.getParameter(@{pname}); } ).try_into().unwrap()
1167 }
1168
1169 pub fn get_program_info_log(&self, program: &WebGLProgram) -> Option<String> {
1170 (js! { return @{self}.getProgramInfoLog(@{program}); } ).try_into().ok()
1171 }
1172
1173 pub fn get_program_parameter(&self, program: &WebGLProgram, pname: GLenum) -> Value {
1174 (js! { return @{self}.getProgramParameter(@{program}, @{pname}); } ).try_into().unwrap()
1175 }
1176
1177 pub fn get_query(&self, target: GLenum, pname: GLenum) -> Option<WebGLQuery> {
1178 (js! { return @{self}.getQuery(@{target}, @{pname}); } ).try_into().ok()
1179 }
1180
1181 pub fn get_query_parameter(&self, query: &WebGLQuery, pname: GLenum) -> Value {
1182 (js! { return @{self}.getQueryParameter(@{query}, @{pname}); } ).try_into().unwrap()
1183 }
1184
1185 pub fn get_renderbuffer_parameter(&self, target: GLenum, pname: GLenum) -> Value {
1186 (js! { return @{self}.getRenderbufferParameter(@{target}, @{pname}); } ).try_into().unwrap()
1187 }
1188
1189 pub fn get_sampler_parameter(&self, sampler: &WebGLSampler, pname: GLenum) -> Value {
1190 (js! { return @{self}.getSamplerParameter(@{sampler}, @{pname}); } ).try_into().unwrap()
1191 }
1192
1193 pub fn get_shader_info_log(&self, shader: &WebGLShader) -> Option<String> {
1194 (js! { return @{self}.getShaderInfoLog(@{shader}); } ).try_into().ok()
1195 }
1196
1197 pub fn get_shader_parameter(&self, shader: &WebGLShader, pname: GLenum) -> Value {
1198 (js! { return @{self}.getShaderParameter(@{shader}, @{pname}); } ).try_into().unwrap()
1199 }
1200
1201 pub fn get_shader_precision_format(&self, shadertype: GLenum, precisiontype: GLenum) -> Option<WebGLShaderPrecisionFormat> {
1202 (js! { return @{self}.getShaderPrecisionFormat(@{shadertype}, @{precisiontype}); } ).try_into().ok()
1203 }
1204
1205 pub fn get_shader_source(&self, shader: &WebGLShader) -> Option<String> {
1206 (js! { return @{self}.getShaderSource(@{shader}); } ).try_into().ok()
1207 }
1208
1209 pub fn get_supported_extensions(&self, ) -> Option<Vec<String>> {
1210 (js! { return @{self}.getSupportedExtensions(); } ).try_into().ok()
1211 }
1212
1213 pub fn get_sync_parameter(&self, sync: &WebGLSync, pname: GLenum) -> Value {
1214 (js! { return @{self}.getSyncParameter(@{sync}, @{pname}); } ).try_into().unwrap()
1215 }
1216
1217 pub fn get_tex_parameter(&self, target: GLenum, pname: GLenum) -> Value {
1218 (js! { return @{self}.getTexParameter(@{target}, @{pname}); } ).try_into().unwrap()
1219 }
1220
1221 pub fn get_transform_feedback_varying(&self, program: &WebGLProgram, index: GLuint) -> Option<WebGLActiveInfo> {
1222 (js! { return @{self}.getTransformFeedbackVarying(@{program}, @{index}); } ).try_into().ok()
1223 }
1224
1225 pub fn get_uniform(&self, program: &WebGLProgram, location: &WebGLUniformLocation) -> Value {
1226 (js! { return @{self}.getUniform(@{program}, @{location}); } ).try_into().unwrap()
1227 }
1228
1229 pub fn get_uniform_block_index(&self, program: &WebGLProgram, uniform_block_name: &str) -> GLuint {
1230 (js! { return @{self}.getUniformBlockIndex(@{program}, @{uniform_block_name}); } ).try_into().unwrap()
1231 }
1232
1233 pub fn get_uniform_indices(&self, program: &WebGLProgram, uniform_names: &[&str]) -> Option<Vec<GLuint>> {
1234 (js! { return @{self}.getUniformIndices(@{program}, @{uniform_names}); } ).try_into().ok()
1235 }
1236
1237 pub fn get_uniform_location(&self, program: &WebGLProgram, name: &str) -> Option<WebGLUniformLocation> {
1238 (js! { return @{self}.getUniformLocation(@{program}, @{name}); } ).try_into().ok()
1239 }
1240
1241 pub fn get_vertex_attrib(&self, index: GLuint, pname: GLenum) -> Value {
1242 (js! { return @{self}.getVertexAttrib(@{index}, @{pname}); } ).try_into().unwrap()
1243 }
1244
1245 pub fn get_vertex_attrib_offset(&self, index: GLuint, pname: GLenum) -> GLintptr {
1246 (js! { return @{self}.getVertexAttribOffset(@{index}, @{pname}); } ).try_into().unwrap()
1247 }
1248
1249 pub fn hint(&self, target: GLenum, mode: GLenum) {
1250 js!( @(no_return) @{self}.hint(@{target}, @{mode}); );
1251 }
1252
1253 pub fn invalidate_framebuffer(&self, target: GLenum, attachments: &[GLenum]) {
1254 js!( @(no_return) @{self}.invalidateFramebuffer(@{target}, @{attachments}); );
1255 }
1256
1257 pub fn invalidate_sub_framebuffer(&self, target: GLenum, attachments: &[GLenum], x: GLint, y: GLint, width: GLsizei, height: GLsizei) {
1258 js!( @(no_return) @{self}.invalidateSubFramebuffer(@{target}, @{attachments}, @{x}, @{y}, @{width}, @{height}); );
1259 }
1260
1261 pub fn is_buffer(&self, buffer: Option<&WebGLBuffer>) -> GLboolean {
1262 (js! { return @{self}.isBuffer(@{buffer}); } ).try_into().unwrap()
1263 }
1264
1265 pub fn is_context_lost(&self, ) -> bool {
1266 (js! { return @{self}.isContextLost(); } ).try_into().unwrap()
1267 }
1268
1269 pub fn is_enabled(&self, cap: GLenum) -> GLboolean {
1270 (js! { return @{self}.isEnabled(@{cap}); } ).try_into().unwrap()
1271 }
1272
1273 pub fn is_framebuffer(&self, framebuffer: Option<&WebGLFramebuffer>) -> GLboolean {
1274 (js! { return @{self}.isFramebuffer(@{framebuffer}); } ).try_into().unwrap()
1275 }
1276
1277 pub fn is_program(&self, program: Option<&WebGLProgram>) -> GLboolean {
1278 (js! { return @{self}.isProgram(@{program}); } ).try_into().unwrap()
1279 }
1280
1281 pub fn is_query(&self, query: Option<&WebGLQuery>) -> GLboolean {
1282 (js! { return @{self}.isQuery(@{query}); } ).try_into().unwrap()
1283 }
1284
1285 pub fn is_renderbuffer(&self, renderbuffer: Option<&WebGLRenderbuffer>) -> GLboolean {
1286 (js! { return @{self}.isRenderbuffer(@{renderbuffer}); } ).try_into().unwrap()
1287 }
1288
1289 pub fn is_sampler(&self, sampler: Option<&WebGLSampler>) -> GLboolean {
1290 (js! { return @{self}.isSampler(@{sampler}); } ).try_into().unwrap()
1291 }
1292
1293 pub fn is_shader(&self, shader: Option<&WebGLShader>) -> GLboolean {
1294 (js! { return @{self}.isShader(@{shader}); } ).try_into().unwrap()
1295 }
1296
1297 pub fn is_sync(&self, sync: Option<&WebGLSync>) -> GLboolean {
1298 (js! { return @{self}.isSync(@{sync}); } ).try_into().unwrap()
1299 }
1300
1301 pub fn is_texture(&self, texture: Option<&WebGLTexture>) -> GLboolean {
1302 (js! { return @{self}.isTexture(@{texture}); } ).try_into().unwrap()
1303 }
1304
1305 pub fn is_transform_feedback(&self, tf: Option<&WebGLTransformFeedback>) -> GLboolean {
1306 (js! { return @{self}.isTransformFeedback(@{tf}); } ).try_into().unwrap()
1307 }
1308
1309 pub fn is_vertex_array(&self, vertex_array: Option<&WebGLVertexArrayObject>) -> GLboolean {
1310 (js! { return @{self}.isVertexArray(@{vertex_array}); } ).try_into().unwrap()
1311 }
1312
1313 pub fn line_width(&self, width: GLfloat) {
1314 js!( @(no_return) @{self}.lineWidth(@{width}); );
1315 }
1316
1317 pub fn link_program(&self, program: &WebGLProgram) {
1318 js!( @(no_return) @{self}.linkProgram(@{program}); );
1319 }
1320
1321 pub fn pause_transform_feedback(&self, ) {
1322 js!( @(no_return) @{self}.pauseTransformFeedback(); );
1323 }
1324
1325 pub fn pixel_storei(&self, pname: GLenum, param: GLint) {
1326 js!( @(no_return) @{self}.pixelStorei(@{pname}, @{param}); );
1327 }
1328
1329 pub fn polygon_offset(&self, factor: GLfloat, units: GLfloat) {
1330 js!( @(no_return) @{self}.polygonOffset(@{factor}, @{units}); );
1331 }
1332
1333 pub fn read_buffer(&self, src: GLenum) {
1334 js!( @(no_return) @{self}.readBuffer(@{src}); );
1335 }
1336
1337 pub fn read_pixels<'a0, T0>(&self, x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type_: GLenum, dst_data: Option<T0>) where T0: AsArrayBufferView<'a0> {
1338 js!( @(no_return) @{self}.readPixels(@{x}, @{y}, @{width}, @{height}, @{format}, @{type_}, @{dst_data.map(|inner| unsafe { inner.as_array_buffer_view() })}); );
1339 }
1340
1341 pub fn read_pixels_1(&self, x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type_: GLenum, offset: GLintptr) {
1342 js!( @(no_return) @{self}.readPixels(@{x}, @{y}, @{width}, @{height}, @{format}, @{type_}, @{(offset as f64)}); );
1343 }
1344
1345 pub fn read_pixels_2<'a0, T0>(&self, x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type_: GLenum, dst_data: T0, dst_offset: GLuint) where T0: AsArrayBufferView<'a0> {
1346 js!( @(no_return) @{self}.readPixels(@{x}, @{y}, @{width}, @{height}, @{format}, @{type_}, @{unsafe { dst_data.as_array_buffer_view() }}, @{dst_offset}); );
1347 }
1348
1349 pub fn renderbuffer_storage(&self, target: GLenum, internalformat: GLenum, width: GLsizei, height: GLsizei) {
1350 js!( @(no_return) @{self}.renderbufferStorage(@{target}, @{internalformat}, @{width}, @{height}); );
1351 }
1352
1353 pub fn renderbuffer_storage_multisample(&self, target: GLenum, samples: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei) {
1354 js!( @(no_return) @{self}.renderbufferStorageMultisample(@{target}, @{samples}, @{internalformat}, @{width}, @{height}); );
1355 }
1356
1357 pub fn resume_transform_feedback(&self, ) {
1358 js!( @(no_return) @{self}.resumeTransformFeedback(); );
1359 }
1360
1361 pub fn sample_coverage(&self, value: GLclampf, invert: GLboolean) {
1362 js!( @(no_return) @{self}.sampleCoverage(@{value}, @{invert}); );
1363 }
1364
1365 pub fn sampler_parameterf(&self, sampler: &WebGLSampler, pname: GLenum, param: GLfloat) {
1366 js!( @(no_return) @{self}.samplerParameterf(@{sampler}, @{pname}, @{param}); );
1367 }
1368
1369 pub fn sampler_parameteri(&self, sampler: &WebGLSampler, pname: GLenum, param: GLint) {
1370 js!( @(no_return) @{self}.samplerParameteri(@{sampler}, @{pname}, @{param}); );
1371 }
1372
1373 pub fn scissor(&self, x: GLint, y: GLint, width: GLsizei, height: GLsizei) {
1374 js!( @(no_return) @{self}.scissor(@{x}, @{y}, @{width}, @{height}); );
1375 }
1376
1377 pub fn shader_source(&self, shader: &WebGLShader, source: &str) {
1378 js!( @(no_return) @{self}.shaderSource(@{shader}, @{source}); );
1379 }
1380
1381 pub fn stencil_func(&self, func: GLenum, ref_: GLint, mask: GLuint) {
1382 js!( @(no_return) @{self}.stencilFunc(@{func}, @{ref_}, @{mask}); );
1383 }
1384
1385 pub fn stencil_func_separate(&self, face: GLenum, func: GLenum, ref_: GLint, mask: GLuint) {
1386 js!( @(no_return) @{self}.stencilFuncSeparate(@{face}, @{func}, @{ref_}, @{mask}); );
1387 }
1388
1389 pub fn stencil_mask(&self, mask: GLuint) {
1390 js!( @(no_return) @{self}.stencilMask(@{mask}); );
1391 }
1392
1393 pub fn stencil_mask_separate(&self, face: GLenum, mask: GLuint) {
1394 js!( @(no_return) @{self}.stencilMaskSeparate(@{face}, @{mask}); );
1395 }
1396
1397 pub fn stencil_op(&self, fail: GLenum, zfail: GLenum, zpass: GLenum) {
1398 js!( @(no_return) @{self}.stencilOp(@{fail}, @{zfail}, @{zpass}); );
1399 }
1400
1401 pub fn stencil_op_separate(&self, face: GLenum, fail: GLenum, zfail: GLenum, zpass: GLenum) {
1402 js!( @(no_return) @{self}.stencilOpSeparate(@{face}, @{fail}, @{zfail}, @{zpass}); );
1403 }
1404
1405 pub fn tex_image2_d<'a0, T0>(&self, target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type_: GLenum, pixels: Option<T0>) where T0: AsArrayBufferView<'a0> {
1406 js!( @(no_return) @{self}.texImage2D(@{target}, @{level}, @{internalformat}, @{width}, @{height}, @{border}, @{format}, @{type_}, @{pixels.map(|inner| unsafe { inner.as_array_buffer_view() })}); );
1407 }
1408
1409 pub fn tex_image2_d_1<T0>(&self, target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type_: GLenum, source: T0) where T0: JsSerialize {
1410 js!( @(no_return) @{self}.texImage2D(@{target}, @{level}, @{internalformat}, @{format}, @{type_}, @{source}); );
1411 }
1412
1413 pub fn tex_image2_d_2(&self, target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type_: GLenum, pbo_offset: GLintptr) {
1414 js!( @(no_return) @{self}.texImage2D(@{target}, @{level}, @{internalformat}, @{width}, @{height}, @{border}, @{format}, @{type_}, @{(pbo_offset as f64)}); );
1415 }
1416
1417 pub fn tex_image2_d_3<T0>(&self, target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type_: GLenum, source: T0) where T0: JsSerialize {
1418 js!( @(no_return) @{self}.texImage2D(@{target}, @{level}, @{internalformat}, @{width}, @{height}, @{border}, @{format}, @{type_}, @{source}); );
1419 }
1420
1421 pub fn tex_image2_d_4<'a0, T0>(&self, target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type_: GLenum, src_data: T0, src_offset: GLuint) where T0: AsArrayBufferView<'a0> {
1422 js!( @(no_return) @{self}.texImage2D(@{target}, @{level}, @{internalformat}, @{width}, @{height}, @{border}, @{format}, @{type_}, @{unsafe { src_data.as_array_buffer_view() }}, @{src_offset}); );
1423 }
1424
1425 pub fn tex_image3_d(&self, target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type_: GLenum, pbo_offset: GLintptr) {
1426 js!( @(no_return) @{self}.texImage3D(@{target}, @{level}, @{internalformat}, @{width}, @{height}, @{depth}, @{border}, @{format}, @{type_}, @{(pbo_offset as f64)}); );
1427 }
1428
1429 pub fn tex_image3_d_1<T0>(&self, target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type_: GLenum, source: T0) where T0: JsSerialize {
1430 js!( @(no_return) @{self}.texImage3D(@{target}, @{level}, @{internalformat}, @{width}, @{height}, @{depth}, @{border}, @{format}, @{type_}, @{source}); );
1431 }
1432
1433 pub fn tex_image3_d_2<'a0, T0>(&self, target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type_: GLenum, src_data: Option<T0>) where T0: AsArrayBufferView<'a0> {
1434 js!( @(no_return) @{self}.texImage3D(@{target}, @{level}, @{internalformat}, @{width}, @{height}, @{depth}, @{border}, @{format}, @{type_}, @{src_data.map(|inner| unsafe { inner.as_array_buffer_view() })}); );
1435 }
1436
1437 pub fn tex_image3_d_3<'a0, T0>(&self, target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type_: GLenum, src_data: T0, src_offset: GLuint) where T0: AsArrayBufferView<'a0> {
1438 js!( @(no_return) @{self}.texImage3D(@{target}, @{level}, @{internalformat}, @{width}, @{height}, @{depth}, @{border}, @{format}, @{type_}, @{unsafe { src_data.as_array_buffer_view() }}, @{src_offset}); );
1439 }
1440
1441 pub fn tex_parameterf(&self, target: GLenum, pname: GLenum, param: GLfloat) {
1442 js!( @(no_return) @{self}.texParameterf(@{target}, @{pname}, @{param}); );
1443 }
1444
1445 pub fn tex_parameteri(&self, target: GLenum, pname: GLenum, param: GLint) {
1446 js!( @(no_return) @{self}.texParameteri(@{target}, @{pname}, @{param}); );
1447 }
1448
1449 pub fn tex_storage2_d(&self, target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei) {
1450 js!( @(no_return) @{self}.texStorage2D(@{target}, @{levels}, @{internalformat}, @{width}, @{height}); );
1451 }
1452
1453 pub fn tex_storage3_d(&self, target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei) {
1454 js!( @(no_return) @{self}.texStorage3D(@{target}, @{levels}, @{internalformat}, @{width}, @{height}, @{depth}); );
1455 }
1456
1457 pub fn tex_sub_image2_d<'a0, T0>(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type_: GLenum, pixels: Option<T0>) where T0: AsArrayBufferView<'a0> {
1458 js!( @(no_return) @{self}.texSubImage2D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{width}, @{height}, @{format}, @{type_}, @{pixels.map(|inner| unsafe { inner.as_array_buffer_view() })}); );
1459 }
1460
1461 pub fn tex_sub_image2_d_1<T0>(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type_: GLenum, source: T0) where T0: JsSerialize {
1462 js!( @(no_return) @{self}.texSubImage2D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{format}, @{type_}, @{source}); );
1463 }
1464
1465 pub fn tex_sub_image2_d_2(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type_: GLenum, pbo_offset: GLintptr) {
1466 js!( @(no_return) @{self}.texSubImage2D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{width}, @{height}, @{format}, @{type_}, @{(pbo_offset as f64)}); );
1467 }
1468
1469 pub fn tex_sub_image2_d_3<T0>(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type_: GLenum, source: T0) where T0: JsSerialize {
1470 js!( @(no_return) @{self}.texSubImage2D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{width}, @{height}, @{format}, @{type_}, @{source}); );
1471 }
1472
1473 pub fn tex_sub_image2_d_4<'a0, T0>(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type_: GLenum, src_data: T0, src_offset: GLuint) where T0: AsArrayBufferView<'a0> {
1474 js!( @(no_return) @{self}.texSubImage2D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{width}, @{height}, @{format}, @{type_}, @{unsafe { src_data.as_array_buffer_view() }}, @{src_offset}); );
1475 }
1476
1477 pub fn tex_sub_image3_d(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type_: GLenum, pbo_offset: GLintptr) {
1478 js!( @(no_return) @{self}.texSubImage3D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{zoffset}, @{width}, @{height}, @{depth}, @{format}, @{type_}, @{(pbo_offset as f64)}); );
1479 }
1480
1481 pub fn tex_sub_image3_d_1<T0>(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type_: GLenum, source: T0) where T0: JsSerialize {
1482 js!( @(no_return) @{self}.texSubImage3D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{zoffset}, @{width}, @{height}, @{depth}, @{format}, @{type_}, @{source}); );
1483 }
1484
1485 pub fn tex_sub_image3_d_2<'a0, T0>(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type_: GLenum, src_data: Option<T0>, src_offset: GLuint) where T0: AsArrayBufferView<'a0> {
1486 js!( @(no_return) @{self}.texSubImage3D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{zoffset}, @{width}, @{height}, @{depth}, @{format}, @{type_}, @{src_data.map(|inner| unsafe { inner.as_array_buffer_view() })}, @{src_offset}); );
1487 }
1488
1489 pub fn transform_feedback_varyings(&self, program: &WebGLProgram, varyings: &[&str], buffer_mode: GLenum) {
1490 js!( @(no_return) @{self}.transformFeedbackVaryings(@{program}, @{varyings}, @{buffer_mode}); );
1491 }
1492
1493 pub fn uniform1f(&self, location: Option<&WebGLUniformLocation>, x: GLfloat) {
1494 js!( @(no_return) @{self}.uniform1f(@{location}, @{x}); );
1495 }
1496
1497 pub fn uniform1fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, f32> {
1498 js!( @(no_return) @{self}.uniform1fv(@{location}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
1499 }
1500
1501 pub fn uniform1fv_1<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, v: T0) where T0: AsTypedArray<'a0, f32> {
1502 js!( @(no_return) @{self}.uniform1fv(@{location}, @{unsafe { v.as_typed_array() }}); );
1503 }
1504
1505 pub fn uniform1i(&self, location: Option<&WebGLUniformLocation>, x: GLint) {
1506 js!( @(no_return) @{self}.uniform1i(@{location}, @{x}); );
1507 }
1508
1509 pub fn uniform1iv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, i32> {
1510 js!( @(no_return) @{self}.uniform1iv(@{location}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
1511 }
1512
1513 pub fn uniform1iv_1<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, v: T0) where T0: AsTypedArray<'a0, i32> {
1514 js!( @(no_return) @{self}.uniform1iv(@{location}, @{unsafe { v.as_typed_array() }}); );
1515 }
1516
1517 pub fn uniform1ui(&self, location: Option<&WebGLUniformLocation>, v0: GLuint) {
1518 js!( @(no_return) @{self}.uniform1ui(@{location}, @{v0}); );
1519 }
1520
1521 pub fn uniform1uiv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, u32> {
1522 js!( @(no_return) @{self}.uniform1uiv(@{location}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
1523 }
1524
1525 pub fn uniform2f(&self, location: Option<&WebGLUniformLocation>, x: GLfloat, y: GLfloat) {
1526 js!( @(no_return) @{self}.uniform2f(@{location}, @{x}, @{y}); );
1527 }
1528
1529 pub fn uniform2fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, f32> {
1530 js!( @(no_return) @{self}.uniform2fv(@{location}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
1531 }
1532
1533 pub fn uniform2fv_1<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, v: T0) where T0: AsTypedArray<'a0, f32> {
1534 js!( @(no_return) @{self}.uniform2fv(@{location}, @{unsafe { v.as_typed_array() }}); );
1535 }
1536
1537 pub fn uniform2i(&self, location: Option<&WebGLUniformLocation>, x: GLint, y: GLint) {
1538 js!( @(no_return) @{self}.uniform2i(@{location}, @{x}, @{y}); );
1539 }
1540
1541 pub fn uniform2iv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, i32> {
1542 js!( @(no_return) @{self}.uniform2iv(@{location}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
1543 }
1544
1545 pub fn uniform2iv_1<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, v: T0) where T0: AsTypedArray<'a0, i32> {
1546 js!( @(no_return) @{self}.uniform2iv(@{location}, @{unsafe { v.as_typed_array() }}); );
1547 }
1548
1549 pub fn uniform2ui(&self, location: Option<&WebGLUniformLocation>, v0: GLuint, v1: GLuint) {
1550 js!( @(no_return) @{self}.uniform2ui(@{location}, @{v0}, @{v1}); );
1551 }
1552
1553 pub fn uniform2uiv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, u32> {
1554 js!( @(no_return) @{self}.uniform2uiv(@{location}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
1555 }
1556
1557 pub fn uniform3f(&self, location: Option<&WebGLUniformLocation>, x: GLfloat, y: GLfloat, z: GLfloat) {
1558 js!( @(no_return) @{self}.uniform3f(@{location}, @{x}, @{y}, @{z}); );
1559 }
1560
1561 pub fn uniform3fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, f32> {
1562 js!( @(no_return) @{self}.uniform3fv(@{location}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
1563 }
1564
1565 pub fn uniform3fv_1<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, v: T0) where T0: AsTypedArray<'a0, f32> {
1566 js!( @(no_return) @{self}.uniform3fv(@{location}, @{unsafe { v.as_typed_array() }}); );
1567 }
1568
1569 pub fn uniform3i(&self, location: Option<&WebGLUniformLocation>, x: GLint, y: GLint, z: GLint) {
1570 js!( @(no_return) @{self}.uniform3i(@{location}, @{x}, @{y}, @{z}); );
1571 }
1572
1573 pub fn uniform3iv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, i32> {
1574 js!( @(no_return) @{self}.uniform3iv(@{location}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
1575 }
1576
1577 pub fn uniform3iv_1<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, v: T0) where T0: AsTypedArray<'a0, i32> {
1578 js!( @(no_return) @{self}.uniform3iv(@{location}, @{unsafe { v.as_typed_array() }}); );
1579 }
1580
1581 pub fn uniform3ui(&self, location: Option<&WebGLUniformLocation>, v0: GLuint, v1: GLuint, v2: GLuint) {
1582 js!( @(no_return) @{self}.uniform3ui(@{location}, @{v0}, @{v1}, @{v2}); );
1583 }
1584
1585 pub fn uniform3uiv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, u32> {
1586 js!( @(no_return) @{self}.uniform3uiv(@{location}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
1587 }
1588
1589 pub fn uniform4f(&self, location: Option<&WebGLUniformLocation>, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat) {
1590 js!( @(no_return) @{self}.uniform4f(@{location}, @{x}, @{y}, @{z}, @{w}); );
1591 }
1592
1593 pub fn uniform4fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, f32> {
1594 js!( @(no_return) @{self}.uniform4fv(@{location}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
1595 }
1596
1597 pub fn uniform4fv_1<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, v: T0) where T0: AsTypedArray<'a0, f32> {
1598 js!( @(no_return) @{self}.uniform4fv(@{location}, @{unsafe { v.as_typed_array() }}); );
1599 }
1600
1601 pub fn uniform4i(&self, location: Option<&WebGLUniformLocation>, x: GLint, y: GLint, z: GLint, w: GLint) {
1602 js!( @(no_return) @{self}.uniform4i(@{location}, @{x}, @{y}, @{z}, @{w}); );
1603 }
1604
1605 pub fn uniform4iv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, i32> {
1606 js!( @(no_return) @{self}.uniform4iv(@{location}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
1607 }
1608
1609 pub fn uniform4iv_1<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, v: T0) where T0: AsTypedArray<'a0, i32> {
1610 js!( @(no_return) @{self}.uniform4iv(@{location}, @{unsafe { v.as_typed_array() }}); );
1611 }
1612
1613 pub fn uniform4ui(&self, location: Option<&WebGLUniformLocation>, v0: GLuint, v1: GLuint, v2: GLuint, v3: GLuint) {
1614 js!( @(no_return) @{self}.uniform4ui(@{location}, @{v0}, @{v1}, @{v2}, @{v3}); );
1615 }
1616
1617 pub fn uniform4uiv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, u32> {
1618 js!( @(no_return) @{self}.uniform4uiv(@{location}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
1619 }
1620
1621 pub fn uniform_block_binding(&self, program: &WebGLProgram, uniform_block_index: GLuint, uniform_block_binding: GLuint) {
1622 js!( @(no_return) @{self}.uniformBlockBinding(@{program}, @{uniform_block_index}, @{uniform_block_binding}); );
1623 }
1624
1625 pub fn uniform_matrix2fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, transpose: GLboolean, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, f32> {
1626 js!( @(no_return) @{self}.uniformMatrix2fv(@{location}, @{transpose}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
1627 }
1628
1629 pub fn uniform_matrix2fv_1<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, transpose: GLboolean, value: T0) where T0: AsTypedArray<'a0, f32> {
1630 js!( @(no_return) @{self}.uniformMatrix2fv(@{location}, @{transpose}, @{unsafe { value.as_typed_array() }}); );
1631 }
1632
1633 pub fn uniform_matrix2x3fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, transpose: GLboolean, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, f32> {
1634 js!( @(no_return) @{self}.uniformMatrix2x3fv(@{location}, @{transpose}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
1635 }
1636
1637 pub fn uniform_matrix2x4fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, transpose: GLboolean, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, f32> {
1638 js!( @(no_return) @{self}.uniformMatrix2x4fv(@{location}, @{transpose}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
1639 }
1640
1641 pub fn uniform_matrix3fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, transpose: GLboolean, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, f32> {
1642 js!( @(no_return) @{self}.uniformMatrix3fv(@{location}, @{transpose}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
1643 }
1644
1645 pub fn uniform_matrix3fv_1<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, transpose: GLboolean, value: T0) where T0: AsTypedArray<'a0, f32> {
1646 js!( @(no_return) @{self}.uniformMatrix3fv(@{location}, @{transpose}, @{unsafe { value.as_typed_array() }}); );
1647 }
1648
1649 pub fn uniform_matrix3x2fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, transpose: GLboolean, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, f32> {
1650 js!( @(no_return) @{self}.uniformMatrix3x2fv(@{location}, @{transpose}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
1651 }
1652
1653 pub fn uniform_matrix3x4fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, transpose: GLboolean, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, f32> {
1654 js!( @(no_return) @{self}.uniformMatrix3x4fv(@{location}, @{transpose}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
1655 }
1656
1657 pub fn uniform_matrix4fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, transpose: GLboolean, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, f32> {
1658 js!( @(no_return) @{self}.uniformMatrix4fv(@{location}, @{transpose}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
1659 }
1660
1661 pub fn uniform_matrix4fv_1<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, transpose: GLboolean, value: T0) where T0: AsTypedArray<'a0, f32> {
1662 js!( @(no_return) @{self}.uniformMatrix4fv(@{location}, @{transpose}, @{unsafe { value.as_typed_array() }}); );
1663 }
1664
1665 pub fn uniform_matrix4x2fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, transpose: GLboolean, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, f32> {
1666 js!( @(no_return) @{self}.uniformMatrix4x2fv(@{location}, @{transpose}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
1667 }
1668
1669 pub fn uniform_matrix4x3fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, transpose: GLboolean, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, f32> {
1670 js!( @(no_return) @{self}.uniformMatrix4x3fv(@{location}, @{transpose}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
1671 }
1672
1673 pub fn use_program(&self, program: Option<&WebGLProgram>) {
1674 js!( @(no_return) @{self}.useProgram(@{program}); );
1675 }
1676
1677 pub fn validate_program(&self, program: &WebGLProgram) {
1678 js!( @(no_return) @{self}.validateProgram(@{program}); );
1679 }
1680
1681 pub fn vertex_attrib1f(&self, index: GLuint, x: GLfloat) {
1682 js!( @(no_return) @{self}.vertexAttrib1f(@{index}, @{x}); );
1683 }
1684
1685 pub fn vertex_attrib1fv<'a0, T0>(&self, index: GLuint, values: T0) where T0: AsTypedArray<'a0, f32> {
1686 js!( @(no_return) @{self}.vertexAttrib1fv(@{index}, @{unsafe { values.as_typed_array() }}); );
1687 }
1688
1689 pub fn vertex_attrib2f(&self, index: GLuint, x: GLfloat, y: GLfloat) {
1690 js!( @(no_return) @{self}.vertexAttrib2f(@{index}, @{x}, @{y}); );
1691 }
1692
1693 pub fn vertex_attrib2fv<'a0, T0>(&self, index: GLuint, values: T0) where T0: AsTypedArray<'a0, f32> {
1694 js!( @(no_return) @{self}.vertexAttrib2fv(@{index}, @{unsafe { values.as_typed_array() }}); );
1695 }
1696
1697 pub fn vertex_attrib3f(&self, index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat) {
1698 js!( @(no_return) @{self}.vertexAttrib3f(@{index}, @{x}, @{y}, @{z}); );
1699 }
1700
1701 pub fn vertex_attrib3fv<'a0, T0>(&self, index: GLuint, values: T0) where T0: AsTypedArray<'a0, f32> {
1702 js!( @(no_return) @{self}.vertexAttrib3fv(@{index}, @{unsafe { values.as_typed_array() }}); );
1703 }
1704
1705 pub fn vertex_attrib4f(&self, index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat) {
1706 js!( @(no_return) @{self}.vertexAttrib4f(@{index}, @{x}, @{y}, @{z}, @{w}); );
1707 }
1708
1709 pub fn vertex_attrib4fv<'a0, T0>(&self, index: GLuint, values: T0) where T0: AsTypedArray<'a0, f32> {
1710 js!( @(no_return) @{self}.vertexAttrib4fv(@{index}, @{unsafe { values.as_typed_array() }}); );
1711 }
1712
1713 pub fn vertex_attrib_divisor(&self, index: GLuint, divisor: GLuint) {
1714 js!( @(no_return) @{self}.vertexAttribDivisor(@{index}, @{divisor}); );
1715 }
1716
1717 pub fn vertex_attrib_i4i(&self, index: GLuint, x: GLint, y: GLint, z: GLint, w: GLint) {
1718 js!( @(no_return) @{self}.vertexAttribI4i(@{index}, @{x}, @{y}, @{z}, @{w}); );
1719 }
1720
1721 pub fn vertex_attrib_i4iv<'a0, T0>(&self, index: GLuint, values: T0) where T0: AsTypedArray<'a0, i32> {
1722 js!( @(no_return) @{self}.vertexAttribI4iv(@{index}, @{unsafe { values.as_typed_array() }}); );
1723 }
1724
1725 pub fn vertex_attrib_i4ui(&self, index: GLuint, x: GLuint, y: GLuint, z: GLuint, w: GLuint) {
1726 js!( @(no_return) @{self}.vertexAttribI4ui(@{index}, @{x}, @{y}, @{z}, @{w}); );
1727 }
1728
1729 pub fn vertex_attrib_i4uiv<'a0, T0>(&self, index: GLuint, values: T0) where T0: AsTypedArray<'a0, u32> {
1730 js!( @(no_return) @{self}.vertexAttribI4uiv(@{index}, @{unsafe { values.as_typed_array() }}); );
1731 }
1732
1733 pub fn vertex_attrib_i_pointer(&self, index: GLuint, size: GLint, type_: GLenum, stride: GLsizei, offset: GLintptr) {
1734 js!( @(no_return) @{self}.vertexAttribIPointer(@{index}, @{size}, @{type_}, @{stride}, @{(offset as f64)}); );
1735 }
1736
1737 pub fn vertex_attrib_pointer(&self, index: GLuint, size: GLint, type_: GLenum, normalized: GLboolean, stride: GLsizei, offset: GLintptr) {
1738 js!( @(no_return) @{self}.vertexAttribPointer(@{index}, @{size}, @{type_}, @{normalized}, @{stride}, @{(offset as f64)}); );
1739 }
1740
1741 pub fn viewport(&self, x: GLint, y: GLint, width: GLsizei, height: GLsizei) {
1742 js!( @(no_return) @{self}.viewport(@{x}, @{y}, @{width}, @{height}); );
1743 }
1744
1745 pub fn wait_sync(&self, sync: &WebGLSync, flags: GLbitfield, timeout: GLint64) {
1746 js!( @(no_return) @{self}.waitSync(@{sync}, @{flags}, @{(timeout as f64)}); );
1747 }
1748}
1749
1750
1751impl InstanceOf for GLContext {
1752 #[inline]
1753 fn instance_of(reference: &Reference) -> bool {
1754 js!(
1755 return [WebGLRenderingContext, WebGL2RenderingContext].includes(@{{reference}}.constructor);
1756 ).try_into().unwrap()
1757 }
1758}
1759
1760#[derive(Debug, Clone, ReferenceType)]
1761#[reference(instance_of = "WebGL2RenderingContext")]
1762pub struct WebGL2RenderingContext(Reference);
1763
1764impl WebGL2RenderingContext {
1765
1766 pub const ACTIVE_ATTRIBUTES: GLenum = 35721;
1767 pub const ACTIVE_TEXTURE: GLenum = 34016;
1768 pub const ACTIVE_UNIFORMS: GLenum = 35718;
1769 pub const ACTIVE_UNIFORM_BLOCKS: GLenum = 35382;
1770 pub const ALIASED_LINE_WIDTH_RANGE: GLenum = 33902;
1771 pub const ALIASED_POINT_SIZE_RANGE: GLenum = 33901;
1772 pub const ALPHA: GLenum = 6406;
1773 pub const ALPHA_BITS: GLenum = 3413;
1774 pub const ALREADY_SIGNALED: GLenum = 37146;
1775 pub const ALWAYS: GLenum = 519;
1776 pub const ANY_SAMPLES_PASSED: GLenum = 35887;
1777 pub const ANY_SAMPLES_PASSED_CONSERVATIVE: GLenum = 36202;
1778 pub const ARRAY_BUFFER: GLenum = 34962;
1779 pub const ARRAY_BUFFER_BINDING: GLenum = 34964;
1780 pub const ATTACHED_SHADERS: GLenum = 35717;
1781 pub const BACK: GLenum = 1029;
1782 pub const BLEND: GLenum = 3042;
1783 pub const BLEND_COLOR: GLenum = 32773;
1784 pub const BLEND_DST_ALPHA: GLenum = 32970;
1785 pub const BLEND_DST_RGB: GLenum = 32968;
1786 pub const BLEND_EQUATION: GLenum = 32777;
1787 pub const BLEND_EQUATION_ALPHA: GLenum = 34877;
1788 pub const BLEND_EQUATION_RGB: GLenum = 32777;
1789 pub const BLEND_SRC_ALPHA: GLenum = 32971;
1790 pub const BLEND_SRC_RGB: GLenum = 32969;
1791 pub const BLUE_BITS: GLenum = 3412;
1792 pub const BOOL: GLenum = 35670;
1793 pub const BOOL_VEC2: GLenum = 35671;
1794 pub const BOOL_VEC3: GLenum = 35672;
1795 pub const BOOL_VEC4: GLenum = 35673;
1796 pub const BROWSER_DEFAULT_WEBGL: GLenum = 37444;
1797 pub const BUFFER_SIZE: GLenum = 34660;
1798 pub const BUFFER_USAGE: GLenum = 34661;
1799 pub const BYTE: GLenum = 5120;
1800 pub const CCW: GLenum = 2305;
1801 pub const CLAMP_TO_EDGE: GLenum = 33071;
1802 pub const COLOR: GLenum = 6144;
1803 pub const COLOR_ATTACHMENT0: GLenum = 36064;
1804 pub const COLOR_ATTACHMENT1: GLenum = 36065;
1805 pub const COLOR_ATTACHMENT10: GLenum = 36074;
1806 pub const COLOR_ATTACHMENT11: GLenum = 36075;
1807 pub const COLOR_ATTACHMENT12: GLenum = 36076;
1808 pub const COLOR_ATTACHMENT13: GLenum = 36077;
1809 pub const COLOR_ATTACHMENT14: GLenum = 36078;
1810 pub const COLOR_ATTACHMENT15: GLenum = 36079;
1811 pub const COLOR_ATTACHMENT2: GLenum = 36066;
1812 pub const COLOR_ATTACHMENT3: GLenum = 36067;
1813 pub const COLOR_ATTACHMENT4: GLenum = 36068;
1814 pub const COLOR_ATTACHMENT5: GLenum = 36069;
1815 pub const COLOR_ATTACHMENT6: GLenum = 36070;
1816 pub const COLOR_ATTACHMENT7: GLenum = 36071;
1817 pub const COLOR_ATTACHMENT8: GLenum = 36072;
1818 pub const COLOR_ATTACHMENT9: GLenum = 36073;
1819 pub const COLOR_BUFFER_BIT: GLenum = 16384;
1820 pub const COLOR_CLEAR_VALUE: GLenum = 3106;
1821 pub const COLOR_WRITEMASK: GLenum = 3107;
1822 pub const COMPARE_REF_TO_TEXTURE: GLenum = 34894;
1823 pub const COMPILE_STATUS: GLenum = 35713;
1824 pub const COMPRESSED_TEXTURE_FORMATS: GLenum = 34467;
1825 pub const CONDITION_SATISFIED: GLenum = 37148;
1826 pub const CONSTANT_ALPHA: GLenum = 32771;
1827 pub const CONSTANT_COLOR: GLenum = 32769;
1828 pub const CONTEXT_LOST_WEBGL: GLenum = 37442;
1829 pub const COPY_READ_BUFFER: GLenum = 36662;
1830 pub const COPY_READ_BUFFER_BINDING: GLenum = 36662;
1831 pub const COPY_WRITE_BUFFER: GLenum = 36663;
1832 pub const COPY_WRITE_BUFFER_BINDING: GLenum = 36663;
1833 pub const CULL_FACE: GLenum = 2884;
1834 pub const CULL_FACE_MODE: GLenum = 2885;
1835 pub const CURRENT_PROGRAM: GLenum = 35725;
1836 pub const CURRENT_QUERY: GLenum = 34917;
1837 pub const CURRENT_VERTEX_ATTRIB: GLenum = 34342;
1838 pub const CW: GLenum = 2304;
1839 pub const DECR: GLenum = 7683;
1840 pub const DECR_WRAP: GLenum = 34056;
1841 pub const DELETE_STATUS: GLenum = 35712;
1842 pub const DEPTH: GLenum = 6145;
1843 pub const DEPTH24_STENCIL8: GLenum = 35056;
1844 pub const DEPTH32F_STENCIL8: GLenum = 36013;
1845 pub const DEPTH_ATTACHMENT: GLenum = 36096;
1846 pub const DEPTH_BITS: GLenum = 3414;
1847 pub const DEPTH_BUFFER_BIT: GLenum = 256;
1848 pub const DEPTH_CLEAR_VALUE: GLenum = 2931;
1849 pub const DEPTH_COMPONENT: GLenum = 6402;
1850 pub const DEPTH_COMPONENT16: GLenum = 33189;
1851 pub const DEPTH_COMPONENT24: GLenum = 33190;
1852 pub const DEPTH_COMPONENT32F: GLenum = 36012;
1853 pub const DEPTH_FUNC: GLenum = 2932;
1854 pub const DEPTH_RANGE: GLenum = 2928;
1855 pub const DEPTH_STENCIL: GLenum = 34041;
1856 pub const DEPTH_STENCIL_ATTACHMENT: GLenum = 33306;
1857 pub const DEPTH_TEST: GLenum = 2929;
1858 pub const DEPTH_WRITEMASK: GLenum = 2930;
1859 pub const DITHER: GLenum = 3024;
1860 pub const DONT_CARE: GLenum = 4352;
1861 pub const DRAW_BUFFER0: GLenum = 34853;
1862 pub const DRAW_BUFFER1: GLenum = 34854;
1863 pub const DRAW_BUFFER10: GLenum = 34863;
1864 pub const DRAW_BUFFER11: GLenum = 34864;
1865 pub const DRAW_BUFFER12: GLenum = 34865;
1866 pub const DRAW_BUFFER13: GLenum = 34866;
1867 pub const DRAW_BUFFER14: GLenum = 34867;
1868 pub const DRAW_BUFFER15: GLenum = 34868;
1869 pub const DRAW_BUFFER2: GLenum = 34855;
1870 pub const DRAW_BUFFER3: GLenum = 34856;
1871 pub const DRAW_BUFFER4: GLenum = 34857;
1872 pub const DRAW_BUFFER5: GLenum = 34858;
1873 pub const DRAW_BUFFER6: GLenum = 34859;
1874 pub const DRAW_BUFFER7: GLenum = 34860;
1875 pub const DRAW_BUFFER8: GLenum = 34861;
1876 pub const DRAW_BUFFER9: GLenum = 34862;
1877 pub const DRAW_FRAMEBUFFER: GLenum = 36009;
1878 pub const DRAW_FRAMEBUFFER_BINDING: GLenum = 36006;
1879 pub const DST_ALPHA: GLenum = 772;
1880 pub const DST_COLOR: GLenum = 774;
1881 pub const DYNAMIC_COPY: GLenum = 35050;
1882 pub const DYNAMIC_DRAW: GLenum = 35048;
1883 pub const DYNAMIC_READ: GLenum = 35049;
1884 pub const ELEMENT_ARRAY_BUFFER: GLenum = 34963;
1885 pub const ELEMENT_ARRAY_BUFFER_BINDING: GLenum = 34965;
1886 pub const EQUAL: GLenum = 514;
1887 pub const FASTEST: GLenum = 4353;
1888 pub const FLOAT: GLenum = 5126;
1889 pub const FLOAT_32_UNSIGNED_INT_24_8_REV: GLenum = 36269;
1890 pub const FLOAT_MAT2: GLenum = 35674;
1891 pub const FLOAT_MAT2X3: GLenum = 35685;
1892 pub const FLOAT_MAT2X4: GLenum = 35686;
1893 pub const FLOAT_MAT3: GLenum = 35675;
1894 pub const FLOAT_MAT3X2: GLenum = 35687;
1895 pub const FLOAT_MAT3X4: GLenum = 35688;
1896 pub const FLOAT_MAT4: GLenum = 35676;
1897 pub const FLOAT_MAT4X2: GLenum = 35689;
1898 pub const FLOAT_MAT4X3: GLenum = 35690;
1899 pub const FLOAT_VEC2: GLenum = 35664;
1900 pub const FLOAT_VEC3: GLenum = 35665;
1901 pub const FLOAT_VEC4: GLenum = 35666;
1902 pub const FRAGMENT_SHADER: GLenum = 35632;
1903 pub const FRAGMENT_SHADER_DERIVATIVE_HINT: GLenum = 35723;
1904 pub const FRAMEBUFFER: GLenum = 36160;
1905 pub const FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: GLenum = 33301;
1906 pub const FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: GLenum = 33300;
1907 pub const FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: GLenum = 33296;
1908 pub const FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: GLenum = 33297;
1909 pub const FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: GLenum = 33302;
1910 pub const FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: GLenum = 33299;
1911 pub const FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: GLenum = 36049;
1912 pub const FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: GLenum = 36048;
1913 pub const FRAMEBUFFER_ATTACHMENT_RED_SIZE: GLenum = 33298;
1914 pub const FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: GLenum = 33303;
1915 pub const FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: GLenum = 36051;
1916 pub const FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: GLenum = 36052;
1917 pub const FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: GLenum = 36050;
1918 pub const FRAMEBUFFER_BINDING: GLenum = 36006;
1919 pub const FRAMEBUFFER_COMPLETE: GLenum = 36053;
1920 pub const FRAMEBUFFER_DEFAULT: GLenum = 33304;
1921 pub const FRAMEBUFFER_INCOMPLETE_ATTACHMENT: GLenum = 36054;
1922 pub const FRAMEBUFFER_INCOMPLETE_DIMENSIONS: GLenum = 36057;
1923 pub const FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: GLenum = 36055;
1924 pub const FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: GLenum = 36182;
1925 pub const FRAMEBUFFER_UNSUPPORTED: GLenum = 36061;
1926 pub const FRONT: GLenum = 1028;
1927 pub const FRONT_AND_BACK: GLenum = 1032;
1928 pub const FRONT_FACE: GLenum = 2886;
1929 pub const FUNC_ADD: GLenum = 32774;
1930 pub const FUNC_REVERSE_SUBTRACT: GLenum = 32779;
1931 pub const FUNC_SUBTRACT: GLenum = 32778;
1932 pub const GENERATE_MIPMAP_HINT: GLenum = 33170;
1933 pub const GEQUAL: GLenum = 518;
1934 pub const GREATER: GLenum = 516;
1935 pub const GREEN_BITS: GLenum = 3411;
1936 pub const HALF_FLOAT: GLenum = 5131;
1937 pub const HIGH_FLOAT: GLenum = 36338;
1938 pub const HIGH_INT: GLenum = 36341;
1939 pub const IMPLEMENTATION_COLOR_READ_FORMAT: GLenum = 35739;
1940 pub const IMPLEMENTATION_COLOR_READ_TYPE: GLenum = 35738;
1941 pub const INCR: GLenum = 7682;
1942 pub const INCR_WRAP: GLenum = 34055;
1943 pub const INT: GLenum = 5124;
1944 pub const INTERLEAVED_ATTRIBS: GLenum = 35980;
1945 pub const INT_2_10_10_10_REV: GLenum = 36255;
1946 pub const INT_SAMPLER_2D: GLenum = 36298;
1947 pub const INT_SAMPLER_2D_ARRAY: GLenum = 36303;
1948 pub const INT_SAMPLER_3D: GLenum = 36299;
1949 pub const INT_SAMPLER_CUBE: GLenum = 36300;
1950 pub const INT_VEC2: GLenum = 35667;
1951 pub const INT_VEC3: GLenum = 35668;
1952 pub const INT_VEC4: GLenum = 35669;
1953 pub const INVALID_ENUM: GLenum = 1280;
1954 pub const INVALID_FRAMEBUFFER_OPERATION: GLenum = 1286;
1955 pub const INVALID_INDEX: GLenum = 4294967295;
1956 pub const INVALID_OPERATION: GLenum = 1282;
1957 pub const INVALID_VALUE: GLenum = 1281;
1958 pub const INVERT: GLenum = 5386;
1959 pub const KEEP: GLenum = 7680;
1960 pub const LEQUAL: GLenum = 515;
1961 pub const LESS: GLenum = 513;
1962 pub const LINEAR: GLenum = 9729;
1963 pub const LINEAR_MIPMAP_LINEAR: GLenum = 9987;
1964 pub const LINEAR_MIPMAP_NEAREST: GLenum = 9985;
1965 pub const LINES: GLenum = 1;
1966 pub const LINE_LOOP: GLenum = 2;
1967 pub const LINE_STRIP: GLenum = 3;
1968 pub const LINE_WIDTH: GLenum = 2849;
1969 pub const LINK_STATUS: GLenum = 35714;
1970 pub const LOW_FLOAT: GLenum = 36336;
1971 pub const LOW_INT: GLenum = 36339;
1972 pub const LUMINANCE: GLenum = 6409;
1973 pub const LUMINANCE_ALPHA: GLenum = 6410;
1974 pub const MAX: GLenum = 32776;
1975 pub const MAX_3D_TEXTURE_SIZE: GLenum = 32883;
1976 pub const MAX_ARRAY_TEXTURE_LAYERS: GLenum = 35071;
1977 pub const MAX_CLIENT_WAIT_TIMEOUT_WEBGL: GLenum = 37447;
1978 pub const MAX_COLOR_ATTACHMENTS: GLenum = 36063;
1979 pub const MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: GLenum = 35379;
1980 pub const MAX_COMBINED_TEXTURE_IMAGE_UNITS: GLenum = 35661;
1981 pub const MAX_COMBINED_UNIFORM_BLOCKS: GLenum = 35374;
1982 pub const MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: GLenum = 35377;
1983 pub const MAX_CUBE_MAP_TEXTURE_SIZE: GLenum = 34076;
1984 pub const MAX_DRAW_BUFFERS: GLenum = 34852;
1985 pub const MAX_ELEMENTS_INDICES: GLenum = 33001;
1986 pub const MAX_ELEMENTS_VERTICES: GLenum = 33000;
1987 pub const MAX_ELEMENT_INDEX: GLenum = 36203;
1988 pub const MAX_FRAGMENT_INPUT_COMPONENTS: GLenum = 37157;
1989 pub const MAX_FRAGMENT_UNIFORM_BLOCKS: GLenum = 35373;
1990 pub const MAX_FRAGMENT_UNIFORM_COMPONENTS: GLenum = 35657;
1991 pub const MAX_FRAGMENT_UNIFORM_VECTORS: GLenum = 36349;
1992 pub const MAX_PROGRAM_TEXEL_OFFSET: GLenum = 35077;
1993 pub const MAX_RENDERBUFFER_SIZE: GLenum = 34024;
1994 pub const MAX_SAMPLES: GLenum = 36183;
1995 pub const MAX_SERVER_WAIT_TIMEOUT: GLenum = 37137;
1996 pub const MAX_TEXTURE_IMAGE_UNITS: GLenum = 34930;
1997 pub const MAX_TEXTURE_LOD_BIAS: GLenum = 34045;
1998 pub const MAX_TEXTURE_SIZE: GLenum = 3379;
1999 pub const MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: GLenum = 35978;
2000 pub const MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: GLenum = 35979;
2001 pub const MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: GLenum = 35968;
2002 pub const MAX_UNIFORM_BLOCK_SIZE: GLenum = 35376;
2003 pub const MAX_UNIFORM_BUFFER_BINDINGS: GLenum = 35375;
2004 pub const MAX_VARYING_COMPONENTS: GLenum = 35659;
2005 pub const MAX_VARYING_VECTORS: GLenum = 36348;
2006 pub const MAX_VERTEX_ATTRIBS: GLenum = 34921;
2007 pub const MAX_VERTEX_OUTPUT_COMPONENTS: GLenum = 37154;
2008 pub const MAX_VERTEX_TEXTURE_IMAGE_UNITS: GLenum = 35660;
2009 pub const MAX_VERTEX_UNIFORM_BLOCKS: GLenum = 35371;
2010 pub const MAX_VERTEX_UNIFORM_COMPONENTS: GLenum = 35658;
2011 pub const MAX_VERTEX_UNIFORM_VECTORS: GLenum = 36347;
2012 pub const MAX_VIEWPORT_DIMS: GLenum = 3386;
2013 pub const MEDIUM_FLOAT: GLenum = 36337;
2014 pub const MEDIUM_INT: GLenum = 36340;
2015 pub const MIN: GLenum = 32775;
2016 pub const MIN_PROGRAM_TEXEL_OFFSET: GLenum = 35076;
2017 pub const MIRRORED_REPEAT: GLenum = 33648;
2018 pub const NEAREST: GLenum = 9728;
2019 pub const NEAREST_MIPMAP_LINEAR: GLenum = 9986;
2020 pub const NEAREST_MIPMAP_NEAREST: GLenum = 9984;
2021 pub const NEVER: GLenum = 512;
2022 pub const NICEST: GLenum = 4354;
2023 pub const NONE: GLenum = 0;
2024 pub const NOTEQUAL: GLenum = 517;
2025 pub const NO_ERROR: GLenum = 0;
2026 pub const OBJECT_TYPE: GLenum = 37138;
2027 pub const ONE: GLenum = 1;
2028 pub const ONE_MINUS_CONSTANT_ALPHA: GLenum = 32772;
2029 pub const ONE_MINUS_CONSTANT_COLOR: GLenum = 32770;
2030 pub const ONE_MINUS_DST_ALPHA: GLenum = 773;
2031 pub const ONE_MINUS_DST_COLOR: GLenum = 775;
2032 pub const ONE_MINUS_SRC_ALPHA: GLenum = 771;
2033 pub const ONE_MINUS_SRC_COLOR: GLenum = 769;
2034 pub const OUT_OF_MEMORY: GLenum = 1285;
2035 pub const PACK_ALIGNMENT: GLenum = 3333;
2036 pub const PACK_ROW_LENGTH: GLenum = 3330;
2037 pub const PACK_SKIP_PIXELS: GLenum = 3332;
2038 pub const PACK_SKIP_ROWS: GLenum = 3331;
2039 pub const PIXEL_PACK_BUFFER: GLenum = 35051;
2040 pub const PIXEL_PACK_BUFFER_BINDING: GLenum = 35053;
2041 pub const PIXEL_UNPACK_BUFFER: GLenum = 35052;
2042 pub const PIXEL_UNPACK_BUFFER_BINDING: GLenum = 35055;
2043 pub const POINTS: GLenum = 0;
2044 pub const POLYGON_OFFSET_FACTOR: GLenum = 32824;
2045 pub const POLYGON_OFFSET_FILL: GLenum = 32823;
2046 pub const POLYGON_OFFSET_UNITS: GLenum = 10752;
2047 pub const QUERY_RESULT: GLenum = 34918;
2048 pub const QUERY_RESULT_AVAILABLE: GLenum = 34919;
2049 pub const R11F_G11F_B10F: GLenum = 35898;
2050 pub const R16F: GLenum = 33325;
2051 pub const R16I: GLenum = 33331;
2052 pub const R16UI: GLenum = 33332;
2053 pub const R32F: GLenum = 33326;
2054 pub const R32I: GLenum = 33333;
2055 pub const R32UI: GLenum = 33334;
2056 pub const R8: GLenum = 33321;
2057 pub const R8I: GLenum = 33329;
2058 pub const R8UI: GLenum = 33330;
2059 pub const R8_SNORM: GLenum = 36756;
2060 pub const RASTERIZER_DISCARD: GLenum = 35977;
2061 pub const READ_BUFFER: GLenum = 3074;
2062 pub const READ_FRAMEBUFFER: GLenum = 36008;
2063 pub const READ_FRAMEBUFFER_BINDING: GLenum = 36010;
2064 pub const RED: GLenum = 6403;
2065 pub const RED_BITS: GLenum = 3410;
2066 pub const RED_INTEGER: GLenum = 36244;
2067 pub const RENDERBUFFER: GLenum = 36161;
2068 pub const RENDERBUFFER_ALPHA_SIZE: GLenum = 36179;
2069 pub const RENDERBUFFER_BINDING: GLenum = 36007;
2070 pub const RENDERBUFFER_BLUE_SIZE: GLenum = 36178;
2071 pub const RENDERBUFFER_DEPTH_SIZE: GLenum = 36180;
2072 pub const RENDERBUFFER_GREEN_SIZE: GLenum = 36177;
2073 pub const RENDERBUFFER_HEIGHT: GLenum = 36163;
2074 pub const RENDERBUFFER_INTERNAL_FORMAT: GLenum = 36164;
2075 pub const RENDERBUFFER_RED_SIZE: GLenum = 36176;
2076 pub const RENDERBUFFER_SAMPLES: GLenum = 36011;
2077 pub const RENDERBUFFER_STENCIL_SIZE: GLenum = 36181;
2078 pub const RENDERBUFFER_WIDTH: GLenum = 36162;
2079 pub const RENDERER: GLenum = 7937;
2080 pub const REPEAT: GLenum = 10497;
2081 pub const REPLACE: GLenum = 7681;
2082 pub const RG: GLenum = 33319;
2083 pub const RG16F: GLenum = 33327;
2084 pub const RG16I: GLenum = 33337;
2085 pub const RG16UI: GLenum = 33338;
2086 pub const RG32F: GLenum = 33328;
2087 pub const RG32I: GLenum = 33339;
2088 pub const RG32UI: GLenum = 33340;
2089 pub const RG8: GLenum = 33323;
2090 pub const RG8I: GLenum = 33335;
2091 pub const RG8UI: GLenum = 33336;
2092 pub const RG8_SNORM: GLenum = 36757;
2093 pub const RGB: GLenum = 6407;
2094 pub const RGB10_A2: GLenum = 32857;
2095 pub const RGB10_A2UI: GLenum = 36975;
2096 pub const RGB16F: GLenum = 34843;
2097 pub const RGB16I: GLenum = 36233;
2098 pub const RGB16UI: GLenum = 36215;
2099 pub const RGB32F: GLenum = 34837;
2100 pub const RGB32I: GLenum = 36227;
2101 pub const RGB32UI: GLenum = 36209;
2102 pub const RGB565: GLenum = 36194;
2103 pub const RGB5_A1: GLenum = 32855;
2104 pub const RGB8: GLenum = 32849;
2105 pub const RGB8I: GLenum = 36239;
2106 pub const RGB8UI: GLenum = 36221;
2107 pub const RGB8_SNORM: GLenum = 36758;
2108 pub const RGB9_E5: GLenum = 35901;
2109 pub const RGBA: GLenum = 6408;
2110 pub const RGBA16F: GLenum = 34842;
2111 pub const RGBA16I: GLenum = 36232;
2112 pub const RGBA16UI: GLenum = 36214;
2113 pub const RGBA32F: GLenum = 34836;
2114 pub const RGBA32I: GLenum = 36226;
2115 pub const RGBA32UI: GLenum = 36208;
2116 pub const RGBA4: GLenum = 32854;
2117 pub const RGBA8: GLenum = 32856;
2118 pub const RGBA8I: GLenum = 36238;
2119 pub const RGBA8UI: GLenum = 36220;
2120 pub const RGBA8_SNORM: GLenum = 36759;
2121 pub const RGBA_INTEGER: GLenum = 36249;
2122 pub const RGB_INTEGER: GLenum = 36248;
2123 pub const RG_INTEGER: GLenum = 33320;
2124 pub const SAMPLER_2D: GLenum = 35678;
2125 pub const SAMPLER_2D_ARRAY: GLenum = 36289;
2126 pub const SAMPLER_2D_ARRAY_SHADOW: GLenum = 36292;
2127 pub const SAMPLER_2D_SHADOW: GLenum = 35682;
2128 pub const SAMPLER_3D: GLenum = 35679;
2129 pub const SAMPLER_BINDING: GLenum = 35097;
2130 pub const SAMPLER_CUBE: GLenum = 35680;
2131 pub const SAMPLER_CUBE_SHADOW: GLenum = 36293;
2132 pub const SAMPLES: GLenum = 32937;
2133 pub const SAMPLE_ALPHA_TO_COVERAGE: GLenum = 32926;
2134 pub const SAMPLE_BUFFERS: GLenum = 32936;
2135 pub const SAMPLE_COVERAGE: GLenum = 32928;
2136 pub const SAMPLE_COVERAGE_INVERT: GLenum = 32939;
2137 pub const SAMPLE_COVERAGE_VALUE: GLenum = 32938;
2138 pub const SCISSOR_BOX: GLenum = 3088;
2139 pub const SCISSOR_TEST: GLenum = 3089;
2140 pub const SEPARATE_ATTRIBS: GLenum = 35981;
2141 pub const SHADER_TYPE: GLenum = 35663;
2142 pub const SHADING_LANGUAGE_VERSION: GLenum = 35724;
2143 pub const SHORT: GLenum = 5122;
2144 pub const SIGNALED: GLenum = 37145;
2145 pub const SIGNED_NORMALIZED: GLenum = 36764;
2146 pub const SRC_ALPHA: GLenum = 770;
2147 pub const SRC_ALPHA_SATURATE: GLenum = 776;
2148 pub const SRC_COLOR: GLenum = 768;
2149 pub const SRGB: GLenum = 35904;
2150 pub const SRGB8: GLenum = 35905;
2151 pub const SRGB8_ALPHA8: GLenum = 35907;
2152 pub const STATIC_COPY: GLenum = 35046;
2153 pub const STATIC_DRAW: GLenum = 35044;
2154 pub const STATIC_READ: GLenum = 35045;
2155 pub const STENCIL: GLenum = 6146;
2156 pub const STENCIL_ATTACHMENT: GLenum = 36128;
2157 pub const STENCIL_BACK_FAIL: GLenum = 34817;
2158 pub const STENCIL_BACK_FUNC: GLenum = 34816;
2159 pub const STENCIL_BACK_PASS_DEPTH_FAIL: GLenum = 34818;
2160 pub const STENCIL_BACK_PASS_DEPTH_PASS: GLenum = 34819;
2161 pub const STENCIL_BACK_REF: GLenum = 36003;
2162 pub const STENCIL_BACK_VALUE_MASK: GLenum = 36004;
2163 pub const STENCIL_BACK_WRITEMASK: GLenum = 36005;
2164 pub const STENCIL_BITS: GLenum = 3415;
2165 pub const STENCIL_BUFFER_BIT: GLenum = 1024;
2166 pub const STENCIL_CLEAR_VALUE: GLenum = 2961;
2167 pub const STENCIL_FAIL: GLenum = 2964;
2168 pub const STENCIL_FUNC: GLenum = 2962;
2169 pub const STENCIL_INDEX8: GLenum = 36168;
2170 pub const STENCIL_PASS_DEPTH_FAIL: GLenum = 2965;
2171 pub const STENCIL_PASS_DEPTH_PASS: GLenum = 2966;
2172 pub const STENCIL_REF: GLenum = 2967;
2173 pub const STENCIL_TEST: GLenum = 2960;
2174 pub const STENCIL_VALUE_MASK: GLenum = 2963;
2175 pub const STENCIL_WRITEMASK: GLenum = 2968;
2176 pub const STREAM_COPY: GLenum = 35042;
2177 pub const STREAM_DRAW: GLenum = 35040;
2178 pub const STREAM_READ: GLenum = 35041;
2179 pub const SUBPIXEL_BITS: GLenum = 3408;
2180 pub const SYNC_CONDITION: GLenum = 37139;
2181 pub const SYNC_FENCE: GLenum = 37142;
2182 pub const SYNC_FLAGS: GLenum = 37141;
2183 pub const SYNC_FLUSH_COMMANDS_BIT: GLenum = 1;
2184 pub const SYNC_GPU_COMMANDS_COMPLETE: GLenum = 37143;
2185 pub const SYNC_STATUS: GLenum = 37140;
2186 pub const TEXTURE: GLenum = 5890;
2187 pub const TEXTURE0: GLenum = 33984;
2188 pub const TEXTURE1: GLenum = 33985;
2189 pub const TEXTURE10: GLenum = 33994;
2190 pub const TEXTURE11: GLenum = 33995;
2191 pub const TEXTURE12: GLenum = 33996;
2192 pub const TEXTURE13: GLenum = 33997;
2193 pub const TEXTURE14: GLenum = 33998;
2194 pub const TEXTURE15: GLenum = 33999;
2195 pub const TEXTURE16: GLenum = 34000;
2196 pub const TEXTURE17: GLenum = 34001;
2197 pub const TEXTURE18: GLenum = 34002;
2198 pub const TEXTURE19: GLenum = 34003;
2199 pub const TEXTURE2: GLenum = 33986;
2200 pub const TEXTURE20: GLenum = 34004;
2201 pub const TEXTURE21: GLenum = 34005;
2202 pub const TEXTURE22: GLenum = 34006;
2203 pub const TEXTURE23: GLenum = 34007;
2204 pub const TEXTURE24: GLenum = 34008;
2205 pub const TEXTURE25: GLenum = 34009;
2206 pub const TEXTURE26: GLenum = 34010;
2207 pub const TEXTURE27: GLenum = 34011;
2208 pub const TEXTURE28: GLenum = 34012;
2209 pub const TEXTURE29: GLenum = 34013;
2210 pub const TEXTURE3: GLenum = 33987;
2211 pub const TEXTURE30: GLenum = 34014;
2212 pub const TEXTURE31: GLenum = 34015;
2213 pub const TEXTURE4: GLenum = 33988;
2214 pub const TEXTURE5: GLenum = 33989;
2215 pub const TEXTURE6: GLenum = 33990;
2216 pub const TEXTURE7: GLenum = 33991;
2217 pub const TEXTURE8: GLenum = 33992;
2218 pub const TEXTURE9: GLenum = 33993;
2219 pub const TEXTURE_2D: GLenum = 3553;
2220 pub const TEXTURE_2D_ARRAY: GLenum = 35866;
2221 pub const TEXTURE_3D: GLenum = 32879;
2222 pub const TEXTURE_BASE_LEVEL: GLenum = 33084;
2223 pub const TEXTURE_BINDING_2D: GLenum = 32873;
2224 pub const TEXTURE_BINDING_2D_ARRAY: GLenum = 35869;
2225 pub const TEXTURE_BINDING_3D: GLenum = 32874;
2226 pub const TEXTURE_BINDING_CUBE_MAP: GLenum = 34068;
2227 pub const TEXTURE_COMPARE_FUNC: GLenum = 34893;
2228 pub const TEXTURE_COMPARE_MODE: GLenum = 34892;
2229 pub const TEXTURE_CUBE_MAP: GLenum = 34067;
2230 pub const TEXTURE_CUBE_MAP_NEGATIVE_X: GLenum = 34070;
2231 pub const TEXTURE_CUBE_MAP_NEGATIVE_Y: GLenum = 34072;
2232 pub const TEXTURE_CUBE_MAP_NEGATIVE_Z: GLenum = 34074;
2233 pub const TEXTURE_CUBE_MAP_POSITIVE_X: GLenum = 34069;
2234 pub const TEXTURE_CUBE_MAP_POSITIVE_Y: GLenum = 34071;
2235 pub const TEXTURE_CUBE_MAP_POSITIVE_Z: GLenum = 34073;
2236 pub const TEXTURE_IMMUTABLE_FORMAT: GLenum = 37167;
2237 pub const TEXTURE_IMMUTABLE_LEVELS: GLenum = 33503;
2238 pub const TEXTURE_MAG_FILTER: GLenum = 10240;
2239 pub const TEXTURE_MAX_LEVEL: GLenum = 33085;
2240 pub const TEXTURE_MAX_LOD: GLenum = 33083;
2241 pub const TEXTURE_MIN_FILTER: GLenum = 10241;
2242 pub const TEXTURE_MIN_LOD: GLenum = 33082;
2243 pub const TEXTURE_WRAP_R: GLenum = 32882;
2244 pub const TEXTURE_WRAP_S: GLenum = 10242;
2245 pub const TEXTURE_WRAP_T: GLenum = 10243;
2246 pub const TIMEOUT_EXPIRED: GLenum = 37147;
2247 pub const TIMEOUT_IGNORED: GLint64 = -1;
2248 pub const TRANSFORM_FEEDBACK: GLenum = 36386;
2249 pub const TRANSFORM_FEEDBACK_ACTIVE: GLenum = 36388;
2250 pub const TRANSFORM_FEEDBACK_BINDING: GLenum = 36389;
2251 pub const TRANSFORM_FEEDBACK_BUFFER: GLenum = 35982;
2252 pub const TRANSFORM_FEEDBACK_BUFFER_BINDING: GLenum = 35983;
2253 pub const TRANSFORM_FEEDBACK_BUFFER_MODE: GLenum = 35967;
2254 pub const TRANSFORM_FEEDBACK_BUFFER_SIZE: GLenum = 35973;
2255 pub const TRANSFORM_FEEDBACK_BUFFER_START: GLenum = 35972;
2256 pub const TRANSFORM_FEEDBACK_PAUSED: GLenum = 36387;
2257 pub const TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: GLenum = 35976;
2258 pub const TRANSFORM_FEEDBACK_VARYINGS: GLenum = 35971;
2259 pub const TRIANGLES: GLenum = 4;
2260 pub const TRIANGLE_FAN: GLenum = 6;
2261 pub const TRIANGLE_STRIP: GLenum = 5;
2262 pub const UNIFORM_ARRAY_STRIDE: GLenum = 35388;
2263 pub const UNIFORM_BLOCK_ACTIVE_UNIFORMS: GLenum = 35394;
2264 pub const UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: GLenum = 35395;
2265 pub const UNIFORM_BLOCK_BINDING: GLenum = 35391;
2266 pub const UNIFORM_BLOCK_DATA_SIZE: GLenum = 35392;
2267 pub const UNIFORM_BLOCK_INDEX: GLenum = 35386;
2268 pub const UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: GLenum = 35398;
2269 pub const UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: GLenum = 35396;
2270 pub const UNIFORM_BUFFER: GLenum = 35345;
2271 pub const UNIFORM_BUFFER_BINDING: GLenum = 35368;
2272 pub const UNIFORM_BUFFER_OFFSET_ALIGNMENT: GLenum = 35380;
2273 pub const UNIFORM_BUFFER_SIZE: GLenum = 35370;
2274 pub const UNIFORM_BUFFER_START: GLenum = 35369;
2275 pub const UNIFORM_IS_ROW_MAJOR: GLenum = 35390;
2276 pub const UNIFORM_MATRIX_STRIDE: GLenum = 35389;
2277 pub const UNIFORM_OFFSET: GLenum = 35387;
2278 pub const UNIFORM_SIZE: GLenum = 35384;
2279 pub const UNIFORM_TYPE: GLenum = 35383;
2280 pub const UNPACK_ALIGNMENT: GLenum = 3317;
2281 pub const UNPACK_COLORSPACE_CONVERSION_WEBGL: GLenum = 37443;
2282 pub const UNPACK_FLIP_Y_WEBGL: GLenum = 37440;
2283 pub const UNPACK_IMAGE_HEIGHT: GLenum = 32878;
2284 pub const UNPACK_PREMULTIPLY_ALPHA_WEBGL: GLenum = 37441;
2285 pub const UNPACK_ROW_LENGTH: GLenum = 3314;
2286 pub const UNPACK_SKIP_IMAGES: GLenum = 32877;
2287 pub const UNPACK_SKIP_PIXELS: GLenum = 3316;
2288 pub const UNPACK_SKIP_ROWS: GLenum = 3315;
2289 pub const UNSIGNALED: GLenum = 37144;
2290 pub const UNSIGNED_BYTE: GLenum = 5121;
2291 pub const UNSIGNED_INT: GLenum = 5125;
2292 pub const UNSIGNED_INT_10F_11F_11F_REV: GLenum = 35899;
2293 pub const UNSIGNED_INT_24_8: GLenum = 34042;
2294 pub const UNSIGNED_INT_2_10_10_10_REV: GLenum = 33640;
2295 pub const UNSIGNED_INT_5_9_9_9_REV: GLenum = 35902;
2296 pub const UNSIGNED_INT_SAMPLER_2D: GLenum = 36306;
2297 pub const UNSIGNED_INT_SAMPLER_2D_ARRAY: GLenum = 36311;
2298 pub const UNSIGNED_INT_SAMPLER_3D: GLenum = 36307;
2299 pub const UNSIGNED_INT_SAMPLER_CUBE: GLenum = 36308;
2300 pub const UNSIGNED_INT_VEC2: GLenum = 36294;
2301 pub const UNSIGNED_INT_VEC3: GLenum = 36295;
2302 pub const UNSIGNED_INT_VEC4: GLenum = 36296;
2303 pub const UNSIGNED_NORMALIZED: GLenum = 35863;
2304 pub const UNSIGNED_SHORT: GLenum = 5123;
2305 pub const UNSIGNED_SHORT_4_4_4_4: GLenum = 32819;
2306 pub const UNSIGNED_SHORT_5_5_5_1: GLenum = 32820;
2307 pub const UNSIGNED_SHORT_5_6_5: GLenum = 33635;
2308 pub const VALIDATE_STATUS: GLenum = 35715;
2309 pub const VENDOR: GLenum = 7936;
2310 pub const VERSION: GLenum = 7938;
2311 pub const VERTEX_ARRAY_BINDING: GLenum = 34229;
2312 pub const VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: GLenum = 34975;
2313 pub const VERTEX_ATTRIB_ARRAY_DIVISOR: GLenum = 35070;
2314 pub const VERTEX_ATTRIB_ARRAY_ENABLED: GLenum = 34338;
2315 pub const VERTEX_ATTRIB_ARRAY_INTEGER: GLenum = 35069;
2316 pub const VERTEX_ATTRIB_ARRAY_NORMALIZED: GLenum = 34922;
2317 pub const VERTEX_ATTRIB_ARRAY_POINTER: GLenum = 34373;
2318 pub const VERTEX_ATTRIB_ARRAY_SIZE: GLenum = 34339;
2319 pub const VERTEX_ATTRIB_ARRAY_STRIDE: GLenum = 34340;
2320 pub const VERTEX_ATTRIB_ARRAY_TYPE: GLenum = 34341;
2321 pub const VERTEX_SHADER: GLenum = 35633;
2322 pub const VIEWPORT: GLenum = 2978;
2323 pub const WAIT_FAILED: GLenum = 37149;
2324 pub const ZERO: GLenum = 0;
2325
2326 pub fn active_texture(&self, texture: GLenum) {
2327 js!( @(no_return) @{self}.activeTexture(@{texture}); );
2328 }
2329
2330 pub fn attach_shader(&self, program: &WebGLProgram, shader: &WebGLShader) {
2331 js!( @(no_return) @{self}.attachShader(@{program}, @{shader}); );
2332 }
2333
2334 pub fn begin_query(&self, target: GLenum, query: &WebGLQuery) {
2335 js!( @(no_return) @{self}.beginQuery(@{target}, @{query}); );
2336 }
2337
2338 pub fn begin_transform_feedback(&self, primitive_mode: GLenum) {
2339 js!( @(no_return) @{self}.beginTransformFeedback(@{primitive_mode}); );
2340 }
2341
2342 pub fn bind_attrib_location(&self, program: &WebGLProgram, index: GLuint, name: &str) {
2343 js!( @(no_return) @{self}.bindAttribLocation(@{program}, @{index}, @{name}); );
2344 }
2345
2346 pub fn bind_buffer(&self, target: GLenum, buffer: Option<&WebGLBuffer>) {
2347 js!( @(no_return) @{self}.bindBuffer(@{target}, @{buffer}); );
2348 }
2349
2350 pub fn bind_buffer_base(&self, target: GLenum, index: GLuint, buffer: Option<&WebGLBuffer>) {
2351 js!( @(no_return) @{self}.bindBufferBase(@{target}, @{index}, @{buffer}); );
2352 }
2353
2354 pub fn bind_buffer_range(&self, target: GLenum, index: GLuint, buffer: Option<&WebGLBuffer>, offset: GLintptr, size: GLsizeiptr) {
2355 js!( @(no_return) @{self}.bindBufferRange(@{target}, @{index}, @{buffer}, @{(offset as f64)}, @{(size as f64)}); );
2356 }
2357
2358 pub fn bind_framebuffer(&self, target: GLenum, framebuffer: Option<&WebGLFramebuffer>) {
2359 js!( @(no_return) @{self}.bindFramebuffer(@{target}, @{framebuffer}); );
2360 }
2361
2362 pub fn bind_renderbuffer(&self, target: GLenum, renderbuffer: Option<&WebGLRenderbuffer>) {
2363 js!( @(no_return) @{self}.bindRenderbuffer(@{target}, @{renderbuffer}); );
2364 }
2365
2366 pub fn bind_sampler(&self, unit: GLuint, sampler: Option<&WebGLSampler>) {
2367 js!( @(no_return) @{self}.bindSampler(@{unit}, @{sampler}); );
2368 }
2369
2370 pub fn bind_texture(&self, target: GLenum, texture: Option<&WebGLTexture>) {
2371 js!( @(no_return) @{self}.bindTexture(@{target}, @{texture}); );
2372 }
2373
2374 pub fn bind_transform_feedback(&self, target: GLenum, tf: Option<&WebGLTransformFeedback>) {
2375 js!( @(no_return) @{self}.bindTransformFeedback(@{target}, @{tf}); );
2376 }
2377
2378 pub fn bind_vertex_array(&self, array: Option<&WebGLVertexArrayObject>) {
2379 js!( @(no_return) @{self}.bindVertexArray(@{array}); );
2380 }
2381
2382 pub fn blend_color(&self, red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) {
2383 js!( @(no_return) @{self}.blendColor(@{red}, @{green}, @{blue}, @{alpha}); );
2384 }
2385
2386 pub fn blend_equation(&self, mode: GLenum) {
2387 js!( @(no_return) @{self}.blendEquation(@{mode}); );
2388 }
2389
2390 pub fn blend_equation_separate(&self, mode_rgb: GLenum, mode_alpha: GLenum) {
2391 js!( @(no_return) @{self}.blendEquationSeparate(@{mode_rgb}, @{mode_alpha}); );
2392 }
2393
2394 pub fn blend_func(&self, sfactor: GLenum, dfactor: GLenum) {
2395 js!( @(no_return) @{self}.blendFunc(@{sfactor}, @{dfactor}); );
2396 }
2397
2398 pub fn blend_func_separate(&self, src_rgb: GLenum, dst_rgb: GLenum, src_alpha: GLenum, dst_alpha: GLenum) {
2399 js!( @(no_return) @{self}.blendFuncSeparate(@{src_rgb}, @{dst_rgb}, @{src_alpha}, @{dst_alpha}); );
2400 }
2401
2402 pub fn blit_framebuffer(&self, src_x0: GLint, src_y0: GLint, src_x1: GLint, src_y1: GLint, dst_x0: GLint, dst_y0: GLint, dst_x1: GLint, dst_y1: GLint, mask: GLbitfield, filter: GLenum) {
2403 js!( @(no_return) @{self}.blitFramebuffer(@{src_x0}, @{src_y0}, @{src_x1}, @{src_y1}, @{dst_x0}, @{dst_y0}, @{dst_x1}, @{dst_y1}, @{mask}, @{filter}); );
2404 }
2405
2406 pub fn buffer_data(&self, target: GLenum, size: GLsizeiptr, usage: GLenum) {
2407 js!( @(no_return) @{self}.bufferData(@{target}, @{(size as f64)}, @{usage}); );
2408 }
2409
2410 pub fn buffer_data_1(&self, target: GLenum, src_data: Option<&ArrayBuffer>, usage: GLenum) {
2411 js!( @(no_return) @{self}.bufferData(@{target}, @{src_data}, @{usage}); );
2412 }
2413
2414 pub fn buffer_data_2<'a0, T0>(&self, target: GLenum, src_data: T0, usage: GLenum, src_offset: GLuint, length: GLuint) where T0: AsArrayBufferView<'a0> {
2415 js!( @(no_return) @{self}.bufferData(@{target}, @{unsafe { src_data.as_array_buffer_view() }}, @{usage}, @{src_offset}, @{length}); );
2416 }
2417
2418 pub fn buffer_sub_data(&self, target: GLenum, dst_byte_offset: GLintptr, src_data: &ArrayBuffer) {
2419 js!( @(no_return) @{self}.bufferSubData(@{target}, @{(dst_byte_offset as f64)}, @{src_data}); );
2420 }
2421
2422 pub fn buffer_sub_data_1<'a0, T0>(&self, target: GLenum, dst_byte_offset: GLintptr, src_data: T0, src_offset: GLuint, length: GLuint) where T0: AsArrayBufferView<'a0> {
2423 js!( @(no_return) @{self}.bufferSubData(@{target}, @{(dst_byte_offset as f64)}, @{unsafe { src_data.as_array_buffer_view() }}, @{src_offset}, @{length}); );
2424 }
2425
2426 pub fn canvas(&self) -> CanvasElement {
2427 (js! { return @{self}.canvas; } ).try_into().unwrap()
2428 }
2429
2430 pub fn check_framebuffer_status(&self, target: GLenum) -> GLenum {
2431 (js! { return @{self}.checkFramebufferStatus(@{target}); } ).try_into().unwrap()
2432 }
2433
2434 pub fn clear(&self, mask: GLbitfield) {
2435 js!( @(no_return) @{self}.clear(@{mask}); );
2436 }
2437
2438 pub fn clear_bufferfi(&self, buffer: GLenum, drawbuffer: GLint, depth: GLfloat, stencil: GLint) {
2439 js!( @(no_return) @{self}.clearBufferfi(@{buffer}, @{drawbuffer}, @{depth}, @{stencil}); );
2440 }
2441
2442 pub fn clear_bufferfv<'a0, T0>(&self, buffer: GLenum, drawbuffer: GLint, values: T0, src_offset: GLuint) where T0: AsTypedArray<'a0, f32> {
2443 js!( @(no_return) @{self}.clearBufferfv(@{buffer}, @{drawbuffer}, @{unsafe { values.as_typed_array() }}, @{src_offset}); );
2444 }
2445
2446 pub fn clear_bufferiv<'a0, T0>(&self, buffer: GLenum, drawbuffer: GLint, values: T0, src_offset: GLuint) where T0: AsTypedArray<'a0, i32> {
2447 js!( @(no_return) @{self}.clearBufferiv(@{buffer}, @{drawbuffer}, @{unsafe { values.as_typed_array() }}, @{src_offset}); );
2448 }
2449
2450 pub fn clear_bufferuiv<'a0, T0>(&self, buffer: GLenum, drawbuffer: GLint, values: T0, src_offset: GLuint) where T0: AsTypedArray<'a0, u32> {
2451 js!( @(no_return) @{self}.clearBufferuiv(@{buffer}, @{drawbuffer}, @{unsafe { values.as_typed_array() }}, @{src_offset}); );
2452 }
2453
2454 pub fn clear_color(&self, red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) {
2455 js!( @(no_return) @{self}.clearColor(@{red}, @{green}, @{blue}, @{alpha}); );
2456 }
2457
2458 pub fn clear_depth(&self, depth: GLclampf) {
2459 js!( @(no_return) @{self}.clearDepth(@{depth}); );
2460 }
2461
2462 pub fn clear_stencil(&self, s: GLint) {
2463 js!( @(no_return) @{self}.clearStencil(@{s}); );
2464 }
2465
2466 pub fn client_wait_sync(&self, sync: &WebGLSync, flags: GLbitfield, timeout: GLuint64) -> GLenum {
2467 (js! { return @{self}.clientWaitSync(@{sync}, @{flags}, @{(timeout as f64)}); } ).try_into().unwrap()
2468 }
2469
2470 pub fn color_mask(&self, red: GLboolean, green: GLboolean, blue: GLboolean, alpha: GLboolean) {
2471 js!( @(no_return) @{self}.colorMask(@{red}, @{green}, @{blue}, @{alpha}); );
2472 }
2473
2474 pub fn compile_shader(&self, shader: &WebGLShader) {
2475 js!( @(no_return) @{self}.compileShader(@{shader}); );
2476 }
2477
2478 pub fn compressed_tex_image2_d(&self, target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, image_size: GLsizei, offset: GLintptr) {
2479 js!( @(no_return) @{self}.compressedTexImage2D(@{target}, @{level}, @{internalformat}, @{width}, @{height}, @{border}, @{image_size}, @{(offset as f64)}); );
2480 }
2481
2482 pub fn compressed_tex_image2_d_1<'a0, T0>(&self, target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, src_data: T0, src_offset: GLuint, src_length_override: GLuint) where T0: AsArrayBufferView<'a0> {
2483 js!( @(no_return) @{self}.compressedTexImage2D(@{target}, @{level}, @{internalformat}, @{width}, @{height}, @{border}, @{unsafe { src_data.as_array_buffer_view() }}, @{src_offset}, @{src_length_override}); );
2484 }
2485
2486 pub fn compressed_tex_image2_d_2<'a0, T0>(&self, target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, data: T0) where T0: AsArrayBufferView<'a0> {
2487 js!( @(no_return) @{self}.compressedTexImage2D(@{target}, @{level}, @{internalformat}, @{width}, @{height}, @{border}, @{unsafe { data.as_array_buffer_view() }}); );
2488 }
2489
2490 pub fn compressed_tex_image3_d(&self, target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, image_size: GLsizei, offset: GLintptr) {
2491 js!( @(no_return) @{self}.compressedTexImage3D(@{target}, @{level}, @{internalformat}, @{width}, @{height}, @{depth}, @{border}, @{image_size}, @{(offset as f64)}); );
2492 }
2493
2494 pub fn compressed_tex_image3_d_1<'a0, T0>(&self, target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, src_data: T0, src_offset: GLuint, src_length_override: GLuint) where T0: AsArrayBufferView<'a0> {
2495 js!( @(no_return) @{self}.compressedTexImage3D(@{target}, @{level}, @{internalformat}, @{width}, @{height}, @{depth}, @{border}, @{unsafe { src_data.as_array_buffer_view() }}, @{src_offset}, @{src_length_override}); );
2496 }
2497
2498 pub fn compressed_tex_sub_image2_d(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, image_size: GLsizei, offset: GLintptr) {
2499 js!( @(no_return) @{self}.compressedTexSubImage2D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{width}, @{height}, @{format}, @{image_size}, @{(offset as f64)}); );
2500 }
2501
2502 pub fn compressed_tex_sub_image2_d_1<'a0, T0>(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, src_data: T0, src_offset: GLuint, src_length_override: GLuint) where T0: AsArrayBufferView<'a0> {
2503 js!( @(no_return) @{self}.compressedTexSubImage2D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{width}, @{height}, @{format}, @{unsafe { src_data.as_array_buffer_view() }}, @{src_offset}, @{src_length_override}); );
2504 }
2505
2506 pub fn compressed_tex_sub_image2_d_2<'a0, T0>(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, data: T0) where T0: AsArrayBufferView<'a0> {
2507 js!( @(no_return) @{self}.compressedTexSubImage2D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{width}, @{height}, @{format}, @{unsafe { data.as_array_buffer_view() }}); );
2508 }
2509
2510 pub fn compressed_tex_sub_image3_d(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, image_size: GLsizei, offset: GLintptr) {
2511 js!( @(no_return) @{self}.compressedTexSubImage3D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{zoffset}, @{width}, @{height}, @{depth}, @{format}, @{image_size}, @{(offset as f64)}); );
2512 }
2513
2514 pub fn compressed_tex_sub_image3_d_1<'a0, T0>(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, src_data: T0, src_offset: GLuint, src_length_override: GLuint) where T0: AsArrayBufferView<'a0> {
2515 js!( @(no_return) @{self}.compressedTexSubImage3D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{zoffset}, @{width}, @{height}, @{depth}, @{format}, @{unsafe { src_data.as_array_buffer_view() }}, @{src_offset}, @{src_length_override}); );
2516 }
2517
2518 pub fn copy_buffer_sub_data(&self, read_target: GLenum, write_target: GLenum, read_offset: GLintptr, write_offset: GLintptr, size: GLsizeiptr) {
2519 js!( @(no_return) @{self}.copyBufferSubData(@{read_target}, @{write_target}, @{(read_offset as f64)}, @{(write_offset as f64)}, @{(size as f64)}); );
2520 }
2521
2522 pub fn copy_tex_image2_d(&self, target: GLenum, level: GLint, internalformat: GLenum, x: GLint, y: GLint, width: GLsizei, height: GLsizei, border: GLint) {
2523 js!( @(no_return) @{self}.copyTexImage2D(@{target}, @{level}, @{internalformat}, @{x}, @{y}, @{width}, @{height}, @{border}); );
2524 }
2525
2526 pub fn copy_tex_sub_image2_d(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei) {
2527 js!( @(no_return) @{self}.copyTexSubImage2D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{x}, @{y}, @{width}, @{height}); );
2528 }
2529
2530 pub fn copy_tex_sub_image3_d(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei) {
2531 js!( @(no_return) @{self}.copyTexSubImage3D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{zoffset}, @{x}, @{y}, @{width}, @{height}); );
2532 }
2533
2534 pub fn create_buffer(&self, ) -> Option<WebGLBuffer> {
2535 (js! { return @{self}.createBuffer(); } ).try_into().ok()
2536 }
2537
2538 pub fn create_framebuffer(&self, ) -> Option<WebGLFramebuffer> {
2539 (js! { return @{self}.createFramebuffer(); } ).try_into().ok()
2540 }
2541
2542 pub fn create_program(&self, ) -> Option<WebGLProgram> {
2543 (js! { return @{self}.createProgram(); } ).try_into().ok()
2544 }
2545
2546 pub fn create_query(&self, ) -> Option<WebGLQuery> {
2547 (js! { return @{self}.createQuery(); } ).try_into().ok()
2548 }
2549
2550 pub fn create_renderbuffer(&self, ) -> Option<WebGLRenderbuffer> {
2551 (js! { return @{self}.createRenderbuffer(); } ).try_into().ok()
2552 }
2553
2554 pub fn create_sampler(&self, ) -> Option<WebGLSampler> {
2555 (js! { return @{self}.createSampler(); } ).try_into().ok()
2556 }
2557
2558 pub fn create_shader(&self, type_: GLenum) -> Option<WebGLShader> {
2559 (js! { return @{self}.createShader(@{type_}); } ).try_into().ok()
2560 }
2561
2562 pub fn create_texture(&self, ) -> Option<WebGLTexture> {
2563 (js! { return @{self}.createTexture(); } ).try_into().ok()
2564 }
2565
2566 pub fn create_transform_feedback(&self, ) -> Option<WebGLTransformFeedback> {
2567 (js! { return @{self}.createTransformFeedback(); } ).try_into().ok()
2568 }
2569
2570 pub fn create_vertex_array(&self, ) -> Option<WebGLVertexArrayObject> {
2571 (js! { return @{self}.createVertexArray(); } ).try_into().ok()
2572 }
2573
2574 pub fn cull_face(&self, mode: GLenum) {
2575 js!( @(no_return) @{self}.cullFace(@{mode}); );
2576 }
2577
2578 pub fn delete_buffer(&self, buffer: Option<&WebGLBuffer>) {
2579 js!( @(no_return) @{self}.deleteBuffer(@{buffer}); );
2580 }
2581
2582 pub fn delete_framebuffer(&self, framebuffer: Option<&WebGLFramebuffer>) {
2583 js!( @(no_return) @{self}.deleteFramebuffer(@{framebuffer}); );
2584 }
2585
2586 pub fn delete_program(&self, program: Option<&WebGLProgram>) {
2587 js!( @(no_return) @{self}.deleteProgram(@{program}); );
2588 }
2589
2590 pub fn delete_query(&self, query: Option<&WebGLQuery>) {
2591 js!( @(no_return) @{self}.deleteQuery(@{query}); );
2592 }
2593
2594 pub fn delete_renderbuffer(&self, renderbuffer: Option<&WebGLRenderbuffer>) {
2595 js!( @(no_return) @{self}.deleteRenderbuffer(@{renderbuffer}); );
2596 }
2597
2598 pub fn delete_sampler(&self, sampler: Option<&WebGLSampler>) {
2599 js!( @(no_return) @{self}.deleteSampler(@{sampler}); );
2600 }
2601
2602 pub fn delete_shader(&self, shader: Option<&WebGLShader>) {
2603 js!( @(no_return) @{self}.deleteShader(@{shader}); );
2604 }
2605
2606 pub fn delete_sync(&self, sync: Option<&WebGLSync>) {
2607 js!( @(no_return) @{self}.deleteSync(@{sync}); );
2608 }
2609
2610 pub fn delete_texture(&self, texture: Option<&WebGLTexture>) {
2611 js!( @(no_return) @{self}.deleteTexture(@{texture}); );
2612 }
2613
2614 pub fn delete_transform_feedback(&self, tf: Option<&WebGLTransformFeedback>) {
2615 js!( @(no_return) @{self}.deleteTransformFeedback(@{tf}); );
2616 }
2617
2618 pub fn delete_vertex_array(&self, vertex_array: Option<&WebGLVertexArrayObject>) {
2619 js!( @(no_return) @{self}.deleteVertexArray(@{vertex_array}); );
2620 }
2621
2622 pub fn depth_func(&self, func: GLenum) {
2623 js!( @(no_return) @{self}.depthFunc(@{func}); );
2624 }
2625
2626 pub fn depth_mask(&self, flag: GLboolean) {
2627 js!( @(no_return) @{self}.depthMask(@{flag}); );
2628 }
2629
2630 pub fn depth_range(&self, z_near: GLclampf, z_far: GLclampf) {
2631 js!( @(no_return) @{self}.depthRange(@{z_near}, @{z_far}); );
2632 }
2633
2634 pub fn detach_shader(&self, program: &WebGLProgram, shader: &WebGLShader) {
2635 js!( @(no_return) @{self}.detachShader(@{program}, @{shader}); );
2636 }
2637
2638 pub fn disable(&self, cap: GLenum) {
2639 js!( @(no_return) @{self}.disable(@{cap}); );
2640 }
2641
2642 pub fn disable_vertex_attrib_array(&self, index: GLuint) {
2643 js!( @(no_return) @{self}.disableVertexAttribArray(@{index}); );
2644 }
2645
2646 pub fn draw_arrays(&self, mode: GLenum, first: GLint, count: GLsizei) {
2647 js!( @(no_return) @{self}.drawArrays(@{mode}, @{first}, @{count}); );
2648 }
2649
2650 pub fn draw_arrays_instanced(&self, mode: GLenum, first: GLint, count: GLsizei, instance_count: GLsizei) {
2651 js!( @(no_return) @{self}.drawArraysInstanced(@{mode}, @{first}, @{count}, @{instance_count}); );
2652 }
2653
2654 pub fn draw_buffers(&self, buffers: &[GLenum]) {
2655 js!( @(no_return) @{self}.drawBuffers(@{buffers}); );
2656 }
2657
2658 pub fn draw_elements(&self, mode: GLenum, count: GLsizei, type_: GLenum, offset: GLintptr) {
2659 js!( @(no_return) @{self}.drawElements(@{mode}, @{count}, @{type_}, @{(offset as f64)}); );
2660 }
2661
2662 pub fn draw_elements_instanced(&self, mode: GLenum, count: GLsizei, type_: GLenum, offset: GLintptr, instance_count: GLsizei) {
2663 js!( @(no_return) @{self}.drawElementsInstanced(@{mode}, @{count}, @{type_}, @{(offset as f64)}, @{instance_count}); );
2664 }
2665
2666 pub fn draw_range_elements(&self, mode: GLenum, start: GLuint, end: GLuint, count: GLsizei, type_: GLenum, offset: GLintptr) {
2667 js!( @(no_return) @{self}.drawRangeElements(@{mode}, @{start}, @{end}, @{count}, @{type_}, @{(offset as f64)}); );
2668 }
2669
2670 pub fn drawing_buffer_height(&self) -> GLsizei {
2671 (js! { return @{self}.drawingBufferHeight; } ).try_into().unwrap()
2672 }
2673
2674 pub fn drawing_buffer_width(&self) -> GLsizei {
2675 (js! { return @{self}.drawingBufferWidth; } ).try_into().unwrap()
2676 }
2677
2678 pub fn enable(&self, cap: GLenum) {
2679 js!( @(no_return) @{self}.enable(@{cap}); );
2680 }
2681
2682 pub fn enable_vertex_attrib_array(&self, index: GLuint) {
2683 js!( @(no_return) @{self}.enableVertexAttribArray(@{index}); );
2684 }
2685
2686 pub fn end_query(&self, target: GLenum) {
2687 js!( @(no_return) @{self}.endQuery(@{target}); );
2688 }
2689
2690 pub fn end_transform_feedback(&self, ) {
2691 js!( @(no_return) @{self}.endTransformFeedback(); );
2692 }
2693
2694 pub fn fence_sync(&self, condition: GLenum, flags: GLbitfield) -> Option<WebGLSync> {
2695 (js! { return @{self}.fenceSync(@{condition}, @{flags}); } ).try_into().ok()
2696 }
2697
2698 pub fn finish(&self, ) {
2699 js!( @(no_return) @{self}.finish(); );
2700 }
2701
2702 pub fn flush(&self, ) {
2703 js!( @(no_return) @{self}.flush(); );
2704 }
2705
2706 pub fn framebuffer_renderbuffer(&self, target: GLenum, attachment: GLenum, renderbuffertarget: GLenum, renderbuffer: Option<&WebGLRenderbuffer>) {
2707 js!( @(no_return) @{self}.framebufferRenderbuffer(@{target}, @{attachment}, @{renderbuffertarget}, @{renderbuffer}); );
2708 }
2709
2710 pub fn framebuffer_texture2_d(&self, target: GLenum, attachment: GLenum, textarget: GLenum, texture: Option<&WebGLTexture>, level: GLint) {
2711 js!( @(no_return) @{self}.framebufferTexture2D(@{target}, @{attachment}, @{textarget}, @{texture}, @{level}); );
2712 }
2713
2714 pub fn framebuffer_texture_layer(&self, target: GLenum, attachment: GLenum, texture: Option<&WebGLTexture>, level: GLint, layer: GLint) {
2715 js!( @(no_return) @{self}.framebufferTextureLayer(@{target}, @{attachment}, @{texture}, @{level}, @{layer}); );
2716 }
2717
2718 pub fn front_face(&self, mode: GLenum) {
2719 js!( @(no_return) @{self}.frontFace(@{mode}); );
2720 }
2721
2722 pub fn generate_mipmap(&self, target: GLenum) {
2723 js!( @(no_return) @{self}.generateMipmap(@{target}); );
2724 }
2725
2726 pub fn get_active_attrib(&self, program: &WebGLProgram, index: GLuint) -> Option<WebGLActiveInfo> {
2727 (js! { return @{self}.getActiveAttrib(@{program}, @{index}); } ).try_into().ok()
2728 }
2729
2730 pub fn get_active_uniform(&self, program: &WebGLProgram, index: GLuint) -> Option<WebGLActiveInfo> {
2731 (js! { return @{self}.getActiveUniform(@{program}, @{index}); } ).try_into().ok()
2732 }
2733
2734 pub fn get_active_uniform_block_name(&self, program: &WebGLProgram, uniform_block_index: GLuint) -> Option<String> {
2735 (js! { return @{self}.getActiveUniformBlockName(@{program}, @{uniform_block_index}); } ).try_into().ok()
2736 }
2737
2738 pub fn get_active_uniform_block_parameter(&self, program: &WebGLProgram, uniform_block_index: GLuint, pname: GLenum) -> Value {
2739 (js! { return @{self}.getActiveUniformBlockParameter(@{program}, @{uniform_block_index}, @{pname}); } ).try_into().unwrap()
2740 }
2741
2742 pub fn get_active_uniforms(&self, program: &WebGLProgram, uniform_indices: &[GLuint], pname: GLenum) -> Value {
2743 (js! { return @{self}.getActiveUniforms(@{program}, @{uniform_indices}, @{pname}); } ).try_into().unwrap()
2744 }
2745
2746 pub fn get_attached_shaders(&self, program: &WebGLProgram) -> Option<Vec<WebGLShader>> {
2747 (js! { return @{self}.getAttachedShaders(@{program}); } ).try_into().ok()
2748 }
2749
2750 pub fn get_attrib_location(&self, program: &WebGLProgram, name: &str) -> GLint {
2751 (js! { return @{self}.getAttribLocation(@{program}, @{name}); } ).try_into().unwrap()
2752 }
2753
2754 pub fn get_buffer_parameter(&self, target: GLenum, pname: GLenum) -> Value {
2755 (js! { return @{self}.getBufferParameter(@{target}, @{pname}); } ).try_into().unwrap()
2756 }
2757
2758 pub fn get_buffer_sub_data<'a0, T0>(&self, target: GLenum, src_byte_offset: GLintptr, dst_buffer: T0, dst_offset: GLuint, length: GLuint) where T0: AsArrayBufferView<'a0> {
2759 js!( @(no_return) @{self}.getBufferSubData(@{target}, @{(src_byte_offset as f64)}, @{unsafe { dst_buffer.as_array_buffer_view() }}, @{dst_offset}, @{length}); );
2760 }
2761
2762 pub fn get_context_attributes(&self, ) -> Option<WebGLContextAttributes> {
2763 (js! { return @{self}.getContextAttributes(); } ).try_into().ok()
2764 }
2765
2766 pub fn get_error(&self, ) -> GLenum {
2767 (js! { return @{self}.getError(); } ).try_into().unwrap()
2768 }
2769
2770 pub fn get_extension<E: Extension>(&self) -> Option<E> {
2771 (js! { return @{self}.getExtension(@{E::NAME}); } ).try_into().ok()
2772 }
2773
2774 pub fn get_frag_data_location(&self, program: &WebGLProgram, name: &str) -> GLint {
2775 (js! { return @{self}.getFragDataLocation(@{program}, @{name}); } ).try_into().unwrap()
2776 }
2777
2778 pub fn get_framebuffer_attachment_parameter(&self, target: GLenum, attachment: GLenum, pname: GLenum) -> Value {
2779 (js! { return @{self}.getFramebufferAttachmentParameter(@{target}, @{attachment}, @{pname}); } ).try_into().unwrap()
2780 }
2781
2782 pub fn get_indexed_parameter(&self, target: GLenum, index: GLuint) -> Value {
2783 (js! { return @{self}.getIndexedParameter(@{target}, @{index}); } ).try_into().unwrap()
2784 }
2785
2786 pub fn get_internalformat_parameter(&self, target: GLenum, internalformat: GLenum, pname: GLenum) -> Value {
2787 (js! { return @{self}.getInternalformatParameter(@{target}, @{internalformat}, @{pname}); } ).try_into().unwrap()
2788 }
2789
2790 pub fn get_parameter(&self, pname: GLenum) -> Value {
2791 (js! { return @{self}.getParameter(@{pname}); } ).try_into().unwrap()
2792 }
2793
2794 pub fn get_program_info_log(&self, program: &WebGLProgram) -> Option<String> {
2795 (js! { return @{self}.getProgramInfoLog(@{program}); } ).try_into().ok()
2796 }
2797
2798 pub fn get_program_parameter(&self, program: &WebGLProgram, pname: GLenum) -> Value {
2799 (js! { return @{self}.getProgramParameter(@{program}, @{pname}); } ).try_into().unwrap()
2800 }
2801
2802 pub fn get_query(&self, target: GLenum, pname: GLenum) -> Option<WebGLQuery> {
2803 (js! { return @{self}.getQuery(@{target}, @{pname}); } ).try_into().ok()
2804 }
2805
2806 pub fn get_query_parameter(&self, query: &WebGLQuery, pname: GLenum) -> Value {
2807 (js! { return @{self}.getQueryParameter(@{query}, @{pname}); } ).try_into().unwrap()
2808 }
2809
2810 pub fn get_renderbuffer_parameter(&self, target: GLenum, pname: GLenum) -> Value {
2811 (js! { return @{self}.getRenderbufferParameter(@{target}, @{pname}); } ).try_into().unwrap()
2812 }
2813
2814 pub fn get_sampler_parameter(&self, sampler: &WebGLSampler, pname: GLenum) -> Value {
2815 (js! { return @{self}.getSamplerParameter(@{sampler}, @{pname}); } ).try_into().unwrap()
2816 }
2817
2818 pub fn get_shader_info_log(&self, shader: &WebGLShader) -> Option<String> {
2819 (js! { return @{self}.getShaderInfoLog(@{shader}); } ).try_into().ok()
2820 }
2821
2822 pub fn get_shader_parameter(&self, shader: &WebGLShader, pname: GLenum) -> Value {
2823 (js! { return @{self}.getShaderParameter(@{shader}, @{pname}); } ).try_into().unwrap()
2824 }
2825
2826 pub fn get_shader_precision_format(&self, shadertype: GLenum, precisiontype: GLenum) -> Option<WebGLShaderPrecisionFormat> {
2827 (js! { return @{self}.getShaderPrecisionFormat(@{shadertype}, @{precisiontype}); } ).try_into().ok()
2828 }
2829
2830 pub fn get_shader_source(&self, shader: &WebGLShader) -> Option<String> {
2831 (js! { return @{self}.getShaderSource(@{shader}); } ).try_into().ok()
2832 }
2833
2834 pub fn get_supported_extensions(&self, ) -> Option<Vec<String>> {
2835 (js! { return @{self}.getSupportedExtensions(); } ).try_into().ok()
2836 }
2837
2838 pub fn get_sync_parameter(&self, sync: &WebGLSync, pname: GLenum) -> Value {
2839 (js! { return @{self}.getSyncParameter(@{sync}, @{pname}); } ).try_into().unwrap()
2840 }
2841
2842 pub fn get_tex_parameter(&self, target: GLenum, pname: GLenum) -> Value {
2843 (js! { return @{self}.getTexParameter(@{target}, @{pname}); } ).try_into().unwrap()
2844 }
2845
2846 pub fn get_transform_feedback_varying(&self, program: &WebGLProgram, index: GLuint) -> Option<WebGLActiveInfo> {
2847 (js! { return @{self}.getTransformFeedbackVarying(@{program}, @{index}); } ).try_into().ok()
2848 }
2849
2850 pub fn get_uniform(&self, program: &WebGLProgram, location: &WebGLUniformLocation) -> Value {
2851 (js! { return @{self}.getUniform(@{program}, @{location}); } ).try_into().unwrap()
2852 }
2853
2854 pub fn get_uniform_block_index(&self, program: &WebGLProgram, uniform_block_name: &str) -> GLuint {
2855 (js! { return @{self}.getUniformBlockIndex(@{program}, @{uniform_block_name}); } ).try_into().unwrap()
2856 }
2857
2858 pub fn get_uniform_indices(&self, program: &WebGLProgram, uniform_names: &[&str]) -> Option<Vec<GLuint>> {
2859 (js! { return @{self}.getUniformIndices(@{program}, @{uniform_names}); } ).try_into().ok()
2860 }
2861
2862 pub fn get_uniform_location(&self, program: &WebGLProgram, name: &str) -> Option<WebGLUniformLocation> {
2863 (js! { return @{self}.getUniformLocation(@{program}, @{name}); } ).try_into().ok()
2864 }
2865
2866 pub fn get_vertex_attrib(&self, index: GLuint, pname: GLenum) -> Value {
2867 (js! { return @{self}.getVertexAttrib(@{index}, @{pname}); } ).try_into().unwrap()
2868 }
2869
2870 pub fn get_vertex_attrib_offset(&self, index: GLuint, pname: GLenum) -> GLintptr {
2871 (js! { return @{self}.getVertexAttribOffset(@{index}, @{pname}); } ).try_into().unwrap()
2872 }
2873
2874 pub fn hint(&self, target: GLenum, mode: GLenum) {
2875 js!( @(no_return) @{self}.hint(@{target}, @{mode}); );
2876 }
2877
2878 pub fn invalidate_framebuffer(&self, target: GLenum, attachments: &[GLenum]) {
2879 js!( @(no_return) @{self}.invalidateFramebuffer(@{target}, @{attachments}); );
2880 }
2881
2882 pub fn invalidate_sub_framebuffer(&self, target: GLenum, attachments: &[GLenum], x: GLint, y: GLint, width: GLsizei, height: GLsizei) {
2883 js!( @(no_return) @{self}.invalidateSubFramebuffer(@{target}, @{attachments}, @{x}, @{y}, @{width}, @{height}); );
2884 }
2885
2886 pub fn is_buffer(&self, buffer: Option<&WebGLBuffer>) -> GLboolean {
2887 (js! { return @{self}.isBuffer(@{buffer}); } ).try_into().unwrap()
2888 }
2889
2890 pub fn is_context_lost(&self, ) -> bool {
2891 (js! { return @{self}.isContextLost(); } ).try_into().unwrap()
2892 }
2893
2894 pub fn is_enabled(&self, cap: GLenum) -> GLboolean {
2895 (js! { return @{self}.isEnabled(@{cap}); } ).try_into().unwrap()
2896 }
2897
2898 pub fn is_framebuffer(&self, framebuffer: Option<&WebGLFramebuffer>) -> GLboolean {
2899 (js! { return @{self}.isFramebuffer(@{framebuffer}); } ).try_into().unwrap()
2900 }
2901
2902 pub fn is_program(&self, program: Option<&WebGLProgram>) -> GLboolean {
2903 (js! { return @{self}.isProgram(@{program}); } ).try_into().unwrap()
2904 }
2905
2906 pub fn is_query(&self, query: Option<&WebGLQuery>) -> GLboolean {
2907 (js! { return @{self}.isQuery(@{query}); } ).try_into().unwrap()
2908 }
2909
2910 pub fn is_renderbuffer(&self, renderbuffer: Option<&WebGLRenderbuffer>) -> GLboolean {
2911 (js! { return @{self}.isRenderbuffer(@{renderbuffer}); } ).try_into().unwrap()
2912 }
2913
2914 pub fn is_sampler(&self, sampler: Option<&WebGLSampler>) -> GLboolean {
2915 (js! { return @{self}.isSampler(@{sampler}); } ).try_into().unwrap()
2916 }
2917
2918 pub fn is_shader(&self, shader: Option<&WebGLShader>) -> GLboolean {
2919 (js! { return @{self}.isShader(@{shader}); } ).try_into().unwrap()
2920 }
2921
2922 pub fn is_sync(&self, sync: Option<&WebGLSync>) -> GLboolean {
2923 (js! { return @{self}.isSync(@{sync}); } ).try_into().unwrap()
2924 }
2925
2926 pub fn is_texture(&self, texture: Option<&WebGLTexture>) -> GLboolean {
2927 (js! { return @{self}.isTexture(@{texture}); } ).try_into().unwrap()
2928 }
2929
2930 pub fn is_transform_feedback(&self, tf: Option<&WebGLTransformFeedback>) -> GLboolean {
2931 (js! { return @{self}.isTransformFeedback(@{tf}); } ).try_into().unwrap()
2932 }
2933
2934 pub fn is_vertex_array(&self, vertex_array: Option<&WebGLVertexArrayObject>) -> GLboolean {
2935 (js! { return @{self}.isVertexArray(@{vertex_array}); } ).try_into().unwrap()
2936 }
2937
2938 pub fn line_width(&self, width: GLfloat) {
2939 js!( @(no_return) @{self}.lineWidth(@{width}); );
2940 }
2941
2942 pub fn link_program(&self, program: &WebGLProgram) {
2943 js!( @(no_return) @{self}.linkProgram(@{program}); );
2944 }
2945
2946 pub fn pause_transform_feedback(&self, ) {
2947 js!( @(no_return) @{self}.pauseTransformFeedback(); );
2948 }
2949
2950 pub fn pixel_storei(&self, pname: GLenum, param: GLint) {
2951 js!( @(no_return) @{self}.pixelStorei(@{pname}, @{param}); );
2952 }
2953
2954 pub fn polygon_offset(&self, factor: GLfloat, units: GLfloat) {
2955 js!( @(no_return) @{self}.polygonOffset(@{factor}, @{units}); );
2956 }
2957
2958 pub fn read_buffer(&self, src: GLenum) {
2959 js!( @(no_return) @{self}.readBuffer(@{src}); );
2960 }
2961
2962 pub fn read_pixels<'a0, T0>(&self, x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type_: GLenum, dst_data: Option<T0>) where T0: AsArrayBufferView<'a0> {
2963 js!( @(no_return) @{self}.readPixels(@{x}, @{y}, @{width}, @{height}, @{format}, @{type_}, @{dst_data.map(|inner| unsafe { inner.as_array_buffer_view() })}); );
2964 }
2965
2966 pub fn read_pixels_1(&self, x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type_: GLenum, offset: GLintptr) {
2967 js!( @(no_return) @{self}.readPixels(@{x}, @{y}, @{width}, @{height}, @{format}, @{type_}, @{(offset as f64)}); );
2968 }
2969
2970 pub fn read_pixels_2<'a0, T0>(&self, x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type_: GLenum, dst_data: T0, dst_offset: GLuint) where T0: AsArrayBufferView<'a0> {
2971 js!( @(no_return) @{self}.readPixels(@{x}, @{y}, @{width}, @{height}, @{format}, @{type_}, @{unsafe { dst_data.as_array_buffer_view() }}, @{dst_offset}); );
2972 }
2973
2974 pub fn renderbuffer_storage(&self, target: GLenum, internalformat: GLenum, width: GLsizei, height: GLsizei) {
2975 js!( @(no_return) @{self}.renderbufferStorage(@{target}, @{internalformat}, @{width}, @{height}); );
2976 }
2977
2978 pub fn renderbuffer_storage_multisample(&self, target: GLenum, samples: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei) {
2979 js!( @(no_return) @{self}.renderbufferStorageMultisample(@{target}, @{samples}, @{internalformat}, @{width}, @{height}); );
2980 }
2981
2982 pub fn resume_transform_feedback(&self, ) {
2983 js!( @(no_return) @{self}.resumeTransformFeedback(); );
2984 }
2985
2986 pub fn sample_coverage(&self, value: GLclampf, invert: GLboolean) {
2987 js!( @(no_return) @{self}.sampleCoverage(@{value}, @{invert}); );
2988 }
2989
2990 pub fn sampler_parameterf(&self, sampler: &WebGLSampler, pname: GLenum, param: GLfloat) {
2991 js!( @(no_return) @{self}.samplerParameterf(@{sampler}, @{pname}, @{param}); );
2992 }
2993
2994 pub fn sampler_parameteri(&self, sampler: &WebGLSampler, pname: GLenum, param: GLint) {
2995 js!( @(no_return) @{self}.samplerParameteri(@{sampler}, @{pname}, @{param}); );
2996 }
2997
2998 pub fn scissor(&self, x: GLint, y: GLint, width: GLsizei, height: GLsizei) {
2999 js!( @(no_return) @{self}.scissor(@{x}, @{y}, @{width}, @{height}); );
3000 }
3001
3002 pub fn shader_source(&self, shader: &WebGLShader, source: &str) {
3003 js!( @(no_return) @{self}.shaderSource(@{shader}, @{source}); );
3004 }
3005
3006 pub fn stencil_func(&self, func: GLenum, ref_: GLint, mask: GLuint) {
3007 js!( @(no_return) @{self}.stencilFunc(@{func}, @{ref_}, @{mask}); );
3008 }
3009
3010 pub fn stencil_func_separate(&self, face: GLenum, func: GLenum, ref_: GLint, mask: GLuint) {
3011 js!( @(no_return) @{self}.stencilFuncSeparate(@{face}, @{func}, @{ref_}, @{mask}); );
3012 }
3013
3014 pub fn stencil_mask(&self, mask: GLuint) {
3015 js!( @(no_return) @{self}.stencilMask(@{mask}); );
3016 }
3017
3018 pub fn stencil_mask_separate(&self, face: GLenum, mask: GLuint) {
3019 js!( @(no_return) @{self}.stencilMaskSeparate(@{face}, @{mask}); );
3020 }
3021
3022 pub fn stencil_op(&self, fail: GLenum, zfail: GLenum, zpass: GLenum) {
3023 js!( @(no_return) @{self}.stencilOp(@{fail}, @{zfail}, @{zpass}); );
3024 }
3025
3026 pub fn stencil_op_separate(&self, face: GLenum, fail: GLenum, zfail: GLenum, zpass: GLenum) {
3027 js!( @(no_return) @{self}.stencilOpSeparate(@{face}, @{fail}, @{zfail}, @{zpass}); );
3028 }
3029
3030 pub fn tex_image2_d<'a0, T0>(&self, target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type_: GLenum, pixels: Option<T0>) where T0: AsArrayBufferView<'a0> {
3031 js!( @(no_return) @{self}.texImage2D(@{target}, @{level}, @{internalformat}, @{width}, @{height}, @{border}, @{format}, @{type_}, @{pixels.map(|inner| unsafe { inner.as_array_buffer_view() })}); );
3032 }
3033
3034 pub fn tex_image2_d_1<T0>(&self, target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type_: GLenum, source: T0) where T0: JsSerialize {
3035 js!( @(no_return) @{self}.texImage2D(@{target}, @{level}, @{internalformat}, @{format}, @{type_}, @{source}); );
3036 }
3037
3038 pub fn tex_image2_d_2(&self, target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type_: GLenum, pbo_offset: GLintptr) {
3039 js!( @(no_return) @{self}.texImage2D(@{target}, @{level}, @{internalformat}, @{width}, @{height}, @{border}, @{format}, @{type_}, @{(pbo_offset as f64)}); );
3040 }
3041
3042 pub fn tex_image2_d_3<T0>(&self, target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type_: GLenum, source: T0) where T0: JsSerialize {
3043 js!( @(no_return) @{self}.texImage2D(@{target}, @{level}, @{internalformat}, @{width}, @{height}, @{border}, @{format}, @{type_}, @{source}); );
3044 }
3045
3046 pub fn tex_image2_d_4<'a0, T0>(&self, target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type_: GLenum, src_data: T0, src_offset: GLuint) where T0: AsArrayBufferView<'a0> {
3047 js!( @(no_return) @{self}.texImage2D(@{target}, @{level}, @{internalformat}, @{width}, @{height}, @{border}, @{format}, @{type_}, @{unsafe { src_data.as_array_buffer_view() }}, @{src_offset}); );
3048 }
3049
3050 pub fn tex_image3_d(&self, target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type_: GLenum, pbo_offset: GLintptr) {
3051 js!( @(no_return) @{self}.texImage3D(@{target}, @{level}, @{internalformat}, @{width}, @{height}, @{depth}, @{border}, @{format}, @{type_}, @{(pbo_offset as f64)}); );
3052 }
3053
3054 pub fn tex_image3_d_1<T0>(&self, target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type_: GLenum, source: T0) where T0: JsSerialize {
3055 js!( @(no_return) @{self}.texImage3D(@{target}, @{level}, @{internalformat}, @{width}, @{height}, @{depth}, @{border}, @{format}, @{type_}, @{source}); );
3056 }
3057
3058 pub fn tex_image3_d_2<'a0, T0>(&self, target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type_: GLenum, src_data: Option<T0>) where T0: AsArrayBufferView<'a0> {
3059 js!( @(no_return) @{self}.texImage3D(@{target}, @{level}, @{internalformat}, @{width}, @{height}, @{depth}, @{border}, @{format}, @{type_}, @{src_data.map(|inner| unsafe { inner.as_array_buffer_view() })}); );
3060 }
3061
3062 pub fn tex_image3_d_3<'a0, T0>(&self, target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type_: GLenum, src_data: T0, src_offset: GLuint) where T0: AsArrayBufferView<'a0> {
3063 js!( @(no_return) @{self}.texImage3D(@{target}, @{level}, @{internalformat}, @{width}, @{height}, @{depth}, @{border}, @{format}, @{type_}, @{unsafe { src_data.as_array_buffer_view() }}, @{src_offset}); );
3064 }
3065
3066 pub fn tex_parameterf(&self, target: GLenum, pname: GLenum, param: GLfloat) {
3067 js!( @(no_return) @{self}.texParameterf(@{target}, @{pname}, @{param}); );
3068 }
3069
3070 pub fn tex_parameteri(&self, target: GLenum, pname: GLenum, param: GLint) {
3071 js!( @(no_return) @{self}.texParameteri(@{target}, @{pname}, @{param}); );
3072 }
3073
3074 pub fn tex_storage2_d(&self, target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei) {
3075 js!( @(no_return) @{self}.texStorage2D(@{target}, @{levels}, @{internalformat}, @{width}, @{height}); );
3076 }
3077
3078 pub fn tex_storage3_d(&self, target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei) {
3079 js!( @(no_return) @{self}.texStorage3D(@{target}, @{levels}, @{internalformat}, @{width}, @{height}, @{depth}); );
3080 }
3081
3082 pub fn tex_sub_image2_d<'a0, T0>(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type_: GLenum, pixels: Option<T0>) where T0: AsArrayBufferView<'a0> {
3083 js!( @(no_return) @{self}.texSubImage2D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{width}, @{height}, @{format}, @{type_}, @{pixels.map(|inner| unsafe { inner.as_array_buffer_view() })}); );
3084 }
3085
3086 pub fn tex_sub_image2_d_1<T0>(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type_: GLenum, source: T0) where T0: JsSerialize {
3087 js!( @(no_return) @{self}.texSubImage2D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{format}, @{type_}, @{source}); );
3088 }
3089
3090 pub fn tex_sub_image2_d_2(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type_: GLenum, pbo_offset: GLintptr) {
3091 js!( @(no_return) @{self}.texSubImage2D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{width}, @{height}, @{format}, @{type_}, @{(pbo_offset as f64)}); );
3092 }
3093
3094 pub fn tex_sub_image2_d_3<T0>(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type_: GLenum, source: T0) where T0: JsSerialize {
3095 js!( @(no_return) @{self}.texSubImage2D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{width}, @{height}, @{format}, @{type_}, @{source}); );
3096 }
3097
3098 pub fn tex_sub_image2_d_4<'a0, T0>(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type_: GLenum, src_data: T0, src_offset: GLuint) where T0: AsArrayBufferView<'a0> {
3099 js!( @(no_return) @{self}.texSubImage2D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{width}, @{height}, @{format}, @{type_}, @{unsafe { src_data.as_array_buffer_view() }}, @{src_offset}); );
3100 }
3101
3102 pub fn tex_sub_image3_d(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type_: GLenum, pbo_offset: GLintptr) {
3103 js!( @(no_return) @{self}.texSubImage3D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{zoffset}, @{width}, @{height}, @{depth}, @{format}, @{type_}, @{(pbo_offset as f64)}); );
3104 }
3105
3106 pub fn tex_sub_image3_d_1<T0>(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type_: GLenum, source: T0) where T0: JsSerialize {
3107 js!( @(no_return) @{self}.texSubImage3D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{zoffset}, @{width}, @{height}, @{depth}, @{format}, @{type_}, @{source}); );
3108 }
3109
3110 pub fn tex_sub_image3_d_2<'a0, T0>(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type_: GLenum, src_data: Option<T0>, src_offset: GLuint) where T0: AsArrayBufferView<'a0> {
3111 js!( @(no_return) @{self}.texSubImage3D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{zoffset}, @{width}, @{height}, @{depth}, @{format}, @{type_}, @{src_data.map(|inner| unsafe { inner.as_array_buffer_view() })}, @{src_offset}); );
3112 }
3113
3114 pub fn transform_feedback_varyings(&self, program: &WebGLProgram, varyings: &[&str], buffer_mode: GLenum) {
3115 js!( @(no_return) @{self}.transformFeedbackVaryings(@{program}, @{varyings}, @{buffer_mode}); );
3116 }
3117
3118 pub fn uniform1f(&self, location: Option<&WebGLUniformLocation>, x: GLfloat) {
3119 js!( @(no_return) @{self}.uniform1f(@{location}, @{x}); );
3120 }
3121
3122 pub fn uniform1fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, f32> {
3123 js!( @(no_return) @{self}.uniform1fv(@{location}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
3124 }
3125
3126 pub fn uniform1fv_1<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, v: T0) where T0: AsTypedArray<'a0, f32> {
3127 js!( @(no_return) @{self}.uniform1fv(@{location}, @{unsafe { v.as_typed_array() }}); );
3128 }
3129
3130 pub fn uniform1i(&self, location: Option<&WebGLUniformLocation>, x: GLint) {
3131 js!( @(no_return) @{self}.uniform1i(@{location}, @{x}); );
3132 }
3133
3134 pub fn uniform1iv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, i32> {
3135 js!( @(no_return) @{self}.uniform1iv(@{location}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
3136 }
3137
3138 pub fn uniform1iv_1<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, v: T0) where T0: AsTypedArray<'a0, i32> {
3139 js!( @(no_return) @{self}.uniform1iv(@{location}, @{unsafe { v.as_typed_array() }}); );
3140 }
3141
3142 pub fn uniform1ui(&self, location: Option<&WebGLUniformLocation>, v0: GLuint) {
3143 js!( @(no_return) @{self}.uniform1ui(@{location}, @{v0}); );
3144 }
3145
3146 pub fn uniform1uiv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, u32> {
3147 js!( @(no_return) @{self}.uniform1uiv(@{location}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
3148 }
3149
3150 pub fn uniform2f(&self, location: Option<&WebGLUniformLocation>, x: GLfloat, y: GLfloat) {
3151 js!( @(no_return) @{self}.uniform2f(@{location}, @{x}, @{y}); );
3152 }
3153
3154 pub fn uniform2fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, f32> {
3155 js!( @(no_return) @{self}.uniform2fv(@{location}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
3156 }
3157
3158 pub fn uniform2fv_1<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, v: T0) where T0: AsTypedArray<'a0, f32> {
3159 js!( @(no_return) @{self}.uniform2fv(@{location}, @{unsafe { v.as_typed_array() }}); );
3160 }
3161
3162 pub fn uniform2i(&self, location: Option<&WebGLUniformLocation>, x: GLint, y: GLint) {
3163 js!( @(no_return) @{self}.uniform2i(@{location}, @{x}, @{y}); );
3164 }
3165
3166 pub fn uniform2iv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, i32> {
3167 js!( @(no_return) @{self}.uniform2iv(@{location}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
3168 }
3169
3170 pub fn uniform2iv_1<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, v: T0) where T0: AsTypedArray<'a0, i32> {
3171 js!( @(no_return) @{self}.uniform2iv(@{location}, @{unsafe { v.as_typed_array() }}); );
3172 }
3173
3174 pub fn uniform2ui(&self, location: Option<&WebGLUniformLocation>, v0: GLuint, v1: GLuint) {
3175 js!( @(no_return) @{self}.uniform2ui(@{location}, @{v0}, @{v1}); );
3176 }
3177
3178 pub fn uniform2uiv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, u32> {
3179 js!( @(no_return) @{self}.uniform2uiv(@{location}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
3180 }
3181
3182 pub fn uniform3f(&self, location: Option<&WebGLUniformLocation>, x: GLfloat, y: GLfloat, z: GLfloat) {
3183 js!( @(no_return) @{self}.uniform3f(@{location}, @{x}, @{y}, @{z}); );
3184 }
3185
3186 pub fn uniform3fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, f32> {
3187 js!( @(no_return) @{self}.uniform3fv(@{location}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
3188 }
3189
3190 pub fn uniform3fv_1<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, v: T0) where T0: AsTypedArray<'a0, f32> {
3191 js!( @(no_return) @{self}.uniform3fv(@{location}, @{unsafe { v.as_typed_array() }}); );
3192 }
3193
3194 pub fn uniform3i(&self, location: Option<&WebGLUniformLocation>, x: GLint, y: GLint, z: GLint) {
3195 js!( @(no_return) @{self}.uniform3i(@{location}, @{x}, @{y}, @{z}); );
3196 }
3197
3198 pub fn uniform3iv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, i32> {
3199 js!( @(no_return) @{self}.uniform3iv(@{location}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
3200 }
3201
3202 pub fn uniform3iv_1<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, v: T0) where T0: AsTypedArray<'a0, i32> {
3203 js!( @(no_return) @{self}.uniform3iv(@{location}, @{unsafe { v.as_typed_array() }}); );
3204 }
3205
3206 pub fn uniform3ui(&self, location: Option<&WebGLUniformLocation>, v0: GLuint, v1: GLuint, v2: GLuint) {
3207 js!( @(no_return) @{self}.uniform3ui(@{location}, @{v0}, @{v1}, @{v2}); );
3208 }
3209
3210 pub fn uniform3uiv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, u32> {
3211 js!( @(no_return) @{self}.uniform3uiv(@{location}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
3212 }
3213
3214 pub fn uniform4f(&self, location: Option<&WebGLUniformLocation>, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat) {
3215 js!( @(no_return) @{self}.uniform4f(@{location}, @{x}, @{y}, @{z}, @{w}); );
3216 }
3217
3218 pub fn uniform4fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, f32> {
3219 js!( @(no_return) @{self}.uniform4fv(@{location}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
3220 }
3221
3222 pub fn uniform4fv_1<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, v: T0) where T0: AsTypedArray<'a0, f32> {
3223 js!( @(no_return) @{self}.uniform4fv(@{location}, @{unsafe { v.as_typed_array() }}); );
3224 }
3225
3226 pub fn uniform4i(&self, location: Option<&WebGLUniformLocation>, x: GLint, y: GLint, z: GLint, w: GLint) {
3227 js!( @(no_return) @{self}.uniform4i(@{location}, @{x}, @{y}, @{z}, @{w}); );
3228 }
3229
3230 pub fn uniform4iv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, i32> {
3231 js!( @(no_return) @{self}.uniform4iv(@{location}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
3232 }
3233
3234 pub fn uniform4iv_1<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, v: T0) where T0: AsTypedArray<'a0, i32> {
3235 js!( @(no_return) @{self}.uniform4iv(@{location}, @{unsafe { v.as_typed_array() }}); );
3236 }
3237
3238 pub fn uniform4ui(&self, location: Option<&WebGLUniformLocation>, v0: GLuint, v1: GLuint, v2: GLuint, v3: GLuint) {
3239 js!( @(no_return) @{self}.uniform4ui(@{location}, @{v0}, @{v1}, @{v2}, @{v3}); );
3240 }
3241
3242 pub fn uniform4uiv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, u32> {
3243 js!( @(no_return) @{self}.uniform4uiv(@{location}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
3244 }
3245
3246 pub fn uniform_block_binding(&self, program: &WebGLProgram, uniform_block_index: GLuint, uniform_block_binding: GLuint) {
3247 js!( @(no_return) @{self}.uniformBlockBinding(@{program}, @{uniform_block_index}, @{uniform_block_binding}); );
3248 }
3249
3250 pub fn uniform_matrix2fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, transpose: GLboolean, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, f32> {
3251 js!( @(no_return) @{self}.uniformMatrix2fv(@{location}, @{transpose}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
3252 }
3253
3254 pub fn uniform_matrix2fv_1<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, transpose: GLboolean, value: T0) where T0: AsTypedArray<'a0, f32> {
3255 js!( @(no_return) @{self}.uniformMatrix2fv(@{location}, @{transpose}, @{unsafe { value.as_typed_array() }}); );
3256 }
3257
3258 pub fn uniform_matrix2x3fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, transpose: GLboolean, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, f32> {
3259 js!( @(no_return) @{self}.uniformMatrix2x3fv(@{location}, @{transpose}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
3260 }
3261
3262 pub fn uniform_matrix2x4fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, transpose: GLboolean, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, f32> {
3263 js!( @(no_return) @{self}.uniformMatrix2x4fv(@{location}, @{transpose}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
3264 }
3265
3266 pub fn uniform_matrix3fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, transpose: GLboolean, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, f32> {
3267 js!( @(no_return) @{self}.uniformMatrix3fv(@{location}, @{transpose}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
3268 }
3269
3270 pub fn uniform_matrix3fv_1<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, transpose: GLboolean, value: T0) where T0: AsTypedArray<'a0, f32> {
3271 js!( @(no_return) @{self}.uniformMatrix3fv(@{location}, @{transpose}, @{unsafe { value.as_typed_array() }}); );
3272 }
3273
3274 pub fn uniform_matrix3x2fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, transpose: GLboolean, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, f32> {
3275 js!( @(no_return) @{self}.uniformMatrix3x2fv(@{location}, @{transpose}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
3276 }
3277
3278 pub fn uniform_matrix3x4fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, transpose: GLboolean, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, f32> {
3279 js!( @(no_return) @{self}.uniformMatrix3x4fv(@{location}, @{transpose}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
3280 }
3281
3282 pub fn uniform_matrix4fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, transpose: GLboolean, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, f32> {
3283 js!( @(no_return) @{self}.uniformMatrix4fv(@{location}, @{transpose}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
3284 }
3285
3286 pub fn uniform_matrix4fv_1<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, transpose: GLboolean, value: T0) where T0: AsTypedArray<'a0, f32> {
3287 js!( @(no_return) @{self}.uniformMatrix4fv(@{location}, @{transpose}, @{unsafe { value.as_typed_array() }}); );
3288 }
3289
3290 pub fn uniform_matrix4x2fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, transpose: GLboolean, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, f32> {
3291 js!( @(no_return) @{self}.uniformMatrix4x2fv(@{location}, @{transpose}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
3292 }
3293
3294 pub fn uniform_matrix4x3fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, transpose: GLboolean, data: T0, src_offset: GLuint, src_length: GLuint) where T0: AsTypedArray<'a0, f32> {
3295 js!( @(no_return) @{self}.uniformMatrix4x3fv(@{location}, @{transpose}, @{unsafe { data.as_typed_array() }}, @{src_offset}, @{src_length}); );
3296 }
3297
3298 pub fn use_program(&self, program: Option<&WebGLProgram>) {
3299 js!( @(no_return) @{self}.useProgram(@{program}); );
3300 }
3301
3302 pub fn validate_program(&self, program: &WebGLProgram) {
3303 js!( @(no_return) @{self}.validateProgram(@{program}); );
3304 }
3305
3306 pub fn vertex_attrib1f(&self, index: GLuint, x: GLfloat) {
3307 js!( @(no_return) @{self}.vertexAttrib1f(@{index}, @{x}); );
3308 }
3309
3310 pub fn vertex_attrib1fv<'a0, T0>(&self, index: GLuint, values: T0) where T0: AsTypedArray<'a0, f32> {
3311 js!( @(no_return) @{self}.vertexAttrib1fv(@{index}, @{unsafe { values.as_typed_array() }}); );
3312 }
3313
3314 pub fn vertex_attrib2f(&self, index: GLuint, x: GLfloat, y: GLfloat) {
3315 js!( @(no_return) @{self}.vertexAttrib2f(@{index}, @{x}, @{y}); );
3316 }
3317
3318 pub fn vertex_attrib2fv<'a0, T0>(&self, index: GLuint, values: T0) where T0: AsTypedArray<'a0, f32> {
3319 js!( @(no_return) @{self}.vertexAttrib2fv(@{index}, @{unsafe { values.as_typed_array() }}); );
3320 }
3321
3322 pub fn vertex_attrib3f(&self, index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat) {
3323 js!( @(no_return) @{self}.vertexAttrib3f(@{index}, @{x}, @{y}, @{z}); );
3324 }
3325
3326 pub fn vertex_attrib3fv<'a0, T0>(&self, index: GLuint, values: T0) where T0: AsTypedArray<'a0, f32> {
3327 js!( @(no_return) @{self}.vertexAttrib3fv(@{index}, @{unsafe { values.as_typed_array() }}); );
3328 }
3329
3330 pub fn vertex_attrib4f(&self, index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat) {
3331 js!( @(no_return) @{self}.vertexAttrib4f(@{index}, @{x}, @{y}, @{z}, @{w}); );
3332 }
3333
3334 pub fn vertex_attrib4fv<'a0, T0>(&self, index: GLuint, values: T0) where T0: AsTypedArray<'a0, f32> {
3335 js!( @(no_return) @{self}.vertexAttrib4fv(@{index}, @{unsafe { values.as_typed_array() }}); );
3336 }
3337
3338 pub fn vertex_attrib_divisor(&self, index: GLuint, divisor: GLuint) {
3339 js!( @(no_return) @{self}.vertexAttribDivisor(@{index}, @{divisor}); );
3340 }
3341
3342 pub fn vertex_attrib_i4i(&self, index: GLuint, x: GLint, y: GLint, z: GLint, w: GLint) {
3343 js!( @(no_return) @{self}.vertexAttribI4i(@{index}, @{x}, @{y}, @{z}, @{w}); );
3344 }
3345
3346 pub fn vertex_attrib_i4iv<'a0, T0>(&self, index: GLuint, values: T0) where T0: AsTypedArray<'a0, i32> {
3347 js!( @(no_return) @{self}.vertexAttribI4iv(@{index}, @{unsafe { values.as_typed_array() }}); );
3348 }
3349
3350 pub fn vertex_attrib_i4ui(&self, index: GLuint, x: GLuint, y: GLuint, z: GLuint, w: GLuint) {
3351 js!( @(no_return) @{self}.vertexAttribI4ui(@{index}, @{x}, @{y}, @{z}, @{w}); );
3352 }
3353
3354 pub fn vertex_attrib_i4uiv<'a0, T0>(&self, index: GLuint, values: T0) where T0: AsTypedArray<'a0, u32> {
3355 js!( @(no_return) @{self}.vertexAttribI4uiv(@{index}, @{unsafe { values.as_typed_array() }}); );
3356 }
3357
3358 pub fn vertex_attrib_i_pointer(&self, index: GLuint, size: GLint, type_: GLenum, stride: GLsizei, offset: GLintptr) {
3359 js!( @(no_return) @{self}.vertexAttribIPointer(@{index}, @{size}, @{type_}, @{stride}, @{(offset as f64)}); );
3360 }
3361
3362 pub fn vertex_attrib_pointer(&self, index: GLuint, size: GLint, type_: GLenum, normalized: GLboolean, stride: GLsizei, offset: GLintptr) {
3363 js!( @(no_return) @{self}.vertexAttribPointer(@{index}, @{size}, @{type_}, @{normalized}, @{stride}, @{(offset as f64)}); );
3364 }
3365
3366 pub fn viewport(&self, x: GLint, y: GLint, width: GLsizei, height: GLsizei) {
3367 js!( @(no_return) @{self}.viewport(@{x}, @{y}, @{width}, @{height}); );
3368 }
3369
3370 pub fn wait_sync(&self, sync: &WebGLSync, flags: GLbitfield, timeout: GLint64) {
3371 js!( @(no_return) @{self}.waitSync(@{sync}, @{flags}, @{(timeout as f64)}); );
3372 }
3373}
3374
3375impl RenderingContext for WebGL2RenderingContext {
3376 type Error = ConversionError;
3377 fn from_canvas(canvas: &CanvasElement) -> Result<Self, ConversionError> {
3378 js!(
3379 return @{canvas}.getContext("webgl2");
3380 ).try_into()
3381 }
3382}
3383
3384
3385#[derive(Debug, Clone, ReferenceType)]
3386#[reference(instance_of = "WebGLActiveInfo")]
3387pub struct WebGLActiveInfo(Reference);
3388
3389impl WebGLActiveInfo {
3390
3391
3392 pub fn name(&self) -> String {
3393 (js! { return @{self}.name; } ).try_into().unwrap()
3394 }
3395
3396 pub fn size(&self) -> GLint {
3397 (js! { return @{self}.size; } ).try_into().unwrap()
3398 }
3399
3400 pub fn type_(&self) -> GLenum {
3401 (js! { return @{self}.type; } ).try_into().unwrap()
3402 }
3403}
3404
3405
3406#[derive(Debug, Clone, ReferenceType)]
3407#[reference(instance_of = "WebGLBuffer")]
3408pub struct WebGLBuffer(Reference);
3409
3410impl WebGLBuffer {
3411
3412}
3413
3414
3415#[derive(Debug, Clone, ReferenceType)]
3416#[reference(instance_of = "WebGLContextEvent")]
3417pub struct WebGLContextEvent(Reference);
3418
3419impl WebGLContextEvent {
3420
3421
3422 pub fn status_message(&self) -> String {
3423 (js! { return @{self}.statusMessage; } ).try_into().unwrap()
3424 }
3425}
3426
3427
3428#[derive(Debug, Clone, ReferenceType)]
3429#[reference(instance_of = "WebGLFramebuffer")]
3430pub struct WebGLFramebuffer(Reference);
3431
3432impl WebGLFramebuffer {
3433
3434}
3435
3436
3437#[derive(Debug, Clone, ReferenceType)]
3438#[reference(instance_of = "WebGLProgram")]
3439pub struct WebGLProgram(Reference);
3440
3441impl WebGLProgram {
3442
3443}
3444
3445
3446#[derive(Debug, Clone, ReferenceType)]
3447#[reference(instance_of = "WebGLQuery")]
3448pub struct WebGLQuery(Reference);
3449
3450impl WebGLQuery {
3451
3452}
3453
3454
3455#[derive(Debug, Clone, ReferenceType)]
3456#[reference(instance_of = "WebGLRenderbuffer")]
3457pub struct WebGLRenderbuffer(Reference);
3458
3459impl WebGLRenderbuffer {
3460
3461}
3462
3463
3464#[derive(Debug, Clone, ReferenceType)]
3465#[reference(instance_of = "WebGLRenderingContext")]
3466pub struct WebGLRenderingContext(Reference);
3467
3468impl WebGLRenderingContext {
3469
3470 pub const ACTIVE_ATTRIBUTES: GLenum = 35721;
3471 pub const ACTIVE_TEXTURE: GLenum = 34016;
3472 pub const ACTIVE_UNIFORMS: GLenum = 35718;
3473 pub const ALIASED_LINE_WIDTH_RANGE: GLenum = 33902;
3474 pub const ALIASED_POINT_SIZE_RANGE: GLenum = 33901;
3475 pub const ALPHA: GLenum = 6406;
3476 pub const ALPHA_BITS: GLenum = 3413;
3477 pub const ALWAYS: GLenum = 519;
3478 pub const ARRAY_BUFFER: GLenum = 34962;
3479 pub const ARRAY_BUFFER_BINDING: GLenum = 34964;
3480 pub const ATTACHED_SHADERS: GLenum = 35717;
3481 pub const BACK: GLenum = 1029;
3482 pub const BLEND: GLenum = 3042;
3483 pub const BLEND_COLOR: GLenum = 32773;
3484 pub const BLEND_DST_ALPHA: GLenum = 32970;
3485 pub const BLEND_DST_RGB: GLenum = 32968;
3486 pub const BLEND_EQUATION: GLenum = 32777;
3487 pub const BLEND_EQUATION_ALPHA: GLenum = 34877;
3488 pub const BLEND_EQUATION_RGB: GLenum = 32777;
3489 pub const BLEND_SRC_ALPHA: GLenum = 32971;
3490 pub const BLEND_SRC_RGB: GLenum = 32969;
3491 pub const BLUE_BITS: GLenum = 3412;
3492 pub const BOOL: GLenum = 35670;
3493 pub const BOOL_VEC2: GLenum = 35671;
3494 pub const BOOL_VEC3: GLenum = 35672;
3495 pub const BOOL_VEC4: GLenum = 35673;
3496 pub const BROWSER_DEFAULT_WEBGL: GLenum = 37444;
3497 pub const BUFFER_SIZE: GLenum = 34660;
3498 pub const BUFFER_USAGE: GLenum = 34661;
3499 pub const BYTE: GLenum = 5120;
3500 pub const CCW: GLenum = 2305;
3501 pub const CLAMP_TO_EDGE: GLenum = 33071;
3502 pub const COLOR_ATTACHMENT0: GLenum = 36064;
3503 pub const COLOR_BUFFER_BIT: GLenum = 16384;
3504 pub const COLOR_CLEAR_VALUE: GLenum = 3106;
3505 pub const COLOR_WRITEMASK: GLenum = 3107;
3506 pub const COMPILE_STATUS: GLenum = 35713;
3507 pub const COMPRESSED_TEXTURE_FORMATS: GLenum = 34467;
3508 pub const CONSTANT_ALPHA: GLenum = 32771;
3509 pub const CONSTANT_COLOR: GLenum = 32769;
3510 pub const CONTEXT_LOST_WEBGL: GLenum = 37442;
3511 pub const CULL_FACE: GLenum = 2884;
3512 pub const CULL_FACE_MODE: GLenum = 2885;
3513 pub const CURRENT_PROGRAM: GLenum = 35725;
3514 pub const CURRENT_VERTEX_ATTRIB: GLenum = 34342;
3515 pub const CW: GLenum = 2304;
3516 pub const DECR: GLenum = 7683;
3517 pub const DECR_WRAP: GLenum = 34056;
3518 pub const DELETE_STATUS: GLenum = 35712;
3519 pub const DEPTH_ATTACHMENT: GLenum = 36096;
3520 pub const DEPTH_BITS: GLenum = 3414;
3521 pub const DEPTH_BUFFER_BIT: GLenum = 256;
3522 pub const DEPTH_CLEAR_VALUE: GLenum = 2931;
3523 pub const DEPTH_COMPONENT: GLenum = 6402;
3524 pub const DEPTH_COMPONENT16: GLenum = 33189;
3525 pub const DEPTH_FUNC: GLenum = 2932;
3526 pub const DEPTH_RANGE: GLenum = 2928;
3527 pub const DEPTH_STENCIL: GLenum = 34041;
3528 pub const DEPTH_STENCIL_ATTACHMENT: GLenum = 33306;
3529 pub const DEPTH_TEST: GLenum = 2929;
3530 pub const DEPTH_WRITEMASK: GLenum = 2930;
3531 pub const DITHER: GLenum = 3024;
3532 pub const DONT_CARE: GLenum = 4352;
3533 pub const DST_ALPHA: GLenum = 772;
3534 pub const DST_COLOR: GLenum = 774;
3535 pub const DYNAMIC_DRAW: GLenum = 35048;
3536 pub const ELEMENT_ARRAY_BUFFER: GLenum = 34963;
3537 pub const ELEMENT_ARRAY_BUFFER_BINDING: GLenum = 34965;
3538 pub const EQUAL: GLenum = 514;
3539 pub const FASTEST: GLenum = 4353;
3540 pub const FLOAT: GLenum = 5126;
3541 pub const FLOAT_MAT2: GLenum = 35674;
3542 pub const FLOAT_MAT3: GLenum = 35675;
3543 pub const FLOAT_MAT4: GLenum = 35676;
3544 pub const FLOAT_VEC2: GLenum = 35664;
3545 pub const FLOAT_VEC3: GLenum = 35665;
3546 pub const FLOAT_VEC4: GLenum = 35666;
3547 pub const FRAGMENT_SHADER: GLenum = 35632;
3548 pub const FRAMEBUFFER: GLenum = 36160;
3549 pub const FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: GLenum = 36049;
3550 pub const FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: GLenum = 36048;
3551 pub const FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: GLenum = 36051;
3552 pub const FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: GLenum = 36050;
3553 pub const FRAMEBUFFER_BINDING: GLenum = 36006;
3554 pub const FRAMEBUFFER_COMPLETE: GLenum = 36053;
3555 pub const FRAMEBUFFER_INCOMPLETE_ATTACHMENT: GLenum = 36054;
3556 pub const FRAMEBUFFER_INCOMPLETE_DIMENSIONS: GLenum = 36057;
3557 pub const FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: GLenum = 36055;
3558 pub const FRAMEBUFFER_UNSUPPORTED: GLenum = 36061;
3559 pub const FRONT: GLenum = 1028;
3560 pub const FRONT_AND_BACK: GLenum = 1032;
3561 pub const FRONT_FACE: GLenum = 2886;
3562 pub const FUNC_ADD: GLenum = 32774;
3563 pub const FUNC_REVERSE_SUBTRACT: GLenum = 32779;
3564 pub const FUNC_SUBTRACT: GLenum = 32778;
3565 pub const GENERATE_MIPMAP_HINT: GLenum = 33170;
3566 pub const GEQUAL: GLenum = 518;
3567 pub const GREATER: GLenum = 516;
3568 pub const GREEN_BITS: GLenum = 3411;
3569 pub const HIGH_FLOAT: GLenum = 36338;
3570 pub const HIGH_INT: GLenum = 36341;
3571 pub const IMPLEMENTATION_COLOR_READ_FORMAT: GLenum = 35739;
3572 pub const IMPLEMENTATION_COLOR_READ_TYPE: GLenum = 35738;
3573 pub const INCR: GLenum = 7682;
3574 pub const INCR_WRAP: GLenum = 34055;
3575 pub const INT: GLenum = 5124;
3576 pub const INT_VEC2: GLenum = 35667;
3577 pub const INT_VEC3: GLenum = 35668;
3578 pub const INT_VEC4: GLenum = 35669;
3579 pub const INVALID_ENUM: GLenum = 1280;
3580 pub const INVALID_FRAMEBUFFER_OPERATION: GLenum = 1286;
3581 pub const INVALID_OPERATION: GLenum = 1282;
3582 pub const INVALID_VALUE: GLenum = 1281;
3583 pub const INVERT: GLenum = 5386;
3584 pub const KEEP: GLenum = 7680;
3585 pub const LEQUAL: GLenum = 515;
3586 pub const LESS: GLenum = 513;
3587 pub const LINEAR: GLenum = 9729;
3588 pub const LINEAR_MIPMAP_LINEAR: GLenum = 9987;
3589 pub const LINEAR_MIPMAP_NEAREST: GLenum = 9985;
3590 pub const LINES: GLenum = 1;
3591 pub const LINE_LOOP: GLenum = 2;
3592 pub const LINE_STRIP: GLenum = 3;
3593 pub const LINE_WIDTH: GLenum = 2849;
3594 pub const LINK_STATUS: GLenum = 35714;
3595 pub const LOW_FLOAT: GLenum = 36336;
3596 pub const LOW_INT: GLenum = 36339;
3597 pub const LUMINANCE: GLenum = 6409;
3598 pub const LUMINANCE_ALPHA: GLenum = 6410;
3599 pub const MAX_COMBINED_TEXTURE_IMAGE_UNITS: GLenum = 35661;
3600 pub const MAX_CUBE_MAP_TEXTURE_SIZE: GLenum = 34076;
3601 pub const MAX_FRAGMENT_UNIFORM_VECTORS: GLenum = 36349;
3602 pub const MAX_RENDERBUFFER_SIZE: GLenum = 34024;
3603 pub const MAX_TEXTURE_IMAGE_UNITS: GLenum = 34930;
3604 pub const MAX_TEXTURE_SIZE: GLenum = 3379;
3605 pub const MAX_VARYING_VECTORS: GLenum = 36348;
3606 pub const MAX_VERTEX_ATTRIBS: GLenum = 34921;
3607 pub const MAX_VERTEX_TEXTURE_IMAGE_UNITS: GLenum = 35660;
3608 pub const MAX_VERTEX_UNIFORM_VECTORS: GLenum = 36347;
3609 pub const MAX_VIEWPORT_DIMS: GLenum = 3386;
3610 pub const MEDIUM_FLOAT: GLenum = 36337;
3611 pub const MEDIUM_INT: GLenum = 36340;
3612 pub const MIRRORED_REPEAT: GLenum = 33648;
3613 pub const NEAREST: GLenum = 9728;
3614 pub const NEAREST_MIPMAP_LINEAR: GLenum = 9986;
3615 pub const NEAREST_MIPMAP_NEAREST: GLenum = 9984;
3616 pub const NEVER: GLenum = 512;
3617 pub const NICEST: GLenum = 4354;
3618 pub const NONE: GLenum = 0;
3619 pub const NOTEQUAL: GLenum = 517;
3620 pub const NO_ERROR: GLenum = 0;
3621 pub const ONE: GLenum = 1;
3622 pub const ONE_MINUS_CONSTANT_ALPHA: GLenum = 32772;
3623 pub const ONE_MINUS_CONSTANT_COLOR: GLenum = 32770;
3624 pub const ONE_MINUS_DST_ALPHA: GLenum = 773;
3625 pub const ONE_MINUS_DST_COLOR: GLenum = 775;
3626 pub const ONE_MINUS_SRC_ALPHA: GLenum = 771;
3627 pub const ONE_MINUS_SRC_COLOR: GLenum = 769;
3628 pub const OUT_OF_MEMORY: GLenum = 1285;
3629 pub const PACK_ALIGNMENT: GLenum = 3333;
3630 pub const POINTS: GLenum = 0;
3631 pub const POLYGON_OFFSET_FACTOR: GLenum = 32824;
3632 pub const POLYGON_OFFSET_FILL: GLenum = 32823;
3633 pub const POLYGON_OFFSET_UNITS: GLenum = 10752;
3634 pub const RED_BITS: GLenum = 3410;
3635 pub const RENDERBUFFER: GLenum = 36161;
3636 pub const RENDERBUFFER_ALPHA_SIZE: GLenum = 36179;
3637 pub const RENDERBUFFER_BINDING: GLenum = 36007;
3638 pub const RENDERBUFFER_BLUE_SIZE: GLenum = 36178;
3639 pub const RENDERBUFFER_DEPTH_SIZE: GLenum = 36180;
3640 pub const RENDERBUFFER_GREEN_SIZE: GLenum = 36177;
3641 pub const RENDERBUFFER_HEIGHT: GLenum = 36163;
3642 pub const RENDERBUFFER_INTERNAL_FORMAT: GLenum = 36164;
3643 pub const RENDERBUFFER_RED_SIZE: GLenum = 36176;
3644 pub const RENDERBUFFER_STENCIL_SIZE: GLenum = 36181;
3645 pub const RENDERBUFFER_WIDTH: GLenum = 36162;
3646 pub const RENDERER: GLenum = 7937;
3647 pub const REPEAT: GLenum = 10497;
3648 pub const REPLACE: GLenum = 7681;
3649 pub const RGB: GLenum = 6407;
3650 pub const RGB565: GLenum = 36194;
3651 pub const RGB5_A1: GLenum = 32855;
3652 pub const RGBA: GLenum = 6408;
3653 pub const RGBA4: GLenum = 32854;
3654 pub const SAMPLER_2D: GLenum = 35678;
3655 pub const SAMPLER_CUBE: GLenum = 35680;
3656 pub const SAMPLES: GLenum = 32937;
3657 pub const SAMPLE_ALPHA_TO_COVERAGE: GLenum = 32926;
3658 pub const SAMPLE_BUFFERS: GLenum = 32936;
3659 pub const SAMPLE_COVERAGE: GLenum = 32928;
3660 pub const SAMPLE_COVERAGE_INVERT: GLenum = 32939;
3661 pub const SAMPLE_COVERAGE_VALUE: GLenum = 32938;
3662 pub const SCISSOR_BOX: GLenum = 3088;
3663 pub const SCISSOR_TEST: GLenum = 3089;
3664 pub const SHADER_TYPE: GLenum = 35663;
3665 pub const SHADING_LANGUAGE_VERSION: GLenum = 35724;
3666 pub const SHORT: GLenum = 5122;
3667 pub const SRC_ALPHA: GLenum = 770;
3668 pub const SRC_ALPHA_SATURATE: GLenum = 776;
3669 pub const SRC_COLOR: GLenum = 768;
3670 pub const STATIC_DRAW: GLenum = 35044;
3671 pub const STENCIL_ATTACHMENT: GLenum = 36128;
3672 pub const STENCIL_BACK_FAIL: GLenum = 34817;
3673 pub const STENCIL_BACK_FUNC: GLenum = 34816;
3674 pub const STENCIL_BACK_PASS_DEPTH_FAIL: GLenum = 34818;
3675 pub const STENCIL_BACK_PASS_DEPTH_PASS: GLenum = 34819;
3676 pub const STENCIL_BACK_REF: GLenum = 36003;
3677 pub const STENCIL_BACK_VALUE_MASK: GLenum = 36004;
3678 pub const STENCIL_BACK_WRITEMASK: GLenum = 36005;
3679 pub const STENCIL_BITS: GLenum = 3415;
3680 pub const STENCIL_BUFFER_BIT: GLenum = 1024;
3681 pub const STENCIL_CLEAR_VALUE: GLenum = 2961;
3682 pub const STENCIL_FAIL: GLenum = 2964;
3683 pub const STENCIL_FUNC: GLenum = 2962;
3684 pub const STENCIL_INDEX8: GLenum = 36168;
3685 pub const STENCIL_PASS_DEPTH_FAIL: GLenum = 2965;
3686 pub const STENCIL_PASS_DEPTH_PASS: GLenum = 2966;
3687 pub const STENCIL_REF: GLenum = 2967;
3688 pub const STENCIL_TEST: GLenum = 2960;
3689 pub const STENCIL_VALUE_MASK: GLenum = 2963;
3690 pub const STENCIL_WRITEMASK: GLenum = 2968;
3691 pub const STREAM_DRAW: GLenum = 35040;
3692 pub const SUBPIXEL_BITS: GLenum = 3408;
3693 pub const TEXTURE: GLenum = 5890;
3694 pub const TEXTURE0: GLenum = 33984;
3695 pub const TEXTURE1: GLenum = 33985;
3696 pub const TEXTURE10: GLenum = 33994;
3697 pub const TEXTURE11: GLenum = 33995;
3698 pub const TEXTURE12: GLenum = 33996;
3699 pub const TEXTURE13: GLenum = 33997;
3700 pub const TEXTURE14: GLenum = 33998;
3701 pub const TEXTURE15: GLenum = 33999;
3702 pub const TEXTURE16: GLenum = 34000;
3703 pub const TEXTURE17: GLenum = 34001;
3704 pub const TEXTURE18: GLenum = 34002;
3705 pub const TEXTURE19: GLenum = 34003;
3706 pub const TEXTURE2: GLenum = 33986;
3707 pub const TEXTURE20: GLenum = 34004;
3708 pub const TEXTURE21: GLenum = 34005;
3709 pub const TEXTURE22: GLenum = 34006;
3710 pub const TEXTURE23: GLenum = 34007;
3711 pub const TEXTURE24: GLenum = 34008;
3712 pub const TEXTURE25: GLenum = 34009;
3713 pub const TEXTURE26: GLenum = 34010;
3714 pub const TEXTURE27: GLenum = 34011;
3715 pub const TEXTURE28: GLenum = 34012;
3716 pub const TEXTURE29: GLenum = 34013;
3717 pub const TEXTURE3: GLenum = 33987;
3718 pub const TEXTURE30: GLenum = 34014;
3719 pub const TEXTURE31: GLenum = 34015;
3720 pub const TEXTURE4: GLenum = 33988;
3721 pub const TEXTURE5: GLenum = 33989;
3722 pub const TEXTURE6: GLenum = 33990;
3723 pub const TEXTURE7: GLenum = 33991;
3724 pub const TEXTURE8: GLenum = 33992;
3725 pub const TEXTURE9: GLenum = 33993;
3726 pub const TEXTURE_2D: GLenum = 3553;
3727 pub const TEXTURE_BINDING_2D: GLenum = 32873;
3728 pub const TEXTURE_BINDING_CUBE_MAP: GLenum = 34068;
3729 pub const TEXTURE_CUBE_MAP: GLenum = 34067;
3730 pub const TEXTURE_CUBE_MAP_NEGATIVE_X: GLenum = 34070;
3731 pub const TEXTURE_CUBE_MAP_NEGATIVE_Y: GLenum = 34072;
3732 pub const TEXTURE_CUBE_MAP_NEGATIVE_Z: GLenum = 34074;
3733 pub const TEXTURE_CUBE_MAP_POSITIVE_X: GLenum = 34069;
3734 pub const TEXTURE_CUBE_MAP_POSITIVE_Y: GLenum = 34071;
3735 pub const TEXTURE_CUBE_MAP_POSITIVE_Z: GLenum = 34073;
3736 pub const TEXTURE_MAG_FILTER: GLenum = 10240;
3737 pub const TEXTURE_MIN_FILTER: GLenum = 10241;
3738 pub const TEXTURE_WRAP_S: GLenum = 10242;
3739 pub const TEXTURE_WRAP_T: GLenum = 10243;
3740 pub const TRIANGLES: GLenum = 4;
3741 pub const TRIANGLE_FAN: GLenum = 6;
3742 pub const TRIANGLE_STRIP: GLenum = 5;
3743 pub const UNPACK_ALIGNMENT: GLenum = 3317;
3744 pub const UNPACK_COLORSPACE_CONVERSION_WEBGL: GLenum = 37443;
3745 pub const UNPACK_FLIP_Y_WEBGL: GLenum = 37440;
3746 pub const UNPACK_PREMULTIPLY_ALPHA_WEBGL: GLenum = 37441;
3747 pub const UNSIGNED_BYTE: GLenum = 5121;
3748 pub const UNSIGNED_INT: GLenum = 5125;
3749 pub const UNSIGNED_SHORT: GLenum = 5123;
3750 pub const UNSIGNED_SHORT_4_4_4_4: GLenum = 32819;
3751 pub const UNSIGNED_SHORT_5_5_5_1: GLenum = 32820;
3752 pub const UNSIGNED_SHORT_5_6_5: GLenum = 33635;
3753 pub const VALIDATE_STATUS: GLenum = 35715;
3754 pub const VENDOR: GLenum = 7936;
3755 pub const VERSION: GLenum = 7938;
3756 pub const VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: GLenum = 34975;
3757 pub const VERTEX_ATTRIB_ARRAY_ENABLED: GLenum = 34338;
3758 pub const VERTEX_ATTRIB_ARRAY_NORMALIZED: GLenum = 34922;
3759 pub const VERTEX_ATTRIB_ARRAY_POINTER: GLenum = 34373;
3760 pub const VERTEX_ATTRIB_ARRAY_SIZE: GLenum = 34339;
3761 pub const VERTEX_ATTRIB_ARRAY_STRIDE: GLenum = 34340;
3762 pub const VERTEX_ATTRIB_ARRAY_TYPE: GLenum = 34341;
3763 pub const VERTEX_SHADER: GLenum = 35633;
3764 pub const VIEWPORT: GLenum = 2978;
3765 pub const ZERO: GLenum = 0;
3766
3767 pub fn active_texture(&self, texture: GLenum) {
3768 js!( @(no_return) @{self}.activeTexture(@{texture}); );
3769 }
3770
3771 pub fn attach_shader(&self, program: &WebGLProgram, shader: &WebGLShader) {
3772 js!( @(no_return) @{self}.attachShader(@{program}, @{shader}); );
3773 }
3774
3775 pub fn bind_attrib_location(&self, program: &WebGLProgram, index: GLuint, name: &str) {
3776 js!( @(no_return) @{self}.bindAttribLocation(@{program}, @{index}, @{name}); );
3777 }
3778
3779 pub fn bind_buffer(&self, target: GLenum, buffer: Option<&WebGLBuffer>) {
3780 js!( @(no_return) @{self}.bindBuffer(@{target}, @{buffer}); );
3781 }
3782
3783 pub fn bind_framebuffer(&self, target: GLenum, framebuffer: Option<&WebGLFramebuffer>) {
3784 js!( @(no_return) @{self}.bindFramebuffer(@{target}, @{framebuffer}); );
3785 }
3786
3787 pub fn bind_renderbuffer(&self, target: GLenum, renderbuffer: Option<&WebGLRenderbuffer>) {
3788 js!( @(no_return) @{self}.bindRenderbuffer(@{target}, @{renderbuffer}); );
3789 }
3790
3791 pub fn bind_texture(&self, target: GLenum, texture: Option<&WebGLTexture>) {
3792 js!( @(no_return) @{self}.bindTexture(@{target}, @{texture}); );
3793 }
3794
3795 pub fn blend_color(&self, red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) {
3796 js!( @(no_return) @{self}.blendColor(@{red}, @{green}, @{blue}, @{alpha}); );
3797 }
3798
3799 pub fn blend_equation(&self, mode: GLenum) {
3800 js!( @(no_return) @{self}.blendEquation(@{mode}); );
3801 }
3802
3803 pub fn blend_equation_separate(&self, mode_rgb: GLenum, mode_alpha: GLenum) {
3804 js!( @(no_return) @{self}.blendEquationSeparate(@{mode_rgb}, @{mode_alpha}); );
3805 }
3806
3807 pub fn blend_func(&self, sfactor: GLenum, dfactor: GLenum) {
3808 js!( @(no_return) @{self}.blendFunc(@{sfactor}, @{dfactor}); );
3809 }
3810
3811 pub fn blend_func_separate(&self, src_rgb: GLenum, dst_rgb: GLenum, src_alpha: GLenum, dst_alpha: GLenum) {
3812 js!( @(no_return) @{self}.blendFuncSeparate(@{src_rgb}, @{dst_rgb}, @{src_alpha}, @{dst_alpha}); );
3813 }
3814
3815 pub fn buffer_data(&self, target: GLenum, size: GLsizeiptr, usage: GLenum) {
3816 js!( @(no_return) @{self}.bufferData(@{target}, @{(size as f64)}, @{usage}); );
3817 }
3818
3819 pub fn buffer_data_1(&self, target: GLenum, data: Option<&ArrayBuffer>, usage: GLenum) {
3820 js!( @(no_return) @{self}.bufferData(@{target}, @{data}, @{usage}); );
3821 }
3822
3823 pub fn buffer_sub_data(&self, target: GLenum, offset: GLintptr, data: &ArrayBuffer) {
3824 js!( @(no_return) @{self}.bufferSubData(@{target}, @{(offset as f64)}, @{data}); );
3825 }
3826
3827 pub fn canvas(&self) -> CanvasElement {
3828 (js! { return @{self}.canvas; } ).try_into().unwrap()
3829 }
3830
3831 pub fn check_framebuffer_status(&self, target: GLenum) -> GLenum {
3832 (js! { return @{self}.checkFramebufferStatus(@{target}); } ).try_into().unwrap()
3833 }
3834
3835 pub fn clear(&self, mask: GLbitfield) {
3836 js!( @(no_return) @{self}.clear(@{mask}); );
3837 }
3838
3839 pub fn clear_color(&self, red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) {
3840 js!( @(no_return) @{self}.clearColor(@{red}, @{green}, @{blue}, @{alpha}); );
3841 }
3842
3843 pub fn clear_depth(&self, depth: GLclampf) {
3844 js!( @(no_return) @{self}.clearDepth(@{depth}); );
3845 }
3846
3847 pub fn clear_stencil(&self, s: GLint) {
3848 js!( @(no_return) @{self}.clearStencil(@{s}); );
3849 }
3850
3851 pub fn color_mask(&self, red: GLboolean, green: GLboolean, blue: GLboolean, alpha: GLboolean) {
3852 js!( @(no_return) @{self}.colorMask(@{red}, @{green}, @{blue}, @{alpha}); );
3853 }
3854
3855 pub fn compile_shader(&self, shader: &WebGLShader) {
3856 js!( @(no_return) @{self}.compileShader(@{shader}); );
3857 }
3858
3859 pub fn compressed_tex_image2_d<'a0, T0>(&self, target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, data: T0) where T0: AsArrayBufferView<'a0> {
3860 js!( @(no_return) @{self}.compressedTexImage2D(@{target}, @{level}, @{internalformat}, @{width}, @{height}, @{border}, @{unsafe { data.as_array_buffer_view() }}); );
3861 }
3862
3863 pub fn compressed_tex_sub_image2_d<'a0, T0>(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, data: T0) where T0: AsArrayBufferView<'a0> {
3864 js!( @(no_return) @{self}.compressedTexSubImage2D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{width}, @{height}, @{format}, @{unsafe { data.as_array_buffer_view() }}); );
3865 }
3866
3867 pub fn copy_tex_image2_d(&self, target: GLenum, level: GLint, internalformat: GLenum, x: GLint, y: GLint, width: GLsizei, height: GLsizei, border: GLint) {
3868 js!( @(no_return) @{self}.copyTexImage2D(@{target}, @{level}, @{internalformat}, @{x}, @{y}, @{width}, @{height}, @{border}); );
3869 }
3870
3871 pub fn copy_tex_sub_image2_d(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei) {
3872 js!( @(no_return) @{self}.copyTexSubImage2D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{x}, @{y}, @{width}, @{height}); );
3873 }
3874
3875 pub fn create_buffer(&self, ) -> Option<WebGLBuffer> {
3876 (js! { return @{self}.createBuffer(); } ).try_into().ok()
3877 }
3878
3879 pub fn create_framebuffer(&self, ) -> Option<WebGLFramebuffer> {
3880 (js! { return @{self}.createFramebuffer(); } ).try_into().ok()
3881 }
3882
3883 pub fn create_program(&self, ) -> Option<WebGLProgram> {
3884 (js! { return @{self}.createProgram(); } ).try_into().ok()
3885 }
3886
3887 pub fn create_renderbuffer(&self, ) -> Option<WebGLRenderbuffer> {
3888 (js! { return @{self}.createRenderbuffer(); } ).try_into().ok()
3889 }
3890
3891 pub fn create_shader(&self, type_: GLenum) -> Option<WebGLShader> {
3892 (js! { return @{self}.createShader(@{type_}); } ).try_into().ok()
3893 }
3894
3895 pub fn create_texture(&self, ) -> Option<WebGLTexture> {
3896 (js! { return @{self}.createTexture(); } ).try_into().ok()
3897 }
3898
3899 pub fn cull_face(&self, mode: GLenum) {
3900 js!( @(no_return) @{self}.cullFace(@{mode}); );
3901 }
3902
3903 pub fn delete_buffer(&self, buffer: Option<&WebGLBuffer>) {
3904 js!( @(no_return) @{self}.deleteBuffer(@{buffer}); );
3905 }
3906
3907 pub fn delete_framebuffer(&self, framebuffer: Option<&WebGLFramebuffer>) {
3908 js!( @(no_return) @{self}.deleteFramebuffer(@{framebuffer}); );
3909 }
3910
3911 pub fn delete_program(&self, program: Option<&WebGLProgram>) {
3912 js!( @(no_return) @{self}.deleteProgram(@{program}); );
3913 }
3914
3915 pub fn delete_renderbuffer(&self, renderbuffer: Option<&WebGLRenderbuffer>) {
3916 js!( @(no_return) @{self}.deleteRenderbuffer(@{renderbuffer}); );
3917 }
3918
3919 pub fn delete_shader(&self, shader: Option<&WebGLShader>) {
3920 js!( @(no_return) @{self}.deleteShader(@{shader}); );
3921 }
3922
3923 pub fn delete_texture(&self, texture: Option<&WebGLTexture>) {
3924 js!( @(no_return) @{self}.deleteTexture(@{texture}); );
3925 }
3926
3927 pub fn depth_func(&self, func: GLenum) {
3928 js!( @(no_return) @{self}.depthFunc(@{func}); );
3929 }
3930
3931 pub fn depth_mask(&self, flag: GLboolean) {
3932 js!( @(no_return) @{self}.depthMask(@{flag}); );
3933 }
3934
3935 pub fn depth_range(&self, z_near: GLclampf, z_far: GLclampf) {
3936 js!( @(no_return) @{self}.depthRange(@{z_near}, @{z_far}); );
3937 }
3938
3939 pub fn detach_shader(&self, program: &WebGLProgram, shader: &WebGLShader) {
3940 js!( @(no_return) @{self}.detachShader(@{program}, @{shader}); );
3941 }
3942
3943 pub fn disable(&self, cap: GLenum) {
3944 js!( @(no_return) @{self}.disable(@{cap}); );
3945 }
3946
3947 pub fn disable_vertex_attrib_array(&self, index: GLuint) {
3948 js!( @(no_return) @{self}.disableVertexAttribArray(@{index}); );
3949 }
3950
3951 pub fn draw_arrays(&self, mode: GLenum, first: GLint, count: GLsizei) {
3952 js!( @(no_return) @{self}.drawArrays(@{mode}, @{first}, @{count}); );
3953 }
3954
3955 pub fn draw_elements(&self, mode: GLenum, count: GLsizei, type_: GLenum, offset: GLintptr) {
3956 js!( @(no_return) @{self}.drawElements(@{mode}, @{count}, @{type_}, @{(offset as f64)}); );
3957 }
3958
3959 pub fn drawing_buffer_height(&self) -> GLsizei {
3960 (js! { return @{self}.drawingBufferHeight; } ).try_into().unwrap()
3961 }
3962
3963 pub fn drawing_buffer_width(&self) -> GLsizei {
3964 (js! { return @{self}.drawingBufferWidth; } ).try_into().unwrap()
3965 }
3966
3967 pub fn enable(&self, cap: GLenum) {
3968 js!( @(no_return) @{self}.enable(@{cap}); );
3969 }
3970
3971 pub fn enable_vertex_attrib_array(&self, index: GLuint) {
3972 js!( @(no_return) @{self}.enableVertexAttribArray(@{index}); );
3973 }
3974
3975 pub fn finish(&self, ) {
3976 js!( @(no_return) @{self}.finish(); );
3977 }
3978
3979 pub fn flush(&self, ) {
3980 js!( @(no_return) @{self}.flush(); );
3981 }
3982
3983 pub fn framebuffer_renderbuffer(&self, target: GLenum, attachment: GLenum, renderbuffertarget: GLenum, renderbuffer: Option<&WebGLRenderbuffer>) {
3984 js!( @(no_return) @{self}.framebufferRenderbuffer(@{target}, @{attachment}, @{renderbuffertarget}, @{renderbuffer}); );
3985 }
3986
3987 pub fn framebuffer_texture2_d(&self, target: GLenum, attachment: GLenum, textarget: GLenum, texture: Option<&WebGLTexture>, level: GLint) {
3988 js!( @(no_return) @{self}.framebufferTexture2D(@{target}, @{attachment}, @{textarget}, @{texture}, @{level}); );
3989 }
3990
3991 pub fn front_face(&self, mode: GLenum) {
3992 js!( @(no_return) @{self}.frontFace(@{mode}); );
3993 }
3994
3995 pub fn generate_mipmap(&self, target: GLenum) {
3996 js!( @(no_return) @{self}.generateMipmap(@{target}); );
3997 }
3998
3999 pub fn get_active_attrib(&self, program: &WebGLProgram, index: GLuint) -> Option<WebGLActiveInfo> {
4000 (js! { return @{self}.getActiveAttrib(@{program}, @{index}); } ).try_into().ok()
4001 }
4002
4003 pub fn get_active_uniform(&self, program: &WebGLProgram, index: GLuint) -> Option<WebGLActiveInfo> {
4004 (js! { return @{self}.getActiveUniform(@{program}, @{index}); } ).try_into().ok()
4005 }
4006
4007 pub fn get_attached_shaders(&self, program: &WebGLProgram) -> Option<Vec<WebGLShader>> {
4008 (js! { return @{self}.getAttachedShaders(@{program}); } ).try_into().ok()
4009 }
4010
4011 pub fn get_attrib_location(&self, program: &WebGLProgram, name: &str) -> GLint {
4012 (js! { return @{self}.getAttribLocation(@{program}, @{name}); } ).try_into().unwrap()
4013 }
4014
4015 pub fn get_buffer_parameter(&self, target: GLenum, pname: GLenum) -> Value {
4016 (js! { return @{self}.getBufferParameter(@{target}, @{pname}); } ).try_into().unwrap()
4017 }
4018
4019 pub fn get_context_attributes(&self, ) -> Option<WebGLContextAttributes> {
4020 (js! { return @{self}.getContextAttributes(); } ).try_into().ok()
4021 }
4022
4023 pub fn get_error(&self, ) -> GLenum {
4024 (js! { return @{self}.getError(); } ).try_into().unwrap()
4025 }
4026
4027 pub fn get_extension<E: Extension>(&self) -> Option<E> {
4028 (js! { return @{self}.getExtension(@{E::NAME}); } ).try_into().ok()
4029 }
4030
4031 pub fn get_framebuffer_attachment_parameter(&self, target: GLenum, attachment: GLenum, pname: GLenum) -> Value {
4032 (js! { return @{self}.getFramebufferAttachmentParameter(@{target}, @{attachment}, @{pname}); } ).try_into().unwrap()
4033 }
4034
4035 pub fn get_parameter(&self, pname: GLenum) -> Value {
4036 (js! { return @{self}.getParameter(@{pname}); } ).try_into().unwrap()
4037 }
4038
4039 pub fn get_program_info_log(&self, program: &WebGLProgram) -> Option<String> {
4040 (js! { return @{self}.getProgramInfoLog(@{program}); } ).try_into().ok()
4041 }
4042
4043 pub fn get_program_parameter(&self, program: &WebGLProgram, pname: GLenum) -> Value {
4044 (js! { return @{self}.getProgramParameter(@{program}, @{pname}); } ).try_into().unwrap()
4045 }
4046
4047 pub fn get_renderbuffer_parameter(&self, target: GLenum, pname: GLenum) -> Value {
4048 (js! { return @{self}.getRenderbufferParameter(@{target}, @{pname}); } ).try_into().unwrap()
4049 }
4050
4051 pub fn get_shader_info_log(&self, shader: &WebGLShader) -> Option<String> {
4052 (js! { return @{self}.getShaderInfoLog(@{shader}); } ).try_into().ok()
4053 }
4054
4055 pub fn get_shader_parameter(&self, shader: &WebGLShader, pname: GLenum) -> Value {
4056 (js! { return @{self}.getShaderParameter(@{shader}, @{pname}); } ).try_into().unwrap()
4057 }
4058
4059 pub fn get_shader_precision_format(&self, shadertype: GLenum, precisiontype: GLenum) -> Option<WebGLShaderPrecisionFormat> {
4060 (js! { return @{self}.getShaderPrecisionFormat(@{shadertype}, @{precisiontype}); } ).try_into().ok()
4061 }
4062
4063 pub fn get_shader_source(&self, shader: &WebGLShader) -> Option<String> {
4064 (js! { return @{self}.getShaderSource(@{shader}); } ).try_into().ok()
4065 }
4066
4067 pub fn get_supported_extensions(&self, ) -> Option<Vec<String>> {
4068 (js! { return @{self}.getSupportedExtensions(); } ).try_into().ok()
4069 }
4070
4071 pub fn get_tex_parameter(&self, target: GLenum, pname: GLenum) -> Value {
4072 (js! { return @{self}.getTexParameter(@{target}, @{pname}); } ).try_into().unwrap()
4073 }
4074
4075 pub fn get_uniform(&self, program: &WebGLProgram, location: &WebGLUniformLocation) -> Value {
4076 (js! { return @{self}.getUniform(@{program}, @{location}); } ).try_into().unwrap()
4077 }
4078
4079 pub fn get_uniform_location(&self, program: &WebGLProgram, name: &str) -> Option<WebGLUniformLocation> {
4080 (js! { return @{self}.getUniformLocation(@{program}, @{name}); } ).try_into().ok()
4081 }
4082
4083 pub fn get_vertex_attrib(&self, index: GLuint, pname: GLenum) -> Value {
4084 (js! { return @{self}.getVertexAttrib(@{index}, @{pname}); } ).try_into().unwrap()
4085 }
4086
4087 pub fn get_vertex_attrib_offset(&self, index: GLuint, pname: GLenum) -> GLintptr {
4088 (js! { return @{self}.getVertexAttribOffset(@{index}, @{pname}); } ).try_into().unwrap()
4089 }
4090
4091 pub fn hint(&self, target: GLenum, mode: GLenum) {
4092 js!( @(no_return) @{self}.hint(@{target}, @{mode}); );
4093 }
4094
4095 pub fn is_buffer(&self, buffer: Option<&WebGLBuffer>) -> GLboolean {
4096 (js! { return @{self}.isBuffer(@{buffer}); } ).try_into().unwrap()
4097 }
4098
4099 pub fn is_context_lost(&self, ) -> bool {
4100 (js! { return @{self}.isContextLost(); } ).try_into().unwrap()
4101 }
4102
4103 pub fn is_enabled(&self, cap: GLenum) -> GLboolean {
4104 (js! { return @{self}.isEnabled(@{cap}); } ).try_into().unwrap()
4105 }
4106
4107 pub fn is_framebuffer(&self, framebuffer: Option<&WebGLFramebuffer>) -> GLboolean {
4108 (js! { return @{self}.isFramebuffer(@{framebuffer}); } ).try_into().unwrap()
4109 }
4110
4111 pub fn is_program(&self, program: Option<&WebGLProgram>) -> GLboolean {
4112 (js! { return @{self}.isProgram(@{program}); } ).try_into().unwrap()
4113 }
4114
4115 pub fn is_renderbuffer(&self, renderbuffer: Option<&WebGLRenderbuffer>) -> GLboolean {
4116 (js! { return @{self}.isRenderbuffer(@{renderbuffer}); } ).try_into().unwrap()
4117 }
4118
4119 pub fn is_shader(&self, shader: Option<&WebGLShader>) -> GLboolean {
4120 (js! { return @{self}.isShader(@{shader}); } ).try_into().unwrap()
4121 }
4122
4123 pub fn is_texture(&self, texture: Option<&WebGLTexture>) -> GLboolean {
4124 (js! { return @{self}.isTexture(@{texture}); } ).try_into().unwrap()
4125 }
4126
4127 pub fn line_width(&self, width: GLfloat) {
4128 js!( @(no_return) @{self}.lineWidth(@{width}); );
4129 }
4130
4131 pub fn link_program(&self, program: &WebGLProgram) {
4132 js!( @(no_return) @{self}.linkProgram(@{program}); );
4133 }
4134
4135 pub fn pixel_storei(&self, pname: GLenum, param: GLint) {
4136 js!( @(no_return) @{self}.pixelStorei(@{pname}, @{param}); );
4137 }
4138
4139 pub fn polygon_offset(&self, factor: GLfloat, units: GLfloat) {
4140 js!( @(no_return) @{self}.polygonOffset(@{factor}, @{units}); );
4141 }
4142
4143 pub fn read_pixels<'a0, T0>(&self, x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type_: GLenum, pixels: Option<T0>) where T0: AsArrayBufferView<'a0> {
4144 js!( @(no_return) @{self}.readPixels(@{x}, @{y}, @{width}, @{height}, @{format}, @{type_}, @{pixels.map(|inner| unsafe { inner.as_array_buffer_view() })}); );
4145 }
4146
4147 pub fn renderbuffer_storage(&self, target: GLenum, internalformat: GLenum, width: GLsizei, height: GLsizei) {
4148 js!( @(no_return) @{self}.renderbufferStorage(@{target}, @{internalformat}, @{width}, @{height}); );
4149 }
4150
4151 pub fn sample_coverage(&self, value: GLclampf, invert: GLboolean) {
4152 js!( @(no_return) @{self}.sampleCoverage(@{value}, @{invert}); );
4153 }
4154
4155 pub fn scissor(&self, x: GLint, y: GLint, width: GLsizei, height: GLsizei) {
4156 js!( @(no_return) @{self}.scissor(@{x}, @{y}, @{width}, @{height}); );
4157 }
4158
4159 pub fn shader_source(&self, shader: &WebGLShader, source: &str) {
4160 js!( @(no_return) @{self}.shaderSource(@{shader}, @{source}); );
4161 }
4162
4163 pub fn stencil_func(&self, func: GLenum, ref_: GLint, mask: GLuint) {
4164 js!( @(no_return) @{self}.stencilFunc(@{func}, @{ref_}, @{mask}); );
4165 }
4166
4167 pub fn stencil_func_separate(&self, face: GLenum, func: GLenum, ref_: GLint, mask: GLuint) {
4168 js!( @(no_return) @{self}.stencilFuncSeparate(@{face}, @{func}, @{ref_}, @{mask}); );
4169 }
4170
4171 pub fn stencil_mask(&self, mask: GLuint) {
4172 js!( @(no_return) @{self}.stencilMask(@{mask}); );
4173 }
4174
4175 pub fn stencil_mask_separate(&self, face: GLenum, mask: GLuint) {
4176 js!( @(no_return) @{self}.stencilMaskSeparate(@{face}, @{mask}); );
4177 }
4178
4179 pub fn stencil_op(&self, fail: GLenum, zfail: GLenum, zpass: GLenum) {
4180 js!( @(no_return) @{self}.stencilOp(@{fail}, @{zfail}, @{zpass}); );
4181 }
4182
4183 pub fn stencil_op_separate(&self, face: GLenum, fail: GLenum, zfail: GLenum, zpass: GLenum) {
4184 js!( @(no_return) @{self}.stencilOpSeparate(@{face}, @{fail}, @{zfail}, @{zpass}); );
4185 }
4186
4187 pub fn tex_image2_d<'a0, T0>(&self, target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type_: GLenum, pixels: Option<T0>) where T0: AsArrayBufferView<'a0> {
4188 js!( @(no_return) @{self}.texImage2D(@{target}, @{level}, @{internalformat}, @{width}, @{height}, @{border}, @{format}, @{type_}, @{pixels.map(|inner| unsafe { inner.as_array_buffer_view() })}); );
4189 }
4190
4191 pub fn tex_image2_d_1<T0>(&self, target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type_: GLenum, source: T0) where T0: JsSerialize {
4192 js!( @(no_return) @{self}.texImage2D(@{target}, @{level}, @{internalformat}, @{format}, @{type_}, @{source}); );
4193 }
4194
4195 pub fn tex_parameterf(&self, target: GLenum, pname: GLenum, param: GLfloat) {
4196 js!( @(no_return) @{self}.texParameterf(@{target}, @{pname}, @{param}); );
4197 }
4198
4199 pub fn tex_parameteri(&self, target: GLenum, pname: GLenum, param: GLint) {
4200 js!( @(no_return) @{self}.texParameteri(@{target}, @{pname}, @{param}); );
4201 }
4202
4203 pub fn tex_sub_image2_d<'a0, T0>(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type_: GLenum, pixels: Option<T0>) where T0: AsArrayBufferView<'a0> {
4204 js!( @(no_return) @{self}.texSubImage2D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{width}, @{height}, @{format}, @{type_}, @{pixels.map(|inner| unsafe { inner.as_array_buffer_view() })}); );
4205 }
4206
4207 pub fn tex_sub_image2_d_1<T0>(&self, target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type_: GLenum, source: T0) where T0: JsSerialize {
4208 js!( @(no_return) @{self}.texSubImage2D(@{target}, @{level}, @{xoffset}, @{yoffset}, @{format}, @{type_}, @{source}); );
4209 }
4210
4211 pub fn uniform1f(&self, location: Option<&WebGLUniformLocation>, x: GLfloat) {
4212 js!( @(no_return) @{self}.uniform1f(@{location}, @{x}); );
4213 }
4214
4215 pub fn uniform1fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, v: T0) where T0: AsTypedArray<'a0, f32> {
4216 js!( @(no_return) @{self}.uniform1fv(@{location}, @{unsafe { v.as_typed_array() }}); );
4217 }
4218
4219 pub fn uniform1i(&self, location: Option<&WebGLUniformLocation>, x: GLint) {
4220 js!( @(no_return) @{self}.uniform1i(@{location}, @{x}); );
4221 }
4222
4223 pub fn uniform1iv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, v: T0) where T0: AsTypedArray<'a0, i32> {
4224 js!( @(no_return) @{self}.uniform1iv(@{location}, @{unsafe { v.as_typed_array() }}); );
4225 }
4226
4227 pub fn uniform2f(&self, location: Option<&WebGLUniformLocation>, x: GLfloat, y: GLfloat) {
4228 js!( @(no_return) @{self}.uniform2f(@{location}, @{x}, @{y}); );
4229 }
4230
4231 pub fn uniform2fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, v: T0) where T0: AsTypedArray<'a0, f32> {
4232 js!( @(no_return) @{self}.uniform2fv(@{location}, @{unsafe { v.as_typed_array() }}); );
4233 }
4234
4235 pub fn uniform2i(&self, location: Option<&WebGLUniformLocation>, x: GLint, y: GLint) {
4236 js!( @(no_return) @{self}.uniform2i(@{location}, @{x}, @{y}); );
4237 }
4238
4239 pub fn uniform2iv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, v: T0) where T0: AsTypedArray<'a0, i32> {
4240 js!( @(no_return) @{self}.uniform2iv(@{location}, @{unsafe { v.as_typed_array() }}); );
4241 }
4242
4243 pub fn uniform3f(&self, location: Option<&WebGLUniformLocation>, x: GLfloat, y: GLfloat, z: GLfloat) {
4244 js!( @(no_return) @{self}.uniform3f(@{location}, @{x}, @{y}, @{z}); );
4245 }
4246
4247 pub fn uniform3fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, v: T0) where T0: AsTypedArray<'a0, f32> {
4248 js!( @(no_return) @{self}.uniform3fv(@{location}, @{unsafe { v.as_typed_array() }}); );
4249 }
4250
4251 pub fn uniform3i(&self, location: Option<&WebGLUniformLocation>, x: GLint, y: GLint, z: GLint) {
4252 js!( @(no_return) @{self}.uniform3i(@{location}, @{x}, @{y}, @{z}); );
4253 }
4254
4255 pub fn uniform3iv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, v: T0) where T0: AsTypedArray<'a0, i32> {
4256 js!( @(no_return) @{self}.uniform3iv(@{location}, @{unsafe { v.as_typed_array() }}); );
4257 }
4258
4259 pub fn uniform4f(&self, location: Option<&WebGLUniformLocation>, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat) {
4260 js!( @(no_return) @{self}.uniform4f(@{location}, @{x}, @{y}, @{z}, @{w}); );
4261 }
4262
4263 pub fn uniform4fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, v: T0) where T0: AsTypedArray<'a0, f32> {
4264 js!( @(no_return) @{self}.uniform4fv(@{location}, @{unsafe { v.as_typed_array() }}); );
4265 }
4266
4267 pub fn uniform4i(&self, location: Option<&WebGLUniformLocation>, x: GLint, y: GLint, z: GLint, w: GLint) {
4268 js!( @(no_return) @{self}.uniform4i(@{location}, @{x}, @{y}, @{z}, @{w}); );
4269 }
4270
4271 pub fn uniform4iv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, v: T0) where T0: AsTypedArray<'a0, i32> {
4272 js!( @(no_return) @{self}.uniform4iv(@{location}, @{unsafe { v.as_typed_array() }}); );
4273 }
4274
4275 pub fn uniform_matrix2fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, transpose: GLboolean, value: T0) where T0: AsTypedArray<'a0, f32> {
4276 js!( @(no_return) @{self}.uniformMatrix2fv(@{location}, @{transpose}, @{unsafe { value.as_typed_array() }}); );
4277 }
4278
4279 pub fn uniform_matrix3fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, transpose: GLboolean, value: T0) where T0: AsTypedArray<'a0, f32> {
4280 js!( @(no_return) @{self}.uniformMatrix3fv(@{location}, @{transpose}, @{unsafe { value.as_typed_array() }}); );
4281 }
4282
4283 pub fn uniform_matrix4fv<'a0, T0>(&self, location: Option<&WebGLUniformLocation>, transpose: GLboolean, value: T0) where T0: AsTypedArray<'a0, f32> {
4284 js!( @(no_return) @{self}.uniformMatrix4fv(@{location}, @{transpose}, @{unsafe { value.as_typed_array() }}); );
4285 }
4286
4287 pub fn use_program(&self, program: Option<&WebGLProgram>) {
4288 js!( @(no_return) @{self}.useProgram(@{program}); );
4289 }
4290
4291 pub fn validate_program(&self, program: &WebGLProgram) {
4292 js!( @(no_return) @{self}.validateProgram(@{program}); );
4293 }
4294
4295 pub fn vertex_attrib1f(&self, index: GLuint, x: GLfloat) {
4296 js!( @(no_return) @{self}.vertexAttrib1f(@{index}, @{x}); );
4297 }
4298
4299 pub fn vertex_attrib1fv<'a0, T0>(&self, index: GLuint, values: T0) where T0: AsTypedArray<'a0, f32> {
4300 js!( @(no_return) @{self}.vertexAttrib1fv(@{index}, @{unsafe { values.as_typed_array() }}); );
4301 }
4302
4303 pub fn vertex_attrib2f(&self, index: GLuint, x: GLfloat, y: GLfloat) {
4304 js!( @(no_return) @{self}.vertexAttrib2f(@{index}, @{x}, @{y}); );
4305 }
4306
4307 pub fn vertex_attrib2fv<'a0, T0>(&self, index: GLuint, values: T0) where T0: AsTypedArray<'a0, f32> {
4308 js!( @(no_return) @{self}.vertexAttrib2fv(@{index}, @{unsafe { values.as_typed_array() }}); );
4309 }
4310
4311 pub fn vertex_attrib3f(&self, index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat) {
4312 js!( @(no_return) @{self}.vertexAttrib3f(@{index}, @{x}, @{y}, @{z}); );
4313 }
4314
4315 pub fn vertex_attrib3fv<'a0, T0>(&self, index: GLuint, values: T0) where T0: AsTypedArray<'a0, f32> {
4316 js!( @(no_return) @{self}.vertexAttrib3fv(@{index}, @{unsafe { values.as_typed_array() }}); );
4317 }
4318
4319 pub fn vertex_attrib4f(&self, index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat) {
4320 js!( @(no_return) @{self}.vertexAttrib4f(@{index}, @{x}, @{y}, @{z}, @{w}); );
4321 }
4322
4323 pub fn vertex_attrib4fv<'a0, T0>(&self, index: GLuint, values: T0) where T0: AsTypedArray<'a0, f32> {
4324 js!( @(no_return) @{self}.vertexAttrib4fv(@{index}, @{unsafe { values.as_typed_array() }}); );
4325 }
4326
4327 pub fn vertex_attrib_pointer(&self, index: GLuint, size: GLint, type_: GLenum, normalized: GLboolean, stride: GLsizei, offset: GLintptr) {
4328 js!( @(no_return) @{self}.vertexAttribPointer(@{index}, @{size}, @{type_}, @{normalized}, @{stride}, @{(offset as f64)}); );
4329 }
4330
4331 pub fn viewport(&self, x: GLint, y: GLint, width: GLsizei, height: GLsizei) {
4332 js!( @(no_return) @{self}.viewport(@{x}, @{y}, @{width}, @{height}); );
4333 }
4334}
4335
4336impl RenderingContext for WebGLRenderingContext {
4337 type Error = ConversionError;
4338 fn from_canvas(canvas: &CanvasElement) -> Result<Self, ConversionError> {
4339 js!(
4340 return @{canvas}.getContext("webgl");
4341 ).try_into()
4342 }
4343}
4344
4345
4346#[derive(Debug, Clone, ReferenceType)]
4347#[reference(instance_of = "WebGLSampler")]
4348pub struct WebGLSampler(Reference);
4349
4350impl WebGLSampler {
4351
4352}
4353
4354
4355#[derive(Debug, Clone, ReferenceType)]
4356#[reference(instance_of = "WebGLShader")]
4357pub struct WebGLShader(Reference);
4358
4359impl WebGLShader {
4360
4361}
4362
4363
4364#[derive(Debug, Clone, ReferenceType)]
4365#[reference(instance_of = "WebGLShaderPrecisionFormat")]
4366pub struct WebGLShaderPrecisionFormat(Reference);
4367
4368impl WebGLShaderPrecisionFormat {
4369
4370
4371 pub fn precision(&self) -> GLint {
4372 (js! { return @{self}.precision; } ).try_into().unwrap()
4373 }
4374
4375 pub fn range_max(&self) -> GLint {
4376 (js! { return @{self}.rangeMax; } ).try_into().unwrap()
4377 }
4378
4379 pub fn range_min(&self) -> GLint {
4380 (js! { return @{self}.rangeMin; } ).try_into().unwrap()
4381 }
4382}
4383
4384
4385#[derive(Debug, Clone, ReferenceType)]
4386#[reference(instance_of = "WebGLSync")]
4387pub struct WebGLSync(Reference);
4388
4389impl WebGLSync {
4390
4391}
4392
4393
4394#[derive(Debug, Clone, ReferenceType)]
4395#[reference(instance_of = "WebGLTexture")]
4396pub struct WebGLTexture(Reference);
4397
4398impl WebGLTexture {
4399
4400}
4401
4402
4403#[derive(Debug, Clone, ReferenceType)]
4404#[reference(instance_of = "WebGLTransformFeedback")]
4405pub struct WebGLTransformFeedback(Reference);
4406
4407impl WebGLTransformFeedback {
4408
4409}
4410
4411
4412#[derive(Debug, Clone, ReferenceType)]
4413#[reference(instance_of = "WebGLUniformLocation")]
4414pub struct WebGLUniformLocation(Reference);
4415
4416impl WebGLUniformLocation {
4417
4418}
4419
4420
4421#[derive(Debug, Clone, ReferenceType)]
4422#[reference(instance_of = "WebGLVertexArrayObject")]
4423pub struct WebGLVertexArrayObject(Reference);
4424
4425impl WebGLVertexArrayObject {
4426
4427}
4428