Documentation
¶
Index ¶
- Constants
- type ActiveInfo
- type Bitfield
- type 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
- type Context
- 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
- type Extension
- type Framebuffer
- type Offset
- type 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
- type Renderbuffer
- type Shader
- type ShaderPrecisionFormat
- type Size
- type Texture
- type UniformLocation
Constants ¶
const ErrorNoContextFound = "failed to get WebGL context from canvas"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActiveInfo ¶
type Bridge ¶
type Bridge struct {
// contains filtered or unexported fields
}
Bridge exposes shared low-level context machinery to renderer packages. It is not a rendering API; WebGL and WebGL2 keep their public methods on their respective Context types.
func (*Bridge) DeleteResource ¶
DeleteResource removes a browser-owned object from the executor registry.
func (*Bridge) Float32Array ¶
Float32Array creates a Float32Array view for a Go slice.
func (*Bridge) Int32Array ¶
Int32Array creates an Int32Array view for a Go slice.
func (*Bridge) RegisterResource ¶
RegisterResource assigns an executor ID to a browser-owned object.
type Context ¶
type Context struct {
OnFrame func(dt, width, height float64)
OnContextLost func()
OnContextRestored func()
// contains filtered or unexported fields
}
func GetContext ¶
func GetContext(canvas *wasmdraw.CanvasElement, options *Options) (context *Context, err error)
GetContext creates a WebGL1 context and starts its frame lifecycle.
func NewContext ¶
func NewContext(canvas *wasmdraw.CanvasElement, contextID string, options *Options) (context *Context, err error)
NewContext creates the shared WebGL base using a specific browser context ID.
func (*Context) ActiveTexture ¶
func (*Context) AttachShader ¶
func (*Context) BindAttribLocation ¶
func (*Context) BindBuffer ¶
func (*Context) BindFramebuffer ¶
func (c *Context) BindFramebuffer(target Enum, framebuffer *Framebuffer) (self *Context)
func (*Context) BindRenderbuffer ¶
func (c *Context) BindRenderbuffer(target Enum, renderbuffer *Renderbuffer) (self *Context)
func (*Context) BindTexture ¶
func (*Context) BlendColor ¶
func (*Context) BlendEquation ¶
func (*Context) BlendEquationSeparate ¶
func (*Context) BlendFuncSeparate ¶
func (*Context) BufferData ¶
func (*Context) BufferDataFloat32 ¶
func (*Context) BufferDataFloat64 ¶
func (*Context) BufferDataInt16 ¶
func (*Context) BufferDataInt32 ¶
func (*Context) BufferDataSize ¶
func (*Context) BufferDataUint16 ¶
func (*Context) BufferDataUint32 ¶
func (*Context) BufferSubData ¶
func (*Context) BufferSubDataFloat32 ¶
func (*Context) BufferSubDataFloat64 ¶
func (*Context) BufferSubDataInt16 ¶
func (*Context) BufferSubDataInt32 ¶
func (*Context) BufferSubDataUint16 ¶
func (*Context) BufferSubDataUint32 ¶
func (*Context) CheckFramebufferStatus ¶
func (*Context) ClearColor ¶
func (*Context) ClearDepth ¶
func (*Context) ClearStencil ¶
func (*Context) CompileShader ¶
CompileShader compiles source and returns the browser diagnostic on failure.
func (*Context) CompressedTexImage2D ¶
func (*Context) CompressedTexSubImage2D ¶
func (*Context) CopyTexImage2D ¶
func (*Context) CopyTexSubImage2D ¶
func (*Context) CreateBuffer ¶
func (*Context) CreateFramebuffer ¶
func (c *Context) CreateFramebuffer() (framebuffer *Framebuffer)
func (*Context) CreateProgram ¶
func (*Context) CreateRenderbuffer ¶
func (c *Context) CreateRenderbuffer() (renderbuffer *Renderbuffer)
func (*Context) CreateShader ¶
func (*Context) CreateTexture ¶
func (*Context) DeleteBuffer ¶
func (*Context) DeleteFramebuffer ¶
func (c *Context) DeleteFramebuffer(framebuffer *Framebuffer)
func (*Context) DeleteProgram ¶
func (*Context) DeleteRenderbuffer ¶
func (c *Context) DeleteRenderbuffer(renderbuffer *Renderbuffer)
func (*Context) DeleteShader ¶
func (*Context) DeleteTexture ¶
func (*Context) DepthRange ¶
func (*Context) DetachShader ¶
func (*Context) DisableVertexAttribArray ¶
func (*Context) DrawArrays ¶
func (*Context) DrawElements ¶
func (*Context) DrawingBufferSize ¶
DrawingBufferSize returns the actual WebGL drawing-buffer dimensions.
func (*Context) EnableVertexAttribArray ¶
func (*Context) FramebufferRenderbuffer ¶
func (c *Context) FramebufferRenderbuffer(target, attachment, renderbufferTarget Enum, renderbuffer *Renderbuffer) (self *Context)
func (*Context) FramebufferTexture2D ¶
func (*Context) GenerateMipmap ¶
func (*Context) GetActiveAttrib ¶
func (c *Context) GetActiveAttrib(program *Program, index uint32) (info *ActiveInfo)
func (*Context) GetActiveUniform ¶
func (c *Context) GetActiveUniform(program *Program, index uint32) (info *ActiveInfo)
func (*Context) GetAttachedShaders ¶
func (*Context) GetAttribLocation ¶
func (*Context) GetBufferParameter ¶
func (*Context) GetContextAttributes ¶
func (*Context) GetExtension ¶
func (*Context) GetFramebufferAttachmentParameter ¶
func (*Context) GetMSPerFrame ¶
func (*Context) GetProgramInfoLog ¶
func (*Context) GetProgramParameter ¶
func (*Context) GetRenderbufferParameter ¶
func (*Context) GetShaderInfoLog ¶
func (*Context) GetShaderParameter ¶
func (*Context) GetShaderPrecisionFormat ¶
func (c *Context) GetShaderPrecisionFormat(shaderType, precisionType Enum) (format *ShaderPrecisionFormat)
func (*Context) GetShaderSource ¶
func (*Context) GetSupportedExtensions ¶
func (*Context) GetTexParameter ¶
func (*Context) GetUniform ¶
func (c *Context) GetUniform(program *Program, location *UniformLocation) (value js.Value)
func (*Context) GetUniformLocation ¶
func (c *Context) GetUniformLocation(program *Program, name string) (location *UniformLocation)
func (*Context) GetVertexAttrib ¶
func (*Context) GetVertexAttribOffset ¶
func (*Context) IsContextLost ¶
func (*Context) IsFramebuffer ¶
func (c *Context) IsFramebuffer(framebuffer *Framebuffer) (valid bool)
func (*Context) IsRenderbuffer ¶
func (c *Context) IsRenderbuffer(renderbuffer *Renderbuffer) (valid bool)
func (*Context) LinkProgram ¶
LinkProgram links a program and returns the browser diagnostic on failure.
func (*Context) PolygonOffset ¶
func (*Context) ReadPixels ¶
func (*Context) ReadPixelsFloat32 ¶
func (*Context) ReadPixelsUint16 ¶
func (*Context) RenderbufferStorage ¶
func (*Context) SampleCoverage ¶
func (*Context) ShaderSource ¶
func (*Context) StencilFunc ¶
func (*Context) StencilFuncSeparate ¶
func (*Context) StencilMask ¶
func (*Context) StencilMaskSeparate ¶
func (*Context) StencilOpSeparate ¶
func (*Context) TexImage2D ¶
func (*Context) TexImage2DFloat32 ¶
func (*Context) TexImage2DSource ¶
func (*Context) TexImage2DUint16 ¶
func (*Context) TexParameterf ¶
func (*Context) TexParameteri ¶
func (*Context) TexSubImage2D ¶
func (*Context) TexSubImage2DFloat32 ¶
func (*Context) TexSubImage2DSource ¶
func (*Context) TexSubImage2DUint16 ¶
func (*Context) Uniform1f ¶
func (c *Context) Uniform1f(location *UniformLocation, x float64) (self *Context)
func (*Context) Uniform1fv ¶
func (c *Context) Uniform1fv(location *UniformLocation, values []float32) (self *Context)
func (*Context) Uniform1i ¶
func (c *Context) Uniform1i(location *UniformLocation, x int) (self *Context)
func (*Context) Uniform1iv ¶
func (c *Context) Uniform1iv(location *UniformLocation, values []int32) (self *Context)
func (*Context) Uniform2f ¶
func (c *Context) Uniform2f(location *UniformLocation, x, y float64) (self *Context)
func (*Context) Uniform2fv ¶
func (c *Context) Uniform2fv(location *UniformLocation, values []float32) (self *Context)
func (*Context) Uniform2i ¶
func (c *Context) Uniform2i(location *UniformLocation, x, y int) (self *Context)
func (*Context) Uniform2iv ¶
func (c *Context) Uniform2iv(location *UniformLocation, values []int32) (self *Context)
func (*Context) Uniform3f ¶
func (c *Context) Uniform3f(location *UniformLocation, x, y, z float64) (self *Context)
func (*Context) Uniform3fv ¶
func (c *Context) Uniform3fv(location *UniformLocation, values []float32) (self *Context)
func (*Context) Uniform3i ¶
func (c *Context) Uniform3i(location *UniformLocation, x, y, z int) (self *Context)
func (*Context) Uniform3iv ¶
func (c *Context) Uniform3iv(location *UniformLocation, values []int32) (self *Context)
func (*Context) Uniform4f ¶
func (c *Context) Uniform4f(location *UniformLocation, x, y, z, w float64) (self *Context)
func (*Context) Uniform4fv ¶
func (c *Context) Uniform4fv(location *UniformLocation, values []float32) (self *Context)
func (*Context) Uniform4i ¶
func (c *Context) Uniform4i(location *UniformLocation, x, y, z, w int) (self *Context)
func (*Context) Uniform4iv ¶
func (c *Context) Uniform4iv(location *UniformLocation, values []int32) (self *Context)
func (*Context) UniformMatrix2fv ¶
func (c *Context) UniformMatrix2fv(location *UniformLocation, transpose bool, values []float32) (self *Context)
func (*Context) UniformMatrix3fv ¶
func (c *Context) UniformMatrix3fv(location *UniformLocation, transpose bool, values []float32) (self *Context)
func (*Context) UniformMatrix4fv ¶
func (c *Context) UniformMatrix4fv(location *UniformLocation, transpose bool, values []float32) (self *Context)
func (*Context) UseProgram ¶
func (*Context) ValidateProgram ¶
func (*Context) VertexAttrib1f ¶
func (*Context) VertexAttrib1fv ¶
func (*Context) VertexAttrib2f ¶
func (*Context) VertexAttrib2fv ¶
func (*Context) VertexAttrib3f ¶
func (*Context) VertexAttrib3fv ¶
func (*Context) VertexAttrib4f ¶
func (*Context) VertexAttrib4fv ¶
func (*Context) VertexAttribPointer ¶
type Enum ¶
type Enum = int
const ( Points Enum = 0x0000 Lines Enum = 0x0001 LineLoop Enum = 0x0002 LineStrip Enum = 0x0003 Triangles Enum = 0x0004 TriangleStrip Enum = 0x0005 TriangleFan Enum = 0x0006 Zero Enum = 0 One Enum = 1 SrcColor Enum = 0x0300 OneMinusSrcColor Enum = 0x0301 SrcAlpha Enum = 0x0302 OneMinusSrcAlpha Enum = 0x0303 DstAlpha Enum = 0x0304 OneMinusDstAlpha Enum = 0x0305 DstColor Enum = 0x0306 OneMinusDstColor Enum = 0x0307 SrcAlphaSaturate Enum = 0x0308 FuncAdd Enum = 0x8006 FuncSubtract Enum = 0x800A FuncReverseSubtract Enum = 0x800B ConstantColor Enum = 0x8001 OneMinusConstantColor Enum = 0x8002 ConstantAlpha Enum = 0x8003 OneMinusConstantAlpha Enum = 0x8004 )
const ( Front Enum = 0x0404 Back Enum = 0x0405 FrontAndBack Enum = 0x0408 CullFace Enum = 0x0B44 Blend Enum = 0x0BE2 Dither Enum = 0x0BD0 StencilTest Enum = 0x0B90 DepthTest Enum = 0x0B71 ScissorTest Enum = 0x0C11 PolygonOffsetFill Enum = 0x8037 SampleAlphaToCoverage Enum = 0x809E SampleCoverage Enum = 0x80A0 CW Enum = 0x0900 CCW Enum = 0x0901 )
const ( Never Enum = 0x0200 Less Enum = 0x0201 Equal Enum = 0x0202 LEqual Enum = 0x0203 Greater Enum = 0x0204 NotEqual Enum = 0x0205 GEqual Enum = 0x0206 Always Enum = 0x0207 Keep Enum = 0x1E00 Replace Enum = 0x1E01 Incr Enum = 0x1E02 Decr Enum = 0x1E03 Invert Enum = 0x150A IncrWrap Enum = 0x8507 DecrWrap Enum = 0x8508 )
const ( Texture2D Enum = 0x0DE1 TextureCubeMap Enum = 0x8513 TextureCubeMapPositiveX Enum = 0x8515 TextureCubeMapNegativeX Enum = 0x8516 TextureCubeMapPositiveY Enum = 0x8517 TextureCubeMapNegativeY Enum = 0x8518 TextureCubeMapPositiveZ Enum = 0x8519 TextureCubeMapNegativeZ Enum = 0x851A TextureMagFilter Enum = 0x2800 TextureMinFilter Enum = 0x2801 TextureWrapS Enum = 0x2802 TextureWrapT Enum = 0x2803 Nearest Enum = 0x2600 Linear Enum = 0x2601 NearestMipmapNearest Enum = 0x2700 LinearMipmapNearest Enum = 0x2701 NearestMipmapLinear Enum = 0x2702 LinearMipmapLinear Enum = 0x2703 Repeat Enum = 0x2901 ClampToEdge Enum = 0x812F MirroredRepeat Enum = 0x8370 RGBA Enum = 0x1908 RGB Enum = 0x1907 Alpha Enum = 0x1906 Luminance Enum = 0x1909 LuminanceAlpha Enum = 0x190A Texture0 Enum = 0x84C0 )
const ( FramebufferTarget Enum = 0x8D40 RenderbufferTarget Enum = 0x8D41 ColorAttachment0 Enum = 0x8CE0 DepthAttachment Enum = 0x8D00 StencilAttachment Enum = 0x8D20 DepthStencilAttachment Enum = 0x821A FramebufferComplete Enum = 0x8CD5 RGBA4 Enum = 0x8056 RGB5A1 Enum = 0x8057 RGB565 Enum = 0x8D62 DepthComponent16 Enum = 0x81A5 StencilIndex8 Enum = 0x8D48 DepthStencil Enum = 0x84F9 )
const ( BlendEquationRGB Enum = 0x8009 BlendEquationAlpha Enum = 0x883D BlendDstRGB Enum = 0x80C8 BlendSrcRGB Enum = 0x80C9 BlendDstAlpha Enum = 0x80CA BlendSrcAlpha Enum = 0x80CB LineWidthValue Enum = 0x0B21 AliasedPointSizeRange Enum = 0x846D AliasedLineWidthRange Enum = 0x846E CullFaceMode Enum = 0x0B45 FrontFaceMode Enum = 0x0B46 DepthRangeValue Enum = 0x0B70 DepthWriteMask Enum = 0x0B72 DepthClearValue Enum = 0x0B73 DepthFuncValue Enum = 0x0B74 StencilClearValue Enum = 0x0B91 StencilFuncValue Enum = 0x0B92 StencilFail Enum = 0x0B94 StencilPassDepthFail Enum = 0x0B95 StencilPassDepthPass Enum = 0x0B96 StencilRef Enum = 0x0B97 StencilValueMask Enum = 0x0B93 StencilWriteMask Enum = 0x0B98 StencilBackFunc Enum = 0x8800 StencilBackFail Enum = 0x8801 StencilBackPassDepthFail Enum = 0x8802 StencilBackPassDepthPass Enum = 0x8803 StencilBackRef Enum = 0x8CA3 StencilBackValueMask Enum = 0x8CA4 StencilBackWriteMask Enum = 0x8CA5 ViewportValue Enum = 0x0BA2 ScissorBox Enum = 0x0C10 ColorClearValue Enum = 0x0C22 ColorWriteMask Enum = 0x0C23 UnpackAlignment Enum = 0x0CF5 PackAlignment Enum = 0x0D05 MaxTextureSize Enum = 0x0D33 MaxViewportDims Enum = 0x0D3A SubpixelBits Enum = 0x0D50 RedBits Enum = 0x0D52 GreenBits Enum = 0x0D53 BlueBits Enum = 0x0D54 AlphaBits Enum = 0x0D55 DepthBits Enum = 0x0D56 StencilBits Enum = 0x0D57 PolygonOffsetUnits Enum = 0x2A00 PolygonOffsetFactor Enum = 0x8038 SampleBuffers Enum = 0x80A8 Samples Enum = 0x80A9 SampleCoverageValue Enum = 0x80AA SampleCoverageInvert Enum = 0x80AB CompressedTextureFormats Enum = 0x86A3 ImplementationColorReadType Enum = 0x8B9A ImplementationColorReadFormat Enum = 0x8B9B )
const ( CurrentProgram Enum = 0x8B8D ShaderType Enum = 0x8B4F ShaderCompiler Enum = 0x8DFA LowFloat Enum = 0x8DF0 MediumFloat Enum = 0x8DF1 HighFloat Enum = 0x8DF2 LowInt Enum = 0x8DF3 MediumInt Enum = 0x8DF4 HighInt Enum = 0x8DF5 MaxVertexAttribs Enum = 0x8869 MaxVertexUniformVectors Enum = 0x8DFB MaxVaryingVectors Enum = 0x8DFC MaxCombinedTextureImageUnits Enum = 0x8B4D MaxVertexTextureImageUnits Enum = 0x8B4C MaxTextureImageUnits Enum = 0x8872 MaxFragmentUniformVectors Enum = 0x8DFD VertexAttribArrayEnabled Enum = 0x8622 VertexAttribArraySize Enum = 0x8623 VertexAttribArrayStride Enum = 0x8624 VertexAttribArrayType Enum = 0x8625 CurrentVertexAttrib Enum = 0x8626 VertexAttribArrayNormalized Enum = 0x886A VertexAttribArrayPointer Enum = 0x8645 VertexAttribArrayBufferBinding Enum = 0x889F )
const ( TextureBinding2D Enum = 0x8069 TextureBindingCubeMap Enum = 0x8514 ActiveTextureValue Enum = 0x84E0 MaxCubeMapTextureSize Enum = 0x851C UnpackFlipYWebGL Enum = 0x9240 UnpackPremultiplyAlphaWebGL Enum = 0x9241 UnpackColorspaceConversionWebGL Enum = 0x9243 BrowserDefaultWebGL Enum = 0x9244 DontCare Enum = 0x1100 Fastest Enum = 0x1101 Nicest Enum = 0x1102 GenerateMipmapHint Enum = 0x8192 )
const ( FramebufferBinding Enum = 0x8CA6 RenderbufferBinding Enum = 0x8CA7 FramebufferIncompleteAttachment Enum = 0x8CD6 FramebufferIncompleteMissingAttachment Enum = 0x8CD7 FramebufferIncompleteDimensions Enum = 0x8CD9 FramebufferUnsupported Enum = 0x8CDD FramebufferAttachmentObjectType Enum = 0x8CD0 FramebufferAttachmentObjectName Enum = 0x8CD1 FramebufferAttachmentTextureLevel Enum = 0x8CD2 FramebufferAttachmentTextureCubeMapFace Enum = 0x8CD3 RenderbufferWidth Enum = 0x8D42 RenderbufferHeight Enum = 0x8D43 RenderbufferInternalFormat Enum = 0x8D44 RenderbufferRedSize Enum = 0x8D50 RenderbufferGreenSize Enum = 0x8D51 RenderbufferBlueSize Enum = 0x8D52 RenderbufferAlphaSize Enum = 0x8D53 RenderbufferDepthSize Enum = 0x8D54 RenderbufferStencilSize Enum = 0x8D55 )
func TextureUnit ¶
type Framebuffer ¶
type Framebuffer struct {
// contains filtered or unexported fields
}
func (*Framebuffer) Value ¶
func (f *Framebuffer) Value() (value js.Value)
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
func DefaultOptions ¶
func DefaultOptions() (options *Options)
DefaultOptions returns browser-default WebGL context attributes.
func (*Options) WithAntialias ¶
func (*Options) WithDesynchronized ¶
func (*Options) WithFailIfMajorPerformanceCaveat ¶
func (*Options) WithPowerPreference ¶
func (*Options) WithPremultipliedAlpha ¶
func (*Options) WithPreserveDrawingBuffer ¶
func (*Options) WithStencil ¶
type Renderbuffer ¶
type Renderbuffer struct {
// contains filtered or unexported fields
}
func (*Renderbuffer) Value ¶
func (r *Renderbuffer) Value() (value js.Value)
type ShaderPrecisionFormat ¶
type UniformLocation ¶
type UniformLocation struct {
// contains filtered or unexported fields
}
func (*UniformLocation) Value ¶
func (u *UniformLocation) Value() (value js.Value)