Documentation
¶
Overview ¶
Package webgl implements OpenGL ES 3.0 on top of a WebGL2 context.
Index ¶
- Variables
- func BindAttribLocation(program uint32, index uint32, name *uint8)
- func BindBuffer(target uint32, buffer uint32)
- func Bool(v js.Value) bool
- func BufferData(target uint32, size int, data unsafe.Pointer, usage uint32)
- func BufferSubData(target uint32, offset int, size int, data unsafe.Pointer)
- func ClearBufferfv(buffer uint32, drawbuffer int32, value *float32)
- func ClearBufferiv(buffer uint32, drawbuffer int32, value *int32)
- func ClearBufferuiv(buffer uint32, drawbuffer int32, value *uint32)
- func CompressedTexImage2D(target uint32, level int32, internalformat uint32, width int32, height int32, ...)
- func CompressedTexImage3D(target uint32, level int32, internalformat uint32, width int32, height int32, ...)
- func CompressedTexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, ...)
- func CompressedTexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, ...)
- func Context() js.Value
- func DeleteProgram(program uint32)
- func DrawBuffers(n int32, bufs *uint32)
- func DrawElements(mode uint32, count int32, xtype uint32, indices unsafe.Pointer)
- func DrawElementsInstanced(mode uint32, count int32, xtype uint32, indices unsafe.Pointer, ...)
- func DrawElementsInstancedBaseInstanceEXT(mode uint32, count int32, xtype uint32, indices unsafe.Pointer, ...)
- func DrawElementsInstancedBaseVertexBaseInstanceEXT(mode uint32, count int32, xtype uint32, indices unsafe.Pointer, ...)
- func DrawElementsInstancedBaseVertexEXT(mode uint32, count int32, xtype uint32, indices unsafe.Pointer, ...)
- func DrawElementsWithOffset(mode uint32, count int32, xtype uint32, indices uintptr)
- func DrawRangeElements(mode uint32, start uint32, end uint32, count int32, xtype uint32, ...)
- func Extension(name string) js.Value
- func Float32List(p unsafe.Pointer, n int) js.Value
- func FlushMappedBufferRange(target uint32, offset int, length int)
- func GetActiveAttrib(program uint32, index uint32, bufSize int32, length *int32, size *int32, ...)
- func GetActiveUniform(program uint32, index uint32, bufSize int32, length *int32, size *int32, ...)
- func GetActiveUniformBlockName(program uint32, uniformBlockIndex uint32, bufSize int32, length *int32, ...)
- func GetActiveUniformBlockiv(program uint32, uniformBlockIndex uint32, pname uint32, params *int32)
- func GetActiveUniformsiv(program uint32, uniformCount int32, uniformIndices *uint32, pname uint32, ...)
- func GetAttachedShaders(program uint32, maxCount int32, count *int32, shaders *uint32)
- func GetAttribLocation(program uint32, name *uint8) int32
- func GetBooleanv(pname uint32, data *bool)
- func GetBufferParameteri64v(target uint32, pname uint32, params *int64)
- func GetBufferParameteriv(target uint32, pname uint32, params *int32)
- func GetBufferPointerv(target uint32, pname uint32, params *unsafe.Pointer)
- func GetError() uint32
- func GetFloatv(pname uint32, data *float32)
- func GetFragDataLocation(program uint32, name *uint8) int32
- func GetFramebufferAttachmentParameteriv(target uint32, attachment uint32, pname uint32, params *int32)
- func GetGraphicsResetStatusKHR() uint32
- func GetInteger64i_v(target uint32, index uint32, data *int64)
- func GetInteger64v(pname uint32, data *int64)
- func GetIntegeri_v(target uint32, index uint32, data *int32)
- func GetIntegerv(pname uint32, data *int32)
- func GetInternalformativ(target uint32, internalformat uint32, pname uint32, count int32, params *int32)
- func GetProgramInfoLog(program uint32, bufSize int32, length *int32, infoLog *uint8)
- func GetProgramiv(program uint32, pname uint32, params *int32)
- func GetQueryObjecti64vEXT(id uint32, pname uint32, params *int64)
- func GetQueryObjectivEXT(id uint32, pname uint32, params *int32)
- func GetQueryObjectui64vEXT(id uint32, pname uint32, params *uint64)
- func GetQueryObjectuiv(id uint32, pname uint32, params *uint32)
- func GetQueryiv(target uint32, pname uint32, params *int32)
- func GetRenderbufferParameteriv(target uint32, pname uint32, params *int32)
- func GetSamplerParameterfv(sampler uint32, pname uint32, params *float32)
- func GetSamplerParameteriv(sampler uint32, pname uint32, params *int32)
- func GetShaderInfoLog(shader uint32, bufSize int32, length *int32, infoLog *uint8)
- func GetShaderPrecisionFormat(shadertype uint32, precisiontype uint32, xrange *int32, precision *int32)
- func GetShaderSource(shader uint32, bufSize int32, length *int32, source *uint8)
- func GetShaderiv(shader uint32, pname uint32, params *int32)
- func GetString(name uint32) *uint8
- func GetStringi(name uint32, index uint32) *uint8
- func GetSynciv(sync uintptr, pname uint32, count int32, length *int32, values *int32)
- func GetTexParameterfv(target uint32, pname uint32, params *float32)
- func GetTexParameteriv(target uint32, pname uint32, params *int32)
- func GetTransformFeedbackVarying(program uint32, index uint32, bufSize int32, length *int32, size *int32, ...)
- func GetUniformBlockIndex(program uint32, uniformBlockName *uint8) uint32
- func GetUniformIndices(program uint32, uniformCount int32, uniformNames **uint8, ...)
- func GetUniformLocation(program uint32, name *uint8) int32
- func GetUniformfv(program uint32, location int32, params *float32)
- func GetUniformiv(program uint32, location int32, params *int32)
- func GetUniformuiv(program uint32, location int32, params *uint32)
- func GetVertexAttribIiv(index uint32, pname uint32, params *int32)
- func GetVertexAttribIuiv(index uint32, pname uint32, params *uint32)
- func GetVertexAttribPointerWithOffsetv(index uint32, pname uint32, offset **uintptr)
- func GetVertexAttribPointerv(index uint32, pname uint32, pointer *unsafe.Pointer)
- func GetVertexAttribfv(index uint32, pname uint32, params *float32)
- func GetVertexAttribiv(index uint32, pname uint32, params *int32)
- func Init(c js.Value) error
- func Int32List(p unsafe.Pointer, n int) js.Value
- func InvalidateFramebuffer(target uint32, numAttachments int32, attachments *uint32)
- func InvalidateSubFramebuffer(target uint32, numAttachments int32, attachments *uint32, x int32, y int32, ...)
- func IsEnablediOES(target uint32, index uint32) bool
- func MapBufferRange(target uint32, offset int, length int, access uint32) unsafe.Pointer
- func Method(ext, name string) js.Value
- func MultiDrawArraysEXT(mode uint32, first *int32, count *int32, primcount int32)
- func MultiDrawElementsEXT(mode uint32, count *int32, xtype uint32, indices *unsafe.Pointer, ...)
- func Number(v js.Value) float64
- func OnRestore(f func())
- func PixelStorei(pname uint32, param int32)
- func ReadPixels(x int32, y int32, width int32, height int32, format uint32, xtype uint32, ...)
- func SamplerParameterfv(sampler uint32, pname uint32, param *float32)
- func SamplerParameteriv(sampler uint32, pname uint32, param *int32)
- func ShaderSource(shader uint32, count int32, xstring **uint8, length *int32)
- func TexImage2D(target uint32, level int32, internalformat int32, width int32, height int32, ...)
- func TexImage3D(target uint32, level int32, internalformat int32, width int32, height int32, ...)
- func TexParameterfv(target uint32, pname uint32, params *float32)
- func TexParameteriv(target uint32, pname uint32, params *int32)
- func TexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, ...)
- func TexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, ...)
- func TransformFeedbackVaryings(program uint32, count int32, varyings **uint8, bufferMode uint32)
- func Uint32List(p unsafe.Pointer, n int) js.Value
- func Uniform(location int32) js.Value
- func UnmapBuffer(target uint32) bool
- func Unsupported()
- func VertexAttribIPointer(index uint32, size int32, xtype uint32, stride int32, pointer unsafe.Pointer)
- func VertexAttribIPointerWithOffset(index uint32, size int32, xtype uint32, stride int32, offset uintptr)
- func VertexAttribPointer(index uint32, size int32, xtype uint32, normalized bool, stride int32, ...)
- func VertexAttribPointerWithOffset(index uint32, size int32, xtype uint32, normalized bool, stride int32, ...)
- type Table
Constants ¶
This section is empty.
Variables ¶
var ( Buffers = newTable() Textures = newTable() Framebuffers = newTable() Renderbuffers = newTable() Programs = newTable() Shaders = newTable() VertexArrays = newTable() Queries = newTable() Samplers = newTable() TransformFeedbacks = newTable() Syncs = newTable() )
Functions ¶
func BindAttribLocation ¶
BindAttribLocation binds a vertex attribute index to a named attribute.
func BufferData ¶
BufferData creates the data store of the bound buffer.
func BufferSubData ¶
BufferSubData updates a subset of the data store of the bound buffer.
func ClearBufferfv ¶
ClearBufferfv clears a buffer of the draw framebuffer.
func ClearBufferiv ¶
ClearBufferiv clears a buffer of the draw framebuffer.
func ClearBufferuiv ¶
ClearBufferuiv clears a buffer of the draw framebuffer.
func CompressedTexImage2D ¶
func CompressedTexImage2D(target uint32, level int32, internalformat uint32, width int32, height int32, border int32, imageSize int32, data unsafe.Pointer)
CompressedTexImage2D specifies a compressed two-dimensional texture image.
func CompressedTexImage3D ¶
func CompressedTexImage3D(target uint32, level int32, internalformat uint32, width int32, height int32, depth int32, border int32, imageSize int32, data unsafe.Pointer)
CompressedTexImage3D specifies a compressed three-dimensional texture image.
func CompressedTexSubImage2D ¶
func CompressedTexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, imageSize int32, data unsafe.Pointer)
CompressedTexSubImage2D specifies a compressed two-dimensional texture subimage.
func CompressedTexSubImage3D ¶
func CompressedTexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, imageSize int32, data unsafe.Pointer)
CompressedTexSubImage3D specifies a compressed three-dimensional texture subimage.
func DeleteProgram ¶
func DeleteProgram(program uint32)
DeleteProgram deletes program and its uniform locations.
func DrawBuffers ¶
DrawBuffers specifies the color buffers to draw into.
func DrawElements ¶
DrawElements renders primitives from the bound element array buffer.
func DrawElementsInstanced ¶
func DrawElementsInstanced(mode uint32, count int32, xtype uint32, indices unsafe.Pointer, instancecount int32)
DrawElementsInstanced renders instanced primitives from the bound element array buffer.
func DrawElementsInstancedBaseInstanceEXT ¶
func DrawElementsInstancedBaseInstanceEXT(mode uint32, count int32, xtype uint32, indices unsafe.Pointer, instancecount int32, baseinstance uint32)
DrawElementsInstancedBaseInstanceEXT renders instanced primitives with a base instance.
func DrawElementsInstancedBaseVertexBaseInstanceEXT ¶
func DrawElementsInstancedBaseVertexBaseInstanceEXT(mode uint32, count int32, xtype uint32, indices unsafe.Pointer, instancecount int32, basevertex int32, baseinstance uint32)
DrawElementsInstancedBaseVertexBaseInstanceEXT renders instanced primitives with a base vertex and instance.
func DrawElementsInstancedBaseVertexEXT ¶
func DrawElementsInstancedBaseVertexEXT(mode uint32, count int32, xtype uint32, indices unsafe.Pointer, instancecount int32, basevertex int32)
DrawElementsInstancedBaseVertexEXT renders instanced primitives with a base vertex.
func DrawElementsWithOffset ¶
DrawElementsWithOffset renders primitives from the bound element array buffer.
func DrawRangeElements ¶
func DrawRangeElements(mode uint32, start uint32, end uint32, count int32, xtype uint32, indices unsafe.Pointer)
DrawRangeElements renders primitives from the bound element array buffer.
func Float32List ¶
Float32List copies n float32 values at p to a Float32Array.
func FlushMappedBufferRange ¶
FlushMappedBufferRange writes a range of an explicitly flushed mapping to the buffer.
func GetActiveAttrib ¶
func GetActiveAttrib(program uint32, index uint32, bufSize int32, length *int32, size *int32, xtype *uint32, name *uint8)
GetActiveAttrib returns information about an active attribute.
func GetActiveUniform ¶
func GetActiveUniform(program uint32, index uint32, bufSize int32, length *int32, size *int32, xtype *uint32, name *uint8)
GetActiveUniform returns information about an active uniform.
func GetActiveUniformBlockName ¶
func GetActiveUniformBlockName(program uint32, uniformBlockIndex uint32, bufSize int32, length *int32, uniformBlockName *uint8)
GetActiveUniformBlockName returns the name of a uniform block.
func GetActiveUniformBlockiv ¶
GetActiveUniformBlockiv queries a uniform block parameter.
func GetActiveUniformsiv ¶
func GetActiveUniformsiv(program uint32, uniformCount int32, uniformIndices *uint32, pname uint32, params *int32)
GetActiveUniformsiv queries parameters of active uniforms.
func GetAttachedShaders ¶
GetAttachedShaders returns the shaders attached to program.
func GetAttribLocation ¶
GetAttribLocation returns the location of an attribute.
func GetBooleanv ¶
GetBooleanv returns the value of a state variable.
func GetBufferParameteri64v ¶
GetBufferParameteri64v queries a parameter of the bound buffer.
func GetBufferParameteriv ¶
GetBufferParameteriv queries a parameter of the bound buffer.
func GetBufferPointerv ¶
GetBufferPointerv returns the mapped pointer of the bound buffer.
func GetError ¶
func GetError() uint32
GetError returns the first recorded error, then the WebGL error.
func GetFragDataLocation ¶
GetFragDataLocation returns the location of a fragment shader output.
func GetFramebufferAttachmentParameteriv ¶
func GetFramebufferAttachmentParameteriv(target uint32, attachment uint32, pname uint32, params *int32)
GetFramebufferAttachmentParameteriv queries a framebuffer attachment parameter.
func GetGraphicsResetStatusKHR ¶
func GetGraphicsResetStatusKHR() uint32
GetGraphicsResetStatusKHR reports a lost or restored context.
func GetInteger64i_v ¶
GetInteger64i_v returns the value of an indexed state variable.
func GetInteger64v ¶
GetInteger64v returns the value of a state variable.
func GetIntegeri_v ¶
GetIntegeri_v returns the value of an indexed state variable.
func GetIntegerv ¶
GetIntegerv returns the value of a state variable.
func GetInternalformativ ¶
func GetInternalformativ(target uint32, internalformat uint32, pname uint32, count int32, params *int32)
GetInternalformativ queries an internal format parameter.
func GetProgramInfoLog ¶
GetProgramInfoLog returns the information log of program.
func GetProgramiv ¶
GetProgramiv queries a program parameter.
func GetQueryObjecti64vEXT ¶
GetQueryObjecti64vEXT queries a query object parameter.
func GetQueryObjectivEXT ¶
GetQueryObjectivEXT queries a query object parameter.
func GetQueryObjectui64vEXT ¶
GetQueryObjectui64vEXT queries a query object parameter.
func GetQueryObjectuiv ¶
GetQueryObjectuiv queries a query object parameter.
func GetQueryiv ¶
GetQueryiv queries the active query of target.
func GetRenderbufferParameteriv ¶
GetRenderbufferParameteriv queries a parameter of the bound renderbuffer.
func GetSamplerParameterfv ¶
GetSamplerParameterfv queries a sampler parameter.
func GetSamplerParameteriv ¶
GetSamplerParameteriv queries a sampler parameter.
func GetShaderInfoLog ¶
GetShaderInfoLog returns the information log of shader.
func GetShaderPrecisionFormat ¶
func GetShaderPrecisionFormat(shadertype uint32, precisiontype uint32, xrange *int32, precision *int32)
GetShaderPrecisionFormat returns the range and precision of a shader numeric format.
func GetShaderSource ¶
GetShaderSource returns the source code of shader.
func GetShaderiv ¶
GetShaderiv queries a shader parameter.
func GetStringi ¶
GetStringi returns an indexed string.
func GetTexParameterfv ¶
GetTexParameterfv queries a texture parameter.
func GetTexParameteriv ¶
GetTexParameteriv queries a texture parameter.
func GetTransformFeedbackVarying ¶
func GetTransformFeedbackVarying(program uint32, index uint32, bufSize int32, length *int32, size *int32, xtype *uint32, name *uint8)
GetTransformFeedbackVarying returns information about a transform feedback varying.
func GetUniformBlockIndex ¶
GetUniformBlockIndex returns the index of a uniform block.
func GetUniformIndices ¶
func GetUniformIndices(program uint32, uniformCount int32, uniformNames **uint8, uniformIndices *uint32)
GetUniformIndices returns the indices of uniform variables.
func GetUniformLocation ¶
GetUniformLocation returns the location of a uniform variable.
func GetUniformfv ¶
GetUniformfv returns the value of a uniform variable.
func GetUniformiv ¶
GetUniformiv returns the value of a uniform variable.
func GetUniformuiv ¶
GetUniformuiv returns the value of a uniform variable.
func GetVertexAttribIiv ¶
GetVertexAttribIiv returns a vertex attribute parameter.
func GetVertexAttribIuiv ¶
GetVertexAttribIuiv returns a vertex attribute parameter.
func GetVertexAttribPointerWithOffsetv ¶
GetVertexAttribPointerWithOffsetv returns the offset of a vertex attribute array.
func GetVertexAttribPointerv ¶
GetVertexAttribPointerv returns the offset of a vertex attribute array.
func GetVertexAttribfv ¶
GetVertexAttribfv returns a vertex attribute parameter.
func GetVertexAttribiv ¶
GetVertexAttribiv returns a vertex attribute parameter.
func InvalidateFramebuffer ¶
InvalidateFramebuffer invalidates framebuffer attachments.
func InvalidateSubFramebuffer ¶
func InvalidateSubFramebuffer(target uint32, numAttachments int32, attachments *uint32, x int32, y int32, width int32, height int32)
InvalidateSubFramebuffer invalidates a region of framebuffer attachments.
func IsEnablediOES ¶
IsEnablediOES reports whether an indexed capability is enabled.
func MapBufferRange ¶
MapBufferRange maps a range of the bound buffer into Go memory.
func Method ¶
Method returns the bound method name of the context, or of the extension ext when not empty. A missing method records GL_INVALID_OPERATION when called.
func MultiDrawArraysEXT ¶
MultiDrawArraysEXT renders several ranges of array data.
func MultiDrawElementsEXT ¶
func MultiDrawElementsEXT(mode uint32, count *int32, xtype uint32, indices *unsafe.Pointer, primcount int32)
MultiDrawElementsEXT renders several ranges of the bound element array buffer.
func OnRestore ¶
func OnRestore(f func())
OnRestore sets the function that binds the context methods again after a context restore.
func PixelStorei ¶
PixelStorei sets pixel storage modes.
func ReadPixels ¶
func ReadPixels(x int32, y int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer)
ReadPixels reads a block of pixels from the read framebuffer.
func SamplerParameterfv ¶
SamplerParameterfv sets a sampler parameter.
func SamplerParameteriv ¶
SamplerParameteriv sets a sampler parameter.
func ShaderSource ¶
ShaderSource replaces the source code of shader.
func TexImage2D ¶
func TexImage2D(target uint32, level int32, internalformat int32, width int32, height int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer)
TexImage2D specifies a two-dimensional texture image.
func TexImage3D ¶
func TexImage3D(target uint32, level int32, internalformat int32, width int32, height int32, depth int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer)
TexImage3D specifies a three-dimensional texture image.
func TexParameterfv ¶
TexParameterfv sets a texture parameter.
func TexParameteriv ¶
TexParameteriv sets a texture parameter.
func TexSubImage2D ¶
func TexSubImage2D(target uint32, level int32, xoffset int32, yoffset int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer)
TexSubImage2D specifies a two-dimensional texture subimage.
func TexSubImage3D ¶
func TexSubImage3D(target uint32, level int32, xoffset int32, yoffset int32, zoffset int32, width int32, height int32, depth int32, format uint32, xtype uint32, pixels unsafe.Pointer)
TexSubImage3D specifies a three-dimensional texture subimage.
func TransformFeedbackVaryings ¶
TransformFeedbackVaryings specifies the varyings to record in transform feedback.
func Uint32List ¶
Uint32List copies n uint32 values at p to a Uint32Array.
func Uniform ¶
Uniform returns the WebGLUniformLocation of location, null for -1 or unknown locations.
func UnmapBuffer ¶
UnmapBuffer writes a written mapping to the bound buffer and releases it.
func Unsupported ¶
func Unsupported()
Unsupported records GL_INVALID_OPERATION for a command without a WebGL2 equivalent.
func VertexAttribIPointer ¶
func VertexAttribIPointer(index uint32, size int32, xtype uint32, stride int32, pointer unsafe.Pointer)
VertexAttribIPointer defines an array of integer vertex attribute data in the bound array buffer.
func VertexAttribIPointerWithOffset ¶
func VertexAttribIPointerWithOffset(index uint32, size int32, xtype uint32, stride int32, offset uintptr)
VertexAttribIPointerWithOffset defines an array of integer vertex attribute data in the bound array buffer.
Types ¶
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
Table maps GL object names to WebGL objects.