webgl_rs/glenum.rs
1/*
2 Credits to https://github.com/oussama/glenum-rs/ for the major part of these enums
3
4 Extended with wasm_bindgen and webgl2 constants and restructured to allow safety in webgl methods
5
6 Documentation taken from https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants
7*/
8use wasm_bindgen::prelude::*;
9
10/// Constants passed to WebGLRenderingContext.vertexAttribPointer()
11#[wasm_bindgen]
12#[derive(Debug, Clone, Copy)]
13pub enum AttributeSize {
14 One = 1,
15 Two = 2,
16 Three = 3,
17 Four = 4,
18}
19
20/// Constants passed to WebGLRenderingContext.createShader()
21#[wasm_bindgen]
22#[derive(Debug, Clone, Copy)]
23pub enum ShaderKind {
24 /// Passed to createShader to define a fragment shader.
25 Fragment = 0x8B30,
26 /// Passed to createShader to define a vertex shader
27 Vertex = 0x8B31,
28}
29
30///FIXME categorize values elsewhere
31pub enum NotProgramParameter {
32 /// The maximum number of entries possible in the vertex attribute list.
33 MaxVertexAttribs = 0x8869,
34 ///
35 MaxVertexUniformVectors = 0x8DFB,
36 ///
37 MaxVaryingVectors = 0x8DFC,
38 ///
39 MaxCombinedTextureImageUnits = 0x8B4D,
40 ///
41 MaxVertexTextureImageUnits = 0x8B4C,
42 /// Implementation dependent number of maximum texture units. At least 8.
43 MaxTextureImageUnits = 0x8872,
44 ///
45 MaxFragmentUniformVectors = 0x8DFD,
46 ///
47 ShadingLanguageVersion = 0x8B8C,
48 ///
49 CurrentProgram = 0x8B8D,
50}
51
52/// Constants passed to WebGLRenderingContext.getProgramParameter()
53/// TODO decide if im keeping it public or move to shader_program as it is only used internally i think
54#[wasm_bindgen]
55#[derive(Debug, Clone, Copy)]
56pub enum ProgramParameter {
57 /// Passed to getProgramParameter to determine if a shader was deleted via deleteProgram. Returns true if it was, false otherwise.
58 DeleteStatus = 0x8B80,
59 /// Passed to getProgramParameter after calling linkProgram to determine if a program was linked correctly. Returns false if there were errors. Use getProgramInfoLog to find the exact error.
60 LinkStatus = 0x8B82,
61 /// Passed to getProgramParameter after calling validateProgram to determine if it is valid. Returns false if errors were found.
62 ValidateStatus = 0x8B83,
63 /// Passed to getProgramParameter after calling attachShader to determine if the shader was attached correctly. Returns false if errors occurred.
64 AttachedShaders = 0x8B85,
65 /// Passed to getProgramParameter to get the number of attributes active in a program.
66 ActiveAttributes = 0x8B89,
67 /// Passed to getProgramParameter to get the number of uniforms active in a program.
68 ActiveUniforms = 0x8B86,
69 /// Passed to getProgramParameter to get the buffer mode when transform feedback is active.
70 TransformFeedbackBufferMode = 0x8C7F,
71 /// Passed to getProgramParameter to get the number of varying variables to capture in transform feedback mode
72 TransformFeedbackVaryings = 0x8C83,
73 /// Passed to getProgramParameter to get the number of uniform blocks containing active uniforms
74 ActiveUniformBlocks = 0x8A36,
75}
76
77/// Constants passed to WebGLRenderingContext.getShaderParameter()
78/// TODO decide if im keeping it public or move to shader_program as it is only used internally i think
79#[wasm_bindgen]
80#[derive(Debug, Clone, Copy)]
81pub enum ShaderParameter {
82 /// Passed to getShaderParameter to get the status of the compilation. Returns false if the shader was not compiled. You can then query getShaderInfoLog to find the exact error
83 CompileStatus = 0x8B81,
84 /// Passed to getShaderParameter to determine if a shader was deleted via deleteShader. Returns true if it was, false otherwise.
85 DeleteStatus = 0x8B80,
86 /// Passed to getShaderParameter to get the shader type.
87 ShaderType = 0x8B4F,
88}
89
90/// Passed to bindBuffer or bufferData to specify the type of buffer being used.
91#[wasm_bindgen]
92#[derive(Debug, Clone, Copy)]
93pub enum BufferKind {
94 Array = 0x8892,
95 ElementArray = 0x8893,
96 /// Buffer for copying from one buffer object to another.
97 CopyReadBuffer = 0x8F36,
98 /// Buffer for copying from one buffer object to another.
99 CopyWriteBuffer = 0x8F37,
100 /// Buffer for transform feedback operations.
101 TransformFeedbackBuffer = 0x8C8E,
102 /// Buffer used for storing uniform blocks.
103 UniformBuffer = 0x8A11,
104 /// Buffer used for pixel transfer operations.
105 PixelPackBuffer = 0x88EB,
106 /// Buffer used for pixel transfer operations.
107 PixelUnpackBuffer = 0x88EC,
108}
109
110#[wasm_bindgen]
111#[derive(Debug, Clone, Copy)]
112pub enum DataHint {
113 /// Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and not change often.
114 StaticDraw = 0x88E4,
115 /// Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and change often.
116 DynamicDraw = 0x88E8,
117 /// Passed to bufferData as a hint about whether the contents of the buffer are likely to not be used often.
118 StreamDraw = 0x88E0,
119 /// Contents of the buffer are likely to be used often and not change often. Contents are read from the buffer, but not written.
120 StaticRead = 0x88E5,
121 /// Contents of the buffer are likely to be used often and change often. Contents are read from the buffer, but not written.
122 DynamicRead = 0x88E9,
123 /// Contents of the buffer are likely to not be used often. Contents are read from the buffer, but not written.
124 StreamRead = 0x88E1,
125 /// Contents of the buffer are likely to be used often and not change often. Contents are neither written or read by the user.
126 StaticCopy = 0x88E6,
127 /// Contents of the buffer are likely to be used often and change often. Contents are neither written or read by the user.
128 DynamicCopy = 0x88EA,
129 /// Contents of the buffer are likely to be used often and not change often. Contents are neither written or read by the user.
130 StreamCopy = 0x88E2,
131}
132
133#[wasm_bindgen]
134#[derive(Debug, Clone, Copy)]
135pub enum BufferParameter {
136 /// Passed to getBufferParameter to get a buffer's size.
137 Size = 0x8764,
138 /// Passed to getBufferParameter to get the hint for the buffer passed in when it was created.
139 Usage = 0x8765,
140}
141
142#[wasm_bindgen]
143#[derive(Debug, Clone, Copy)]
144pub enum DataType {
145 I8 = 0x1400,
146 U8 = 0x1401,
147 I16 = 0x1402,
148 U16 = 0x1403,
149 I32 = 0x1404,
150 U32 = 0x1405,
151 Float = 0x1406,
152}
153
154#[wasm_bindgen]
155#[derive(Debug, Clone, Copy)]
156pub enum Flag {
157 /// Passed to enable/disable to turn on/off blending. Can also be used with getParameter to find the current blending method.
158 Blend = 0x0BE2,
159 /// Passed to enable/disable to turn on/off culling. Can also be used with getParameter to find the current culling method.
160 CullFace = 0x0B44,
161 /// Passed to enable/disable to turn on/off the depth test. Can also be used with getParameter to query the depth test.
162 DepthTest = 0x0B71,
163 /// Passed to enable/disable to turn on/off dithering. Can also be used with getParameter to find the current dithering method.
164 Dither = 0x0BD0,
165 /// Passed to enable/disable to turn on/off the polygon offset. Useful for rendering hidden-line images, decals, and or solids with highlighted edges. Can also be used with getParameter to query the scissor test.
166 PolygonOffsetFill = 0x8037,
167 /// Passed to enable/disable to turn on/off the alpha to coverage. Used in multi-sampling alpha channels.
168 SampleAlphaToCoverage = 0x809E,
169 /// Passed to enable/disable to turn on/off the sample coverage. Used in multi-sampling.
170 SampleCoverage = 0x80A0,
171 /// Passed to enable/disable to turn on/off the scissor test. Can also be used with getParameter to query the scissor test.
172 ScissorTest = 0x0C11,
173 /// Passed to enable/disable to turn on/off the stencil test. Can also be used with getParameter to query the stencil test.
174 StencilTest = 0x0B90,
175 /// Passed to enable/disable to turn on/off that primitives are discarded immediately before the rasterization stage,
176 /// but after the optional transform feedback stage. gl.clear() commands are ignored.
177 RasterizerDiscard = 0x8C89,
178}
179
180#[wasm_bindgen]
181#[derive(Debug, Clone, Copy)]
182pub enum BufferBit {
183 /// Passed to clear to clear the current depth buffer.
184 Depth = 0x00000100,
185 /// Passed to clear to clear the current stencil buffer.
186 Stencil = 0x00000400,
187 /// Passed to clear to clear the current color buffer.
188 Color = 0x00004000,
189}
190
191/// Passed to drawElements or drawArrays to draw primitives.
192#[wasm_bindgen]
193#[derive(Debug, Clone, Copy)]
194pub enum Primitives {
195 /// Passed to drawElements or drawArrays to draw single points.
196 Points = 0x0000,
197 /// Passed to drawElements or drawArrays to draw lines. Each vertex connects to the one after it.
198 Lines = 0x0001,
199 /// Passed to drawElements or drawArrays to draw lines. Each set of two vertices is treated as a separate line segment.
200 LineLoop = 0x0002,
201 /// Passed to drawElements or drawArrays to draw a connected group of line segments from the first vertex to the last.
202 LineStrip = 0x0003,
203 /// Passed to drawElements or drawArrays to draw triangles. Each set of three vertices creates a separate triangle.
204 Triangles = 0x0004,
205 /// Passed to drawElements or drawArrays to draw a connected group of triangles.
206 TriangleStrip = 0x0005,
207 /// Passed to drawElements or drawArrays to draw a connected group of triangles. Each vertex connects to the previous and the first vertex in the fan.
208 TriangleFan = 0x0006,
209}
210
211/// Constants passed to WebGLRenderingContext.blendFunc() or WebGLRenderingContext.blendFuncSeparate() to specify the blending mode (for both, RBG and alpha, or separately).
212#[wasm_bindgen]
213#[derive(Debug, Clone, Copy)]
214pub enum BlendMode {
215 /// Passed to blendFunc or blendFuncSeparate to turn off a component.
216 Zero = 0,
217 /// Passed to blendFunc or blendFuncSeparate to turn on a component.
218 One = 1,
219 /// Passed to blendFunc or blendFuncSeparate to multiply a component by the source elements color.
220 SrcColor = 0x0300,
221 /// Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source elements color.
222 OneMinusSrcColor = 0x0301,
223 /// Passed to blendFunc or blendFuncSeparate to multiply a component by the source's alpha.
224 SrcAlpha = 0x0302,
225 /// Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source's alpha.
226 OneMinusSrcAlpha = 0x0303,
227 /// Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's alpha.
228 DstAlpha = 0x0304,
229 /// Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's alpha.
230 OneMinusDstAlpha = 0x0305,
231 /// Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's color.
232 DstColor = 0x0306,
233 /// Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's color.
234 OneMinusDstColor = 0x0307,
235 /// Passed to blendFunc or blendFuncSeparate to multiply a component by the minimum of source's alpha or one minus the destination's alpha.
236 SrcAlphaSaturate = 0x0308,
237 /// Passed to blendFunc or blendFuncSeparate to specify a constant color blend function.
238 ConstantColor = 0x8001,
239 /// Passed to blendFunc or blendFuncSeparate to specify one minus a constant color blend function.
240 OneMinusConstantColor = 0x8002,
241 /// Passed to blendFunc or blendFuncSeparate to specify a constant alpha blend function.
242 ConstantAlpha = 0x8003,
243 /// Passed to blendFunc or blendFuncSeparate to specify one minus a constant alpha blend function.
244 OneMinusConstantAlpha = 0x8004,
245}
246
247/// Constants passed to WebGLRenderingContext.blendEquation()
248/// or WebGLRenderingContext.blendEquationSeparate() to control
249/// how the blending is calculated (for both, RBG and alpha, or separately).
250#[wasm_bindgen]
251#[derive(Debug, Clone, Copy)]
252pub enum BlendEquation {
253 /// Passed to blendEquation or blendEquationSeparate to set an addition blend function.
254 FuncAdd = 0x8006,
255 /// Passed to blendEquation or blendEquationSeparate to specify a subtraction blend function (source - destination).
256 FuncSubstract = 0x800A,
257 /// Passed to blendEquation or blendEquationSeparate to specify a reverse subtraction blend function (destination - source).
258 FuncReverseSubtract = 0x800B,
259 /// Minimum of source and destination,
260 Min = 0x8007,
261 /// Maximum of source and destination,
262 Max = 0x8008,
263}
264
265/// Constants passed to WebGLRenderingContext.getParameter() to specify what information to return.
266#[wasm_bindgen]
267#[derive(Debug, Clone, Copy)]
268pub enum Parameter {
269 /// Passed to getParameter to get the current RGB blend function. same as BlendEquationRgb
270 BlendEquation = 0x8009,
271 /// Passed to getParameter to get the current alpha blend function. Same as BLEND_EQUATION
272 BlendEquationAlpha = 0x883D,
273 /// Passed to getParameter to get the current destination RGB blend function.
274 BlendDstRgb = 0x80C8,
275 /// Passed to getParameter to get the current destination RGB blend function.
276 BlendSrcRgb = 0x80C9,
277 /// Passed to getParameter to get the current destination alpha blend function.
278 BlendDstAlpha = 0x80CA,
279 /// Passed to getParameter to get the current source alpha blend function.
280 BlendSrcAlpha = 0x80CB,
281 /// Passed to getParameter to return a the current blend color.
282 BlendColor = 0x8005,
283 /// Passed to getParameter to get the array buffer binding.
284 ArrayBufferBinding = 0x8894,
285 /// Passed to getParameter to get the current element array buffer.
286 ElementArrayBufferBinding = 0x8895,
287 /// Passed to getParameter to get the current lineWidth (set by the lineWidth method).
288 LineWidth = 0x0B21,
289 /// Passed to getParameter to get the current size of a point drawn with gl.POINTS
290 AliasedPointSizeRange = 0x846D,
291 /// Passed to getParameter to get the range of available widths for a line. Returns a length-2 array with the lo value at 0, and hight at 1.
292 AliasedLineWidthRange = 0x846E,
293 /// Passed to getParameter to get the current value of cullFace. Should return FRONT, BACK, or FRONT_AND_BACK
294 CullFaceMode = 0x0B45,
295 /// Passed to getParameter to determine the current value of frontFace. Should return CW or CCW.
296 FrontFace = 0x0B46,
297 /// Passed to getParameter to return a length-2 array of floats giving the current depth range.
298 DepthRange = 0x0B70,
299 /// Passed to getParameter to determine if the depth write mask is enabled.
300 DepthWritemask = 0x0B72,
301 /// Passed to getParameter to determine the current depth clear value.
302 DepthClearValue = 0x0B73,
303 /// Passed to getParameter to get the current depth function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL.
304 DepthFunc = 0x0B74,
305 /// Passed to getParameter to get the value the stencil will be cleared to.
306 StencilClearValue = 0x0B91,
307 /// Passed to getParameter to get the current stencil function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL.
308 StencilFunc = 0x0B92,
309 /// Passed to getParameter to get the current stencil fail function. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP.
310 StencilFail = 0x0B94,
311 /// Passed to getParameter to get the current stencil fail function should the depth buffer test fail. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP.
312 StencilPassDepthFail = 0x0B95,
313 /// Passed to getParameter to get the current stencil fail function should the depth buffer test pass. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP.
314 StencilPassDepthPass = 0x0B96,
315 /// Passed to getParameter to get the reference value used for stencil tests.
316 StencilRef = 0x0B97,
317 ///
318 StencilValueMask = 0x0B93,
319 ///
320 StencilWritemask = 0x0B98,
321 ///
322 StencilBackFunc = 0x8800,
323 ///
324 StencilBackFail = 0x8801,
325 ///
326 StencilBackPassDepthFail = 0x8802,
327 ///
328 StencilBackPassDepthPass = 0x8803,
329 ///
330 StencilBackRef = 0x8CA3,
331 ///
332 StencilBackValueMask = 0x8CA4,
333 ///
334 StencilBackWritemask = 0x8CA5,
335 /// Returns an Int32Array with four elements for the current viewport dimensions.
336 Viewport = 0x0BA2,
337 /// Returns an Int32Array with four elements for the current scissor box dimensions.
338 ScissorBox = 0x0C10,
339 ///
340 ColorClearValue = 0x0C22,
341 ///
342 ColorWritemask = 0x0C23,
343 ///
344 UnpackAlignment = 0x0CF5,
345 ///
346 PackAlignment = 0x0D05,
347 ///
348 MaxTextureSize = 0x0D33,
349 ///
350 MaxViewportDims = 0x0D3A,
351 ///
352 SubpixelBits = 0x0D50,
353 ///
354 RedBits = 0x0D52,
355 ///
356 GreenBits = 0x0D53,
357 ///
358 BlueBits = 0x0D54,
359 ///
360 AlphaBits = 0x0D55,
361 ///
362 DepthBits = 0x0D56,
363 ///
364 StencilBits = 0x0D57,
365 ///
366 PolygonOffsetUnits = 0x2A00,
367 ///
368 PolygonOffsetFactor = 0x8038,
369 ///
370 TextureBinding2d = 0x8069,
371 ///
372 SampleBuffers = 0x80A8,
373 ///
374 Samples = 0x80A9,
375 ///
376 SampleCoverageValue = 0x80AA,
377 ///
378 SampleCoverageInvert = 0x80AB,
379 ///
380 CompressedTextureFormats = 0x86A3,
381 ///
382 Vendor = 0x1F00,
383 ///
384 Renderer = 0x1F01,
385 ///
386 Version = 0x1F02,
387 ///
388 ImplementationColorReadType = 0x8B9A,
389 ///
390 ImplementationColorReadFormat = 0x8B9B,
391 ///
392 BrowserDefaultWebgl = 0x9244,
393
394 ///
395 TextureBindingCubeMap = 0x8514,
396
397 ///
398 MaxCubeMapTextureSize = 0x851C,
399}
400
401/// Constants passed to WebGLRenderingContext.getVertexAttrib().
402#[wasm_bindgen]
403#[derive(Debug, Clone, Copy)]
404pub enum VertexAttrib {
405 /// Passed to getVertexAttrib to read back the current vertex attribute.
406 Current = 0x8626,
407 ///
408 ArrayEnabled = 0x8622,
409 ///
410 ArraySize = 0x8623,
411 ///
412 ArrayStride = 0x8624,
413 ///
414 ArrayType = 0x8625,
415 ///
416 ArrayNormalized = 0x886A,
417 ///
418 ArrayPointer = 0x8645,
419 ///
420 ArrayBufferBinding = 0x889F,
421}
422
423/// Constants passed to WebGLRenderingContext.cullFace().
424#[wasm_bindgen]
425#[derive(Debug, Clone, Copy)]
426pub enum Culling {
427 /// Passed to cullFace to specify that only front faces should be drawn.
428 Front = 0x0404,
429 /// Passed to cullFace to specify that only back faces should be drawn.
430 Back = 0x0405,
431 /// Passed to cullFace to specify that front and back faces should be drawn.
432 FrontAndBack = 0x0408,
433}
434
435/// Constants returned from WebGLRenderingContext.getError().
436#[wasm_bindgen]
437#[derive(Debug, Clone, Copy)]
438pub enum Error {
439 /// Returned from getError.
440 NoError = 0,
441 /// Returned from getError.
442 InvalidEnum = 0x0500,
443 /// Returned from getError.
444 InvalidValue = 0x0501,
445 /// Returned from getError.
446 InvalidOperation = 0x0502,
447 /// Returned from getError.
448 InvalidFramebufferOperation = 0x0506,
449 /// Returned from getError.
450 OutOfMemory = 0x0505,
451 /// Returned from getError.
452 ContextLostWebgl = 0x9242,
453}
454
455/// Constants passed to WebGLRenderingContext.frontFace().
456#[wasm_bindgen]
457#[derive(Debug, Clone, Copy)]
458pub enum FrontFaceDirection {
459 /// Passed to frontFace to specify the front face of a polygon is drawn in the clockwise direction
460 CW = 0x0900,
461 /// Passed to frontFace to specify the front face of a polygon is drawn in the counter clockwise direction
462 CCW = 0x0901,
463}
464
465/// Constants passed to WebGLRenderingContext.depthFunc().
466#[wasm_bindgen]
467#[derive(Debug, Clone, Copy)]
468pub enum DepthTest {
469 /// Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn.
470 Never = 0x0200,
471 /// Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn.
472 Always = 0x0207,
473 /// Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value.
474 Less = 0x0201,
475 /// Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value.
476 Equal = 0x0202,
477 /// Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value.
478 Lequal = 0x0203,
479 /// Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value.
480 Greater = 0x0204,
481 /// Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value.
482 Gequal = 0x0206,
483 /// Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value.
484 Notequal = 0x0205,
485}
486
487/// Constants passed to WebGLRenderingContext.stencilFunc().
488#[wasm_bindgen]
489#[derive(Debug, Clone, Copy)]
490pub enum StencilTest {
491 /// Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn.
492 Never = 0x0200,
493 /// Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn.
494 Always = 0x0207,
495 /// Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value.
496 Less = 0x0201,
497 /// Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value.
498 Equal = 0x0202,
499 /// Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value.
500 Lequal = 0x0203,
501 /// Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value.
502 Greater = 0x0204,
503 /// Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value.
504 Gequal = 0x0206,
505 /// Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value.
506 Notequal = 0x0205,
507}
508
509/// Constants passed to WebGLRenderingContext.stencilOp().
510#[wasm_bindgen]
511#[derive(Debug, Clone, Copy)]
512pub enum StencilAction {
513 Zero = 0,
514 ///
515 Keep = 0x1E00,
516 ///
517 Replace = 0x1E01,
518 ///
519 Incr = 0x1E02,
520 ///
521 Decr = 0x1E03,
522 ///
523 Invert = 0x150A,
524 ///
525 IncrWrap = 0x8507,
526 ///
527 DecrWrap = 0x8508,
528}
529
530#[wasm_bindgen]
531#[derive(Debug, Clone, Copy)]
532pub enum PixelType {
533 ///
534 UnsignedByte = 0x1401,
535 ///
536 UnsignedShort4444 = 0x8033,
537 ///
538 UnsignedShort5551 = 0x8034,
539 ///
540 UnsignedShort565 = 0x8363,
541 ///
542 Float = 0x1406,
543}
544
545#[wasm_bindgen]
546#[derive(Debug, Clone, Copy)]
547pub enum PixelFormat {
548 ///
549 DepthComponent = 0x1902,
550 ///
551 Alpha = 0x1906,
552 ///
553 Rgb = 0x1907,
554 ///
555 Rgba = 0x1908,
556 ///
557 Luminance = 0x1909,
558 ///
559 LuminanceAlpha = 0x190A,
560}
561
562#[wasm_bindgen]
563#[derive(Debug, Clone, Copy)]
564pub enum PixelReadFormat {
565 ///
566 Alpha = 0x1906,
567 ///
568 Rgb = 0x1907,
569 ///
570 Rgba = 0x1908,
571}
572
573#[wasm_bindgen]
574#[derive(Debug, Clone, Copy)]
575pub enum PixelCopyFormat {
576 ///
577 Alpha = 0x1906,
578 ///
579 Rgb = 0x1907,
580 ///
581 Rgba = 0x1908,
582 ///
583 Luminance = 0x1909,
584 ///
585 LuminanceAlpha = 0x190A,
586}
587
588/// Constants passed to WebGLRenderingContext.hint() mode argument
589#[wasm_bindgen]
590#[derive(Debug, Clone, Copy)]
591pub enum HintMode {
592 /// There is no preference for this behavior.
593 DontCare = 0x1100,
594 /// The most efficient behavior should be used.
595 Fastest = 0x1101,
596 /// The most correct or the highest quality option should be used.
597 Nicest = 0x1102,
598}
599
600/// Constants passed to WebGLRenderingContext.hint() target argument
601#[wasm_bindgen]
602#[derive(Debug, Clone, Copy)]
603pub enum HintTarget {
604 /// Hint for the quality of filtering when generating mipmap images with WebGLRenderingContext.generateMipmap().
605 GenerateMipmapHint = 0x8192,
606 /// Accuracy of the derivative calculation for the GLSL built-in functions: dFdx, dFdy, and fwidth.
607 FragmentShaderDerivativeHint = 0x8B8B,
608}
609
610/// WebGLRenderingContext.texParameter[fi]() or WebGLRenderingContext.bindTexture() "target" parameter
611#[wasm_bindgen]
612#[derive(Debug, Clone, Copy)]
613pub enum TextureKind {
614 ///
615 Texture2d = 0x0DE1,
616 ///
617 TextureCubeMap = 0x8513,
618 /// A three-dimensional texture.
619 Texture3d = 0x806F,
620 /// A two-dimensional array texture.
621 Texture2dArray = 0x8C1A,
622}
623
624/// WebGLRenderingContext.texStorage2D() `target` parameter
625#[wasm_bindgen]
626#[derive(Debug, Clone, Copy)]
627pub enum Texture2DKind {
628 ///
629 Texture2d = 0x0DE1,
630 ///
631 TextureCubeMap = 0x8513,
632}
633
634/// WebGLRenderingContext.texStorage3D() `target` parameter
635#[wasm_bindgen]
636#[derive(Debug, Clone, Copy)]
637pub enum Texture3DKind {
638 /// A three-dimensional texture.
639 Texture3d = 0x806F,
640 /// A two-dimensional array texture.
641 Texture2dArray = 0x8C1A,
642}
643
644/// WebGLRenderingContext.texParameter[fi]() "pname" parameter
645#[wasm_bindgen]
646#[derive(Debug, Clone, Copy)]
647pub enum TextureParameter {
648 ///
649 MagFilter = 0x2800,
650 ///
651 MinFilter = 0x2801,
652 ///
653 WrapS = 0x2802,
654 ///
655 WrapT = 0x2803,
656 /// Texture mipmap level
657 BaseLevel = 0x813C,
658 /// Comparison function
659 CompareFunc = 0x884D,
660 /// Texture comparison mode
661 CompareMode = 0x884C,
662 /// Immutability of the texture format and size
663 ImmutableFormat = 0x912F,
664 ///
665 ImmutableLevels = 0x82DF,
666 /// Maximum texture mipmap array level
667 MaxLevel = 0x813D,
668 /// Texture maximum level-of-detail value
669 MaxLod = 0x813B,
670 /// Texture minimum level-of-detail value
671 MinLod = 0x813A,
672 /// gl.TEXTURE_WRAP_R Wrapping function for texture coordinate r
673 WrapR = 0x8072,
674}
675
676/// WebGLRenderingContext.texImage2D() "target" parameter
677#[wasm_bindgen]
678#[derive(Debug, Clone, Copy)]
679pub enum TextureBindPoint {
680 ///
681 Texture2d = 0x0DE1,
682 ///
683 TextureCubeMapPositiveX = 0x8515,
684 ///
685 TextureCubeMapNegativeX = 0x8516,
686 ///
687 TextureCubeMapPositiveY = 0x8517,
688 ///
689 TextureCubeMapNegativeY = 0x8518,
690 ///
691 TextureCubeMapPositiveZ = 0x8519,
692 ///
693 TextureCubeMapNegativeZ = 0x851A,
694}
695
696/// WebGLRenderingContext.texParameter[fi]() "param" parameter
697#[wasm_bindgen]
698#[derive(Debug, Clone, Copy)]
699pub enum TextureMagFilter {
700 ///
701 Nearest = 0x2600,
702 ///
703 Linear = 0x2601,
704}
705
706/// WebGLRenderingContext.texParameter[fi]() "param" parameter
707#[wasm_bindgen]
708#[derive(Debug, Clone, Copy)]
709pub enum TextureMinFilter {
710 ///
711 Nearest = 0x2600,
712 ///
713 Linear = 0x2601,
714 ///
715 NearestMipmapNearest = 0x2700,
716 ///
717 LinearMipmapNearest = 0x2701,
718 ///
719 NearestMipmapLinear = 0x2702,
720 ///
721 LinearMipmapLinear = 0x2703,
722}
723
724/// WebGLRenderingContext.texParameter[fi]() "param" parameter
725#[wasm_bindgen]
726#[derive(Debug, Clone, Copy, PartialEq)]
727pub enum TextureWrap {
728 ///
729 Repeat = 0x2901,
730 ///
731 ClampToEdge = 0x812F,
732 ///
733 MirroredRepeat = 0x8370,
734}
735
736/// Constants passed to WebGLRenderingContext.hint()
737#[wasm_bindgen]
738#[derive(Debug, Clone, Copy)]
739pub enum Buffers {
740 ///
741 Framebuffer = 0x8D40,
742 ///
743 Renderbuffer = 0x8D41,
744 ///
745 Rgba4 = 0x8056,
746 ///
747 Rgb5A1 = 0x8057,
748 ///
749 Rgb565 = 0x8D62,
750 ///
751 DepthComponent16 = 0x81A5,
752 ///
753 StencilIndex = 0x1901,
754 ///
755 StencilIndex8 = 0x8D48,
756 ///
757 DepthStencil = 0x84F9,
758 ///
759 RenderbufferWidth = 0x8D42,
760 ///
761 RenderbufferHeight = 0x8D43,
762 ///
763 RenderbufferInternalFormat = 0x8D44,
764 ///
765 RenderbufferRedSize = 0x8D50,
766 ///
767 RenderbufferGreenSize = 0x8D51,
768 ///
769 RenderbufferBlueSize = 0x8D52,
770 ///
771 RenderbufferAlphaSize = 0x8D53,
772 ///
773 RenderbufferDepthSize = 0x8D54,
774 ///
775 RenderbufferStencilSize = 0x8D55,
776 ///
777 FramebufferAttachmentObjectType = 0x8CD0,
778 ///
779 FramebufferAttachmentObjectName = 0x8CD1,
780 ///
781 FramebufferAttachmentTextureLevel = 0x8CD2,
782 ///
783 FramebufferAttachmentTextureCubeMapFace = 0x8CD3,
784 ///
785 ColorAttachment0 = 0x8CE0,
786 ///
787 DepthAttachment = 0x8D00,
788 ///
789 StencilAttachment = 0x8D20,
790 ///
791 DepthStencilAttachment = 0x821A,
792 ///
793 None = 0,
794 ///
795 FramebufferComplete = 0x8CD5,
796 ///
797 FramebufferIncompleteAttachment = 0x8CD6,
798 ///
799 FramebufferIncompleteMissingAttachment = 0x8CD7,
800 ///
801 FramebufferIncompleteDimensions = 0x8CD9,
802 ///
803 FramebufferUnsupported = 0x8CDD,
804 ///
805 FramebufferBinding = 0x8CA6,
806 ///
807 RenderbufferBinding = 0x8CA7,
808 ///
809 MaxRenderbufferSize = 0x84E8,
810 ///
811 InvalidFramebufferOperation = 0x0506,
812}
813
814/// Constants passed to WebGLRenderingContext.pixelStorei()
815#[wasm_bindgen]
816#[derive(Debug, Clone, Copy)]
817pub enum PixelStorageMode {
818 ///
819 UnpackFlipYWebgl = 0x9240,
820 ///
821 UnpackPremultiplyAlphaWebgl = 0x9241,
822 ///
823 UnpackColorspaceConversionWebgl = 0x9243,
824 /// Packing of pixel data into memory.
825 /// Can be 1, 2, 4, 8 defaults to 4
826 PackAlignment = 0x0D05,
827 /// Unpacking of pixel data from memory
828 /// Can be 1, 2, 4, 8 defaults to 4
829 UnpackAlignment = 0x0CF5,
830 /// Number of pixels in a row.
831 PackRowLength = 0x0D02,
832 /// Number of pixel locations skipped before the first pixel is written into memory.
833 PackSkipPixels = 0x0D04,
834 /// Number of rows of pixel locations skipped before the first pixel is written into memory
835 PackSkipRows = 0x0D03,
836 /// Number of pixels in a row.
837 UnpackRowLength = 0x0CF2,
838 /// Image height used for reading pixel data from memory
839 UnpackImageHeight = 0x806E,
840 /// Number of pixel images skipped before the first pixel is read from memory
841 UnpackSkipPixels = 0x0CF4,
842 /// Number of rows of pixel locations skipped before the first pixel is read from memory
843 UnpackSkipRows = 0x0CF3,
844 /// Number of pixel images skipped before the first pixel is read from memory
845 UnpackSkipImages = 0x806D,
846}
847
848///
849#[wasm_bindgen]
850#[derive(Debug, Clone, Copy)]
851pub enum ShaderPrecision {
852 ///
853 LowFloat = 0x8DF0,
854 ///
855 MediumFloat = 0x8DF1,
856 ///
857 HighFloat = 0x8DF2,
858 ///
859 LowInt = 0x8DF3,
860 ///
861 MediumInt = 0x8DF4,
862 ///
863 HighInt = 0x8DF5,
864}
865
866/// Constants passed to WebGLRenderingContext.hint()
867#[wasm_bindgen]
868#[derive(Debug, Clone, Copy)]
869pub enum UniformType {
870 ///
871 FloatVec2 = 0x8B50,
872 ///
873 FloatVec3 = 0x8B51,
874 ///
875 FloatVec4 = 0x8B52,
876 ///
877 IntVec2 = 0x8B53,
878 ///
879 IntVec3 = 0x8B54,
880 ///
881 IntVec4 = 0x8B55,
882 ///
883 Bool = 0x8B56,
884 ///
885 BoolVec2 = 0x8B57,
886 ///
887 BoolVec3 = 0x8B58,
888 ///
889 BoolVec4 = 0x8B59,
890 ///
891 FloatMat2 = 0x8B5A,
892 ///
893 FloatMat3 = 0x8B5B,
894 ///
895 FloatMat4 = 0x8B5C,
896 ///
897 Sampler2d = 0x8B5E,
898 ///
899 SamplerCube = 0x8B60,
900}
901
902///
903#[wasm_bindgen]
904#[derive(Debug, Clone, Copy)]
905pub enum TextureCompression {
906 /// A DXT1-compressed image in an RGB image format.
907 RgbDxt1 = 0x83F0,
908 /// A DXT1-compressed image in an RGB image format with a simple on/off alpha value.
909 RgbaDxt1 = 0x83F1,
910 /// A DXT3-compressed image in an RGBA image format.
911 /// Compared to a 32-bit RGBA texture, it offers 4:1 compression.
912 RgbaDxt3 = 0x83F2,
913 /// A DXT5-compressed image in an RGBA image format.
914 /// It also provides a 4:1 compression,
915 /// but differs to the DXT3 compression in how the alpha compression is done.
916 RgbaDxt5 = 0x83F3,
917}
918
919/// A texture unit
920#[wasm_bindgen]
921#[derive(Debug, Clone, Copy)]
922pub enum TextureUnit {
923 Texture0 = 0x84C0,
924 Texture1 = 0x84C1,
925 Texture2 = 0x84C2,
926 Texture3 = 0x84C3,
927 Texture4 = 0x84C4,
928 Texture5 = 0x84C5,
929 Texture6 = 0x84C6,
930 Texture7 = 0x84C7,
931 Texture8 = 0x84C8,
932 Texture9 = 0x84C9,
933 Texture10 = 0x84CA,
934 Texture11 = 0x84CB,
935 Texture12 = 0x84CC,
936 Texture13 = 0x84CD,
937 Texture14 = 0x84CE,
938 Texture15 = 0x84CF,
939 Texture16 = 0x84D0,
940 Texture17 = 0x84D1,
941 Texture18 = 0x84D2,
942 Texture19 = 0x84D3,
943 Texture20 = 0x84D4,
944 Texture21 = 0x84D5,
945 Texture22 = 0x84D6,
946 Texture23 = 0x84D7,
947 Texture24 = 0x84D8,
948 Texture25 = 0x84D9,
949 Texture26 = 0x84DA,
950 Texture27 = 0x84DB,
951 Texture28 = 0x84DC,
952 Texture29 = 0x84DD,
953 Texture30 = 0x84DE,
954 Texture31 = 0x84DF,
955}
956
957/// Constants passed to WebGLRenderingContext.bindFramebuffer() and other framebuffer methods
958#[wasm_bindgen]
959#[derive(Debug, Clone, Copy)]
960pub enum FramebufferKind {
961 /// Collection buffer data storage of color, alpha, depth and stencil buffers used to render an image.
962 Framebuffer = 0x8D40,
963 /// Equivalent to `Framebuffer`. Used as a destination for drawing, rendering, clearing, and writing operations.
964 DrawFramebuffer = 0x8CA9,
965 /// Used as a source for reading operations.
966 ReadFramebuffer = 0x8CA8,
967}
968
969/// Constants passed to `WebGLRenderingContext.checkFramebufferStatus()`
970#[wasm_bindgen]
971#[derive(Debug, Clone, Copy)]
972pub enum FramebufferStatus {
973 /// The framebuffer is ready to display.
974 FramebufferComplete = 0x8CD5,
975 /// The attachment types are mismatched or not all framebuffer attachment points are framebuffer attachment complete.
976 FramebufferIncompleteAttachment = 0x8CD6,
977 /// There is no attachment.
978 FramebufferIncompleteMissingAttachment = 0x8CD7,
979 /// Height and width of the attachment are not the same.
980 FramebufferIncompleteDimensions = 0x8CD9,
981 /// The format of the attachment is not supported or if depth and stencil attachments are not the same renderbuffer.
982 FramebufferUnsupported = 0x8CDD,
983 /// The values of gl.RENDERBUFFER_SAMPLES are different among attached renderbuffers, or are non-zero if the
984 /// attached images are a mix of renderbuffers and textures.
985 FramebufferIncompleteMultisample = 0x8D56,
986}
987
988/// Constants passed to `WebGLRenderingContext.framebufferRenderbuffer()`
989#[wasm_bindgen]
990#[derive(Debug, Clone, Copy)]
991pub enum RenderbufferKind {
992 /// Buffer data storage for single images in a renderable internal format.
993 Renderbuffer = 0x8D41,
994}
995
996/// Constants passed to `WebGLRenderingContext.framebufferRenderbuffer()`
997#[wasm_bindgen]
998#[derive(Debug, Clone, Copy)]
999pub enum Attachment {
1000 /// color buffer.
1001 ColorAttachment0 = 0x8CE0,
1002 /// depth buffer.
1003 DepthAttachment = 0x8D00,
1004 /// stencil buffer.
1005 StencilAttachment = 0x8D20,
1006 /// depth and stencil buffer.
1007 DepthStencilAttachment = 0x821A,
1008 ColorAttachment1 = 0x8CE1,
1009 ColorAttachment2 = 0x8CE2,
1010 ColorAttachment3 = 0x8CE3,
1011 ColorAttachment4 = 0x8CE4,
1012 ColorAttachment5 = 0x8CE5,
1013 ColorAttachment6 = 0x8CE6,
1014 ColorAttachment7 = 0x8CE7,
1015 ColorAttachment8 = 0x8CE8,
1016 ColorAttachment9 = 0x8CE9,
1017 ColorAttachment10 = 0x8CEA,
1018 ColorAttachment11 = 0x8CEB,
1019 ColorAttachment12 = 0x8CEC,
1020 ColorAttachment13 = 0x8CED,
1021 ColorAttachment14 = 0x8CEE,
1022 ColorAttachment15 = 0x8CEF,
1023}
1024
1025/// Constants passed to `WebGLRenderingContext.getRenderbufferParameter()`
1026#[wasm_bindgen]
1027#[derive(Debug, Clone, Copy)]
1028pub enum RenderbufferParameter {
1029 /// Returns a GLint indicating the width of the image of the currently bound renderbuffer.
1030 Width = 0x8D42,
1031 /// Returns a GLint indicating the height of the image of the currently bound renderbuffer.
1032 Height = 0x8D43,
1033 /// Returns a GLint that is the resolution size (in bits) for the green color.
1034 GreenSize = 0x8D51,
1035 /// Returns a GLint that is the resolution size (in bits) for the blue color.
1036 BlueSize = 0x8D52,
1037 /// Returns a GLint that is the resolution size (in bits) for the red color.
1038 RedSize = 0x8D50,
1039 /// Returns a GLint that is the resolution size (in bits) for the alpha component.
1040 AlphaSize = 0x8D53,
1041 /// Returns a GLint that is the resolution size (in bits) for the depth component.
1042 DepthSize = 0x8D54,
1043 /// Returns a GLint that is the resolution size (in bits) for the stencil component.
1044 StencilSize = 0x8D55,
1045 /// Returns a GLint indicating the number of samples of the image of the currently bound renderbuffer.
1046 Samples = 0x8CAB,
1047 Format = 0x8D44,
1048}
1049
1050// TODO extend with https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/renderbufferStorage
1051/// Constants returned from `WebGLRenderingContext.getRenderbufferParameter()`
1052#[wasm_bindgen]
1053#[derive(Debug, Clone, Copy)]
1054pub enum RenderbufferFormat {
1055 /// 4 red bits, 4 green bits, 4 blue bits 4 alpha bits.
1056 Rgba4 = 0x8056,
1057 /// 5 red bits, 6 green bits, 5 blue bits.
1058 Rgb565 = 0x8D62,
1059 /// 5 red bits, 5 green bits, 5 blue bits, 1 alpha bit.
1060 Rgb5A1 = 0x8057,
1061 /// 16 depth bits.
1062 DepthComponent16 = 0x81A5,
1063 /// 8 stencil bits.
1064 StencilIndex8 = 0x8D48,
1065}
1066
1067/// Constants passed to vertexAttribPointer
1068#[wasm_bindgen]
1069#[derive(Debug, Clone, Copy)]
1070pub enum AttributeType {
1071 /// signed 8-bit integer, with values in [-128, 127]
1072 Byte = 0x1400,
1073 /// signed 16-bit integer, with values in [-32768, 32767]
1074 Short = 0x1402,
1075 /// unsigned 8-bit integer, with values in [0, 255]
1076 UnsignedByte = 0x1401,
1077 /// unsigned 16-bit integer, with values in [0, 65535]
1078 UnsignedShort = 0x1403,
1079 /// 32-bit IEEE floating point number
1080 Float = 0x1406,
1081 /// 16-bit IEEE floating point number
1082 HalfFloat = 0x140B,
1083}
1084
1085/// Constants passed to readBuffer
1086#[wasm_bindgen]
1087#[derive(Debug, Clone, Copy)]
1088pub enum ColorBuffer {
1089 None = 0,
1090 Back = 0x0405,
1091 /// color buffer.
1092 ColorAttachment0 = 0x8CE0,
1093 ColorAttachment1 = 0x8CE1,
1094 ColorAttachment2 = 0x8CE2,
1095 ColorAttachment3 = 0x8CE3,
1096 ColorAttachment4 = 0x8CE4,
1097 ColorAttachment5 = 0x8CE5,
1098 ColorAttachment6 = 0x8CE6,
1099 ColorAttachment7 = 0x8CE7,
1100 ColorAttachment8 = 0x8CE8,
1101 ColorAttachment9 = 0x8CE9,
1102 ColorAttachment10 = 0x8CEA,
1103 ColorAttachment11 = 0x8CEB,
1104 ColorAttachment12 = 0x8CEC,
1105 ColorAttachment13 = 0x8CED,
1106 ColorAttachment14 = 0x8CEE,
1107 ColorAttachment15 = 0x8CEF,
1108}
1109
1110/// Constants passed to getInternalformatParameter
1111#[wasm_bindgen]
1112#[derive(Debug, Clone, Copy)]
1113pub enum InformationType {
1114 /// Returns a Int32Array containing sample counts supported for internalformat in descending order.
1115 Samples = 0x80A9,
1116}
1117
1118/// Constants passed to beginQuery
1119#[wasm_bindgen]
1120#[derive(Debug, Clone, Copy)]
1121pub enum QueryTarget {
1122 /// Specifies an occlusion query: these queries detect whether an object is visible (whether the scoped drawing commands pass the depth test and if so, how many samples pass).
1123 AnySamplesPassed = 0x8C2F,
1124 /// Same as above above, but less accurate and faster version.
1125 AnySamplesPassedConservative = 0x8D6A,
1126 /// Number of primitives that are written to transform feedback buffers.
1127 TransformFeedbackPrimitivesWritten = 0x8C88,
1128}
1129
1130/// Constants passed to getQuery
1131#[wasm_bindgen]
1132#[derive(Debug, Clone, Copy)]
1133pub enum Query {
1134 Current = 0x8865,
1135}
1136
1137/// Constants passed to getQueryParameter
1138#[wasm_bindgen]
1139#[derive(Debug, Clone, Copy)]
1140pub enum QueryParameter {
1141 Result = 0x8866,
1142 ResultAvailable = 0x8867,
1143}
1144
1145/// Constants passed to fenceSync
1146#[wasm_bindgen]
1147#[derive(Debug, Clone, Copy)]
1148pub enum GPUState {
1149 CommandsComplete = 0x9117,
1150}
1151
1152/// Constants passed to clientWaitSync
1153#[wasm_bindgen]
1154#[derive(Debug, Clone, Copy)]
1155pub enum WaitStatus {
1156 /// Indicates that the sync object was signaled when this method was called.
1157 AlreadySignaled = 0x911A,
1158 /// Indicates that the timeout time passed and that the sync object did not become signaled.
1159 TimeoutExpired = 0x911B,
1160 /// Indicates that the sync object was signaled before the timeout expired.
1161 ConditionSatisfied = 0x911C,
1162 /// Indicates that an error occurred during the execution.
1163 WaitFailed = 0x911D,
1164}
1165
1166#[wasm_bindgen]
1167#[derive(Debug, Clone, Copy)]
1168pub enum SyncStatus {
1169 Signaled = 0x9119,
1170 Unsignaled = 0x9118,
1171}
1172
1173/// Constants passed to getSyncParameter
1174#[wasm_bindgen]
1175#[derive(Debug, Clone, Copy)]
1176pub enum SyncParameter {
1177 Type = 0x9112,
1178 Status = 0x9114,
1179 Condition = 0x9113,
1180 Flags = 0x9115,
1181}
1182
1183/// Constants passed to bindTransformFeedback
1184#[wasm_bindgen]
1185#[derive(Debug, Clone, Copy)]
1186pub enum TransformFeedback {
1187 TransformFeedback = 0x8E22,
1188}
1189
1190/// Passed to beginTransformFeedback.
1191#[wasm_bindgen]
1192#[derive(Debug, Clone, Copy)]
1193pub enum TransformFeedbackMode {
1194 /// Passed to drawElements or drawArrays to draw single points.
1195 Points = 0x0000,
1196 /// Passed to drawElements or drawArrays to draw lines. Each vertex connects to the one after it.
1197 Lines = 0x0001,
1198 /// Passed to drawElements or drawArrays to draw triangles. Each set of three vertices creates a separate triangle.
1199 Triangles = 0x0004,
1200}
1201
1202/// Passed to transformFeedbackVaryings.
1203#[wasm_bindgen]
1204#[derive(Debug, Clone, Copy)]
1205pub enum TransformFeedbackBufferMode {
1206 InterleavedAttribs = 0x8C8C,
1207 SeparateAttribs = 0x8C8D,
1208}
1209
1210/// Passed to bindBufferBase
1211#[wasm_bindgen]
1212#[derive(Debug, Clone, Copy)]
1213pub enum BufferBase {
1214 /// Buffer for transform feedback operations.
1215 TransformFeedbackBuffer = 0x8C8E,
1216 /// Buffer used for storing uniform blocks.
1217 UniformBuffer = 0x8A11,
1218}
1219
1220#[wasm_bindgen]
1221#[derive(Debug, Clone, Copy)]
1222pub enum CompareMode {
1223 None = 0,
1224 CompareRefToTexture = 0x884E,
1225}