glenum/lib.rs
1/*
2 Documentation taken from https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants
3*/
4
5extern crate serde;
6#[macro_use]
7extern crate serde_derive;
8
9
10/// Constants passed to WebGLRenderingContext.vertexAttribPointer()
11#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
12pub enum AttributeSize {
13 One = 1,
14 Two = 2,
15 Three = 3,
16 Four = 4
17}
18
19/// Constants passed to WebGLRenderingContext.createShader()
20#[derive(Debug, Clone, Copy)]
21pub enum ShaderKind {
22 /// Passed to createShader to define a fragment shader.
23 Fragment = 0x8B30,
24 /// Passed to createShader to define a vertex shader
25 Vertex = 0x8B31,
26}
27
28/// Constants passed to WebGLRenderingContext.createShader()
29#[derive(Debug, Clone, Copy)]
30pub enum ShaderParameter {
31 /// Passed to getShaderParamter 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
32 CompileStatus = 0x8B81,
33 /// Passed to getShaderParamter to determine if a shader was deleted via deleteShader. Returns true if it was, false otherwise.
34 DeleteStatus = 0x8B80,
35 /// 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.
36 LinkStatus = 0x8B82,
37 /// Passed to getProgramParameter after calling validateProgram to determine if it is valid. Returns false if errors were found.
38 ValidateStatus = 0x8B83,
39 /// Passed to getProgramParameter after calling attachShader to determine if the shader was attached correctly. Returns false if errors occurred.
40 AttachedShaders = 0x8B85,
41 /// Passed to getProgramParameter to get the number of attributes active in a program.
42 ActiveAttributes = 0x8B89,
43 /// Passed to getProgramParamter to get the number of uniforms active in a program.
44 ActiveUniforms = 0x8B86,
45 /// The maximum number of entries possible in the vertex attribute list.
46 MaxVertexAttribs = 0x8869,
47 ///
48 MaxVertexUniformVectors = 0x8DFB,
49 ///
50 MaxVaryingVectors = 0x8DFC,
51 ///
52 MaxCombinedTextureImageUnits = 0x8B4D,
53 ///
54 MaxVertexTextureImageUnits = 0x8B4C,
55 /// Implementation dependent number of maximum texture units. At least 8.
56 MaxTextureImageUnits = 0x8872,
57 ///
58 MaxFragmentUniformVectors = 0x8DFD,
59 ///
60 ShaderType = 0x8B4F,
61 ///
62 ShadingLanguageVersion = 0x8B8C,
63 ///
64 CurrentProgram = 0x8B8D,
65}
66
67
68
69
70
71/// Passed to bindBuffer or bufferData to specify the type of buffer being used.
72#[derive(Debug, Clone, Copy)]
73pub enum BufferKind {
74 Array = 0x8892,
75 ElementArray = 0x8893,
76}
77
78#[derive(Debug, Clone, Copy)]
79pub enum DrawMode {
80 /// Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and not change often.
81 Static = 0x88E4,
82 /// Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and change often.
83 Dynamic = 0x88E8,
84 /// Passed to bufferData as a hint about whether the contents of the buffer are likely to not be used often.
85 Stream = 0x88E0,
86}
87
88#[derive(Debug, Clone, Copy)]
89pub enum BufferParameter {
90 /// Passed to getBufferParameter to get a buffer's size.
91 Size = 0x8764,
92 /// Passed to getBufferParameter to get the hint for the buffer passed in when it was created.
93 Usage = 0x8765,
94}
95
96#[derive(Debug,Clone, Copy, Serialize, Deserialize)]
97pub enum DataType {
98 I8 = 0x1400,
99 U8 = 0x1401,
100 I16 = 0x1402,
101 U16 = 0x1403,
102 I32 = 0x1404,
103 U32 = 0x1405,
104 Float = 0x1406,
105}
106
107#[derive(Debug,Clone, Copy)]
108pub enum Flag {
109 /// Passed to enable/disable to turn on/off blending. Can also be used with getParameter to find the current blending method.
110 Blend = 0x0BE2,
111 /// Passed to enable/disable to turn on/off the depth test. Can also be used with getParameter to query the depth test.
112 DepthTest = 0x0B71,
113 /// Passed to enable/disable to turn on/off dithering. Can also be used with getParameter to find the current dithering method.
114 Dither = 0x0BD0,
115 /// 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.
116 PolygonOffsetFill = 0x8037,
117 /// Passed to enable/disable to turn on/off the alpha to coverage. Used in multi-sampling alpha channels.
118 SampleAlphaToCoverage = 0x809E,
119 /// Passed to enable/disable to turn on/off the sample coverage. Used in multi-sampling.
120 SampleCoverage = 0x80A0,
121 /// Passed to enable/disable to turn on/off the scissor test. Can also be used with getParameter to query the scissor test.
122 ScissorTest = 0x0C11,
123 /// Passed to enable/disable to turn on/off the stencil test. Can also be used with getParameter to query the stencil test.
124 StencilTest = 0x0B90,
125}
126
127#[derive(Debug,Clone, Copy)]
128pub enum BufferBit {
129 /// Passed to clear to clear the current depth buffer.
130 Depth = 0x00000100,
131 /// Passed to clear to clear the current stencil buffer.
132 Stencil = 0x00000400,
133 /// Passed to clear to clear the current color buffer.
134 Color = 0x00004000,
135}
136
137/// Passed to drawElements or drawArrays to draw primitives.
138#[derive(Debug,Clone, Copy)]
139pub enum Primitives {
140 /// Passed to drawElements or drawArrays to draw single points.
141 Points = 0x0000,
142 /// Passed to drawElements or drawArrays to draw lines. Each vertex connects to the one after it.
143 Lines = 0x0001,
144 /// Passed to drawElements or drawArrays to draw lines. Each set of two vertices is treated as a separate line segment.
145 LineLoop = 0x0002,
146 /// Passed to drawElements or drawArrays to draw a connected group of line segments from the first vertex to the last.
147 LineStrip = 0x0003,
148 /// Passed to drawElements or drawArrays to draw triangles. Each set of three vertices creates a separate triangle.
149 Triangles = 0x0004,
150 /// Passed to drawElements or drawArrays to draw a connected group of triangles.
151 TriangleStrip = 0x0005,
152 /// 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.
153 TriangleFan = 0x0006,
154}
155
156
157/// Constants passed to WebGLRenderingContext.blendFunc() or WebGLRenderingContext.blendFuncSeparate() to specify the blending mode (for both, RBG and alpha, or separately).
158#[derive(Debug,Clone, Copy)]
159pub enum BlendMode {
160 /// Passed to blendFunc or blendFuncSeparate to turn off a component.
161 Zero = 0,
162 /// Passed to blendFunc or blendFuncSeparate to turn on a component.
163 One = 1,
164 /// Passed to blendFunc or blendFuncSeparate to multiply a component by the source elements color.
165 SrcColor = 0x0300,
166 /// Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source elements color.
167 OneMinusSrcColor = 0x0301,
168 /// Passed to blendFunc or blendFuncSeparate to multiply a component by the source's alpha.
169 SrcAlpha = 0x0302,
170 /// Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the source's alpha.
171 OneMinusSrcAlpha = 0x0303,
172 /// Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's alpha.
173 DstAlpha = 0x0304,
174 /// Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's alpha.
175 OneMinusDstAlpha = 0x0305,
176 /// Passed to blendFunc or blendFuncSeparate to multiply a component by the destination's color.
177 DstColor = 0x0306,
178 /// Passed to blendFunc or blendFuncSeparate to multiply a component by one minus the destination's color.
179 OneMinusDstColor = 0x0307,
180 /// Passed to blendFunc or blendFuncSeparate to multiply a component by the minimum of source's alpha or one minus the destination's alpha.
181 SrcAlphaSaturate = 0x0308,
182 /// Passed to blendFunc or blendFuncSeparate to specify a constant color blend function.
183 ConstantColor = 0x8001,
184 /// Passed to blendFunc or blendFuncSeparate to specify one minus a constant color blend function.
185 OneMinusConstantColor = 0x8002,
186 /// Passed to blendFunc or blendFuncSeparate to specify a constant alpha blend function.
187 ConstantAlpha = 0x8003,
188 /// Passed to blendFunc or blendFuncSeparate to specify one minus a constant alpha blend function.
189 OneMinusConstantAlpha = 0x8004,
190}
191
192/// Constants passed to WebGLRenderingContext.blendEquation()
193/// or WebGLRenderingContext.blendEquationSeparate() to control
194/// how the blending is calculated (for both, RBG and alpha, or separately).
195#[derive(Debug,Clone, Copy)]
196pub enum BlendEquation {
197 /// Passed to blendEquation or blendEquationSeparate to set an addition blend function.
198 FuncAdd = 0x8006,
199 /// Passed to blendEquation or blendEquationSeparate to specify a subtraction blend function (source - destination).
200 FuncSubstract = 0x800A,
201 /// Passed to blendEquation or blendEquationSeparate to specify a reverse subtraction blend function (destination - source).
202 FuncReverseSubtract = 0x800B,
203}
204
205
206/// Constants passed to WebGLRenderingContext.getParameter() to specify what information to return.
207#[derive(Debug,Clone, Copy)]
208pub enum Parameter {
209 /// Passed to getParameter to get the current RGB blend function. same as BlendEquationRgb
210 BlendEquation = 0x8009,
211 /// Passed to getParameter to get the current alpha blend function. Same as BLEND_EQUATION
212 BlendEquationAlpha = 0x883D,
213 /// Passed to getParameter to get the current destination RGB blend function.
214 BlendDstRgb = 0x80C8,
215 /// Passed to getParameter to get the current destination RGB blend function.
216 BlendSrcRgb = 0x80C9,
217 /// Passed to getParameter to get the current destination alpha blend function.
218 BlendDstAlpha = 0x80CA,
219 /// Passed to getParameter to get the current source alpha blend function.
220 BlendSrcAlpha = 0x80CB,
221 /// Passed to getParameter to return a the current blend color.
222 BlendColor = 0x8005,
223 /// Passed to getParameter to get the array buffer binding.
224 ArrayBufferBinding = 0x8894,
225 /// Passed to getParameter to get the current element array buffer.
226 ElementArrayBufferBinding = 0x8895,
227 /// Passed to getParameter to get the current lineWidth (set by the lineWidth method).
228 LineWidth = 0x0B21,
229 /// Passed to getParameter to get the current size of a point drawn with gl.POINTS
230 AliasedPointSizeRange = 0x846D,
231 /// 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.
232 AliasedLineWidthRange = 0x846E,
233 /// Passed to getParameter to get the current value of cullFace. Should return FRONT, BACK, or FRONT_AND_BACK
234 CullFaceMode = 0x0B45,
235 /// Passed to getParameter to determine the current value of frontFace. Should return CW or CCW.
236 FrontFace = 0x0B46,
237 /// Passed to getParameter to return a length-2 array of floats giving the current depth range.
238 DepthRange = 0x0B70,
239 /// Passed to getParameter to determine if the depth write mask is enabled.
240 DepthWritemask = 0x0B72,
241 /// Passed to getParameter to determine the current depth clear value.
242 DepthClearValue = 0x0B73,
243 /// Passed to getParameter to get the current depth function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL.
244 DepthFunc = 0x0B74,
245 /// Passed to getParameter to get the value the stencil will be cleared to.
246 StencilClearValue = 0x0B91,
247 /// Passed to getParameter to get the current stencil function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL.
248 StencilFunc = 0x0B92,
249 /// Passed to getParameter to get the current stencil fail function. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP.
250 StencilFail = 0x0B94,
251 /// 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.
252 StencilPassDepthFail = 0x0B95,
253 /// 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.
254 StencilPassDepthPass = 0x0B96,
255 /// Passed to getParameter to get the reference value used for stencil tests.
256 StencilRef = 0x0B97,
257 ///
258 StencilValueMask = 0x0B93,
259 ///
260 StencilWritemask = 0x0B98,
261 ///
262 StencilBackFunc = 0x8800,
263 ///
264 StencilBackFail = 0x8801,
265 ///
266 StencilBackPassDepthFail = 0x8802,
267 ///
268 StencilBackPassDepthPass = 0x8803,
269 ///
270 StencilBackRef = 0x8CA3,
271 ///
272 StencilBackValueMask = 0x8CA4,
273 ///
274 StencilBackWritemask = 0x8CA5,
275 /// Returns an Int32Array with four elements for the current viewport dimensions.
276 Viewport = 0x0BA2,
277 /// Returns an Int32Array with four elements for the current scissor box dimensions.
278 ScissorBox = 0x0C10,
279 ///
280 ColorClearValue = 0x0C22,
281 ///
282 ColorWritemask = 0x0C23,
283 ///
284 UnpackAlignment = 0x0CF5,
285 ///
286 PackAlignment = 0x0D05,
287 ///
288 MaxTextureSize = 0x0D33,
289 ///
290 MaxViewportDims = 0x0D3A,
291 ///
292 SubpixelBits = 0x0D50,
293 ///
294 RedBits = 0x0D52,
295 ///
296 GreenBits = 0x0D53,
297 ///
298 BlueBits = 0x0D54,
299 ///
300 AlphaBits = 0x0D55,
301 ///
302 DepthBits = 0x0D56,
303 ///
304 StencilBits = 0x0D57,
305 ///
306 PolygonOffsetUnits = 0x2A00,
307 ///
308 PolygonOffsetFactor = 0x8038,
309 ///
310 TextureBinding2d = 0x8069,
311 ///
312 SampleBuffers = 0x80A8,
313 ///
314 Samples = 0x80A9,
315 ///
316 SampleCoverageValue = 0x80AA,
317 ///
318 SampleCoverageInvert = 0x80AB,
319 ///
320 CompressedTextureFormats = 0x86A3,
321 ///
322 Vendor = 0x1F00,
323 ///
324 Renderer = 0x1F01,
325 ///
326 Version = 0x1F02,
327 ///
328 ImplementationColorReadType = 0x8B9A,
329 ///
330 ImplementationColorReadFormat = 0x8B9B,
331 ///
332 BrowserDefaultWebgl = 0x9244,
333
334 ///
335 TextureBindingCubeMap = 0x8514,
336
337 ///
338 MaxCubeMapTextureSize = 0x851C,
339}
340
341
342/// Constants passed to WebGLRenderingContext.getVertexAttrib().
343#[derive(Debug, Clone, Copy)]
344pub enum VertexAttrib {
345 /// Passed to getVertexAttrib to read back the current vertex attribute.
346 Current = 0x8626,
347 ///
348 ArrayEnabled = 0x8622,
349 ///
350 ArraySize = 0x8623,
351 ///
352 ArrayStride = 0x8624,
353 ///
354 ArrayType = 0x8625,
355 ///
356 ArrayNormalized = 0x886A,
357 ///
358 ArrayPointer = 0x8645,
359 ///
360 ArrayBufferBinding = 0x889F,
361}
362
363
364/// Constants passed to WebGLRenderingContext.cullFace().
365#[derive(Debug, Clone, Copy)]
366pub enum Culling {
367 /// Passed to enable/disable to turn on/off culling. Can also be used with getParameter to find the current culling method.
368 CullFace = 0x0B44,
369 /// Passed to cullFace to specify that only front faces should be drawn.
370 Front = 0x0404,
371 /// Passed to cullFace to specify that only back faces should be drawn.
372 Back = 0x0405,
373 /// Passed to cullFace to specify that front and back faces should be drawn.
374 FrontAndBack = 0x0408,
375}
376
377
378/// Constants returned from WebGLRenderingContext.getError().
379#[derive(Debug, Clone, Copy)]
380pub enum Error {
381 /// Returned from getError.
382 NoError = 0,
383 /// Returned from getError.
384 InvalidEnum = 0x0500,
385 /// Returned from getError.
386 InvalidValue = 0x0501,
387 /// Returned from getError.
388 InvalidOperation = 0x0502,
389 /// Returned from getError.
390 OutOfMemory = 0x0505,
391 /// Returned from getError.
392 ContextLostWebgl = 0x9242,
393}
394
395/// Constants passed to WebGLRenderingContext.frontFace().
396#[derive(Debug, Clone,Copy)]
397pub enum FrontFaceDirection {
398 /// Passed to frontFace to specify the front face of a polygon is drawn in the clockwise direction
399 CW = 0x0900,
400 /// Passed to frontFace to specify the front face of a polygon is drawn in the counter clockwise direction
401 CCW = 0x0901,
402}
403
404
405/// Constants passed to WebGLRenderingContext.depthFunc().
406#[derive(Debug,Clone, Copy)]
407pub enum DepthTest {
408 /// Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn.
409 Never = 0x0200,
410 /// 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.
411 Always = 0x0207,
412 /// Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value.
413 Less = 0x0201,
414 /// Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value.
415 Equal = 0x0202,
416 /// 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.
417 Lequal = 0x0203,
418 /// Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value.
419 Greater = 0x0204,
420 /// 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.
421 Gequal = 0x0206,
422 /// 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.
423 Notequal = 0x0205,
424}
425
426/// Constants passed to WebGLRenderingContext.stencilFunc().
427#[derive(Debug, Clone,Copy)]
428pub enum StencilTest {
429 /// Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn.
430 Never = 0x0200,
431 /// 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.
432 Always = 0x0207,
433 /// Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value.
434 Less = 0x0201,
435 /// Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value.
436 Equal = 0x0202,
437 /// 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.
438 Lequal = 0x0203,
439 /// Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value.
440 Greater = 0x0204,
441 /// 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.
442 Gequal = 0x0206,
443 /// 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.
444 Notequal = 0x0205,
445}
446
447
448/// Constants passed to WebGLRenderingContext.stencilOp().
449#[derive(Debug, Clone, Copy)]
450pub enum StencilAction {
451 ///
452 Keep = 0x1E00,
453 ///
454 Replace = 0x1E01,
455 ///
456 Incr = 0x1E02,
457 ///
458 Decr = 0x1E03,
459 ///
460 Invert = 0x150A,
461 ///
462 IncrWrap = 0x8507,
463 ///
464 DecrWrap = 0x8508,
465}
466
467
468
469#[derive(Debug, Clone, Copy)]
470pub enum PixelType {
471 ///
472 UnsignedByte = 0x1401,
473 ///
474 UnsignedShort4444 = 0x8033,
475 ///
476 UnsignedShort5551 = 0x8034,
477 ///
478 UnsignedShort565 = 0x8363,
479}
480
481
482
483#[derive(Debug, Clone, Copy)]
484pub enum PixelFormat {
485 ///
486 DepthComponent = 0x1902,
487 ///
488 Alpha = 0x1906,
489 ///
490 Rgb = 0x1907,
491 ///
492 Rgba = 0x1908,
493 ///
494 Luminance = 0x1909,
495 ///
496 LuminanceAlpha = 0x190A,
497}
498
499
500/// Constants passed to WebGLRenderingContext.hint()
501#[derive(Debug, Clone, Copy)]
502pub enum Hint {
503 /// There is no preference for this behavior.
504 DontCare = 0x1100,
505 /// The most efficient behavior should be used.
506 Fastest = 0x1101,
507 /// The most correct or the highest quality option should be used.
508 Nicest = 0x1102,
509 /// Hint for the quality of filtering when generating mipmap images with WebGLRenderingContext.generateMipmap().
510 GenerateMipmapHint = 0x8192,
511}
512
513/// WebGLRenderingContext.texParameter[fi]() or WebGLRenderingContext.bindTexture() "target" parameter
514#[derive(Debug, Clone, Copy)]
515pub enum TextureKind {
516 ///
517 Texture2d = 0x0DE1,
518 ///
519 TextureCubeMap = 0x8513,
520}
521
522/// WebGLRenderingContext.texParameter[fi]() "pname" parameter
523#[derive(Debug, Clone, Copy)]
524pub enum TextureParameter {
525 ///
526 TextureMagFilter = 0x2800,
527 ///
528 TextureMinFilter = 0x2801,
529 ///
530 TextureWrapS = 0x2802,
531 ///
532 TextureWrapT = 0x2803,
533 ///
534 BorderColor = 0x1004
535}
536
537
538/// WebGLRenderingContext.texImage2D() "target" parameter
539#[derive(Debug, Clone, Copy)]
540pub enum TextureBindPoint {
541 ///
542 Texture2d = 0x0DE1,
543 ///
544 TextureCubeMapPositiveX = 0x8515,
545 ///
546 TextureCubeMapNegativeX = 0x8516,
547 ///
548 TextureCubeMapPositiveY = 0x8517,
549 ///
550 TextureCubeMapNegativeY = 0x8518,
551 ///
552 TextureCubeMapPositiveZ = 0x8519,
553 ///
554 TextureCubeMapNegativeZ = 0x851A,
555}
556
557/// WebGLRenderingContext.texParameter[fi]() "param" parameter
558#[derive(Debug, Clone, Copy)]
559pub enum TextureMagFilter {
560 ///
561 Nearest = 0x2600,
562 ///
563 Linear = 0x2601,
564}
565
566/// WebGLRenderingContext.texParameter[fi]() "param" parameter
567#[derive(Debug, Clone, Copy)]
568pub enum TextureMinFilter {
569 ///
570 Nearest = 0x2600,
571 ///
572 Linear = 0x2601,
573 ///
574 NearestMipmapNearest = 0x2700,
575 ///
576 LinearMipmapNearest = 0x2701,
577 ///
578 NearestMipmapLinear = 0x2702,
579 ///
580 LinearMipmapLinear = 0x2703,
581}
582
583/// WebGLRenderingContext.texParameter[fi]() "param" parameter
584#[derive(Debug, Clone, Copy,PartialEq)]
585pub enum TextureWrap {
586 ///
587 Repeat = 0x2901,
588 ///
589 ClampToEdge = 0x812F,
590 ///
591 MirroredRepeat = 0x8370,
592}
593
594
595/// Constants passed to WebGLRenderingContext.hint()
596#[derive(Debug, Clone, Copy)]
597pub enum Buffers {
598 ///
599 Framebuffer = 0x8D40,
600 ///
601 Renderbuffer = 0x8D41,
602 ///
603 Rgba4 = 0x8056,
604 ///
605 Rgb5A1 = 0x8057,
606 ///
607 Rgb565 = 0x8D62,
608 ///
609 DepthComponent16 = 0x81A5,
610 ///
611 StencilIndex = 0x1901,
612 ///
613 StencilIndex8 = 0x8D48,
614 ///
615 DepthStencil = 0x84F9,
616 ///
617 RenderbufferWidth = 0x8D42,
618 ///
619 RenderbufferHeight = 0x8D43,
620 ///
621 RenderbufferInternalFormat = 0x8D44,
622 ///
623 RenderbufferRedSize = 0x8D50,
624 ///
625 RenderbufferGreenSize = 0x8D51,
626 ///
627 RenderbufferBlueSize = 0x8D52,
628 ///
629 RenderbufferAlphaSize = 0x8D53,
630 ///
631 RenderbufferDepthSize = 0x8D54,
632 ///
633 RenderbufferStencilSize = 0x8D55,
634 ///
635 FramebufferAttachmentObjectType = 0x8CD0,
636 ///
637 FramebufferAttachmentObjectName = 0x8CD1,
638 ///
639 FramebufferAttachmentTextureLevel = 0x8CD2,
640 ///
641 FramebufferAttachmentTextureCubeMapFace = 0x8CD3,
642 ///
643 ColorAttachment0 = 0x8CE0,
644 ///
645 DepthAttachment = 0x8D00,
646 ///
647 StencilAttachment = 0x8D20,
648 ///
649 DepthStencilAttachment = 0x821A,
650 ///
651 None = 0,
652 ///
653 FramebufferComplete = 0x8CD5,
654 ///
655 FramebufferIncompleteAttachment = 0x8CD6,
656 ///
657 FramebufferIncompleteMissingAttachment = 0x8CD7,
658 ///
659 FramebufferIncompleteDimensions = 0x8CD9,
660 ///
661 FramebufferUnsupported = 0x8CDD,
662 ///
663 FramebufferBinding = 0x8CA6,
664 ///
665 RenderbufferBinding = 0x8CA7,
666 ///
667 MaxRenderbufferSize = 0x84E8,
668 ///
669 InvalidFramebufferOperation = 0x0506,
670}
671
672
673/// Constants passed to WebGLRenderingContext.hint()
674#[derive(Debug,Clone, Copy)]
675pub enum PixelStorageMode {
676 ///
677 UnpackFlipYWebgl = 0x9240,
678 ///
679 UnpackPremultiplyAlphaWebgl = 0x9241,
680 ///
681 UnpackColorspaceConversionWebgl = 0x9243,
682 /// Packing of pixel data into memory.
683 /// Can be 1, 2, 4, 8 defaults to 4
684 PackAlignment = 0x0D05,
685 /// Unpacking of pixel data from memory
686 /// Can be 1, 2, 4, 8 defaults to 4
687 UnpackAlignment = 0x0CF5,
688}
689
690
691
692
693///
694#[derive(Debug, Clone, Copy)]
695pub enum ShaderPrecision {
696 ///
697 LowFloat = 0x8DF0,
698 ///
699 MediumFloat = 0x8DF1,
700 ///
701 HighFloat = 0x8DF2,
702 ///
703 LowInt = 0x8DF3,
704 ///
705 MediumInt = 0x8DF4,
706 ///
707 HighInt = 0x8DF5,
708}
709
710
711/// Constants passed to WebGLRenderingContext.hint()
712#[derive(Debug, Clone, Copy)]
713pub enum UniformType {
714 ///
715 FloatVec2 = 0x8B50,
716 ///
717 FloatVec3 = 0x8B51,
718 ///
719 FloatVec4 = 0x8B52,
720 ///
721 IntVec2 = 0x8B53,
722 ///
723 IntVec3 = 0x8B54,
724 ///
725 IntVec4 = 0x8B55,
726 ///
727 Bool = 0x8B56,
728 ///
729 BoolVec2 = 0x8B57,
730 ///
731 BoolVec3 = 0x8B58,
732 ///
733 BoolVec4 = 0x8B59,
734 ///
735 FloatMat2 = 0x8B5A,
736 ///
737 FloatMat3 = 0x8B5B,
738 ///
739 FloatMat4 = 0x8B5C,
740 ///
741 Sampler2d = 0x8B5E,
742 ///
743 SamplerCube = 0x8B60,
744}
745
746
747
748///
749#[derive(Debug, Clone, Copy)]
750pub enum TextureCompression {
751 /// A DXT1-compressed image in an RGB image format.
752 RgbDxt1 = 0x83F0,
753 /// A DXT1-compressed image in an RGB image format with a simple on/off alpha value.
754 RgbaDxt1 = 0x83F1,
755 /// A DXT3-compressed image in an RGBA image format.
756 /// Compared to a 32-bit RGBA texture, it offers 4:1 compression.
757 RgbaDxt3 = 0x83F2,
758 /// A DXT5-compressed image in an RGBA image format.
759 /// It also provides a 4:1 compression,
760 /// but differs to the DXT3 compression in how the alpha compression is done.
761 RgbaDxt5 = 0x83F3,
762}