noodle

package module
v0.0.0-...-d5ea794 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2020 License: MIT Imports: 13 Imported by: 1

README

Noodle WebGL Library

It does WebGL stuff. Experimental. Need more docs.

How to run examples

The main example is in example/wasm, and you will want to run the build.sh in there to generate the WASM.

If you wish to use the built in host (since WebAssemblies require a host), you need to run example/webserver/run.sh which will create a HTTP server at localhost:8090.

The webserver is able to listen to changes in the example/wasm folder and the root project folder. When it detects a change it will reload the page automatically.

Documentation

Overview

Package noodle is a WebGL game engine, designed for low level access for fast and efficent 3D applications

Index

Constants

View Source
const (
	//CharacterSetCompleteASCII is the complete ascii charset
	CharacterSetCompleteASCII = "" /* 741-byte string literal not displayed */
	//CharacterSetASCII provides standard printable ASCII characters
	CharacterSetASCII = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
)
View Source
const (
	// GlDepthBufferBit passed to <code>clear</code> to clear the current depth buffer.
	GlDepthBufferBit GLEnum = 0x00000100
	// GlStencilBufferBit passed to <code>clear</code> to clear the current stencil buffer.
	GlStencilBufferBit = 0x00000400
	// GlColorBufferBit passed to <code>clear</code> to clear the current color buffer.
	GlColorBufferBit = 0x00004000
	// GlPoints passed to <code>drawelements</code> or <code>drawarrays</code> to draw single points.
	GlPoints = 0x0000
	// GlLines passed to <code>drawelements</code> or <code>drawarrays</code> to draw lines. each vertex connects to the one after it.
	GlLines = 0x0001
	// GlLineLoop passed to <code>drawelements</code> or <code>drawarrays</code> to draw lines. each set of two vertices is treated as a separate line segment.
	GlLineLoop = 0x0002
	// GlLineStrip passed to <code>drawelements</code> or <code>drawarrays</code> to draw a connected group of line segments from the first vertex to the last.
	GlLineStrip = 0x0003
	// GlTriangles passed to <code>drawelements</code> or <code>drawarrays</code> to draw triangles. each set of three vertices creates a separate triangle.
	GlTriangles = 0x0004
	// GlTriangleStrip passed to <code>drawelements</code> or <code>drawarrays</code> to draw a connected group of triangles.
	GlTriangleStrip = 0x0005
	// GlTriangleFan passed to <code>drawelements</code> or <code>drawarrays</code> to draw a connected group of triangles. each vertex connects to the previous and the first vertex in the fan.
	GlTriangleFan = 0x0006
	// GlZero passed to <code>blendfunc</code> or <code>blendfuncseparate</code> to turn off a component.
	GlZero = 0
	// GlOne passed to <code>blendfunc</code> or <code>blendfuncseparate</code> to turn on a component.
	GlOne = 1
	// GlSrcColor passed to <code>blendfunc</code> or <code>blendfuncseparate</code> to multiply a component by the source elements color.
	GlSrcColor = 0x0300
	// GlOneMinusSrcColor passed to <code>blendfunc</code> or <code>blendfuncseparate</code> to multiply a component by one minus the source elements color.
	GlOneMinusSrcColor = 0x0301
	// GlSrcAlpha passed to <code>blendfunc</code> or <code>blendfuncseparate</code> to multiply a component by the source's alpha.
	GlSrcAlpha = 0x0302
	// GlOneMinusSrcAlpha passed to <code>blendfunc</code> or <code>blendfuncseparate</code> to multiply a component by one minus the source's alpha.
	GlOneMinusSrcAlpha = 0x0303
	// GlDstAlpha passed to <code>blendfunc</code> or <code>blendfuncseparate</code> to multiply a component by the destination's alpha.
	GlDstAlpha = 0x0304
	// GlOneMinusDstAlpha passed to <code>blendfunc</code> or <code>blendfuncseparate</code> to multiply a component by one minus the destination's alpha.
	GlOneMinusDstAlpha = 0x0305
	// GlDstColor passed to <code>blendfunc</code> or <code>blendfuncseparate</code> to multiply a component by the destination's color.
	GlDstColor = 0x0306
	// GlOneMinusDstColor passed to <code>blendfunc</code> or <code>blendfuncseparate</code> to multiply a component by one minus the destination's color.
	GlOneMinusDstColor = 0x0307
	// GlSrcAlphaSaturate passed to <code>blendfunc</code> or <code>blendfuncseparate</code> to multiply a component by the minimum of source's alpha or one minus the destination's alpha.
	GlSrcAlphaSaturate = 0x0308
	// GlConstantColor passed to <code>blendfunc</code> or <code>blendfuncseparate</code> to specify a constant color blend function.
	GlConstantColor = 0x8001
	// GlOneMinusConstantColor passed to <code>blendfunc</code> or <code>blendfuncseparate</code> to specify one minus a constant color blend function.
	GlOneMinusConstantColor = 0x8002
	// GlConstantAlpha passed to <code>blendfunc</code> or <code>blendfuncseparate</code> to specify a constant alpha blend function.
	GlConstantAlpha = 0x8003
	// GlOneMinusConstantAlpha passed to <code>blendfunc</code> or <code>blendfuncseparate</code> to specify one minus a constant alpha blend function.
	GlOneMinusConstantAlpha = 0x8004
	// GlFuncAdd passed to <code>blendequation</code> or <code>blendequationseparate</code> to set an addition blend function.
	GlFuncAdd = 0x8006
	// GlFuncSubtract passed to <code>blendequation</code> or <code>blendequationseparate</code> to specify a subtraction blend function (source - destination).
	GlFuncSubtract = 0x800a
	// GlFuncReverseSubtract passed to <code>blendequation</code> or <code>blendequationseparate</code> to specify a reverse subtraction blend function (destination - source).
	GlFuncReverseSubtract = 0x800b
	// GlBlendEquation passed to <code>getparameter</code> to get the current rgb blend function.
	GlBlendEquation = 0x8009
	// GlBlendEquationRgb passed to <code>getparameter</code> to get the current rgb blend function. same as blendEquation
	GlBlendEquationRgb = 0x8009
	// GlBlendEquationAlpha passed to <code>getparameter</code> to get the current alpha blend function. same as blendEquation
	GlBlendEquationAlpha = 0x883d
	// GlBlendDstRgb passed to <code>getparameter</code> to get the current destination rgb blend function.
	GlBlendDstRgb = 0x80c8
	// GlBlendSrcRgb passed to <code>getparameter</code> to get the current destination rgb blend function.
	GlBlendSrcRgb = 0x80c9
	// GlBlendDstAlpha passed to <code>getparameter</code> to get the current destination alpha blend function.
	GlBlendDstAlpha = 0x80ca
	// GlBlendSrcAlpha passed to <code>getparameter</code> to get the current source alpha blend function.
	GlBlendSrcAlpha = 0x80cb
	// GlBlendColor passed to <code>getparameter</code> to return a the current blend color.
	GlBlendColor = 0x8005
	// GlArrayBufferBinding passed to <code>getparameter</code> to get the array buffer binding.
	GlArrayBufferBinding = 0x8894
	// GlElementArrayBufferBinding passed to <code>getparameter</code> to get the current element array buffer.
	GlElementArrayBufferBinding = 0x8895
	// GlLineWidth passed to <code>getparameter</code> to get the current <code>linewidth</code> (set by the <code>linewidth</code> method).
	GlLineWidth = 0x0b21
	// GlAliasedPointSizeRange passed to <code>getparameter</code> to get the current size of a point drawn with <code>gl.points</code>
	GlAliasedPointSizeRange = 0x846d
	// GlAliasedLineWidthRange passed to <code>getparameter</code> 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.
	GlAliasedLineWidthRange = 0x846e
	// GlCullFaceMode passed to <code>getparameter</code> to get the current value of <code>cullface</code>. should return <code>front</code>, <code>back</code>, or <code>frontAndBack</code>
	GlCullFaceMode = 0x0b45
	// GlFrontFace passed to <code>getparameter</code> to determine the current value of <code>frontface</code>. should return <code>cw</code> or <code>ccw</code>.
	GlFrontFace = 0x0b46
	// GlDepthRange passed to <code>getparameter</code> to return a length-2 array of floats giving the current depth range.
	GlDepthRange = 0x0b70
	// GlDepthWritemask passed to <code>getparameter</code> to determine if the depth write mask is enabled.
	GlDepthWritemask = 0x0b72
	// GlDepthClearValue passed to <code>getparameter</code> to determine the current depth clear value.
	GlDepthClearValue = 0x0b73
	// GlDepthFunc passed to <code>getparameter</code> to get the current depth function. returns <code>never</code>, <code>always</code>, <code>less</code>, <code>equal</code>, <code>lequal</code>, <code>greater</code>, <code>gequal</code>, or <code>notequal</code>.
	GlDepthFunc = 0x0b74
	// GlStencilClearValue passed to <code>getparameter</code> to get the value the stencil will be cleared to.
	GlStencilClearValue = 0x0b91
	// GlStencilFunc passed to <code>getparameter</code> to get the current stencil function. returns <code>never</code>, <code>always</code>, <code>less</code>, <code>equal</code>, <code>lequal</code>, <code>greater</code>, <code>gequal</code>, or <code>notequal</code>.
	GlStencilFunc = 0x0b92
	// GlStencilFail passed to <code>getparameter</code> to get the current stencil fail function. should return <code>keep</code>, <code>replace</code>, <code>incr</code>, <code>decr</code>, <code>invert</code>, <code>incrWrap</code>, or <code>decrWrap</code>.
	GlStencilFail = 0x0b94
	// GlStencilPassDepthFail passed to <code>getparameter</code> to get the current stencil fail function should the depth buffer test fail. should return <code>keep</code>, <code>replace</code>, <code>incr</code>, <code>decr</code>, <code>invert</code>, <code>incrWrap</code>, or <code>decrWrap</code>.
	GlStencilPassDepthFail = 0x0b95
	// GlStencilPassDepthPass passed to <code>getparameter</code> to get the current stencil fail function should the depth buffer test pass. should return keep, replace, incr, decr, invert, incrWrap, or decrWrap.
	GlStencilPassDepthPass = 0x0b96
	// GlStencilRef passed to <code>getparameter</code> to get the reference value used for stencil tests.
	GlStencilRef = 0x0b97
	// GlStencilValueMask &nbsp;
	GlStencilValueMask = 0x0b93
	// GlStencilWritemask &nbsp;
	GlStencilWritemask = 0x0b98
	// GlStencilBackFunc &nbsp;
	GlStencilBackFunc = 0x8800
	// GlStencilBackFail &nbsp;
	GlStencilBackFail = 0x8801
	// GlStencilBackPassDepthFail &nbsp;
	GlStencilBackPassDepthFail = 0x8802
	// GlStencilBackPassDepthPass &nbsp;
	GlStencilBackPassDepthPass = 0x8803
	// GlStencilBackRef &nbsp;
	GlStencilBackRef = 0x8ca3
	// GlStencilBackValueMask &nbsp;
	GlStencilBackValueMask = 0x8ca4
	// GlStencilBackWritemask &nbsp;
	GlStencilBackWritemask = 0x8ca5
	// GlViewport returns an <a href="/en-us/docs/web/javascript/reference/globalObjects/int32array" title="the int32array typed array represents an array of twos-complement 32-bit signed integers in the platform byte order. if control over byte order is needed, use dataview instead. the contents are initialized to 0. once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation)."><code>int32array</code></a> with four elements for the current viewport dimensions.
	GlViewport = 0x0ba2
	// GlScissorBox returns an <a href="/en-us/docs/web/javascript/reference/globalObjects/int32array" title="the int32array typed array represents an array of twos-complement 32-bit signed integers in the platform byte order. if control over byte order is needed, use dataview instead. the contents are initialized to 0. once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation)."><code>int32array</code></a> with four elements for the current scissor box dimensions.
	GlScissorBox = 0x0c10
	// GlColorClearValue &nbsp;
	GlColorClearValue = 0x0c22
	// GlColorWritemask &nbsp;
	GlColorWritemask = 0x0c23
	// GlUnpackAlignment &nbsp;
	GlUnpackAlignment = 0x0cf5
	// GlPackAlignment &nbsp;
	GlPackAlignment = 0x0d05
	// GlMaxTextureSize &nbsp;
	GlMaxTextureSize = 0x0d33
	// GlMaxViewportDims &nbsp;
	GlMaxViewportDims = 0x0d3a
	// GlSubpixelBits &nbsp;
	GlSubpixelBits = 0x0d50
	// GlRedBits &nbsp;
	GlRedBits = 0x0d52
	// GlGreenBits &nbsp;
	GlGreenBits = 0x0d53
	// GlBlueBits &nbsp;
	GlBlueBits = 0x0d54
	// GlAlphaBits &nbsp;
	GlAlphaBits = 0x0d55
	// GlDepthBits &nbsp;
	GlDepthBits = 0x0d56
	// GlStencilBits &nbsp;
	GlStencilBits = 0x0d57
	// GlPolygonOffsetUnits &nbsp;
	GlPolygonOffsetUnits = 0x2a00
	// GlPolygonOffsetFactor &nbsp;
	GlPolygonOffsetFactor = 0x8038
	// GlTextureBinding2d &nbsp;
	GlTextureBinding2d = 0x8069
	// GlSampleBuffers &nbsp;
	GlSampleBuffers = 0x80a8
	// GlSamples &nbsp;
	GlSamples = 0x80a9
	// GlSampleCoverageValue &nbsp;
	GlSampleCoverageValue = 0x80aa
	// GlSampleCoverageInvert &nbsp;
	GlSampleCoverageInvert = 0x80ab
	// GlCompressedTextureFormats &nbsp;
	GlCompressedTextureFormats = 0x86a3
	// GlVendor &nbsp;
	GlVendor = 0x1f00
	// GlRenderer &nbsp;
	GlRenderer = 0x1f01
	// GlVersion &nbsp;
	GlVersion = 0x1f02
	// GlImplementationColorReadType &nbsp;
	GlImplementationColorReadType = 0x8b9a
	// GlImplementationColorReadFormat &nbsp;
	GlImplementationColorReadFormat = 0x8b9b
	// GlBrowserDefaultWebgl &nbsp;
	GlBrowserDefaultWebgl = 0x9244
	// GlStaticDraw passed to <code>bufferdata</code> as a hint about whether the contents of the buffer are likely to be used often and not change often.
	GlStaticDraw = 0x88e4
	// GlStreamDraw passed to <code>bufferdata</code> as a hint about whether the contents of the buffer are likely to not be used often.
	GlStreamDraw = 0x88e0
	// GlDynamicDraw passed to <code>bufferdata</code> as a hint about whether the contents of the buffer are likely to be used often and change often.
	GlDynamicDraw = 0x88e8
	// GlArrayBuffer passed to <code>bindbuffer</code> or <code>bufferdata</code> to specify the type of buffer being used.
	GlArrayBuffer = 0x8892
	// GlElementArrayBuffer passed to <code>bindbuffer</code> or <code>bufferdata</code> to specify the type of buffer being used.
	GlElementArrayBuffer = 0x8893
	// GlBufferSize passed to <code>getbufferparameter</code> to get a buffer's size.
	GlBufferSize = 0x8764
	// GlBufferUsage passed to&nbsp;<code>getbufferparameter</code> to get the hint for the buffer passed in when it was created.
	GlBufferUsage = 0x8765
	// GlCurrentVertexAttrib passed to <code>getvertexattrib</code> to read back the current vertex attribute.
	GlCurrentVertexAttrib = 0x8626
	// GlVertexAttribArrayEnabled &nbsp;
	GlVertexAttribArrayEnabled = 0x8622
	// GlVertexAttribArraySize &nbsp;
	GlVertexAttribArraySize = 0x8623
	// GlVertexAttribArrayStride &nbsp;
	GlVertexAttribArrayStride = 0x8624
	// GlVertexAttribArrayType &nbsp;
	GlVertexAttribArrayType = 0x8625
	// GlVertexAttribArrayNormalized &nbsp;
	GlVertexAttribArrayNormalized = 0x886a
	// GlVertexAttribArrayPointer &nbsp;
	GlVertexAttribArrayPointer = 0x8645
	// GlVertexAttribArrayBufferBinding &nbsp;
	GlVertexAttribArrayBufferBinding = 0x889f
	// GlCullFace passed to <code>enable</code>/<code>disable</code> to turn on/off culling. can also be used with <code>getparameter</code> to find the current culling method.
	GlCullFace = 0x0b44
	// GlFront passed to <code>cullface</code> to specify that only front faces should be culled.
	GlFront = 0x0404
	// GlBack passed to <code>cullface</code> to specify that only back faces should be culled.
	GlBack = 0x0405
	// GlFrontAndBack passed to&nbsp;<code>cullface</code> to specify that front and back faces should be culled.
	GlFrontAndBack = 0x0408
	// GlBlend passed to <code>enable</code>/<code>disable</code> to turn on/off blending. can also be used with <code>getparameter</code> to find the current blending method.
	GlBlend = 0x0be2
	// GlDepthTest passed to <code>enable</code>/<code>disable</code> to turn on/off the depth test. can also be used with <code>getparameter</code> to query the depth test.
	GlDepthTest = 0x0b71
	// GlDither passed to <code>enable</code>/<code>disable</code> to turn on/off dithering. can also be used with <code>getparameter</code> to find the current dithering method.
	GlDither = 0x0bd0
	// GlPolygonOffsetFill passed to <code>enable</code>/<code>disable</code> 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 <code>getparameter</code> to query the scissor test.
	GlPolygonOffsetFill = 0x8037
	// GlSampleAlphaToCoverage passed to <code>enable</code>/<code>disable</code> to turn on/off the alpha to coverage. used in multi-sampling alpha channels.
	GlSampleAlphaToCoverage = 0x809e
	// GlSampleCoverage passed to <code>enable</code>/<code>disable</code> to turn on/off the sample coverage. used in multi-sampling.
	GlSampleCoverage = 0x80a0
	// GlScissorTest passed to <code>enable</code>/<code>disable</code> to turn on/off the scissor test. can also be used with <code>getparameter</code> to query the scissor test.
	GlScissorTest = 0x0c11
	// GlStencilTest passed to <code>enable</code>/<code>disable</code> to turn on/off the stencil test. can also be used with <code>getparameter</code> to query the stencil test.
	GlStencilTest = 0x0b90
	// GlNoError returned from <code>geterror</code>.
	GlNoError = 0
	// GlInvalidEnum returned from <code>geterror</code>.
	GlInvalidEnum = 0x0500
	// GlInvalidValue returned from <code>geterror</code>.
	GlInvalidValue = 0x0501
	// GlInvalidOperation returned from <code>geterror</code>.
	GlInvalidOperation = 0x0502
	// GlOutOfMemory returned from <code>geterror</code>.
	GlOutOfMemory = 0x0505
	// GlContextLostWebgl returned from <code>geterror</code>.
	GlContextLostWebgl = 0x9242
	// GlCw passed to <code>frontface</code> to specify the front face of a polygon is drawn in the clockwise direction
	GlCw = 0x0900
	// GlCcw passed to <code>frontface</code> to specify the front face of a polygon is drawn in the counter clockwise direction
	GlCcw = 0x0901
	// GlDontCare there is no preference for this behavior.
	GlDontCare = 0x1100
	// GlFastest the most efficient behavior should be used.
	GlFastest = 0x1101
	// GlNicest the most correct or the highest quality option should be used.
	GlNicest = 0x1102
	// GlGenerateMipmapHint hint for the quality of filtering when generating mipmap images with <a href="/en-us/docs/web/api/webglrenderingcontext/generatemipmap" title="the webglrenderingcontext.generatemipmap() method of the webgl api generates a set of mipmaps for a webgltexture object."><code>webglrenderingcontext.generatemipmap()</code></a>.
	GlGenerateMipmapHint = 0x8192
	// GlByte &nbsp;
	GlByte = 0x1400
	// GlShort &nbsp;
	GlShort = 0x1402
	// GlUnsignedShort &nbsp;
	GlUnsignedShort = 0x1403
	// GlInt &nbsp;
	GlInt = 0x1404
	// GlUnsignedInt &nbsp;
	GlUnsignedInt = 0x1405
	// GlFloat &nbsp;
	GlFloat = 0x1406
	// GlDepthComponent &nbsp;
	GlDepthComponent = 0x1902
	// GlAlpha &nbsp;
	GlAlpha = 0x1906
	// GlRGB &nbsp;
	GlRGB = 0x1907
	// GlRGBA &nbsp;
	GlRGBA = 0x1908
	// GlLuminance &nbsp;
	GlLuminance = 0x1909
	// GlLuminanceAlpha &nbsp;
	GlLuminanceAlpha = 0x190a
	// GlUnsignedByte &nbsp;
	GlUnsignedByte = 0x1401
	// GlUnsignedShort4444 &nbsp;
	GlUnsignedShort4444 = 0x8033
	// GlUnsignedShort5551 &nbsp;
	GlUnsignedShort5551 = 0x8034
	// GlUnsignedShort565 &nbsp;
	GlUnsignedShort565 = 0x8363
	// GlFragmentShader passed to <code>createshader</code> to define a fragment shader.
	GlFragmentShader = 0x8b30
	// GlVertexShader passed to <code>createshader</code> to define a vertex shader
	GlVertexShader = 0x8b31
	// GlCompileStatus passed to <code>getshaderparamter</code> to get the status of the compilation. returns false if the shader was not compiled. you can then query <code>getshaderinfolog</code> to find the exact error
	GlCompileStatus = 0x8b81
	// GlDeleteStatus passed to <code>getshaderparamter</code> to determine if a shader was deleted via <code>deleteshader</code>. returns true if it was, false otherwise.
	GlDeleteStatus = 0x8b80
	// GlLinkStatus passed to <code>getprogramparameter</code> after calling <code>linkprogram</code> to determine if a program was linked correctly. returns false if there were errors. use <code>getprograminfolog</code> to find the exact error.
	GlLinkStatus = 0x8b82
	// GlValidateStatus passed to <code>getprogramparameter</code> after calling <code>validateprogram</code> to determine if it is valid. returns false if errors were found.
	GlValidateStatus = 0x8b83
	// GlAttachedShaders passed to <code>getprogramparameter</code> after calling <code>attachshader</code> to determine if the shader was attached correctly. returns false if errors occurred.
	GlAttachedShaders = 0x8b85
	// GlActiveAttributes passed to <code>getprogramparameter</code> to get the number of attributes active in a program.
	GlActiveAttributes = 0x8b89
	// GlActiveUniforms passed to <code>getprogramparamter</code> to get the number of uniforms active in a program.
	GlActiveUniforms = 0x8b86
	// GlMaxVertexAttribs the maximum number of entries possible in the vertex attribute list.
	GlMaxVertexAttribs = 0x8869
	// GlMaxVertexUniformVectors &nbsp;
	GlMaxVertexUniformVectors = 0x8dfb
	// GlMaxVaryingVectors &nbsp;
	GlMaxVaryingVectors = 0x8dfc
	// GlMaxCombinedTextureImageUnits &nbsp;
	GlMaxCombinedTextureImageUnits = 0x8b4d
	// GlMaxVertexTextureImageUnits &nbsp;
	GlMaxVertexTextureImageUnits = 0x8b4c
	// GlMaxTextureImageUnits implementation dependent number of maximum texture units. at least 8.
	GlMaxTextureImageUnits = 0x8872
	// GlMaxFragmentUniformVectors &nbsp;
	GlMaxFragmentUniformVectors = 0x8dfd
	// GlShaderType &nbsp;
	GlShaderType = 0x8b4f
	// GlShadingLanguageVersion &nbsp;
	GlShadingLanguageVersion = 0x8b8c
	// GlCurrentProgram &nbsp;
	GlCurrentProgram = 0x8b8d
	// GlNever passed to <code>depthfunction</code> or <code>stencilfunction</code> to specify depth or stencil tests will never pass. i.e. nothing will be drawn.
	GlNever = 0x0200
	// GlLess passed to <code>depthfunction</code> or <code>stencilfunction</code> to specify depth or stencil tests will pass if the new depth value is less than the stored value.
	GlLess = 0x0201
	// GlEqual passed to <code>depthfunction</code> or <code>stencilfunction</code> to specify depth or stencil tests will pass if the new depth value is equals to the stored value.
	GlEqual = 0x0202
	// GlLEqual passed to <code>depthfunction</code> or <code>stencilfunction</code> to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value.
	GlLEqual = 0x0203
	// GlGreater passed to <code>depthfunction</code> or <code>stencilfunction</code> to specify depth or stencil tests will pass if the new depth value is greater than the stored value.
	GlGreater = 0x0204
	// GlNotEqual passed to <code>depthfunction</code> or <code>stencilfunction</code> to specify depth or stencil tests will pass if the new depth value is not equal to the stored value.
	GlNotEqual = 0x0205
	// GlGEqual passed to <code>depthfunction</code> or <code>stencilfunction</code> to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value.
	GlGEqual = 0x0206
	// GlAlways passed to <code>depthfunction</code> or <code>stencilfunction</code> to specify depth or stencil tests will always pass. i.e. pixels will be drawn in the order they are drawn.
	GlAlways = 0x0207
	// GlKeep &nbsp;
	GlKeep = 0x1e00
	// GlReplace &nbsp;
	GlReplace = 0x1e01
	// GlIncr &nbsp;
	GlIncr = 0x1e02
	// GlDecr &nbsp;
	GlDecr = 0x1e03
	// GlInvert &nbsp;
	GlInvert = 0x150a
	// GlIncrWrap &nbsp;
	GlIncrWrap = 0x8507
	// GlDecrWrap &nbsp;
	GlDecrWrap = 0x8508
	// GlNearest &nbsp;
	GlNearest = 0x2600
	// GlLinear &nbsp;
	GlLinear = 0x2601
	// GlNearestMipmapNearest &nbsp;
	GlNearestMipmapNearest = 0x2700
	// GlLinearMipmapNearest &nbsp;
	GlLinearMipmapNearest = 0x2701
	// GlNearestMipmapLinear &nbsp;
	GlNearestMipmapLinear = 0x2702
	// GlLinearMipmapLinear &nbsp;
	GlLinearMipmapLinear = 0x2703
	// GlTextureMagFilter &nbsp;
	GlTextureMagFilter = 0x2800
	// GlTextureMinFilter &nbsp;
	GlTextureMinFilter = 0x2801
	// GlTextureWrapS &nbsp;
	GlTextureWrapS = 0x2802
	// GlTextureWrapT &nbsp;
	GlTextureWrapT = 0x2803
	// GlTexture2D &nbsp;
	GlTexture2D = 0x0de1
	// GlTexture &nbsp;
	GlTexture = 0x1702
	// GlTextureCubeMap &nbsp;
	GlTextureCubeMap = 0x8513
	// GlTextureBindingCubeMap &nbsp;
	GlTextureBindingCubeMap = 0x8514
	// GlTextureCubeMapPositiveX &nbsp;
	GlTextureCubeMapPositiveX = 0x8515
	// GlTextureCubeMapNegativeX &nbsp;
	GlTextureCubeMapNegativeX = 0x8516
	// GlTextureCubeMapPositiveY &nbsp;
	GlTextureCubeMapPositiveY = 0x8517
	// GlTextureCubeMapNegativeY &nbsp;
	GlTextureCubeMapNegativeY = 0x8518
	// GlTextureCubeMapPositiveZ &nbsp;
	GlTextureCubeMapPositiveZ = 0x8519
	// GlTextureCubeMapNegativeZ &nbsp;
	GlTextureCubeMapNegativeZ = 0x851a
	// GlMaxCubeMapTextureSize &nbsp;
	GlMaxCubeMapTextureSize = 0x851c
	// GlActiveTexture the current active texture unit.
	GlActiveTexture = 0x84e0
	// GlRepeat &nbsp;
	GlRepeat = 0x2901
	// GlClampToEdge &nbsp;
	GlClampToEdge = 0x812f
	// GlMirroredRepeat &nbsp;
	GlMirroredRepeat = 0x8370
	// GlFloatVec2 &nbsp;
	GlFloatVec2 = 0x8b50
	// GlFloatVec3 &nbsp;
	GlFloatVec3 = 0x8b51
	// GlFloatVec4 &nbsp;
	GlFloatVec4 = 0x8b52
	// GlIntVec2 &nbsp;
	GlIntVec2 = 0x8b53
	// GlIntVec3 &nbsp;
	GlIntVec3 = 0x8b54
	// GlIntVec4 &nbsp;
	GlIntVec4 = 0x8b55
	// GlBool &nbsp;
	GlBool = 0x8b56
	// GlBoolVec2 &nbsp;
	GlBoolVec2 = 0x8b57
	// GlBoolVec3 &nbsp;
	GlBoolVec3 = 0x8b58
	// GlBoolVec4 &nbsp;
	GlBoolVec4 = 0x8b59
	// GlFloatMat2 &nbsp;
	GlFloatMat2 = 0x8b5a
	// GlFloatMat3 &nbsp;
	GlFloatMat3 = 0x8b5b
	// GlFloatMat4 &nbsp;
	GlFloatMat4 = 0x8b5c
	// GlSampler2d &nbsp;
	GlSampler2d = 0x8b5e
	// GlSamplerCube &nbsp;
	GlSamplerCube = 0x8b60
	// GlLowFloat &nbsp;
	GlLowFloat = 0x8df0
	// GlMediumFloat &nbsp;
	GlMediumFloat = 0x8df1
	// GlHighFloat &nbsp;
	GlHighFloat = 0x8df2
	// GlLowInt &nbsp;
	GlLowInt = 0x8df3
	// GlMediumInt &nbsp;
	GlMediumInt = 0x8df4
	// GlHighInt &nbsp;
	GlHighInt = 0x8df5
	// GlFramebuffer &nbsp;
	GlFramebuffer = 0x8d40
	// GlRenderbuffer &nbsp;
	GlRenderbuffer = 0x8d41
	// GlRGBA4 &nbsp;
	GlRGBA4 = 0x8056
	// GlRGB5A1 &nbsp;
	GlRGB5A1 = 0x8057
	// GlRGB565 &nbsp;
	GlRGB565 = 0x8d62
	// GlDepthComponent16 &nbsp;
	GlDepthComponent16 = 0x81a5
	// GlStencilIndex8 &nbsp;
	GlStencilIndex8 = 0x8d48
	// GlDepthStencil &nbsp;
	GlDepthStencil = 0x84f9
	// GlRenderbufferWidth &nbsp;
	GlRenderbufferWidth = 0x8d42
	// GlRenderbufferHeight &nbsp;
	GlRenderbufferHeight = 0x8d43
	// GlRenderbufferInternalFormat &nbsp;
	GlRenderbufferInternalFormat = 0x8d44
	// GlRenderbufferRedSize &nbsp;
	GlRenderbufferRedSize = 0x8d50
	// GlRenderbufferGreenSize &nbsp;
	GlRenderbufferGreenSize = 0x8d51
	// GlRenderbufferBlueSize &nbsp;
	GlRenderbufferBlueSize = 0x8d52
	// GlRenderbufferAlphaSize &nbsp;
	GlRenderbufferAlphaSize = 0x8d53
	// GlRenderbufferDepthSize &nbsp;
	GlRenderbufferDepthSize = 0x8d54
	// GlRenderbufferStencilSize &nbsp;
	GlRenderbufferStencilSize = 0x8d55
	// GlFramebufferAttachmentObjectType &nbsp;
	GlFramebufferAttachmentObjectType = 0x8cd0
	// GlFramebufferAttachmentObjectName &nbsp;
	GlFramebufferAttachmentObjectName = 0x8cd1
	// GlFramebufferAttachmentTextureLevel &nbsp;
	GlFramebufferAttachmentTextureLevel = 0x8cd2
	// GlFramebufferAttachmentTextureCubeMapFace &nbsp;
	GlFramebufferAttachmentTextureCubeMapFace = 0x8cd3
	// GlColorAttachment0 &nbsp;
	GlColorAttachment0 = 0x8ce0
	// GlDepthAttachment &nbsp;
	GlDepthAttachment = 0x8d00
	// GlStencilAttachment &nbsp;
	GlStencilAttachment = 0x8d20
	// GlNone &nbsp;
	GlNone = 0
	// GlFramebufferComplete &nbsp;
	GlFramebufferComplete = 0x8cd5
	// GlFramebufferIncompleteAttachment &nbsp;
	GlFramebufferIncompleteAttachment = 0x8cd6
	// GlFramebufferIncompleteMissingAttachment &nbsp;
	GlFramebufferIncompleteMissingAttachment = 0x8cd7
	// GlFramebufferIncompleteDimensions &nbsp;
	GlFramebufferIncompleteDimensions = 0x8cd9
	// GlFramebufferUnsupported &nbsp;
	GlFramebufferUnsupported = 0x8cdd
	// GlFramebufferBinding &nbsp;
	GlFramebufferBinding = 0x8ca6
	// GlRenderbufferBinding &nbsp;
	GlRenderbufferBinding = 0x8ca7
	// GlMaxRenderbufferSize &nbsp;
	GlMaxRenderbufferSize = 0x84e8
	// GlInvalidFramebufferOperation &nbsp;
	GlInvalidFramebufferOperation = 0x0506
	// GlUnpackFlipYWebgl &nbsp;
	GlUnpackFlipYWebgl = 0x9240
	// GlUnpackPremultiplyAlphaWebgl &nbsp;
	GlUnpackPremultiplyAlphaWebgl = 0x9241
	// GlUnpackColorspaceConversionWebgl &nbsp;
	GlUnpackColorspaceConversionWebgl = 0x9243
	// GlReadBuffer &nbsp;
	GlReadBuffer = 0x0c02
	// GlUnpackRowLength &nbsp;
	GlUnpackRowLength = 0x0cf2
	// GlUnpackSkipRows &nbsp;
	GlUnpackSkipRows = 0x0cf3
	// GlUnpackSkipPixels &nbsp;
	GlUnpackSkipPixels = 0x0cf4
	// GlPackRowLength &nbsp;
	GlPackRowLength = 0x0d02
	// GlPackSkipRows &nbsp;
	GlPackSkipRows = 0x0d03
	// GlPackSkipPixels &nbsp;
	GlPackSkipPixels = 0x0d04
	// GlTextureBinding3d &nbsp;
	GlTextureBinding3d = 0x806a
	// GlUnpackSkipImages &nbsp;
	GlUnpackSkipImages = 0x806d
	// GlUnpackImageHeight &nbsp;
	GlUnpackImageHeight = 0x806e
	// GlMax3dTextureSize &nbsp;
	GlMax3dTextureSize = 0x8073
	// GlMaxElementsVertices &nbsp;
	GlMaxElementsVertices = 0x80e8
	// GlMaxElementsIndices &nbsp;
	GlMaxElementsIndices = 0x80e9
	// GlMaxTextureLodBias &nbsp;
	GlMaxTextureLodBias = 0x84fd
	// GlMaxFragmentUniformComponents &nbsp;
	GlMaxFragmentUniformComponents = 0x8b49
	// GlMaxVertexUniformComponents &nbsp;
	GlMaxVertexUniformComponents = 0x8b4a
	// GlMaxArrayTextureLayers &nbsp;
	GlMaxArrayTextureLayers = 0x88ff
	// GlMinProgramTexelOffset &nbsp;
	GlMinProgramTexelOffset = 0x8904
	// GlMaxProgramTexelOffset &nbsp;
	GlMaxProgramTexelOffset = 0x8905
	// GlMaxVaryingComponents &nbsp;
	GlMaxVaryingComponents = 0x8b4b
	// GlFragmentShaderDerivativeHint &nbsp;
	GlFragmentShaderDerivativeHint = 0x8b8b
	// GlRasterizerDiscard &nbsp;
	GlRasterizerDiscard = 0x8c89
	// GlVertexArrayBinding &nbsp;
	GlVertexArrayBinding = 0x85b5
	// GlMaxVertexOutputComponents &nbsp;
	GlMaxVertexOutputComponents = 0x9122
	// GlMaxFragmentInputComponents &nbsp;
	GlMaxFragmentInputComponents = 0x9125
	// GlMaxServerWaitTimeout &nbsp;
	GlMaxServerWaitTimeout = 0x9111
	// GlMaxElementIndex &nbsp;
	GlMaxElementIndex = 0x8d6b
	// GlRed &nbsp;
	GlRed = 0x1903
	// GlRGB8 &nbsp;
	GlRGB8 = 0x8051
	// GlRGBA8 &nbsp;
	GlRGBA8 = 0x8058
	// GlRGB10A2 &nbsp;
	GlRGB10A2 = 0x8059
	// GlTexture3d &nbsp;
	GlTexture3d = 0x806f
	// GlTextureWrapR &nbsp;
	GlTextureWrapR = 0x8072
	// GlTextureMinLod &nbsp;
	GlTextureMinLod = 0x813a
	// GlTextureMaxLod &nbsp;
	GlTextureMaxLod = 0x813b
	// GlTextureBaseLevel &nbsp;
	GlTextureBaseLevel = 0x813c
	// GlTextureMaxLevel &nbsp;
	GlTextureMaxLevel = 0x813d
	// GlTextureCompareMode &nbsp;
	GlTextureCompareMode = 0x884c
	// GlTextureCompareFunc &nbsp;
	GlTextureCompareFunc = 0x884d
	// GlSrgb &nbsp;
	GlSrgb = 0x8c40
	// GlSrgb8 &nbsp;
	GlSrgb8 = 0x8c41
	// GlSrgb8Alpha8 &nbsp;
	GlSrgb8Alpha8 = 0x8c43
	// GlCompareRefToTexture &nbsp;
	GlCompareRefToTexture = 0x884e
	// GlRGBA32f &nbsp;
	GlRGBA32f = 0x8814
	// GlRGB32f &nbsp;
	GlRGB32f = 0x8815
	// GlRGBA16f &nbsp;
	GlRGBA16f = 0x881a
	// GlRGB16f &nbsp;
	GlRGB16f = 0x881b
	// GlTexture2DArray &nbsp;
	GlTexture2DArray = 0x8c1a
	// GlTextureBinding2dArray &nbsp;
	GlTextureBinding2dArray = 0x8c1d
	// GlR11fG11fB10f &nbsp;
	GlR11fG11fB10f = 0x8c3a
	// GlRGB9E5 &nbsp;
	GlRGB9E5 = 0x8c3d
	// GlRGBA32ui &nbsp;
	GlRGBA32ui = 0x8d70
	// GlRGB32ui &nbsp;
	GlRGB32ui = 0x8d71
	// GlRGBA16ui &nbsp;
	GlRGBA16ui = 0x8d76
	// GlRGB16ui &nbsp;
	GlRGB16ui = 0x8d77
	// GlRGBA8ui &nbsp;
	GlRGBA8ui = 0x8d7c
	// GlRGB8ui &nbsp;
	GlRGB8ui = 0x8d7d
	// GlRGBA32i &nbsp;
	GlRGBA32i = 0x8d82
	// GlRGB32i &nbsp;
	GlRGB32i = 0x8d83
	// GlRGBA16i &nbsp;
	GlRGBA16i = 0x8d88
	// GlRGB16i &nbsp;
	GlRGB16i = 0x8d89
	// GlRGBA8i &nbsp;
	GlRGBA8i = 0x8d8e
	// GlRGB8i &nbsp;
	GlRGB8i = 0x8d8f
	// GlRedInteger &nbsp;
	GlRedInteger = 0x8d94
	// GlRGBInteger &nbsp;
	GlRGBInteger = 0x8d98
	// GlRGBAInteger &nbsp;
	GlRGBAInteger = 0x8d99
	// GlR8 &nbsp;
	GlR8 = 0x8229
	// GlRg8 &nbsp;
	GlRg8 = 0x822b
	// GlRGB10A2ui &nbsp;
	GlRGB10A2ui = 0x906f
	// GlTextureImmutableFormat &nbsp;
	GlTextureImmutableFormat = 0x912f
	// GlTextureImmutableLevels &nbsp;
	GlTextureImmutableLevels = 0x82df
	// GlUnsignedInt2101010Rev &nbsp;
	GlUnsignedInt2101010Rev = 0x8368
	// GlUnsignedInt10f11f11fRev &nbsp;
	GlUnsignedInt10f11f11fRev = 0x8c3b
	// GlUnsignedInt5999Rev &nbsp;
	GlUnsignedInt5999Rev = 0x8c3e
	// GlFloat32UnsignedInt248Rev &nbsp;
	GlFloat32UnsignedInt248Rev = 0x8dad
	// GlHalfFloat &nbsp;
	GlHalfFloat = 0x140b
	// GlRg &nbsp;
	GlRg = 0x8227
	// GlRgInteger &nbsp;
	GlRgInteger = 0x8228
	// GlInt2101010Rev &nbsp;
	GlInt2101010Rev = 0x8d9f
	// GlCurrentQuery &nbsp;
	GlCurrentQuery = 0x8865
	// GlQueryResult &nbsp;
	GlQueryResult = 0x8866
	// GlQueryResultAvailable &nbsp;
	GlQueryResultAvailable = 0x8867
	// GlAnySamplesPassed &nbsp;
	GlAnySamplesPassed = 0x8c2f
	// GlAnySamplesPassedConservative &nbsp;
	GlAnySamplesPassedConservative = 0x8d6a
	// GlMaxDrawBuffers &nbsp;
	GlMaxDrawBuffers = 0x8824
	// GlDrawBuffer0 &nbsp;
	GlDrawBuffer0 = 0x8825
	// GlDrawBuffer1 &nbsp;
	GlDrawBuffer1 = 0x8826
	// GlDrawBuffer2 &nbsp;
	GlDrawBuffer2 = 0x8827
	// GlDrawBuffer3 &nbsp;
	GlDrawBuffer3 = 0x8828
	// GlDrawBuffer4 &nbsp;
	GlDrawBuffer4 = 0x8829
	// GlDrawBuffer5 &nbsp;
	GlDrawBuffer5 = 0x882a
	// GlDrawBuffer6 &nbsp;
	GlDrawBuffer6 = 0x882b
	// GlDrawBuffer7 &nbsp;
	GlDrawBuffer7 = 0x882c
	// GlDrawBuffer8 &nbsp;
	GlDrawBuffer8 = 0x882d
	// GlDrawBuffer9 &nbsp;
	GlDrawBuffer9 = 0x882e
	// GlDrawBuffer10 &nbsp;
	GlDrawBuffer10 = 0x882f
	// GlDrawBuffer11 &nbsp;
	GlDrawBuffer11 = 0x8830
	// GlDrawBuffer12 &nbsp;
	GlDrawBuffer12 = 0x8831
	// GlDrawBuffer13 &nbsp;
	GlDrawBuffer13 = 0x8832
	// GlDrawBuffer14 &nbsp;
	GlDrawBuffer14 = 0x8833
	// GlDrawBuffer15 &nbsp;
	GlDrawBuffer15 = 0x8834
	// GlMaxColorAttachments &nbsp;
	GlMaxColorAttachments = 0x8cdf
	// GlColorAttachment1 &nbsp;
	GlColorAttachment1 = 0x8ce1
	// GlColorAttachment2 &nbsp;
	GlColorAttachment2 = 0x8ce2
	// GlColorAttachment3 &nbsp;
	GlColorAttachment3 = 0x8ce3
	// GlColorAttachment4 &nbsp;
	GlColorAttachment4 = 0x8ce4
	// GlColorAttachment5 &nbsp;
	GlColorAttachment5 = 0x8ce5
	// GlColorAttachment6 &nbsp;
	GlColorAttachment6 = 0x8ce6
	// GlColorAttachment7 &nbsp;
	GlColorAttachment7 = 0x8ce7
	// GlColorAttachment8 &nbsp;
	GlColorAttachment8 = 0x8ce8
	// GlColorAttachment9 &nbsp;
	GlColorAttachment9 = 0x8ce9
	// GlColorAttachment10 &nbsp;
	GlColorAttachment10 = 0x8cea
	// GlColorAttachment11 &nbsp;
	GlColorAttachment11 = 0x8ceb
	// GlColorAttachment12 &nbsp;
	GlColorAttachment12 = 0x8cec
	// GlColorAttachment13 &nbsp;
	GlColorAttachment13 = 0x8ced
	// GlColorAttachment14 &nbsp;
	GlColorAttachment14 = 0x8cee
	// GlColorAttachment15 &nbsp;
	GlColorAttachment15 = 0x8cef
	// GlSampler3d &nbsp;
	GlSampler3d = 0x8b5f
	// GlSampler2dShadow &nbsp;
	GlSampler2dShadow = 0x8b62
	// GlSampler2dArray &nbsp;
	GlSampler2dArray = 0x8dc1
	// GlSampler2dArrayShadow &nbsp;
	GlSampler2dArrayShadow = 0x8dc4
	// GlSamplerCubeShadow &nbsp;
	GlSamplerCubeShadow = 0x8dc5
	// GlIntSampler2d &nbsp;
	GlIntSampler2d = 0x8dca
	// GlIntSampler3d &nbsp;
	GlIntSampler3d = 0x8dcb
	// GlIntSamplerCube &nbsp;
	GlIntSamplerCube = 0x8dcc
	// GlIntSampler2dArray &nbsp;
	GlIntSampler2dArray = 0x8dcf
	// GlUnsignedIntSampler2d &nbsp;
	GlUnsignedIntSampler2d = 0x8dd2
	// GlUnsignedIntSampler3d &nbsp;
	GlUnsignedIntSampler3d = 0x8dd3
	// GlUnsignedIntSamplerCube &nbsp;
	GlUnsignedIntSamplerCube = 0x8dd4
	// GlUnsignedIntSampler2dArray &nbsp;
	GlUnsignedIntSampler2dArray = 0x8dd7
	// GlMaxSamples &nbsp;
	GlMaxSamples = 0x8d57
	// GlSamplerBinding &nbsp;
	GlSamplerBinding = 0x8919
	// GlPixelPackBuffer &nbsp;
	GlPixelPackBuffer = 0x88eb
	// GlPixelUnpackBuffer &nbsp;
	GlPixelUnpackBuffer = 0x88ec
	// GlPixelPackBufferBinding &nbsp;
	GlPixelPackBufferBinding = 0x88ed
	// GlPixelUnpackBufferBinding &nbsp;
	GlPixelUnpackBufferBinding = 0x88ef
	// GlCopyReadBuffer &nbsp;
	GlCopyReadBuffer = 0x8f36
	// GlCopyWriteBuffer &nbsp;
	GlCopyWriteBuffer = 0x8f37
	// GlCopyReadBufferBinding &nbsp;
	GlCopyReadBufferBinding = 0x8f36
	// GlCopyWriteBufferBinding &nbsp;
	GlCopyWriteBufferBinding = 0x8f37
	// GlFloatMat2x3 &nbsp;
	GlFloatMat2x3 = 0x8b65
	// GlFloatMat2x4 &nbsp;
	GlFloatMat2x4 = 0x8b66
	// GlFloatMat3x2 &nbsp;
	GlFloatMat3x2 = 0x8b67
	// GlFloatMat3x4 &nbsp;
	GlFloatMat3x4 = 0x8b68
	// GlFloatMat4x2 &nbsp;
	GlFloatMat4x2 = 0x8b69
	// GlFloatMat4x3 &nbsp;
	GlFloatMat4x3 = 0x8b6a
	// GlUnsignedIntVec2 &nbsp;
	GlUnsignedIntVec2 = 0x8dc6
	// GlUnsignedIntVec3 &nbsp;
	GlUnsignedIntVec3 = 0x8dc7
	// GlUnsignedIntVec4 &nbsp;
	GlUnsignedIntVec4 = 0x8dc8
	// GlUnsignedNormalized &nbsp;
	GlUnsignedNormalized = 0x8c17
	// GlSignedNormalized &nbsp;
	GlSignedNormalized = 0x8f9c
	// GlVertexAttribArrayInteger &nbsp;
	GlVertexAttribArrayInteger = 0x88fd
	// GlVertexAttribArrayDivisor &nbsp;
	GlVertexAttribArrayDivisor = 0x88fe
	// GlTransformFeedbackBufferMode &nbsp;
	GlTransformFeedbackBufferMode = 0x8c7f
	// GlMaxTransformFeedbackSeparateComponents &nbsp;
	GlMaxTransformFeedbackSeparateComponents = 0x8c80
	// GlTransformFeedbackVaryings &nbsp;
	GlTransformFeedbackVaryings = 0x8c83
	// GlTransformFeedbackBufferStart &nbsp;
	GlTransformFeedbackBufferStart = 0x8c84
	// GlTransformFeedbackBufferSize &nbsp;
	GlTransformFeedbackBufferSize = 0x8c85
	// GlTransformFeedbackPrimitivesWritten &nbsp;
	GlTransformFeedbackPrimitivesWritten = 0x8c88
	// GlMaxTransformFeedbackInterleavedComponents &nbsp;
	GlMaxTransformFeedbackInterleavedComponents = 0x8c8a
	// GlMaxTransformFeedbackSeparateAttribs &nbsp;
	GlMaxTransformFeedbackSeparateAttribs = 0x8c8b
	// GlInterleavedAttribs &nbsp;
	GlInterleavedAttribs = 0x8c8c
	// GlSeparateAttribs &nbsp;
	GlSeparateAttribs = 0x8c8d
	// GlTransformFeedbackBuffer &nbsp;
	GlTransformFeedbackBuffer = 0x8c8e
	// GlTransformFeedbackBufferBinding &nbsp;
	GlTransformFeedbackBufferBinding = 0x8c8f
	// GlTransformFeedback &nbsp;
	GlTransformFeedback = 0x8e22
	// GlTransformFeedbackPaused &nbsp;
	GlTransformFeedbackPaused = 0x8e23
	// GlTransformFeedbackActive &nbsp;
	GlTransformFeedbackActive = 0x8e24
	// GlTransformFeedbackBinding &nbsp;
	GlTransformFeedbackBinding = 0x8e25
	// GlFramebufferAttachmentColorEncoding &nbsp;
	GlFramebufferAttachmentColorEncoding = 0x8210
	// GlFramebufferAttachmentComponentType &nbsp;
	GlFramebufferAttachmentComponentType = 0x8211
	// GlFramebufferAttachmentRedSize &nbsp;
	GlFramebufferAttachmentRedSize = 0x8212
	// GlFramebufferAttachmentGreenSize &nbsp;
	GlFramebufferAttachmentGreenSize = 0x8213
	// GlFramebufferAttachmentBlueSize &nbsp;
	GlFramebufferAttachmentBlueSize = 0x8214
	// GlFramebufferAttachmentAlphaSize &nbsp;
	GlFramebufferAttachmentAlphaSize = 0x8215
	// GlFramebufferAttachmentDepthSize &nbsp;
	GlFramebufferAttachmentDepthSize = 0x8216
	// GlFramebufferAttachmentStencilSize &nbsp;
	GlFramebufferAttachmentStencilSize = 0x8217
	// GlFramebufferDefault &nbsp;
	GlFramebufferDefault = 0x8218
	// GlDepthStencilAttachment &nbsp;
	GlDepthStencilAttachment = 0x821a
	// GlDepth24Stencil8 &nbsp;
	GlDepth24Stencil8 = 0x88f0
	// GlDrawFramebufferBinding &nbsp;
	GlDrawFramebufferBinding = 0x8ca6
	// GlReadFramebuffer &nbsp;
	GlReadFramebuffer = 0x8ca8
	// GlDrawFramebuffer &nbsp;
	GlDrawFramebuffer = 0x8ca9
	// GlReadFramebufferBinding &nbsp;
	GlReadFramebufferBinding = 0x8caa
	// GlRenderbufferSamples &nbsp;
	GlRenderbufferSamples = 0x8cab
	// GlFramebufferAttachmentTextureLayer &nbsp;
	GlFramebufferAttachmentTextureLayer = 0x8cd4
	// GlFramebufferIncompleteMultisample &nbsp;
	GlFramebufferIncompleteMultisample = 0x8d56
	// GlUniformBuffer &nbsp;
	GlUniformBuffer = 0x8a11
	// GlUniformBufferBinding &nbsp;
	GlUniformBufferBinding = 0x8a28
	// GlUniformBufferStart &nbsp;
	GlUniformBufferStart = 0x8a29
	// GlUniformBufferSize &nbsp;
	GlUniformBufferSize = 0x8a2a
	// GlMaxVertexUniformBlocks &nbsp;
	GlMaxVertexUniformBlocks = 0x8a2b
	// GlMaxFragmentUniformBlocks &nbsp;
	GlMaxFragmentUniformBlocks = 0x8a2d
	// GlMaxCombinedUniformBlocks &nbsp;
	GlMaxCombinedUniformBlocks = 0x8a2e
	// GlMaxUniformBufferBindings &nbsp;
	GlMaxUniformBufferBindings = 0x8a2f
	// GlMaxUniformBlockSize &nbsp;
	GlMaxUniformBlockSize = 0x8a30
	// GlMaxCombinedVertexUniformComponents &nbsp;
	GlMaxCombinedVertexUniformComponents = 0x8a31
	// GlMaxCombinedFragmentUniformComponents &nbsp;
	GlMaxCombinedFragmentUniformComponents = 0x8a33
	// GlUniformBufferOffsetAlignment &nbsp;
	GlUniformBufferOffsetAlignment = 0x8a34
	// GlActiveUniformBlocks &nbsp;
	GlActiveUniformBlocks = 0x8a36
	// GlUniformType &nbsp;
	GlUniformType = 0x8a37
	// GlUniformSize &nbsp;
	GlUniformSize = 0x8a38
	// GlUniformBlockIndex &nbsp;
	GlUniformBlockIndex = 0x8a3a
	// GlUniformOffset &nbsp;
	GlUniformOffset = 0x8a3b
	// GlUniformArrayStride &nbsp;
	GlUniformArrayStride = 0x8a3c
	// GlUniformMatrixStride &nbsp;
	GlUniformMatrixStride = 0x8a3d
	// GlUniformIsRowMajor &nbsp;
	GlUniformIsRowMajor = 0x8a3e
	// GlUniformBlockBinding &nbsp;
	GlUniformBlockBinding = 0x8a3f
	// GlUniformBlockDataSize &nbsp;
	GlUniformBlockDataSize = 0x8a40
	// GlUniformBlockActiveUniforms &nbsp;
	GlUniformBlockActiveUniforms = 0x8a42
	// GlUniformBlockActiveUniformIndices &nbsp;
	GlUniformBlockActiveUniformIndices = 0x8a43
	// GlUniformBlockReferencedByVertexShader &nbsp;
	GlUniformBlockReferencedByVertexShader = 0x8a44
	// GlUniformBlockReferencedByFragmentShader &nbsp;
	GlUniformBlockReferencedByFragmentShader = 0x8a46
	// GlObjectType &nbsp;
	GlObjectType = 0x9112
	// GlSyncCondition &nbsp;
	GlSyncCondition = 0x9113
	// GlSyncStatus &nbsp;
	GlSyncStatus = 0x9114
	// GlSyncFlags &nbsp;
	GlSyncFlags = 0x9115
	// GlSyncFence &nbsp;
	GlSyncFence = 0x9116
	// GlSyncGpuCommandsComplete &nbsp;
	GlSyncGpuCommandsComplete = 0x9117
	// GlUnsignaled &nbsp;
	GlUnsignaled = 0x9118
	// GlSignaled &nbsp;
	GlSignaled = 0x9119
	// GlAlreadySignaled &nbsp;
	GlAlreadySignaled = 0x911a
	// GlTimeoutExpired &nbsp;
	GlTimeoutExpired = 0x911b
	// GlConditionSatisfied &nbsp;
	GlConditionSatisfied = 0x911c
	// GlWaitFailed &nbsp;
	GlWaitFailed = 0x911d
	// GlSyncFlushCommandsBit &nbsp;
	GlSyncFlushCommandsBit = 0x00000001
	// GlColor &nbsp;
	GlColor = 0x1800
	// GlStencil &nbsp;
	GlStencil = 0x1802
	// GlMin &nbsp;
	GlMin = 0x8007
	// GlDepthComponent24 &nbsp;
	GlDepthComponent24 = 0x81a6
	// GlStreamRead &nbsp;
	GlStreamRead = 0x88e1
	// GlStreamCopy &nbsp;
	GlStreamCopy = 0x88e2
	// GlStaticRead &nbsp;
	GlStaticRead = 0x88e5
	// GlStaticCopy &nbsp;
	GlStaticCopy = 0x88e6
	// GlDynamicRead &nbsp;
	GlDynamicRead = 0x88e9
	// GlDynamicCopy &nbsp;
	GlDynamicCopy = 0x88ea
	// GlDepthComponent32f &nbsp;
	GlDepthComponent32f = 0x8cac
	// GlDepth32fStencil8 &nbsp;
	GlDepth32fStencil8 = 0x8cad
	// GlInvalidIndex &nbsp;
	GlInvalidIndex = 0xffffffff
	// GlTimeoutIgnored &nbsp;
	GlTimeoutIgnored = -1
	// GlMaxClientWaitTimeoutWebgl &nbsp;
	GlMaxClientWaitTimeoutWebgl = 0x9247
	// GlVertexAttribArrayDivisorAngle describes the frequency divisor used for instanced rendering.
	GlVertexAttribArrayDivisorAngle = 0x88fe
	// GlUnmaskedVendorWebgl passed to <code>getparameter</code> to get the vendor string of the graphics driver.
	GlUnmaskedVendorWebgl = 0x9245
	// GlUnmaskedRendererWebgl passed to <code>getparameter</code> to get the renderer string of the graphics driver.
	GlUnmaskedRendererWebgl = 0x9246
	// GlMaxTextureMaxAnisotropyExt returns the maximum available anisotropy.
	GlMaxTextureMaxAnisotropyExt = 0x84ff
	// GlTextureMaxAnisotropyExt passed to <code>texparameter</code> to set the desired maximum anisotropy for a texture.
	GlTextureMaxAnisotropyExt = 0x84fe
	// GlCompressedRgbS3tcDxt1Ext a dxt1-compressed image in an rgb image format.
	GlCompressedRgbS3tcDxt1Ext = 0x83f0
	// GlCompressedRgbaS3tcDxt1Ext a dxt1-compressed image in an rgb image format with a simple on/off alpha value.
	GlCompressedRgbaS3tcDxt1Ext = 0x83f1
	// GlCompressedRgbaS3tcDxt3Ext a dxt3-compressed image in an rgba image format. compared to a 32-bit rgba texture, it offers 4:1 compression.
	GlCompressedRgbaS3tcDxt3Ext = 0x83f2
	// GlCompressedRgbaS3tcDxt5Ext a dxt5-compressed image in an rgba image format. it also provides a 4:1 compression, but differs to the dxt3 compression in how the alpha compression is done.
	GlCompressedRgbaS3tcDxt5Ext = 0x83f3
	// GlCompressedR11Eac one-channel (red) unsigned format compression.
	GlCompressedR11Eac = 0x9270
	// GlCompressedSignedR11Eac one-channel (red) signed format compression.
	GlCompressedSignedR11Eac = 0x9271
	// GlCompressedRg11Eac two-channel (red and green) unsigned format compression.
	GlCompressedRg11Eac = 0x9272
	// GlCompressedSignedRg11Eac two-channel (red and green) signed format compression.
	GlCompressedSignedRg11Eac = 0x9273
	// GlCompressedRgb8Etc2 compresses rbg8 data with no alpha channel.
	GlCompressedRgb8Etc2 = 0x9274
	// GlCompressedRgba8Etc2Eac compresses rgba8 data. the rgb part is encoded the same as <code>rgbEtc2</code>, but the alpha part is encoded separately.
	GlCompressedRgba8Etc2Eac = 0x9275
	// GlCompressedSrgb8Etc2 compresses srbg8 data with no alpha channel.
	GlCompressedSrgb8Etc2 = 0x9276
	// GlCompressedSrgb8Alpha8Etc2Eac compresses srgba8 data. the srgb part is encoded the same as <code>srgbEtc2</code>, but the alpha part is encoded separately.
	GlCompressedSrgb8Alpha8Etc2Eac = 0x9277
	// GlCompressedRgb8PunchthroughAlpha1Etc2 similar to <code>rgb8Etc</code>, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent.
	GlCompressedRgb8PunchthroughAlpha1Etc2 = 0x9278
	// GlCompressedSrgb8PunchthroughAlpha1Etc2 similar to <code>srgb8Etc</code>, but with ability to punch through the alpha channel, which means to make it completely opaque or transparent.
	GlCompressedSrgb8PunchthroughAlpha1Etc2 = 0x9279
	// GlCompressedRgbPvrtc4bppv1Img rgb compression in 4-bit mode. one block for each 4×4 pixels.
	GlCompressedRgbPvrtc4bppv1Img = 0x8c00
	// GlCompressedRgbaPvrtc4bppv1Img rgba compression in 4-bit mode. one block for each 4×4 pixels.
	GlCompressedRgbaPvrtc4bppv1Img = 0x8c02
	// GlCompressedRgbPvrtc2bppv1Img rgb compression in 2-bit mode. one block for each 8×4 pixels.
	GlCompressedRgbPvrtc2bppv1Img = 0x8c01
	// GlCompressedRgbaPvrtc2bppv1Img rgba compression in 2-bit mode. one block for each 8×4 pixe
	GlCompressedRgbaPvrtc2bppv1Img = 0x8c03
	// GlCompressedRgbEtc1Webgl compresses 24-bit rgb data with no alpha channel.
	GlCompressedRgbEtc1Webgl = 0x8d64
	// GlCompressedRgbAtcWebgl compresses rgb textures with no alpha channel.
	GlCompressedRgbAtcWebgl = 0x8c92
	// GlCompressedRgbaAtcExplicitAlphaWebgl compresses rgba textures using explicit alpha encoding (useful when alpha transitions are sharp).
	GlCompressedRgbaAtcExplicitAlphaWebgl = 0x8c92
	// GlCompressedRgbaAtcInterpolatedAlphaWebgl compresses rgba textures using interpolated alpha encoding (useful when alpha transitions are gradient).
	GlCompressedRgbaAtcInterpolatedAlphaWebgl = 0x87ee
	// GlUnsignedInt248Webgl unsigned integer type for 24-bit depth texture data.
	GlUnsignedInt248Webgl = 0x84fa
	// GlHalfFloatOes half floating-point type (16-bit).
	GlHalfFloatOes = 0x8d61
	// GlRGBA32fExt rgba 32-bit floating-point&nbsp;color-renderable format.
	GlRGBA32fExt = 0x8814
	// GlRGB32fExt rgb 32-bit floating-point&nbsp;color-renderable format.
	GlRGB32fExt = 0x8815
	// GlFramebufferAttachmentComponentTypeExt &nbsp;
	GlFramebufferAttachmentComponentTypeExt = 0x8211
	// GlUnsignedNormalizedExt &nbsp;
	GlUnsignedNormalizedExt = 0x8c17
	// GlMinExt produces the minimum color components of the source and destination colors.
	GlMinExt = 0x8007
	// GlMaxExt produces the maximum color components of the source and destination colors.
	GlMaxExt = 0x8008
	// GlSrgbExt unsized srgb format that leaves the precision up to the driver.
	GlSrgbExt = 0x8c40
	// GlSrgbAlphaExt unsized srgb format with unsized alpha component.
	GlSrgbAlphaExt = 0x8c42
	// GlSrgb8Alpha8Ext sized (8-bit) srgb and alpha formats.
	GlSrgb8Alpha8Ext = 0x8c43
	// GlFramebufferAttachmentColorEncodingExt returns the framebuffer color encoding.
	GlFramebufferAttachmentColorEncodingExt = 0x8210
	// GlFragmentShaderDerivativeHintOes indicates the accuracy of the derivative calculation for the glsl built-in functions: <code>dfdx</code>, <code>dfdy</code>, and <code>fwidth</code>.
	GlFragmentShaderDerivativeHintOes = 0x8b8b
	// GlColorAttachment0Webgl framebuffer color attachment point
	GlColorAttachment0Webgl = 0x8ce0
	// GlColorAttachment1Webgl framebuffer color attachment point
	GlColorAttachment1Webgl = 0x8ce1
	// GlColorAttachment2Webgl framebuffer color attachment point
	GlColorAttachment2Webgl = 0x8ce2
	// GlColorAttachment3Webgl framebuffer color attachment point
	GlColorAttachment3Webgl = 0x8ce3
	// GlColorAttachment4Webgl framebuffer color attachment point
	GlColorAttachment4Webgl = 0x8ce4
	// GlColorAttachment5Webgl framebuffer color attachment point
	GlColorAttachment5Webgl = 0x8ce5
	// GlColorAttachment6Webgl framebuffer color attachment point
	GlColorAttachment6Webgl = 0x8ce6
	// GlColorAttachment7Webgl framebuffer color attachment point
	GlColorAttachment7Webgl = 0x8ce7
	// GlColorAttachment8Webgl framebuffer color attachment point
	GlColorAttachment8Webgl = 0x8ce8
	// GlColorAttachment9Webgl framebuffer color attachment point
	GlColorAttachment9Webgl = 0x8ce9
	// GlColorAttachment10Webgl framebuffer color attachment point
	GlColorAttachment10Webgl = 0x8cea
	// GlColorAttachment11Webgl framebuffer color attachment point
	GlColorAttachment11Webgl = 0x8ceb
	// GlColorAttachment12Webgl framebuffer color attachment point
	GlColorAttachment12Webgl = 0x8cec
	// GlColorAttachment13Webgl framebuffer color attachment point
	GlColorAttachment13Webgl = 0x8ced
	// GlColorAttachment14Webgl framebuffer color attachment point
	GlColorAttachment14Webgl = 0x8cee
	// GlColorAttachment15Webgl framebuffer color attachment point
	GlColorAttachment15Webgl = 0x8cef
	// GlDrawBuffer0Webgl draw buffer
	GlDrawBuffer0Webgl = 0x8825
	// GlDrawBuffer1Webgl draw buffer
	GlDrawBuffer1Webgl = 0x8826
	// GlDrawBuffer2Webgl draw buffer
	GlDrawBuffer2Webgl = 0x8827
	// GlDrawBuffer3Webgl draw buffer
	GlDrawBuffer3Webgl = 0x8828
	// GlDrawBuffer4Webgl draw buffer
	GlDrawBuffer4Webgl = 0x8829
	// GlDrawBuffer5Webgl draw buffer
	GlDrawBuffer5Webgl = 0x882a
	// GlDrawBuffer6Webgl draw buffer
	GlDrawBuffer6Webgl = 0x882b
	// GlDrawBuffer7Webgl draw buffer
	GlDrawBuffer7Webgl = 0x882c
	// GlDrawBuffer8Webgl draw buffer
	GlDrawBuffer8Webgl = 0x882d
	// GlDrawBuffer9Webgl draw buffer
	GlDrawBuffer9Webgl = 0x882e
	// GlDrawBuffer10Webgl draw buffer
	GlDrawBuffer10Webgl = 0x882f
	// GlDrawBuffer11Webgl draw buffer
	GlDrawBuffer11Webgl = 0x8830
	// GlDrawBuffer12Webgl draw buffer
	GlDrawBuffer12Webgl = 0x8831
	// GlDrawBuffer13Webgl draw buffer
	GlDrawBuffer13Webgl = 0x8832
	// GlDrawBuffer14Webgl draw buffer
	GlDrawBuffer14Webgl = 0x8833
	// GlDrawBuffer15Webgl draw buffer
	GlDrawBuffer15Webgl = 0x8834
	// GlMaxColorAttachmentsWebgl maximum number of framebuffer color attachment points
	GlMaxColorAttachmentsWebgl = 0x8cdf
	// GlMaxDrawBuffersWebgl maximum number of draw buffers
	GlMaxDrawBuffersWebgl = 0x8824
	// GlVertexArrayBindingOes the bound vertex array object (vao).
	GlVertexArrayBindingOes = 0x85b5
	// GlQueryCounterBitsExt the number of bits used to hold the query result for the given target.
	GlQueryCounterBitsExt = 0x8864
	// GlCurrentQueryExt the currently active query.
	GlCurrentQueryExt = 0x8865
	// GlQueryResultExt the query result.
	GlQueryResultExt = 0x8866
	// GlQueryResultAvailableExt a boolean indicating whether or not a query result is available.
	GlQueryResultAvailableExt = 0x8867
	// GlTimeElapsedExt elapsed time (in nanoseconds).
	GlTimeElapsedExt = 0x88bf
	// GlTimestampExt the current time.
	GlTimestampExt = 0x8e28
	// GlGpuDisjointExt a boolean indicating whether or not the gpu performed any disjoint operation.
	GlGpuDisjointExt = 0x8fbb
)
View Source
const (
	//GlTexture0 A texture unit. The first texture unit
	GlTexture0 = iota + 0x84c0
	//GlTexture1 A texture unit
	GlTexture1
	//GlTexture2 A texture unit
	GlTexture2
	//GlTexture3 A texture unit
	GlTexture3
	//GlTexture4 A texture unit
	GlTexture4
	//GlTexture5 A texture unit
	GlTexture5
	//GlTexture6 A texture unit
	GlTexture6
	//GlTexture7 A texture unit
	GlTexture7
	//GlTexture8 A texture unit
	GlTexture8
	//GlTexture9 A texture unit
	GlTexture9
	//GlTexture10 A texture unit
	GlTexture10
	//GlTexture11 A texture unit
	GlTexture11
	//GlTexture12 A texture unit
	GlTexture12
	//GlTexture13 A texture unit
	GlTexture13
	//GlTexture14 A texture unit
	GlTexture14
	//GlTexture15 A texture unit
	GlTexture15
	//GlTexture16 A texture unit
	GlTexture16
	//GlTexture17 A texture unit
	GlTexture17
	//GlTexture18 A texture unit
	GlTexture18
	//GlTexture19 A texture unit
	GlTexture19
	//GlTexture20 A texture unit
	GlTexture20
	//GlTexture21 A texture unit
	GlTexture21
	//GlTexture22 A texture unit
	GlTexture22
	//GlTexture23 A texture unit
	GlTexture23
	//GlTexture24 A texture unit
	GlTexture24
	//GlTexture25 A texture unit
	GlTexture25
	//GlTexture26 A texture unit
	GlTexture26
	//GlTexture27 A texture unit
	GlTexture27
	//GlTexture28 A texture unit
	GlTexture28
	//GlTexture29 A texture unit
	GlTexture29
	//GlTexture30 A texture unit
	GlTexture30
	//GlTexture31 A texture unit. The last texture unit.
	GlTexture31 = 0x84df
)
View Source
const (
	//TextureFilterLinear linear filtering
	TextureFilterLinear TextureFilter = GlLinear
	//TextureFilterNearest nearest neighbour filtering
	TextureFilterNearest = GlNearest
	//TextureFilterNearestMipmapNearest nearest neighbour filtering
	TextureFilterNearestMipmapNearest = GlNearestMipmapNearest
	//TextureFilterLinearMipmapNearest linear filtering
	TextureFilterLinearMipmapNearest = GlLinearMipmapNearest
	//TextureFilterNearestMipmapLinear nearest neighbour filtering
	TextureFilterNearestMipmapLinear = GlNearestMipmapLinear
	//TextureFilterLinearMipmapLinear linear filtering
	TextureFilterLinearMipmapLinear = GlLinearMipmapLinear
)
View Source
const (
	//TextureWrapRepeat repeats the texture
	TextureWrapRepeat TextureWrap = GlRepeat
	//TextureWrapClampToEdge clamps the texture
	TextureWrapClampToEdge = GlClampToEdge
	//TextureWrapMirroredRepeat mirrors the texture
	TextureWrapMirroredRepeat = GlMirroredRepeat
)
View Source
const (
	//Dash -
	KeyDash         = Key(189)
	KeyApostrophe   = Key(222)
	KeySemicolon    = Key(186)
	KeyEquals       = Key(187)
	KeyComma        = Key(188)
	KeyPeriod       = Key(190)
	KeySlash        = Key(191)
	KeyBackslash    = Key(220)
	KeyBackspace    = Key(8)
	KeyTab          = Key(9)
	KeyCapsLock     = Key(20)
	KeySpace        = Key(32)
	KeyEnter        = Key(13)
	KeyEscape       = Key(27)
	KeyInsert       = Key(45)
	KeyPrintScreen  = Key(42)
	KeyDelete       = Key(46)
	KeyPageUp       = Key(33)
	KeyPageDown     = Key(34)
	KeyHome         = Key(36)
	KeyEnd          = Key(35)
	KeyPause        = Key(19)
	KeyScrollLock   = Key(145)
	KeyArrowLeft    = Key(37)
	KeyArrowRight   = Key(39)
	KeyArrowDown    = Key(40)
	KeyArrowUp      = Key(38)
	KeyLeftBracket  = Key(219)
	KeyLeftShift    = Key(16)
	KeyLeftControl  = Key(17)
	KeyLeftSuper    = Key(73)
	KeyLeftAlt      = Key(18)
	KeyRightBracket = Key(221)
	KeyRightShift   = Key(16)
	KeyRightControl = Key(17)
	KeyRightSuper   = Key(73)
	KeyRightAlt     = Key(18)
	KeyZero         = Key(48)
	KeyOne          = Key(49)
	KeyTwo          = Key(50)
	KeyThree        = Key(51)
	KeyFour         = Key(52)
	KeyFive         = Key(53)
	KeySix          = Key(54)
	KeySeven        = Key(55)
	KeyEight        = Key(56)
	KeyNine         = Key(57)
	KeyF1           = Key(112)
	KeyF2           = Key(113)
	KeyF3           = Key(114)
	KeyF4           = Key(115)
	KeyF5           = Key(116)
	KeyF6           = Key(117)
	KeyF7           = Key(118)
	KeyF8           = Key(119)
	KeyF9           = Key(120)
	KeyF10          = Key(121)
	KeyF11          = Key(122)
	KeyF12          = Key(123)
	KeyA            = Key(65)
	KeyB            = Key(66)
	KeyC            = Key(67)
	KeyD            = Key(68)
	KeyE            = Key(69)
	KeyF            = Key(70)
	KeyG            = Key(71)
	KeyH            = Key(72)
	KeyI            = Key(73)
	KeyJ            = Key(74)
	KeyK            = Key(75)
	KeyL            = Key(76)
	KeyM            = Key(77)
	KeyN            = Key(78)
	KeyO            = Key(79)
	KeyP            = Key(80)
	KeyQ            = Key(81)
	KeyR            = Key(82)
	KeyS            = Key(83)
	KeyT            = Key(84)
	KeyU            = Key(85)
	KeyV            = Key(86)
	KeyW            = Key(87)
	KeyX            = Key(88)
	KeyY            = Key(89)
	KeyZ            = Key(90)
	KeyNumLock      = Key(144)
	KeyNumMultiply  = Key(106)
	KeyNumDivide    = Key(111)
	KeyNumAdd       = Key(107)
	KeyNumSubtract  = Key(109)
	KeyNumZero      = Key(96)
	KeyNumOne       = Key(97)
	KeyNumTwo       = Key(98)
	KeyNumThree     = Key(99)
	KeyNumFour      = Key(100)
	KeyNumFive      = Key(101)
	KeyNumSix       = Key(102)
	KeyNumSeven     = Key(103)
	KeyNumEight     = Key(104)
	KeyNumNine      = Key(105)
	KeyNumDecimal   = Key(110)
	KeyNumEnter     = Key(13)
)
View Source
const (
	//PI 3.1415
	PI float32 = 3.14159265358979323846

	//Deg2Rad used to convert degrees into radians
	Deg2Rad float32 = PI / 180

	//Rad2Deg used to convert radians into degrees
	Rad2Deg float32 = 180 / PI
)

Variables

View Source
var (
	// LightGray ...
	LightGray = NewColor(200, 200, 200, 255)
	//Gray ...
	Gray = NewColor(130, 130, 130, 255)
	//DarkGray ...
	DarkGray = NewColor(80, 80, 80, 255)
	//Yellow ...
	Yellow = NewColor(253, 249, 0, 255) // Yellow
	//Gold ...
	Gold = NewColor(255, 203, 0, 255) // Gold
	//Orange ...
	Orange = NewColor(255, 161, 0, 255) // Orange
	//Pink ...
	Pink = NewColor(255, 109, 194, 255) // Pink
	//Red ...
	Red = NewColor(230, 41, 55, 255) // Red
	//Maroon ...
	Maroon = NewColor(190, 33, 55, 255) // Maroon
	//Green ...
	Green = NewColor(0, 228, 48, 255) // Green
	//Lime ...
	Lime = NewColor(0, 158, 47, 255) // Lime
	//DarkGreen ...
	DarkGreen = NewColor(0, 117, 44, 255) // Dark Green
	//SkyBlue ...
	SkyBlue = NewColor(102, 191, 255, 255) // Sky Blue
	//Blue ...
	Blue = NewColor(0, 121, 241, 255) // Blue
	//DarkBlue ...
	DarkBlue = NewColor(0, 82, 172, 255) // Dark Blue
	//Purple ...
	Purple = NewColor(200, 122, 255, 255) // Purple
	//Violet ...
	Violet = NewColor(135, 60, 190, 255) // Violet
	//DarkPurple ...
	DarkPurple = NewColor(112, 31, 126, 255) // Dark Purple
	//Beige ...
	Beige = NewColor(211, 176, 131, 255) // Beige
	//Brown ...
	Brown = NewColor(127, 106, 79, 255) // Brown
	//DarkBrown ...
	DarkBrown = NewColor(76, 63, 47, 255) // Dark Brown
	//White ...
	White = NewColor(255, 255, 255, 255) // White
	//Black ...
	Black = NewColor(0, 0, 0, 255) // Black
	//Blank (Transparent)
	Blank = NewColor(0, 0, 0, 0) // Blank (Transparent)
	//Magenta ...
	Magenta = NewColor(255, 0, 255, 255) // Magenta
	//RayWhite - Off White
	RayWhite = NewColor(245, 245, 245, 255) // My own White (raylib logo)
	//Aqua ...
	Aqua = NewColor(0, 162, 156, 255)
	//GopherBlue is the Go Blue
	GopherBlue = NewColor(1, 173, 216, 255)
	//Transparent is completely black with no alpha
	Transparent = NewColor(0, 0, 0, 0)
)
View Source
var (
	//GL gives direct access to the WebGL component of the canvas.
	GL *WebGL

	//DebugDraw causes renderers to display debug information
	DebugDraw = false
	//DebugDrawLoops is a less efficent way of drawing, but preserves the box representation when drawing
	DebugDrawLoops = true

	//AlwaysDraw continously draws
	AlwaysDraw = true
)

Functions

func AddEventListener

func AddEventListener(event string, fn func(this js.Value, args []js.Value) interface{}) js.Func

AddEventListener adds a new event listener to the canvas. It will return a JS function that needs to be Released() when its no longer required.

func Clamp

func Clamp(v float64, min float64, max float64) float64

Clamp a value between min and max

func Clamp32

func Clamp32(v float32, min float32, max float32) float32

Clamp32 a value between min and max

func DT

func DT() float32

DT returns a less accurate version of GetDeltaTime, for all your 32bit mathmatic needs.

func DownloadFile

func DownloadFile(url string) ([]byte, error)

DownloadFile fetches a URL and return the bytes

func DownloadString

func DownloadString(url string) (string, error)

DownloadString fetches a string from the URL

func Exit

func Exit()

Exit the application

func Float32frombits

func Float32frombits(b uint32) float32

Float32frombits returns the floating point number corresponding to the IEEE 754 binary representation b.

func GetDeltaTime

func GetDeltaTime() float64

GetDeltaTime returns a high accuracy difference in time between the last frame and the current one.

func GetFrameCount

func GetFrameCount() int64

GetFrameCount returns the current frame

func GetFrameTime

func GetFrameTime() float64

GetFrameTime returns the time the last frame was rendered

func Height

func Height() int

Height gets the width of the screen

func Inf

func Inf(sign int) float32

Inf returns positive infinity if sign >= 0, negative infinity if sign < 0.

func NaN32

func NaN32() float32

NaN32 returns an IEEE 754 “not-a-number” value. Source: https://github.com/chewxy/math32/blob/9a000fcb79dff2019bd78fc28bd676198ff3a616/bits.go

func RequestRedraw

func RequestRedraw()

RequestRedraw requests for a new animation frame

func Run

func Run(application Application) int

Run setups the WebGL context and runs the application. It is blocking and returns an exit code if Exit() is ever called.

func SetCanvasSize

func SetCanvasSize(w, h int)

SetCanvasSize the size of the canvas

func Width

func Width() int

Width gets the width of the screen

Types

type Application

type Application interface {
	Start() bool
	Update(deltaTime float32)
	Render()
}

Application handles the base framework

type Color

type Color struct {
	R uint8
	G uint8
	B uint8
	A uint8
}

Color type, RGBA (32bit)

func NewColor

func NewColor(r, g, b, a uint8) Color

NewColor creates a new colour

func NewColorFromHSV

func NewColorFromHSV(hsv Vector3) Color

NewColorFromHSV turns a HSV to a colour

func NewColorFromNormalized

func NewColorFromNormalized(normalized Vector4) Color

NewColorFromNormalized creates a colour from the normalized value [0..1]

func NewColorInt

func NewColorInt(hexValue int) Color

NewColorInt creates a colour from a hexadecimal int

func (Color) Fade

func (c Color) Fade(alpha float32) Color

Fade a colour

func (Color) Lerp

func (c Color) Lerp(target Color, amount float32) Color

Lerp a color towards another color

func (Color) LerpHSV

func (c Color) LerpHSV(target Color, amount float32) Color

LerpHSV will lerp the color towards another, using their calculated HSV to do so. Note it is more efficient to store the calculated HSV of each and lerp between them

func (Color) Normalize

func (c Color) Normalize() Vector4

Normalize returns the normalized colour as floats [0..1]

func (Color) ToHSV

func (c Color) ToHSV() Vector3

ToHSV turns the colour into a HSV format

func (Color) ToInt

func (c Color) ToInt() int

ToInt converts the colour into a hexadecimal int

func (Color) ToTint

func (c Color) ToTint() float32

ToTint converts the colour into a float32 tint which is used in shaders.

type Font

type Font struct {
	Spacing float32 //Spacing is the offset between characters
	// contains filtered or unexported fields
}

Font contains meta information about an available font atlas

func LoadFont

func LoadFont(face font.Face, charset string) *Font

LoadFont generates an atlas and prepares a font

func LoadFontBitmap

func LoadFontBitmap(image *Image, charset string, charPerLines, noLines int) *Font

LoadFontBitmap loads a bitmap font, with the given charset map and given characters per line. The image will be directly used as the font. NOTE: Due to Go's inconsistencies and frankly absurb design choice in how it represent strings, this needs to be ASCII Extended only charset. You can map different icons, but this needs to be a []byte basically, because Go is dumb.

Serious, it has some really shit font implementation, and to top it off, it gives me shit like "iterating gives different results than indexing". Its beyond reason

func (*Font) GetCharset

func (f *Font) GetCharset() string

GetCharset gets the current character set

func (*Font) GetGlyphs

func (f *Font) GetGlyphs() map[rune]Glyph

GetGlyphs gets a map of glyphs

func (*Font) GetTexture

func (f *Font) GetTexture() *Texture

GetTexture gets the current atlas texture

func (*Font) GlyphString

func (f *Font) GlyphString(str string) *GlyphString

GlyphString turns the string into a series of Glyphs. This is used in rendering for drawing each character. A quad can be made at each position, with the UV supplied. All the origins of the sprites are assumed to be at 0,1 (bottom left). When drawing, draw from the bottom left corner. This will ensure the scaling is applied correctly. This function takes into account for their Kerning, but some TTF fonts may not support Kerning (Go Bug)

func (*Font) Kern

func (f *Font) Kern(left, right rune) float32

Kern gets the spacing between two runes

type FontKerner

type FontKerner interface {
	//Kern the font.
	Kern(a, b rune) fixed.Int26_6
}

FontKerner handles kerning

type GLEnum

type GLEnum = int

GLEnum represents all available WebGL constants, prefixed with Gl and turned into UpperCamelCase. For example, DEPTH_BUFFER_BIT is now GlDepthBufferBit

type Glyph

type Glyph struct {
	Atlas   Rectangle //Atlas defines the UV of the glyph
	Ascent  float32   //Ascent is how far up it should be shifted
	Descent float32   //Descent is how far down it should be shifted
	Advance float32   //Advance is how far the next character should start
}

Glyph is a particular rune graphic in the atlas

type GlyphString

type GlyphString struct {
	Positions  []Vector2   //Positions is the relative position of each glyph
	UV         []Rectangle //UV is the UV of each glyph
	LineHeight float32     //LineHeight is the maximium height of each line
	// contains filtered or unexported fields
}

GlyphString is a string made up out of glyphs.

func (*GlyphString) GetFont

func (gstr *GlyphString) GetFont() *Font

GetFont gets the current font in the glyph stirng

func (*GlyphString) GetTexture

func (gstr *GlyphString) GetTexture() *Texture

GetTexture gets the current atlas texture

func (*GlyphString) RenderSprites

func (gstr *GlyphString) RenderSprites(renderer *SpriteRenderer, position Vector2, scale float32, color Color)

RenderSprites uses the SpriteRenderer to draw the glyphs. Its main purpose is to serve as an example on how a renderer could be writen for the fonts. see noodle/font.go for this function.

type Image

type Image struct {
	// contains filtered or unexported fields
}

Image is a CPU image

func LoadImage

func LoadImage(url string) (*Image, error)

LoadImage loads a new image

func LoadImageRGBA

func LoadImageRGBA(rgba *image.RGBA) (*Image, error)

LoadImageRGBA loads a go RGBA image

func (*Image) CreateTexture

func (i *Image) CreateTexture() *Texture

CreateTexture creates a new texture

func (*Image) Data

func (i *Image) Data() js.Value

Data gets the JS value

func (*Image) Height

func (i *Image) Height() int

Height gets the height in pixels

func (*Image) IsPowerOf2

func (i *Image) IsPowerOf2() bool

IsPowerOf2 checks if the image is a square power

func (*Image) Width

func (i *Image) Width() int

Width gets the width in pixels

type InputHandler

type InputHandler struct {
	// contains filtered or unexported fields
}

InputHandler handles the different states of the input

func Input

func Input() *InputHandler

Input returns the current input handler

func (*InputHandler) GetAxis

func (i *InputHandler) GetAxis(negativeKey, positiveKey Key) float32

GetAxis gets a normalized 1D axis

func (*InputHandler) GetAxis2D

func (i *InputHandler) GetAxis2D(negHorizontalKey, posHorizontalKey, negVerticalKey, posVerticalKey Key) Vector2

GetAxis2D gets a normalized 2D axis based on the keys being pressed

func (*InputHandler) GetButton

func (i *InputHandler) GetButton(button int) bool

GetButton gets if the current button is pressed

func (*InputHandler) GetButtonDown

func (i *InputHandler) GetButtonDown(button int) bool

GetButtonDown gets if the current button has started being pressed

func (*InputHandler) GetButtonUp

func (i *InputHandler) GetButtonUp(button int) bool

GetButtonUp gets if the current button was released

func (*InputHandler) GetKey

func (i *InputHandler) GetKey(key Key) bool

GetKey gets if the current key is pressed

func (*InputHandler) GetKeyDown

func (i *InputHandler) GetKeyDown(key Key) bool

GetKeyDown gets if the current key has started being pressed

func (*InputHandler) GetKeyUp

func (i *InputHandler) GetKeyUp(key Key) bool

GetKeyUp gets if the current key was released

func (*InputHandler) GetMousePosition

func (i *InputHandler) GetMousePosition() Vector2

GetMousePosition gets the current mouse position

func (*InputHandler) GetMouseScroll

func (i *InputHandler) GetMouseScroll() float32

GetMouseScroll gets the current mouse scroll delta

func (*InputHandler) GetMouseX

func (i *InputHandler) GetMouseX() int

GetMouseX gets the current mouse position on the screen in pixels

func (*InputHandler) GetMouseY

func (i *InputHandler) GetMouseY() int

GetMouseY gets the current mouse position on the screen in pixels

type Key

type Key int

Key is a Keycode representation of a keyboard character. use the https://keycode.info/ tool to help identify missing key codes

type Matrix

type Matrix struct {
	M0 float32
	M1 float32
	M2 float32
	M3 float32

	M4 float32
	M5 float32
	M6 float32
	M7 float32

	M8  float32
	M9  float32
	M10 float32
	M11 float32

	M12 float32
	M13 float32
	M14 float32
	M15 float32
}

Matrix A representation of a 4 x 4 matrix

func NewMatrixFrustum

func NewMatrixFrustum(left, right, bottom, top, near, far float32) Matrix

NewMatrixFrustum generates a Frustum Matrix.

func NewMatrixIdentity

func NewMatrixIdentity() Matrix

NewMatrixIdentity creates a identity

func NewMatrixLookAt

func NewMatrixLookAt(eye, target, up Vector3) Matrix

NewMatrixLookAt creates a matrix to look at a target

func NewMatrixOrtho

func NewMatrixOrtho(left, right, bottom, top, near, far float32) Matrix

NewMatrixOrtho creates a orthographic projection

func NewMatrixPerspective

func NewMatrixPerspective(fovy, aspect, near, far float32) Matrix

NewMatrixPerspective creates a perspective projection matrix. FOVY is in degrees

func NewMatrixQuaternion

func NewMatrixQuaternion(q Quaternion) Matrix

NewMatrixQuaternion creates a new rotation matrix from a quaternion https://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToMatrix/index.htm

func NewMatrixRotate

func NewMatrixRotate(axis Vector3, radians float32) Matrix

NewMatrixRotate creates a rotation matrix based of the axis and radians

func NewMatrixRotateX

func NewMatrixRotateX(radians float32) Matrix

NewMatrixRotateX creates a new matrix that is rotated

func NewMatrixRotateXYZ

func NewMatrixRotateXYZ(radians Vector3) Matrix

NewMatrixRotateXYZ new xyz-rotation matrix (in radians)

func NewMatrixRotateY

func NewMatrixRotateY(radians float32) Matrix

NewMatrixRotateY creates a new matrix that is rotated

func NewMatrixRotateZ

func NewMatrixRotateZ(radians float32) Matrix

NewMatrixRotateZ creates a new matrix that is rotated

func NewMatrixScale

func NewMatrixScale(scale Vector3) Matrix

NewMatrixScale creates a new scalling matrix

func NewMatrixTransform

func NewMatrixTransform(transform Transform) Matrix

NewMatrixTransform creates a new matrix based off a transform

func NewMatrixTranslate

func NewMatrixTranslate(v Vector3) Matrix

NewMatrixTranslate creates a blank translation matrix from vector

func NewMatrixTranslate32

func NewMatrixTranslate32(x, y, z float32) Matrix

NewMatrixTranslate32 creates a blank translation matrix

func NewMatrixTranslate64

func NewMatrixTranslate64(x, y, z float64) Matrix

NewMatrixTranslate64 creates a blank translation matrix

func (Matrix) Add

func (m Matrix) Add(right Matrix) Matrix

Add two matrices

func (Matrix) Decompose

func (m Matrix) Decompose() []float32

Decompose turns a matrix into an slice of floats

func (*Matrix) DecomposePointer

func (m *Matrix) DecomposePointer() *[16]float32

DecomposePointer is an unsafe Decompose. Instead of the values being copied, a pointer to the matrix is cast into a float array pointer and returned.

func (Matrix) Detrimant

func (m Matrix) Detrimant() float32

Detrimant of the matrix

func (Matrix) Invert

func (m Matrix) Invert() Matrix

Invert the matrix

func (Matrix) Multiply

func (m Matrix) Multiply(right Matrix) Matrix

Multiply two matrix together. Note that order matters.

func (Matrix) Normalize

func (m Matrix) Normalize() Matrix

Normalize calcuates the normal of the matrix

func (Matrix) Subtract

func (m Matrix) Subtract(right Matrix) Matrix

Subtract two matrices

func (Matrix) Trace

func (m Matrix) Trace() float32

Trace of the matrix (sum of values along diagonal)

func (Matrix) Transpose

func (m Matrix) Transpose() Matrix

Transpose the matrix

type Quaternion

type Quaternion struct {
	X float32
	Y float32
	Z float32
	W float32
}

Quaternion A represntation of rotations that does not suffer from gimbal lock

func NewQuaternionAxisAngle

func NewQuaternionAxisAngle(axis Vector3, angle float32) Quaternion

NewQuaternionAxisAngle creates a quaternion from an axis and its rotation

func NewQuaternionBetweenVectors

func NewQuaternionBetweenVectors(start, dest Vector3) Quaternion

NewQuaternionBetweenVectors creates a rotation between the two vectors.

func NewQuaternionEuler

func NewQuaternionEuler(euler Vector3) Quaternion

NewQuaternionEuler creates a quaternion from euler angles (roll, yaw, pitch) in radians

func NewQuaternionIdentity

func NewQuaternionIdentity() Quaternion

NewQuaternionIdentity creates a Quaternion Identity (a blank quaternion)

func NewQuaternionLookAt

func NewQuaternionLookAt(eye, center, up Vector3) Quaternion

NewQuaternionLookAt creates a rotation from the eye to the center, with the give up.

func NewQuaternionMatrix

func NewQuaternionMatrix(matrix Matrix) Quaternion

NewQuaternionMatrix converts a pure rotation matrix into a quaternion

func (Quaternion) Backward

func (q Quaternion) Backward() Vector3

Backward returns a directional vector that is represented by this quaternion

func (Quaternion) Decompose

func (q Quaternion) Decompose() []float32

Decompose the quaternion into a slice of floats

func (Quaternion) Down

func (q Quaternion) Down() Vector3

Down returns a directional vector that is represented by this quaternion

func (Quaternion) Forward

func (q Quaternion) Forward() Vector3

Forward returns a directional vector that is represented by this quaternion

func (Quaternion) Inverse

func (q Quaternion) Inverse() Quaternion

Inverse the quaternion

func (Quaternion) Left

func (q Quaternion) Left() Vector3

Left returns a directional vector that is represented by this quaternion

func (Quaternion) Length

func (q Quaternion) Length() float32

Length of the quaternion

func (Quaternion) Lerp

func (q Quaternion) Lerp(target Quaternion, amount float32) Quaternion

Lerp a vector towards another vector

func (Quaternion) Multiply

func (q Quaternion) Multiply(q2 Quaternion) Quaternion

Multiply two Quaternion together, doing queraternion mathmatics

func (Quaternion) Nlerp

func (q Quaternion) Nlerp(target Quaternion, amount float32) Quaternion

Nlerp slerp-optimized interpolation between two quaternions

func (Quaternion) Normalize

func (q Quaternion) Normalize() Quaternion

Normalize a quaternion

func (Quaternion) Right

func (q Quaternion) Right() Vector3

Right returns a directional vector that is represented by this quaternion

func (Quaternion) Rotate

func (q Quaternion) Rotate(v Vector3) Vector3

Rotate a vector by the rotation this quaternion represents.

func (Quaternion) Scale

func (q Quaternion) Scale(scale float32) Quaternion

Scale the quaternion (v * scale)

func (Quaternion) Slerp

func (q Quaternion) Slerp(q2 Quaternion, amount float32) Quaternion

Slerp Spherically Lerped

func (Quaternion) SqrLength

func (q Quaternion) SqrLength() float32

SqrLength is the squared length of the quaternion

func (Quaternion) ToAxisAngle

func (q Quaternion) ToAxisAngle() (Vector3, float32)

ToAxisAngle returns the rotation angle and axis for a given quaternion

func (Quaternion) ToEuler

func (q Quaternion) ToEuler() Vector3

ToEuler turns the quaternion into equivalent euler angles (roll, putch, yaw). Values are returned in Degrees

func (Quaternion) ToMatrix

func (q Quaternion) ToMatrix() Matrix

ToMatrix turns the quaternion into a matrix representation

func (Quaternion) Up

func (q Quaternion) Up() Vector3

Up returns a directional vector that is represented by this quaternion

type Rectangle

type Rectangle struct {
	X      float32
	Y      float32
	Width  float32
	Height float32
}

Rectangle Structure author: Lachee source: https://github.com/raysan5/raylib/blob/master/src/raylib.h

func NewRectangle

func NewRectangle(x, y, width, height float32) Rectangle

NewRectangle creates a new rect

func NewRectangleFromMinMax

func NewRectangleFromMinMax(min Vector2, max Vector2) Rectangle

NewRectangleFromMinMax creates a new rect

func NewRectangleFromPositionSize

func NewRectangleFromPositionSize(position, size Vector2) Rectangle

NewRectangleFromPositionSize creates a rectangle out of a position and size

func NewRectangleFromVector4

func NewRectangleFromVector4(vector Vector4) Rectangle

NewRectangleFromVector4 creates a rectangle out of a vector4

func NewRectangled

func NewRectangled(x, y, width, height float64) Rectangle

NewRectangled creates a new rect using float64

func (Rectangle) Center

func (r Rectangle) Center() Vector2

Center gets the center position of the rectangle

func (Rectangle) Grow

func (r Rectangle) Grow(x, y float32) Rectangle

Grow adds the vector to the width and height of the rectangle.

func (Rectangle) GrowV

func (r Rectangle) GrowV(v Vector2) Rectangle

GrowV adds the vector to the width and height of the rectangle.

func (Rectangle) Lerp

func (r Rectangle) Lerp(target Rectangle, amount float32) Rectangle

Lerp a rectangle to a target rectangle

func (Rectangle) LerpPosition

func (r Rectangle) LerpPosition(pos Vector2, amount float32) Rectangle

LerpPosition a rectangle to a target position

func (Rectangle) MaxPosition

func (r Rectangle) MaxPosition() Vector2

MaxPosition gets the maximum position within the bounds

func (Rectangle) MinPosition

func (r Rectangle) MinPosition() Vector2

MinPosition gets the smallest position the rectangle can be. Alias of Position().

func (Rectangle) Move

func (r Rectangle) Move(x, y float32) Rectangle

Move shifts the rectangle by a value

func (Rectangle) MoveV

func (r Rectangle) MoveV(v Vector2) Rectangle

MoveV shifts the rectangle by a vector

func (Rectangle) Position

func (r Rectangle) Position() Vector2

Position gets the position of the rectangle. Alias of MinPosition().

func (Rectangle) Scale

func (r Rectangle) Scale(scale float32) Rectangle

Scale the width and height of the rectangle

func (Rectangle) SetPosition

func (r Rectangle) SetPosition(v Vector2) Rectangle

SetPosition sets the position of the rectangle

func (Rectangle) SetSize

func (r Rectangle) SetSize(v Vector2) Rectangle

SetSize sets the size of the rectangle

func (Rectangle) Size

func (r Rectangle) Size() Vector2

Size gets the size of the rectangle

func (Rectangle) ToVector4

func (r Rectangle) ToVector4() Vector4

ToVector4 creates a Vector4 out of the rectangle components

type Shader

type Shader struct {
	// contains filtered or unexported fields
}

Shader holds the shaders

func LoadShader

func LoadShader(vertCode, fragCode string) (*Shader, error)

LoadShader loads a shader from code

func LoadShaderFromURL

func LoadShaderFromURL(vertURL, fragURL string) (*Shader, error)

LoadShaderFromURL loads a shader from a URL

func (*Shader) BindVertexData

func (shader *Shader) BindVertexData(attribute string, bufferLocation GLEnum, buffer WebGLBuffer, bufferSize int, bufferType GLEnum, normalize bool, stride int, offset int)

BindVertexData binds a buffer of vertex data to an attribute

func (*Shader) GetAttribLocation

func (shader *Shader) GetAttribLocation(attribute string) WebGLAttributeLocation

GetAttribLocation gets a location of an attribute

func (*Shader) GetProgram

func (shader *Shader) GetProgram() WebGLShaderProgram

GetProgram gets the shader program

func (*Shader) GetUniformLocation

func (shader *Shader) GetUniformLocation(location string) WebGLUniformLocation

GetUniformLocation returns the location of a specific uniform variable which is part of a given WebGLProgram.

func (*Shader) Use

func (shader *Shader) Use()

Use tells GL to use this shader

type SliceSprite

type SliceSprite struct {
	Source    *Texture
	Rectangle Rectangle
	Border    Vector2
}

SliceSprite is a sliced texture

func NewSliceSprite

func NewSliceSprite(source *Texture, rectangle Rectangle, border Vector2) *SliceSprite

NewSliceSprite a new sprite

func (*SliceSprite) Height

func (spr *SliceSprite) Height() int

Height gets the sprites height in pixels

func (*SliceSprite) Slice

func (spr *SliceSprite) Slice() (Vector2, Vector2)

Slice generates a UV slice for the SpriteRenderer

func (*SliceSprite) Texture

func (spr *SliceSprite) Texture() *Texture

Texture gets the current sprit texture

func (*SliceSprite) Width

func (spr *SliceSprite) Width() int

Width gets the sprites width in pixels

type Sprite

type Sprite struct {
	Source    *Texture
	Rectangle Rectangle
}

Sprite is a basic implementation of a UVTile. Its a single texture with a rectangle slice.

func NewSprite

func NewSprite(source *Texture, rectangle Rectangle) *Sprite

NewSprite a new sprite

func (*Sprite) Height

func (spr *Sprite) Height() int

Height gets the sprites height in pixels

func (*Sprite) Slice

func (spr *Sprite) Slice() (Vector2, Vector2)

Slice generates a UV slice for the SpriteRenderer

func (*Sprite) Texture

func (spr *Sprite) Texture() *Texture

Texture gets the current sprit texture

func (*Sprite) Width

func (spr *Sprite) Width() int

Width gets the sprites width in pixels

type SpriteRenderer

type SpriteRenderer struct {
	Zoom   float32 //Zoom is the perspective zoom on the sprites
	Camera Vector2 //Camera is the position of the camera
	// contains filtered or unexported fields
}

SpriteRenderer renders UVTiles in a batched manner

func NewSpriteRenderer

func NewSpriteRenderer() *SpriteRenderer

NewSpriteRenderer creates a new sprite renderer

func (*SpriteRenderer) Begin

func (b *SpriteRenderer) Begin() *SpriteRenderer

Begin starts a SpriteRenderer

func (*SpriteRenderer) Draw

func (b *SpriteRenderer) Draw(r UVTile, origin Vector2, transform Transform2D, color Color)

Draw a particular texture

func (*SpriteRenderer) End

func (b *SpriteRenderer) End() *SpriteRenderer

End finalises a SpriteRenderer

type Texture

type Texture struct {
	// contains filtered or unexported fields
}

Texture is a GPU image

func NewTexture

func NewTexture(image *Image) *Texture

NewTexture a new Texture from the image

func (*Texture) Bind

func (tex *Texture) Bind()

Bind tells GL to use this texture

func (*Texture) CreateSprite

func (tex *Texture) CreateSprite(region Rectangle) *Sprite

CreateSprite creates a sprite

func (*Texture) Data

func (tex *Texture) Data() WebGLTexture

Data gets the internal JS reference

func (*Texture) Height

func (tex *Texture) Height() int

Height gets the width of the texture

func (*Texture) SetFilter

func (tex *Texture) SetFilter(filter TextureFilter)

SetFilter binds the texture and sets the filtering

func (*Texture) SetImage

func (tex *Texture) SetImage(image *Image)

SetImage copies the data from the Image into the texture, setting initial filtering.

func (*Texture) SetSampler

func (tex *Texture) SetSampler(sampler WebGLUniformLocation, textureIndex int)

SetSampler updates the texture sampler

func (*Texture) SetWrap

func (tex *Texture) SetWrap(wrap TextureWrap)

SetWrap binds the texture and sets how the texture will be wrapped

func (*Texture) Slice

func (tex *Texture) Slice() (Vector2, Vector2)

Slice slices the texture into a UV region

func (*Texture) Texture

func (tex *Texture) Texture() *Texture

Texture returns this texture. Exists for compatability with the UVTile

func (*Texture) Width

func (tex *Texture) Width() int

Width gets the width of the texture

type TextureFilter

type TextureFilter = GLEnum

TextureFilter is the filter to use on a texture

type TextureWrap

type TextureWrap = GLEnum

TextureWrap is how a texture should be wrapped.

type Transform

type Transform struct {
	Position Vector3
	Rotation Quaternion
	Scale    Vector3
}

Transform is a structure of tranlsation, rotation and scale properties

func NewTransform

func NewTransform(translation Vector3, rotation Quaternion, scale Vector3) Transform

NewTransform creates a new transform

func NewTransformIdentity

func NewTransformIdentity() Transform

NewTransformIdentity creates a new blank transform

func (Transform) ToMatrix

func (t Transform) ToMatrix() Matrix

ToMatrix turns this tranform into a matrix that performs it.

type Transform2D

type Transform2D struct {
	Position Vector2
	Rotation float32
	Scale    Vector2
}

Transform2D is a structure of tranlsation, rotation and scale properties

func NewTransform2D

func NewTransform2D(translation Vector2, rotation float32, scale Vector2) Transform2D

NewTransform2D creates a new transform

type UIRenderer

type UIRenderer struct {
	Zoom float32
	// contains filtered or unexported fields
}

UIRenderer renders UVTiles in a batched manner

func NewUIRenderer

func NewUIRenderer() *UIRenderer

NewUIRenderer creates a new sprite renderer

func (*UIRenderer) Begin

func (b *UIRenderer) Begin() *UIRenderer

Begin starts a UIRenderer

func (*UIRenderer) Draw

func (b *UIRenderer) Draw(rect Rectangle, color Color)

Draw a particular texture

func (*UIRenderer) End

func (b *UIRenderer) End() *UIRenderer

End finalises a UIRenderer

func (*UIRenderer) GetScale

func (b *UIRenderer) GetScale() float32

GetScale gets the current scale

func (*UIRenderer) ScaleInput

func (b *UIRenderer) ScaleInput(state bool)

ScaleInput will scale all the rectangles, so that they are pixel perfect

func (*UIRenderer) Screen2UISpace

func (b *UIRenderer) Screen2UISpace(screen Vector2) Vector2

Screen2UISpace converts the screen cooridinates to UI coords

func (*UIRenderer) SetScale

func (b *UIRenderer) SetScale(scale float32)

SetScale sets how zoomed in the rectangles appear

func (*UIRenderer) SetSprite

func (b *UIRenderer) SetSprite(sprite *SliceSprite)

SetSprite sets teh current sprite

type UVTile

type UVTile interface {
	//Texture returns the texture
	Texture() *Texture

	//Width is the size in pixels of the source image
	Width() int

	//Height is the size in pixels of the source image
	Height() int

	//Slice returns uv extremes, UV Min and UV Max
	Slice() (Vector2, Vector2)
}

UVTile interface provides methods for sprites

type Vector

type Vector interface {
	Decompose() []float32
}

Vector a interface for any vector

type Vector2

type Vector2 struct {
	X float32
	Y float32
}

Vector2 a 2 dimensional vector

func NewVector2

func NewVector2(x, y float32) Vector2

NewVector2 creates a new vector with defined components

func NewVector2One

func NewVector2One() Vector2

NewVector2One creates a vector that is completely 1

func NewVector2Right

func NewVector2Right() Vector2

NewVector2Right creates a normalized vector pointing right

func NewVector2Up

func NewVector2Up() Vector2

NewVector2Up creates a normalized vector pointing up

func NewVector2Zero

func NewVector2Zero() Vector2

NewVector2Zero creates a vector with all components equaling 0

func NewVector2d

func NewVector2d(x, y float64) Vector2

NewVector2d creates a new vector with double precesion float (float64)

func NewVector2i

func NewVector2i(x, y int) Vector2

NewVector2i creates a new vector

func (Vector2) Add

func (v Vector2) Add(v2 Vector2) Vector2

Add two vectors (v1 + v2)

func (Vector2) Angle

func (v Vector2) Angle(v2 Vector2) float32

Angle the vector creates with another vector

func (Vector2) Decompose

func (v Vector2) Decompose() []float32

Decompose the Vector into a new slice of floats.

func (Vector2) DecomposePointer

func (v Vector2) DecomposePointer() *[2]float32

DecomposePointer the vector into a slice of floats

func (Vector2) Distance

func (v Vector2) Distance(v2 Vector2) float32

Distance between two vectors

func (Vector2) Divide

func (v Vector2) Divide(d float32) Vector2

Divide a vector by a value ( v1.x / d, v1.y / d )

func (Vector2) DivideV

func (v Vector2) DivideV(v2 Vector2) Vector2

DivideV a vector by another vector: ( v1.x / v2.x, v1.y / v2.y )

func (Vector2) DotProduct

func (v Vector2) DotProduct(v2 Vector2) float32

DotProduct of the vector

func (Vector2) Length

func (v Vector2) Length() float32

Length of the vector

func (Vector2) Lerp

func (v Vector2) Lerp(target Vector2, amount float32) Vector2

Lerp a vector towards another vector

func (Vector2) Max

func (v Vector2) Max(v2 Vector2) Vector2

Max value for each pair of components

func (Vector2) Min

func (v Vector2) Min(v2 Vector2) Vector2

Min value for each pair of components

func (Vector2) Multiply

func (v Vector2) Multiply(v2 Vector2) Vector2

Multiply a vector by another vector

func (Vector2) Negate

func (v Vector2) Negate() Vector2

Negate or Inverts a vector

func (Vector2) Normalize

func (v Vector2) Normalize() Vector2

Normalize a vector

func (Vector2) Perpendicular

func (v Vector2) Perpendicular() Vector2

Perpendicular to this vector

func (Vector2) Reflect

func (v Vector2) Reflect(mirrorNormal Vector2) Vector2

Reflect a vector. The mirror normal can be invisioned as a mirror perpendicular to the surface that is hit.

func (Vector2) RotateByRadians

func (v Vector2) RotateByRadians(radians float32) Vector2

RotateByRadians rotates the vector in radians. Use Deg2Rad to convert degress into radians.

func (Vector2) Scale

func (v Vector2) Scale(scale float32) Vector2

Scale the vector (v * scale)

func (Vector2) SqrLength

func (v Vector2) SqrLength() float32

SqrLength is the squared length of the vector

func (Vector2) Subtract

func (v Vector2) Subtract(v2 Vector2) Vector2

Subtract two vectors (v1 - v2)

func (Vector2) ToVector3

func (v Vector2) ToVector3() Vector3

ToVector3 converts this vector2 into a vector3

type Vector3

type Vector3 struct {
	X float32
	Y float32
	Z float32
}

Vector3 a 3 dimensional vector

func NewVector3

func NewVector3(x, y, z float32) Vector3

NewVector3 creates a new vector with defined components

func NewVector3Forward

func NewVector3Forward() Vector3

NewVector3Forward creates a normalized vector pointing forwards

func NewVector3One

func NewVector3One() Vector3

NewVector3One creats a factor that is entirely 1

func NewVector3Right

func NewVector3Right() Vector3

NewVector3Right creates a normalized vector pointing right

func NewVector3Up

func NewVector3Up() Vector3

NewVector3Up creates a normalized vector pointing up

func NewVector3Zero

func NewVector3Zero() Vector3

NewVector3Zero creates a vector with all components equaling 0

func NewVector3d

func NewVector3d(x, y, z float64) Vector3

NewVector3d creates a new vector with double precesion float (float64)

func NewVector3i

func NewVector3i(x, y, z int) Vector3

NewVector3i creates a new vector

func (Vector3) Add

func (v Vector3) Add(v2 Vector3) Vector3

Add two vectors (v1 + v2)

func (Vector3) Angle

func (v Vector3) Angle(v2 Vector3) float32

Angle the vector creates with another vector

func (Vector3) Barycenter

func (v Vector3) Barycenter(a, b, c Vector3) Vector3

Barycenter computers the coordinates (u, v, w) for the vector with respect to triangle (a, b, c). Assumes vector is on plane with triangle

func (Vector3) CrossProduct

func (v Vector3) CrossProduct(other Vector3) Vector3

CrossProduct of the vector

func (Vector3) Decompose

func (v Vector3) Decompose() []float32

Decompose the Vector into a new slice of floats.

func (Vector3) DecomposePointer

func (v Vector3) DecomposePointer() *[3]float32

DecomposePointer the vector into a slice of floats

func (Vector3) Distance

func (v Vector3) Distance(v2 Vector3) float32

Distance between two vectors

func (Vector3) Divide

func (v Vector3) Divide(d float32) Vector3

Divide a vector by a value (v / d)

func (Vector3) DivideV

func (v Vector3) DivideV(v2 Vector3) Vector3

DivideV a vector by another vecotr (v / v2)

func (Vector3) DotProduct

func (v Vector3) DotProduct(v2 Vector3) float32

DotProduct of the vector

func (Vector3) Length

func (v Vector3) Length() float32

Length of the vector

func (Vector3) Lerp

func (v Vector3) Lerp(target Vector3, amount float32) Vector3

Lerp a vector towards another vector

func (Vector3) Max

func (v Vector3) Max(v2 Vector3) Vector3

Max value for each pair of components

func (Vector3) Min

func (v Vector3) Min(v2 Vector3) Vector3

Min value for each pair of components

func (Vector3) Multiply

func (v Vector3) Multiply(v2 Vector3) Vector3

Multiply a vector by another vector

func (Vector3) Negate

func (v Vector3) Negate() Vector3

Negate or Inverts a vector

func (Vector3) Normalize

func (v Vector3) Normalize() Vector3

Normalize a vector

func (*Vector3) OrthoNormalize

func (v *Vector3) OrthoNormalize(v2 *Vector3)

OrthoNormalize makes two vectors normalized and orthogonal to each other

func (Vector3) Perpendicular

func (v Vector3) Perpendicular() Vector3

Perpendicular to this vector

func (Vector3) Reflect

func (v Vector3) Reflect(mirrorNormal Vector3) Vector3

Reflect a vector. The mirror normal can be invisioned as a mirror perpendicular to the surface that is hit.

func (Vector3) Rotate

func (v Vector3) Rotate(q Quaternion) Vector3

Rotate rotates the vector

func (Vector3) Scale

func (v Vector3) Scale(scale float32) Vector3

Scale the vector (v * scale)

func (Vector3) SqrLength

func (v Vector3) SqrLength() float32

SqrLength is the squared length of the vector

func (Vector3) Subtract

func (v Vector3) Subtract(v2 Vector3) Vector3

Subtract two vectors (v1 - v2)

func (Vector3) ToVector4

func (v Vector3) ToVector4() Vector4

ToVector4 coverts the vector3 into a vector4

func (Vector3) Transform

func (v Vector3) Transform(m Matrix) Vector3

Transform a vector by a given matrix

type Vector4

type Vector4 struct {
	X float32
	Y float32
	Z float32
	W float32
}

Vector4 A 4 dimensional vector

func NewVector4

func NewVector4(x, y, z, w float32) Vector4

NewVector4 creates a new vector with defined components

func NewVector4Zero

func NewVector4Zero() Vector4

NewVector4Zero creates a vector with all components equaling 0

func NewVector4d

func NewVector4d(x, y, z, w float64) Vector4

NewVector4d creates a new vector with double precesion float (float64)

func NewVector4i

func NewVector4i(x, y, z, w int) Vector4

NewVector4i creates a new vector

func (Vector4) Add

func (v Vector4) Add(v2 Vector4) Vector4

Add two vectors (v1 + v2)

func (Vector4) Decompose

func (v Vector4) Decompose() []float32

Decompose the Vector into a new slice of floats.

func (Vector4) DecomposePointer

func (v Vector4) DecomposePointer() *[4]float32

DecomposePointer the vector into a slice of floats

func (Vector4) Distance

func (v Vector4) Distance(v2 Vector4) float32

Distance between two vectors

func (Vector4) Divide

func (v Vector4) Divide(d float32) Vector4

Divide a vector by a value (v / d)

func (Vector4) DivideV

func (v Vector4) DivideV(v2 Vector4) Vector4

DivideV a vector by another vecotr (v / v2)

func (Vector4) DotProduct

func (v Vector4) DotProduct(v2 Vector4) float32

DotProduct of the vector

func (Vector4) Length

func (v Vector4) Length() float32

Length of the vector

func (Vector4) Lerp

func (v Vector4) Lerp(target Vector4, amount float32) Vector4

Lerp a vector towards another vector

func (Vector4) Max

func (v Vector4) Max(v2 Vector4) Vector4

Max value for each pair of components

func (Vector4) Min

func (v Vector4) Min(v2 Vector4) Vector4

Min value for each pair of components

func (Vector4) Multiply

func (v Vector4) Multiply(v2 Vector4) Vector4

Multiply a vector by another vector

func (Vector4) Negate

func (v Vector4) Negate() Vector4

Negate or Inverts a vector

func (Vector4) Normalize

func (v Vector4) Normalize() Vector4

Normalize a vector

func (Vector4) Scale

func (v Vector4) Scale(scale float32) Vector4

Scale the vector (v * scale)

func (Vector4) SqrLength

func (v Vector4) SqrLength() float32

SqrLength is the squared length of the vector

func (Vector4) Subtract

func (v Vector4) Subtract(v2 Vector4) Vector4

Subtract two vectors (v1 - v2)

type WebGL

type WebGL struct {
	// contains filtered or unexported fields
}

WebGL is the base class that wraps GL functionality.

func (*WebGL) ActiveTexture

func (gl *WebGL) ActiveTexture(target GLEnum)

ActiveTexture tells WebGL what texture state will be now modified

func (*WebGL) AttachShader

func (gl *WebGL) AttachShader(shaderProgram WebGLShaderProgram, shader WebGLShader)

AttachShader attaches a shader to the program

func (*WebGL) BindBuffer

func (gl *WebGL) BindBuffer(target GLEnum, buffer WebGLBuffer)

BindBuffer binds a given WebGLBuffer to a target.

func (*WebGL) BindTexture

func (gl *WebGL) BindTexture(target GLEnum, texture WebGLTexture)

BindTexture binds a given WebGLTexture to a target (binding point).

func (*WebGL) BlendFunc

func (gl *WebGL) BlendFunc(sFactor GLEnum, gFactor GLEnum)

BlendFunc specifies a function that compares incoming pixel depth to the current blending.

func (*WebGL) BufferData

func (gl *WebGL) BufferData(target GLEnum, data interface{}, usage GLEnum)

BufferData sets the data of a buffer

func (*WebGL) BufferSubData

func (gl *WebGL) BufferSubData(target GLEnum, offset int, data interface{})

BufferSubData updates a subset of a buffer object's data store.

func (*WebGL) Call

func (gl *WebGL) Call(m string, args ...interface{}) js.Value

Call the internal context and reutrns the JS value

func (*WebGL) Clear

func (gl *WebGL) Clear(option GLEnum)

Clear empties the buffers

func (*WebGL) ClearColor

func (gl *WebGL) ClearColor(r, g, b, a float64)

ClearColor sets the colour the screen will be cleared to

func (*WebGL) ClearDepth

func (gl *WebGL) ClearDepth(depth float64)

ClearDepth sets the z value that is set to the depth buffer every frame

func (*WebGL) CompileShader

func (gl *WebGL) CompileShader(shader WebGLShader) error

CompileShader compiles the shader

func (*WebGL) CreateBuffer

func (gl *WebGL) CreateBuffer() WebGLBuffer

CreateBuffer creates a WebGLBuffer object.

func (*WebGL) CreateProgram

func (gl *WebGL) CreateProgram() WebGLShaderProgram

CreateProgram creates a new webgl shader program

func (*WebGL) CreateShader

func (gl *WebGL) CreateShader(shaderType GLEnum) WebGLShader

CreateShader creates a new WebGLShader

func (*WebGL) CreateTexture

func (gl *WebGL) CreateTexture() WebGLTexture

CreateTexture creates a new texture on the GPU

func (*WebGL) DeleteShader

func (gl *WebGL) DeleteShader(shader WebGLShader)

DeleteShader marks a given WebGLShader object for deletion. It will then be deleted whenever the shader is no longer in use.

func (*WebGL) DepthFunc

func (gl *WebGL) DepthFunc(function GLEnum)

DepthFunc specifies a function that compares incoming pixel depth to the current depth buffer value.

func (*WebGL) Disable

func (gl *WebGL) Disable(option GLEnum)

Disable disables a option

func (*WebGL) DrawElements

func (gl *WebGL) DrawElements(mode GLEnum, count int, valueType GLEnum, offset int)

DrawElements renders primitives from array data.

func (*WebGL) Enable

func (gl *WebGL) Enable(option GLEnum)

Enable enables a option

func (*WebGL) EnableVertexAttribArray

func (gl *WebGL) EnableVertexAttribArray(position WebGLAttributeLocation)

EnableVertexAttribArray turns on the generic vertex attribute array at the specified index into the list of attribute arrays.

func (*WebGL) GenerateMipmap

func (gl *WebGL) GenerateMipmap(target GLEnum)

GenerateMipmap creats the Mipmap for a texture

func (*WebGL) GetAttribLocation

func (gl *WebGL) GetAttribLocation(shaderProgram WebGLShaderProgram, attribute string) WebGLAttributeLocation

GetAttribLocation gets a location of an attribute

func (*WebGL) GetProgramInfoLog

func (gl *WebGL) GetProgramInfoLog(shaderProgram WebGLShaderProgram) string

GetProgramInfoLog returns the information log for the specified WebGLProgram object. It contains errors that occurred during failed linking or validation of WebGLProgram objects.

func (*WebGL) GetProgramParameter

func (gl *WebGL) GetProgramParameter(shaderProgram WebGLShaderProgram, param GLEnum) js.Value

GetProgramParameter returns information about the given program.

func (*WebGL) GetShaderInfoLog

func (gl *WebGL) GetShaderInfoLog(shader WebGLShader) string

GetShaderInfoLog returns the information log for the specified WebGLShader object. It contains warnings, debugging and compile information.

func (*WebGL) GetShaderParameter

func (gl *WebGL) GetShaderParameter(shader WebGLShader, param GLEnum) js.Value

GetShaderParameter returns information about the given shader.

func (*WebGL) GetUniformLocation

func (gl *WebGL) GetUniformLocation(shaderProgram WebGLShaderProgram, location string) WebGLUniformLocation

GetUniformLocation returns the location of a specific uniform variable which is part of a given WebGLProgram.

func (*WebGL) IsUndefined

func (gl *WebGL) IsUndefined() bool

IsUndefined checks if the context is undefined

func (*WebGL) LinkProgram

func (gl *WebGL) LinkProgram(shaderProgram WebGLShaderProgram) error

LinkProgram inks a given WebGLProgram, completing the process of preparing the GPU code for the program's fragment and vertex shaders.

func (*WebGL) NewBuffer

func (gl *WebGL) NewBuffer(target GLEnum, data interface{}, usage GLEnum) WebGLBuffer

NewBuffer creates, binds and sets the data of a new buffer

func (*WebGL) NewProgram

func (gl *WebGL) NewProgram(shaders []WebGLShader) (WebGLShaderProgram, error)

NewProgram creates a new webgl shader program with some shaders and links it

func (*WebGL) NewShader

func (gl *WebGL) NewShader(shaderType GLEnum, sourceCode string) (WebGLShader, error)

NewShader creates, sources and compiles a new shader

func (*WebGL) ShaderSource

func (gl *WebGL) ShaderSource(shader WebGLShader, source string)

ShaderSource sets the shader source code

func (*WebGL) TexImage2D

func (gl *WebGL) TexImage2D(target GLEnum, level int, internalFormat GLEnum, format GLEnum, texelType GLEnum, pixels interface{})

TexImage2D specifies a 2D image

func (*WebGL) TexParameterf

func (gl *WebGL) TexParameterf(target GLEnum, param GLEnum, value float64)

TexParameterf set texture parameters

func (*WebGL) TexParameteri

func (gl *WebGL) TexParameteri(target GLEnum, param GLEnum, value int)

TexParameteri set texture parameters

func (*WebGL) UnbindTexture

func (gl *WebGL) UnbindTexture(target GLEnum)

UnbindTexture unbinds the target texture. Alias of bindTexture(target, nil) as WebGLTexture cannot be nil

func (*WebGL) Uniform1f

func (gl *WebGL) Uniform1f(location WebGLUniformLocation, value float32)

Uniform1f specifies values of uniform variables

func (*WebGL) Uniform1fv

func (gl *WebGL) Uniform1fv(location WebGLUniformLocation, value []float32)

Uniform1fv specifies values of uniform variables

func (*WebGL) Uniform1i

func (gl *WebGL) Uniform1i(location WebGLUniformLocation, value int)

Uniform1i specifies values of uniform variables

func (*WebGL) Uniform1iv

func (gl *WebGL) Uniform1iv(location WebGLUniformLocation, value []int)

Uniform1iv specifies values of uniform variables

func (*WebGL) Uniform2f

func (gl *WebGL) Uniform2f(location WebGLUniformLocation, value, value2 float32)

Uniform2f specifies values of uniform variables

func (*WebGL) Uniform2fv

func (gl *WebGL) Uniform2fv(location WebGLUniformLocation, value []float32)

Uniform2fv specifies values of uniform variables

func (*WebGL) Uniform2i

func (gl *WebGL) Uniform2i(location WebGLUniformLocation, value, value2 int)

Uniform2i specifies values of uniform variables

func (*WebGL) Uniform2iv

func (gl *WebGL) Uniform2iv(location WebGLUniformLocation, value []int)

Uniform2iv specifies values of uniform variables

func (*WebGL) Uniform2v

func (gl *WebGL) Uniform2v(location WebGLUniformLocation, value Vector2)

Uniform2v is an alias of Uniform2fv but with Vector support

func (*WebGL) UniformMatrix4fv

func (gl *WebGL) UniformMatrix4fv(location WebGLUniformLocation, matrix Matrix)

UniformMatrix4fv specify matrix values for uniform variables.

func (*WebGL) UseProgram

func (gl *WebGL) UseProgram(shaderProgram WebGLShaderProgram)

UseProgram tells webgl to start using this program

func (*WebGL) VertexAttribPointer

func (gl *WebGL) VertexAttribPointer(position WebGLAttributeLocation, size int, valueType GLEnum, normalized bool, stride int, offset int)

VertexAttribPointer binds the buffer currently bound to gl.ARRAY_BUFFER to a generic vertex attribute of the current vertex buffer object and specifies its layout.

func (*WebGL) Viewport

func (gl *WebGL) Viewport(x, y, width, height int)

Viewport sets the viewport, which specifies the affine transformation of x and y from normalized device coordinates to window coordinates.

type WebGLAttributeLocation

type WebGLAttributeLocation = int

WebGLAttributeLocation is a representation of a attribute location

type WebGLBuffer

type WebGLBuffer = js.Value

WebGLBuffer the js representation of a buffer

type WebGLShader

type WebGLShader = js.Value

WebGLShader is a JS representation of a shader

type WebGLShaderProgram

type WebGLShaderProgram = js.Value

WebGLShaderProgram is a JS representation of a shader program

type WebGLTexture

type WebGLTexture = js.Value

WebGLTexture is a JS representation of a texture

type WebGLUniformLocation

type WebGLUniformLocation = js.Value

WebGLUniformLocation is a JS representation of a uniform location

Directories

Path Synopsis
example

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL