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