Versions in this module Expand all Collapse all v0 v0.0.3 Aug 26, 2026 v0.0.2 Aug 25, 2026 v0.0.1 Aug 24, 2026 Changes in this version + const ErrorNoContextFound — js/wasm + type ActiveInfo struct — js/wasm + Name string + Size int + Type Enum + type Bitfield = int — js/wasm + const ColorBufferBit + const DepthBufferBit + const StencilBufferBit + type Bridge struct — js/wasm + func NewBridge(context *Context) (bridge *Bridge) + func (b *Bridge) Bytes(values []byte) (result js.Value) + func (b *Bridge) Call(method string, arguments ...any) (result js.Value) + func (b *Bridge) DeleteResource(id uint32) + func (b *Bridge) Direct(method string, arguments ...any) (result js.Value) + func (b *Bridge) Float32Array(values []float32) (result js.Value) + func (b *Bridge) Int32Array(values []int32) (result js.Value) + func (b *Bridge) RecordU32(operation byte, values ...uint32) (recorded bool) + func (b *Bridge) RegisterResource(value js.Value) (id uint32) + func (b *Bridge) Uint32Array(values []uint32) (result js.Value) + type Buffer struct — js/wasm + func (b *Buffer) Value() (value js.Value) + type Context struct — js/wasm + OnContextLost func() + OnContextRestored func() + OnFrame func(dt, width, height float64) + func GetContext(canvas *wasmdraw.CanvasElement, options *Options) (context *Context, err error) + func NewContext(canvas *wasmdraw.CanvasElement, contextID string, options *Options) (context *Context, err error) + func (c *Context) ActiveTexture(texture Enum) (self *Context) + func (c *Context) AttachShader(program *Program, shader *Shader) (self *Context) + func (c *Context) BindAttribLocation(program *Program, index uint32, name string) (self *Context) + func (c *Context) BindBuffer(target Enum, buffer *Buffer) (self *Context) + func (c *Context) BindFramebuffer(target Enum, framebuffer *Framebuffer) (self *Context) + func (c *Context) BindRenderbuffer(target Enum, renderbuffer *Renderbuffer) (self *Context) + func (c *Context) BindTexture(target Enum, texture *Texture) (self *Context) + func (c *Context) BlendColor(red, green, blue, alpha float64) (self *Context) + func (c *Context) BlendEquation(mode Enum) (self *Context) + func (c *Context) BlendEquationSeparate(rgb, alpha Enum) (self *Context) + func (c *Context) BlendFunc(source, destination Enum) (self *Context) + func (c *Context) BlendFuncSeparate(sourceRGB, destinationRGB, sourceAlpha, destinationAlpha Enum) (self *Context) + func (c *Context) BufferData(target Enum, data []byte, usage Enum) (self *Context) + func (c *Context) BufferDataFloat32(target Enum, data []float32, usage Enum) (self *Context) + func (c *Context) BufferDataFloat64(target Enum, data []float64, usage Enum) (self *Context) + func (c *Context) BufferDataInt16(target Enum, data []int16, usage Enum) (self *Context) + func (c *Context) BufferDataInt32(target Enum, data []int32, usage Enum) (self *Context) + func (c *Context) BufferDataSize(target Enum, size Size, usage Enum) (self *Context) + func (c *Context) BufferDataUint16(target Enum, data []uint16, usage Enum) (self *Context) + func (c *Context) BufferDataUint32(target Enum, data []uint32, usage Enum) (self *Context) + func (c *Context) BufferSubData(target Enum, offset Offset, data []byte) (self *Context) + func (c *Context) BufferSubDataFloat32(target Enum, offset Offset, data []float32) (self *Context) + func (c *Context) BufferSubDataFloat64(target Enum, offset Offset, data []float64) (self *Context) + func (c *Context) BufferSubDataInt16(target Enum, offset Offset, data []int16) (self *Context) + func (c *Context) BufferSubDataInt32(target Enum, offset Offset, data []int32) (self *Context) + func (c *Context) BufferSubDataUint16(target Enum, offset Offset, data []uint16) (self *Context) + func (c *Context) BufferSubDataUint32(target Enum, offset Offset, data []uint32) (self *Context) + func (c *Context) CheckFramebufferStatus(target Enum) (status Enum) + func (c *Context) Clear(mask Bitfield) (self *Context) + func (c *Context) ClearColor(red, green, blue, alpha float64) (self *Context) + func (c *Context) ClearDepth(depth float64) (self *Context) + func (c *Context) ClearStencil(stencil int) (self *Context) + func (c *Context) ColorMask(red, green, blue, alpha bool) (self *Context) + func (c *Context) CompileShader(shaderType Enum, source string) (shader *Shader, err error) + func (c *Context) CompressedTexImage2D(target Enum, level int, internalFormat Enum, width, height, border int, ...) (self *Context) + func (c *Context) CompressedTexSubImage2D(target Enum, level, xOffset, yOffset, width, height int, format Enum, ...) (self *Context) + func (c *Context) CopyTexImage2D(target Enum, level int, internalFormat Enum, x, y, width, height, border int) (self *Context) + func (c *Context) CopyTexSubImage2D(target Enum, level, xOffset, yOffset, x, y, width, height int) (self *Context) + func (c *Context) CreateBuffer() (buffer *Buffer) + func (c *Context) CreateFramebuffer() (framebuffer *Framebuffer) + func (c *Context) CreateProgram() (program *Program) + func (c *Context) CreateRenderbuffer() (renderbuffer *Renderbuffer) + func (c *Context) CreateShader(shaderType Enum) (shader *Shader) + func (c *Context) CreateTexture() (texture *Texture) + func (c *Context) CullFace(mode Enum) (self *Context) + func (c *Context) DeleteBuffer(buffer *Buffer) + func (c *Context) DeleteFramebuffer(framebuffer *Framebuffer) + func (c *Context) DeleteProgram(program *Program) + func (c *Context) DeleteRenderbuffer(renderbuffer *Renderbuffer) + func (c *Context) DeleteShader(shader *Shader) + func (c *Context) DeleteTexture(texture *Texture) + func (c *Context) DepthFunc(function Enum) (self *Context) + func (c *Context) DepthMask(flag bool) (self *Context) + func (c *Context) DepthRange(near, far float64) (self *Context) + func (c *Context) DetachShader(program *Program, shader *Shader) (self *Context) + func (c *Context) Disable(capability Enum) (self *Context) + func (c *Context) DisableVertexAttribArray(index uint32) (self *Context) + func (c *Context) Dispose() + func (c *Context) DrawArrays(mode Enum, first, count int) (self *Context) + func (c *Context) DrawElements(mode Enum, count int, valueType Enum, offset Offset) (self *Context) + func (c *Context) DrawingBufferSize() (width, height int) + func (c *Context) Enable(capability Enum) (self *Context) + func (c *Context) EnableVertexAttribArray(index uint32) (self *Context) + func (c *Context) Finish() (self *Context) + func (c *Context) Flush() (self *Context) + func (c *Context) FramebufferRenderbuffer(target, attachment, renderbufferTarget Enum, renderbuffer *Renderbuffer) (self *Context) + func (c *Context) FramebufferTexture2D(target, attachment, textureTarget Enum, texture *Texture, level int) (self *Context) + func (c *Context) FrontFace(mode Enum) (self *Context) + func (c *Context) GenerateMipmap(target Enum) (self *Context) + func (c *Context) GetActiveAttrib(program *Program, index uint32) (info *ActiveInfo) + func (c *Context) GetActiveUniform(program *Program, index uint32) (info *ActiveInfo) + func (c *Context) GetAttachedShaders(program *Program) (shaders []*Shader) + func (c *Context) GetAttribLocation(program *Program, name string) (location int) + func (c *Context) GetBool(name Enum) (value bool) + func (c *Context) GetBufferParameter(target, name Enum) (value js.Value) + func (c *Context) GetContextAttributes() (attributes js.Value) + func (c *Context) GetError() (value Enum) + func (c *Context) GetExtension(name string) (extension *Extension, ok bool) + func (c *Context) GetFPS() (fps int) + func (c *Context) GetFloat(name Enum) (value float64) + func (c *Context) GetFramebufferAttachmentParameter(target, attachment, name Enum) (value js.Value) + func (c *Context) GetInt(name Enum) (value int) + func (c *Context) GetMSPerFrame() (mean, minValue, maxValue float64) + func (c *Context) GetParameter(name Enum) (value js.Value) + func (c *Context) GetProgramInfoLog(program *Program) (log string) + func (c *Context) GetProgramParameter(program *Program, name Enum) (value js.Value) + func (c *Context) GetRenderbufferParameter(target, name Enum) (value js.Value) + func (c *Context) GetShaderInfoLog(shader *Shader) (log string) + func (c *Context) GetShaderParameter(shader *Shader, name Enum) (value js.Value) + func (c *Context) GetShaderPrecisionFormat(shaderType, precisionType Enum) (format *ShaderPrecisionFormat) + func (c *Context) GetShaderSource(shader *Shader) (source string) + func (c *Context) GetString(name Enum) (value string) + func (c *Context) GetSupportedExtensions() (extensions []string) + func (c *Context) GetTexParameter(target, name Enum) (value js.Value) + func (c *Context) GetUniform(program *Program, location *UniformLocation) (value js.Value) + func (c *Context) GetUniformLocation(program *Program, name string) (location *UniformLocation) + func (c *Context) GetVertexAttrib(index uint32, name Enum) (value js.Value) + func (c *Context) GetVertexAttribOffset(index uint32, name Enum) (offset int) + func (c *Context) Hint(target, mode Enum) (self *Context) + func (c *Context) IsBuffer(buffer *Buffer) (valid bool) + func (c *Context) IsContextLost() (lost bool) + func (c *Context) IsEnabled(capability Enum) (enabled bool) + func (c *Context) IsFramebuffer(framebuffer *Framebuffer) (valid bool) + func (c *Context) IsProgram(program *Program) (valid bool) + func (c *Context) IsRenderbuffer(renderbuffer *Renderbuffer) (valid bool) + func (c *Context) IsShader(shader *Shader) (valid bool) + func (c *Context) IsTexture(texture *Texture) (valid bool) + func (c *Context) LineWidth(width float64) (self *Context) + func (c *Context) LinkProgram(shaders ...*Shader) (program *Program, err error) + func (c *Context) PixelStorei(name Enum, value int) (self *Context) + func (c *Context) PolygonOffset(factor, units float64) (self *Context) + func (c *Context) ReadPixels(x, y, width, height int, format, valueType Enum, destination []byte) (count int) + func (c *Context) ReadPixelsFloat32(x, y, width, height int, format, valueType Enum, destination []float32) (count int) + func (c *Context) ReadPixelsUint16(x, y, width, height int, format, valueType Enum, destination []uint16) (count int) + func (c *Context) RenderbufferStorage(target, internalFormat Enum, width, height int) (self *Context) + func (c *Context) SampleCoverage(value float64, invert bool) (self *Context) + func (c *Context) Scissor(x, y, width, height int) (self *Context) + func (c *Context) ShaderSource(shader *Shader, source string) (self *Context) + func (c *Context) Start() (self *Context) + func (c *Context) StencilFunc(function Enum, reference int, mask uint32) (self *Context) + func (c *Context) StencilFuncSeparate(face, function Enum, reference int, mask uint32) (self *Context) + func (c *Context) StencilMask(mask uint32) (self *Context) + func (c *Context) StencilMaskSeparate(face Enum, mask uint32) (self *Context) + func (c *Context) StencilOp(fail, depthFail, depthPass Enum) (self *Context) + func (c *Context) StencilOpSeparate(face, fail, depthFail, depthPass Enum) (self *Context) + func (c *Context) Stop() (self *Context) + func (c *Context) TexImage2D(target Enum, level int, internalFormat Enum, width, height, border int, ...) (self *Context) + func (c *Context) TexImage2DFloat32(target Enum, level int, internalFormat Enum, width, height, border int, ...) (self *Context) + func (c *Context) TexImage2DSource(target Enum, level int, internalFormat, format, valueType Enum, ...) (self *Context) + func (c *Context) TexImage2DUint16(target Enum, level int, internalFormat Enum, width, height, border int, ...) (self *Context) + func (c *Context) TexParameterf(target, name Enum, value float64) (self *Context) + func (c *Context) TexParameteri(target, name Enum, value int) (self *Context) + func (c *Context) TexSubImage2D(target Enum, level, xOffset, yOffset, width, height int, ...) (self *Context) + func (c *Context) TexSubImage2DFloat32(target Enum, level, xOffset, yOffset, width, height int, ...) (self *Context) + func (c *Context) TexSubImage2DSource(target Enum, level, xOffset, yOffset int, format, valueType Enum, ...) (self *Context) + func (c *Context) TexSubImage2DUint16(target Enum, level, xOffset, yOffset, width, height int, ...) (self *Context) + func (c *Context) Uniform1f(location *UniformLocation, x float64) (self *Context) + func (c *Context) Uniform1fv(location *UniformLocation, values []float32) (self *Context) + func (c *Context) Uniform1i(location *UniformLocation, x int) (self *Context) + func (c *Context) Uniform1iv(location *UniformLocation, values []int32) (self *Context) + func (c *Context) Uniform2f(location *UniformLocation, x, y float64) (self *Context) + func (c *Context) Uniform2fv(location *UniformLocation, values []float32) (self *Context) + func (c *Context) Uniform2i(location *UniformLocation, x, y int) (self *Context) + func (c *Context) Uniform2iv(location *UniformLocation, values []int32) (self *Context) + func (c *Context) Uniform3f(location *UniformLocation, x, y, z float64) (self *Context) + func (c *Context) Uniform3fv(location *UniformLocation, values []float32) (self *Context) + func (c *Context) Uniform3i(location *UniformLocation, x, y, z int) (self *Context) + func (c *Context) Uniform3iv(location *UniformLocation, values []int32) (self *Context) + func (c *Context) Uniform4f(location *UniformLocation, x, y, z, w float64) (self *Context) + func (c *Context) Uniform4fv(location *UniformLocation, values []float32) (self *Context) + func (c *Context) Uniform4i(location *UniformLocation, x, y, z, w int) (self *Context) + func (c *Context) Uniform4iv(location *UniformLocation, values []int32) (self *Context) + func (c *Context) UniformMatrix2fv(location *UniformLocation, transpose bool, values []float32) (self *Context) + func (c *Context) UniformMatrix3fv(location *UniformLocation, transpose bool, values []float32) (self *Context) + func (c *Context) UniformMatrix4fv(location *UniformLocation, transpose bool, values []float32) (self *Context) + func (c *Context) UseProgram(program *Program) (self *Context) + func (c *Context) ValidateProgram(program *Program) (valid bool) + func (c *Context) Version() (version int) + func (c *Context) VertexAttrib1f(index uint32, x float64) (self *Context) + func (c *Context) VertexAttrib1fv(index uint32, values []float32) (self *Context) + func (c *Context) VertexAttrib2f(index uint32, x, y float64) (self *Context) + func (c *Context) VertexAttrib2fv(index uint32, values []float32) (self *Context) + func (c *Context) VertexAttrib3f(index uint32, x, y, z float64) (self *Context) + func (c *Context) VertexAttrib3fv(index uint32, values []float32) (self *Context) + func (c *Context) VertexAttrib4f(index uint32, x, y, z, w float64) (self *Context) + func (c *Context) VertexAttrib4fv(index uint32, values []float32) (self *Context) + func (c *Context) VertexAttribPointer(index uint32, size int, valueType Enum, normalized bool, stride, offset int) (self *Context) + func (c *Context) Viewport(x, y, width, height int) (self *Context) + type Enum = int — js/wasm + const ActiveAttributes + const ActiveTextureValue + const ActiveUniforms + const AliasedLineWidthRange + const AliasedPointSizeRange + const Alpha + const AlphaBits + const Always + const ArrayBuffer + const ArrayBufferBinding + const AttachedShaders + const Back + const Blend + const BlendDstAlpha + const BlendDstRGB + const BlendEquationAlpha + const BlendEquationRGB + const BlendSrcAlpha + const BlendSrcRGB + const BlueBits + const BrowserDefaultWebGL + const BufferSize + const BufferUsage + const Byte + const CCW + const CW + const ClampToEdge + const ColorAttachment0 + const ColorClearValue + const ColorWriteMask + const CompileStatus + const CompressedTextureFormats + const ConstantAlpha + const ConstantColor + const ContextLostWebGL + const CullFace + const CullFaceMode + const CurrentProgram + const CurrentVertexAttrib + const Decr + const DecrWrap + const DeleteStatus + const DepthAttachment + const DepthBits + const DepthClearValue + const DepthComponent16 + const DepthFuncValue + const DepthRangeValue + const DepthStencil + const DepthStencilAttachment + const DepthTest + const DepthWriteMask + const Dither + const DontCare + const DstAlpha + const DstColor + const DynamicDraw + const ElementArrayBuffer + const ElementArrayBufferBinding + const Equal + const Fastest + const Float + const FragmentShader + const FramebufferAttachmentObjectName + const FramebufferAttachmentObjectType + const FramebufferAttachmentTextureCubeMapFace + const FramebufferAttachmentTextureLevel + const FramebufferBinding + const FramebufferComplete + const FramebufferIncompleteAttachment + const FramebufferIncompleteDimensions + const FramebufferIncompleteMissingAttachment + const FramebufferTarget + const FramebufferUnsupported + const Front + const FrontAndBack + const FrontFaceMode + const FuncAdd + const FuncReverseSubtract + const FuncSubtract + const GEqual + const GenerateMipmapHint + const Greater + const GreenBits + const HighFloat + const HighInt + const ImplementationColorReadFormat + const ImplementationColorReadType + const Incr + const IncrWrap + const Int + const InvalidEnum + const InvalidOperation + const InvalidValue + const Invert + const Keep + const LEqual + const Less + const LineLoop + const LineStrip + const LineWidthValue + const Linear + const LinearMipmapLinear + const LinearMipmapNearest + const Lines + const LinkStatus + const LowFloat + const LowInt + const Luminance + const LuminanceAlpha + const MaxCombinedTextureImageUnits + const MaxCubeMapTextureSize + const MaxFragmentUniformVectors + const MaxTextureImageUnits + const MaxTextureSize + const MaxVaryingVectors + const MaxVertexAttribs + const MaxVertexTextureImageUnits + const MaxVertexUniformVectors + const MaxViewportDims + const MediumFloat + const MediumInt + const MirroredRepeat + const Nearest + const NearestMipmapLinear + const NearestMipmapNearest + const Never + const Nicest + const NoError + const NotEqual + const One + const OneMinusConstantAlpha + const OneMinusConstantColor + const OneMinusDstAlpha + const OneMinusDstColor + const OneMinusSrcAlpha + const OneMinusSrcColor + const OutOfMemory + const PackAlignment + const Points + const PolygonOffsetFactor + const PolygonOffsetFill + const PolygonOffsetUnits + const RGB + const RGB565 + const RGB5A1 + const RGBA + const RGBA4 + const RedBits + const RenderbufferAlphaSize + const RenderbufferBinding + const RenderbufferBlueSize + const RenderbufferDepthSize + const RenderbufferGreenSize + const RenderbufferHeight + const RenderbufferInternalFormat + const RenderbufferRedSize + const RenderbufferStencilSize + const RenderbufferTarget + const RenderbufferWidth + const Renderer + const Repeat + const Replace + const SampleAlphaToCoverage + const SampleBuffers + const SampleCoverage + const SampleCoverageInvert + const SampleCoverageValue + const Samples + const ScissorBox + const ScissorTest + const ShaderCompiler + const ShaderType + const ShadingLanguageVersion + const Short + const SrcAlpha + const SrcAlphaSaturate + const SrcColor + const StaticDraw + const StencilAttachment + const StencilBackFail + const StencilBackFunc + const StencilBackPassDepthFail + const StencilBackPassDepthPass + const StencilBackRef + const StencilBackValueMask + const StencilBackWriteMask + const StencilBits + const StencilClearValue + const StencilFail + const StencilFuncValue + const StencilIndex8 + const StencilPassDepthFail + const StencilPassDepthPass + const StencilRef + const StencilTest + const StencilValueMask + const StencilWriteMask + const StreamDraw + const SubpixelBits + const Texture0 + const Texture2D + const TextureBinding2D + const TextureBindingCubeMap + const TextureCubeMap + const TextureCubeMapNegativeX + const TextureCubeMapNegativeY + const TextureCubeMapNegativeZ + const TextureCubeMapPositiveX + const TextureCubeMapPositiveY + const TextureCubeMapPositiveZ + const TextureMagFilter + const TextureMinFilter + const TextureWrapS + const TextureWrapT + const TriangleFan + const TriangleStrip + const Triangles + const UnpackAlignment + const UnpackColorspaceConversionWebGL + const UnpackFlipYWebGL + const UnpackPremultiplyAlphaWebGL + const UnsignedByte + const UnsignedInt + const UnsignedShort + const ValidateStatus + const Vendor + const Version + const VertexAttribArrayBufferBinding + const VertexAttribArrayEnabled + const VertexAttribArrayNormalized + const VertexAttribArrayPointer + const VertexAttribArraySize + const VertexAttribArrayStride + const VertexAttribArrayType + const VertexShader + const ViewportValue + const Zero + func TextureUnit(index int) (unit Enum) + type Extension struct — js/wasm + func (e *Extension) Call(method string, arguments ...any) (value js.Value) + func (e *Extension) Get(name string) (value js.Value) + func (e *Extension) Value() (value js.Value) + type Framebuffer struct — js/wasm + func (f *Framebuffer) Value() (value js.Value) + type Offset = int — js/wasm + type Options struct — js/wasm + func DefaultOptions() (options *Options) + func (o *Options) WithAlpha(value bool) (self *Options) + func (o *Options) WithAntialias(value bool) (self *Options) + func (o *Options) WithDepth(value bool) (self *Options) + func (o *Options) WithDesynchronized(value bool) (self *Options) + func (o *Options) WithFailIfMajorPerformanceCaveat(value bool) (self *Options) + func (o *Options) WithPowerPreference(value string) (self *Options) + func (o *Options) WithPremultipliedAlpha(value bool) (self *Options) + func (o *Options) WithPreserveDrawingBuffer(value bool) (self *Options) + func (o *Options) WithStencil(value bool) (self *Options) + type Program struct — js/wasm + func (p *Program) Value() (value js.Value) + type Renderbuffer struct — js/wasm + func (r *Renderbuffer) Value() (value js.Value) + type Shader struct — js/wasm + func (s *Shader) Value() (value js.Value) + type ShaderPrecisionFormat struct — js/wasm + Precision int + RangeMax int + RangeMin int + type Size = int — js/wasm + type Texture struct — js/wasm + func (t *Texture) Value() (value js.Value) + type UniformLocation struct — js/wasm + func (u *UniformLocation) Value() (value js.Value)