Documentation
¶
Rendered for js/wasm
Overview ¶
Package webgl provides bindings for WebGL via syscall/js.
Index ¶
- type Context
- func (c *Context) ActiveTexture(texture int)
- func (c *Context) AttachShader(program js.Value, shader js.Value)
- func (c *Context) BindAttribLocation(program js.Value, index int, name string)
- func (c *Context) BindBuffer(target int, buffer js.Value)
- func (c *Context) BindFramebuffer(target int, framebuffer js.Value)
- func (c *Context) BindRenderbuffer(target int, renderbuffer js.Value)
- func (c *Context) BindTexture(target int, texture js.Value)
- func (c *Context) BlendColor(r, g, b, a float64)
- func (c *Context) BlendEquation(mode int)
- func (c *Context) BlendEquationSeparate(modeRGB, modeAlpha int)
- func (c *Context) BlendFunc(sfactor, dfactor int)
- func (c *Context) BlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha int)
- func (c *Context) BufferData(target int, data interface{}, usage int)
- func (c *Context) BufferSubData(target int, offset int, data interface{})
- func (c *Context) CheckFramebufferStatus(target int) int
- func (c *Context) Clear(flags int)
- func (c *Context) ClearColor(r, g, b, a float64)
- func (c *Context) ClearDepth(depth float64)
- func (c *Context) ClearStencil(s int)
- func (c *Context) ColorMask(r, g, b, a bool)
- func (c *Context) CompileShader(shader js.Value)
- func (c *Context) CopyTexImage2D(target, level, internal, x, y, w, h, border int)
- func (c *Context) CopyTexSubImage2D(target, level, xoffset, yoffset, x, y, w, h int)
- func (c *Context) CreateBuffer() js.Value
- func (c *Context) CreateFramebuffer() js.Value
- func (c *Context) CreateProgram() js.Value
- func (c *Context) CreateRenderbuffer() js.Value
- func (c *Context) CreateShader(typ int) js.Value
- func (c *Context) CreateTexture() js.Value
- func (c *Context) CullFace(mode int)
- func (c *Context) DeleteBuffer(buffer js.Value)
- func (c *Context) DeleteFramebuffer(framebuffer js.Value)
- func (c *Context) DeleteProgram(program js.Value)
- func (c *Context) DeleteRenderbuffer(renderbuffer js.Value)
- func (c *Context) DeleteShader(shader js.Value)
- func (c *Context) DeleteTexture(texture js.Value)
- func (c *Context) DepthFunc(fun int)
- func (c *Context) DepthMask(flag bool)
- func (c *Context) DepthRange(zNear, zFar float64)
- func (c *Context) DetachShader(program, shader js.Value)
- func (c *Context) Disable(cap int)
- func (c *Context) DisableVertexAttribArray(index int)
- func (c *Context) DrawArrays(mode, first, count int)
- func (c *Context) DrawElements(mode, count, typ, offset int)
- func (c *Context) Enable(cap int)
- func (c *Context) EnableVertexAttribArray(index int)
- func (c *Context) Finish()
- func (c *Context) Flush()
- func (c *Context) FrameBufferRenderBuffer(target, attachment, renderbufferTarget int, renderbuffer js.Value)
- func (c *Context) FramebufferTexture2D(target, attachment, textarget int, texture js.Value, level int)
- func (c *Context) FrontFace(mode int)
- func (c *Context) GenerateMipmap(target int)
- func (c *Context) GetActiveAttrib(program js.Value, index int) js.Value
- func (c *Context) GetActiveUniform(program js.Value, index int) js.Value
- func (c *Context) GetAttachedShaders(program js.Value) []js.Value
- func (c *Context) GetAttribLocation(program js.Value, name string) int
- func (c *Context) GetBufferParameter(target, pname int) js.Value
- func (c *Context) GetContextAttributes() ContextAttributes
- func (c *Context) GetError() int
- func (c *Context) GetExtension(name string) js.Value
- func (c *Context) GetFramebufferAttachmentParameter(target, attachment, pname int) js.Value
- func (c *Context) GetParameter(pname int) js.Value
- func (c *Context) GetProgramInfoLog(program js.Value) string
- func (c *Context) GetProgramParameterb(program js.Value, pname int) bool
- func (c *Context) GetProgramParameteri(program js.Value, pname int) int
- func (c *Context) GetRenderbufferParameter(target, pname int) js.Value
- func (c *Context) GetShaderInfoLog(shader js.Value) string
- func (c *Context) GetShaderParameter(shader js.Value, pname int) js.Value
- func (c *Context) GetShaderParameterb(shader js.Value, pname int) bool
- func (c *Context) GetShaderSource(shader js.Value) string
- func (c *Context) GetSupportedExtensions() []string
- func (c *Context) GetTexParameter(target, pname int) js.Value
- func (c *Context) GetUniform(program, location js.Value) js.Value
- func (c *Context) GetUniformLocation(program js.Value, name string) js.Value
- func (c *Context) GetVertexAttrib(index, pname int) js.Value
- func (c *Context) GetVertexAttribOffset(index, pname int) int
- func (c *Context) IsBuffer(buffer js.Value) bool
- func (c *Context) IsContextLost() bool
- func (c *Context) IsEnabled(capability int) bool
- func (c *Context) IsFramebuffer(framebuffer js.Value) bool
- func (c *Context) IsProgram(program js.Value) bool
- func (c *Context) IsRenderbuffer(renderbuffer js.Value) bool
- func (c *Context) IsShader(shader js.Value) bool
- func (c *Context) IsTexture(texture js.Value) bool
- func (c *Context) LineWidth(width float64)
- func (c *Context) LinkProgram(program js.Value)
- func (c *Context) PixelStorei(pname, param int)
- func (c *Context) PolygonOffset(factor, units float64)
- func (c *Context) ReadPixels(x, y, width, height, format, typ int, pixels js.Value)
- func (c *Context) RenderbufferStorage(target, internalFormat, width, height int)
- func (c *Context) Scissor(x, y, width, height int)
- func (c *Context) ShaderSource(shader js.Value, source string)
- func (c *Context) TexImage2D(target, level, internalFormat, format, kind int, image js.Value)
- func (c *Context) TexParameteri(target int, pname int, param int)
- func (c *Context) TexSubImage2D(target, level, xoffset, yoffset, format, typ int, image js.Value)
- func (c *Context) Uniform1f(location js.Value, x float32)
- func (c *Context) Uniform1i(location js.Value, x int)
- func (c *Context) Uniform2f(location js.Value, x, y float32)
- func (c *Context) Uniform2i(location js.Value, x, y int)
- func (c *Context) Uniform3f(location js.Value, x, y, z float32)
- func (c *Context) Uniform3i(location js.Value, x, y, z int)
- func (c *Context) Uniform4f(location js.Value, x, y, z, w float32)
- func (c *Context) Uniform4i(location js.Value, x, y, z, w int)
- func (c *Context) UniformMatrix2fv(location js.Value, transpose bool, value []float32)
- func (c *Context) UniformMatrix3fv(location js.Value, transpose bool, value []float32)
- func (c *Context) UniformMatrix4fv(location js.Value, transpose bool, value []float32)
- func (c *Context) UseProgram(program js.Value)
- func (c *Context) ValidateProgram(program js.Value)
- func (c *Context) VertexAttribPointer(index, size, typ int, normal bool, stride int, offset int)
- func (c *Context) Viewport(x, y, width, height int)
- type ContextAttributes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
js.Value
ARRAY_BUFFER int
ARRAY_BUFFER_BINDING int
ATTACHED_SHADERS int
BACK int
BLEND int
BLEND_COLOR int
BLEND_DST_ALPHA int
BLEND_DST_RGB int
BLEND_EQUATION int
BLEND_EQUATION_ALPHA int
BLEND_EQUATION_RGB int
BLEND_SRC_ALPHA int
BLEND_SRC_RGB int
BLUE_BITS int
BOOL int
BOOL_VEC2 int
BOOL_VEC3 int
BOOL_VEC4 int
BROWSER_DEFAULT_WEBGL int
BUFFER_SIZE int
BUFFER_USAGE int
BYTE int
CCW int
CLAMP_TO_EDGE int
COLOR_ATTACHMENT0 int
COLOR_BUFFER_BIT int
COLOR_CLEAR_VALUE int
COLOR_WRITEMASK int
COMPILE_STATUS int
COMPRESSED_TEXTURE_FORMATS int
CONSTANT_ALPHA int
CONSTANT_COLOR int
CONTEXT_LOST_WEBGL int
CULL_FACE int
CULL_FACE_MODE int
CURRENT_PROGRAM int
CURRENT_VERTEX_ATTRIB int
CW int
DECR int
DECR_WRAP int
DELETE_STATUS int
DEPTH_ATTACHMENT int
DEPTH_BITS int
DEPTH_BUFFER_BIT int
DEPTH_CLEAR_VALUE int
DEPTH_COMPONENT int
DEPTH_COMPONENT16 int
DEPTH_FUNC int
DEPTH_RANGE int
DEPTH_STENCIL int
DEPTH_STENCIL_ATTACHMENT int
DEPTH_TEST int
DEPTH_WRITEMASK int
DITHER int
DONT_CARE int
DST_ALPHA int
DST_COLOR int
DYNAMIC_DRAW int
ELEMENT_ARRAY_BUFFER int
ELEMENT_ARRAY_BUFFER_BINDING int
EQUAL int
FASTEST int
FLOAT int
FLOAT_MAT2 int
FLOAT_MAT3 int
FLOAT_MAT4 int
FLOAT_VEC2 int
FLOAT_VEC3 int
FLOAT_VEC4 int
FRAGMENT_SHADER int
FRAMEBUFFER int
FRAMEBUFFER_ATTACHMENT_Value_NAME int
FRAMEBUFFER_ATTACHMENT_Value_TYPE int
FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE int
FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL int
FRAMEBUFFER_BINDING int
FRAMEBUFFER_COMPLETE int
FRAMEBUFFER_INCOMPLETE_ATTACHMENT int
FRAMEBUFFER_INCOMPLETE_DIMENSIONS int
FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT int
FRAMEBUFFER_UNSUPPORTED int
FRONT int
FRONT_AND_BACK int
FRONT_FACE int
FUNC_ADD int
FUNC_REVERSE_SUBTRACT int
FUNC_SUBTRACT int
GENERATE_MIPMAP_HINT int
GEQUAL int
GREATER int
GREEN_BITS int
HIGH_FLOAT int
HIGH_INT int
INCR int
INCR_WRAP int
INFO_LOG_LENGTH int
INT int
INT_VEC2 int
INT_VEC3 int
INT_VEC4 int
INVALID_ENUM int
INVALID_FRAMEBUFFER_OPERATION int
INVALID_OPERATION int
INVALID_VALUE int
INVERT int
KEEP int
LEQUAL int
LESS int
LINEAR int
LINEAR_MIPMAP_LINEAR int
LINEAR_MIPMAP_NEAREST int
LINES int
LINE_LOOP int
LINE_STRIP int
LINE_WIDTH int
LINK_STATUS int
LOW_FLOAT int
LOW_INT int
LUMINANCE int
LUMINANCE_ALPHA int
MAX_COMBINED_TEXTURE_IMAGE_UNITS int
MAX_CUBE_MAP_TEXTURE_SIZE int
MAX_FRAGMENT_UNIFORM_VECTORS int
MAX_RENDERBUFFER_SIZE int
MAX_TEXTURE_IMAGE_UNITS int
MAX_TEXTURE_SIZE int
MAX_VARYING_VECTORS int
MAX_VERTEX_ATTRIBS int
MAX_VERTEX_TEXTURE_IMAGE_UNITS int
MAX_VERTEX_UNIFORM_VECTORS int
MAX_VIEWPORT_DIMS int
MEDIUM_FLOAT int
MEDIUM_INT int
MIRRORED_REPEAT int
NEAREST int
NEAREST_MIPMAP_LINEAR int
NEAREST_MIPMAP_NEAREST int
NEVER int
NICEST int
NONE int
NOTEQUAL int
NO_ERROR int
NUM_COMPRESSED_TEXTURE_FORMATS int
ONE int
ONE_MINUS_CONSTANT_ALPHA int
ONE_MINUS_CONSTANT_COLOR int
ONE_MINUS_DST_ALPHA int
ONE_MINUS_DST_COLOR int
ONE_MINUS_SRC_ALPHA int
ONE_MINUS_SRC_COLOR int
OUT_OF_MEMORY int
PACK_ALIGNMENT int
POINTS int
POLYGON_OFFSET_FACTOR int
POLYGON_OFFSET_FILL int
POLYGON_OFFSET_UNITS int
RED_BITS int
RENDERBUFFER int
RENDERBUFFER_ALPHA_SIZE int
RENDERBUFFER_BINDING int
RENDERBUFFER_BLUE_SIZE int
RENDERBUFFER_DEPTH_SIZE int
RENDERBUFFER_GREEN_SIZE int
RENDERBUFFER_HEIGHT int
RENDERBUFFER_INTERNAL_FORMAT int
RENDERBUFFER_RED_SIZE int
RENDERBUFFER_STENCIL_SIZE int
RENDERBUFFER_WIDTH int
RENDERER int
REPEAT int
REPLACE int
RGB int
RGB5_A1 int
RGB565 int
RGBA int
RGBA4 int
SAMPLER_2D int
SAMPLER_CUBE int
SAMPLES int
SAMPLE_ALPHA_TO_COVERAGE int
SAMPLE_BUFFERS int
SAMPLE_COVERAGE int
SAMPLE_COVERAGE_INVERT int
SAMPLE_COVERAGE_VALUE int
SCISSOR_BOX int
SCISSOR_TEST int
SHADER_COMPILER int
SHADER_SOURCE_LENGTH int
SHADER_TYPE int
SHADING_LANGUAGE_VERSION int
SHORT int
SRC_ALPHA int
SRC_ALPHA_SATURATE int
SRC_COLOR int
STATIC_DRAW int
STENCIL_ATTACHMENT int
STENCIL_BACK_FAIL int
STENCIL_BACK_FUNC int
STENCIL_BACK_PASS_DEPTH_FAIL int
STENCIL_BACK_PASS_DEPTH_PASS int
STENCIL_BACK_REF int
STENCIL_BACK_VALUE_MASK int
STENCIL_BACK_WRITEMASK int
STENCIL_BITS int
STENCIL_BUFFER_BIT int
STENCIL_CLEAR_VALUE int
STENCIL_FAIL int
STENCIL_FUNC int
STENCIL_INDEX int
STENCIL_INDEX8 int
STENCIL_PASS_DEPTH_FAIL int
STENCIL_PASS_DEPTH_PASS int
STENCIL_REF int
STENCIL_TEST int
STENCIL_VALUE_MASK int
STENCIL_WRITEMASK int
STREAM_DRAW int
SUBPIXEL_BITS int
TEXTURE int
TEXTURE0 int
TEXTURE1 int
TEXTURE2 int
TEXTURE3 int
TEXTURE4 int
TEXTURE5 int
TEXTURE6 int
TEXTURE7 int
TEXTURE8 int
TEXTURE9 int
TEXTURE10 int
TEXTURE11 int
TEXTURE12 int
TEXTURE13 int
TEXTURE14 int
TEXTURE15 int
TEXTURE16 int
TEXTURE17 int
TEXTURE18 int
TEXTURE19 int
TEXTURE20 int
TEXTURE21 int
TEXTURE22 int
TEXTURE23 int
TEXTURE24 int
TEXTURE25 int
TEXTURE26 int
TEXTURE27 int
TEXTURE28 int
TEXTURE29 int
TEXTURE30 int
TEXTURE31 int
TEXTURE_2D int
TEXTURE_BINDING_2D int
TEXTURE_BINDING_CUBE_MAP int
TEXTURE_CUBE_MAP int
TEXTURE_CUBE_MAP_NEGATIVE_X int
TEXTURE_CUBE_MAP_NEGATIVE_Y int
TEXTURE_CUBE_MAP_NEGATIVE_Z int
TEXTURE_CUBE_MAP_POSITIVE_X int
TEXTURE_CUBE_MAP_POSITIVE_Y int
TEXTURE_CUBE_MAP_POSITIVE_Z int
TEXTURE_MAG_FILTER int
TEXTURE_MIN_FILTER int
TEXTURE_WRAP_S int
TEXTURE_WRAP_T int
TRIANGLES int
TRIANGLE_FAN int
TRIANGLE_STRIP int
UNPACK_ALIGNMENT int
UNPACK_COLORSPACE_CONVERSION_WEBGL int
UNPACK_FLIP_Y_WEBGL int
UNPACK_PREMULTIPLY_ALPHA_WEBGL int
UNSIGNED_BYTE int
UNSIGNED_INT int
UNSIGNED_SHORT int
UNSIGNED_SHORT_4_4_4_4 int
UNSIGNED_SHORT_5_5_5_1 int
UNSIGNED_SHORT_5_6_5 int
VALIDATE_STATUS int
VENDOR int
VERSION int
VERTEX_ATTRIB_ARRAY_BUFFER_BINDING int
VERTEX_ATTRIB_ARRAY_ENABLED int
VERTEX_ATTRIB_ARRAY_NORMALIZED int
VERTEX_ATTRIB_ARRAY_POINTER int
VERTEX_ATTRIB_ARRAY_SIZE int
VERTEX_ATTRIB_ARRAY_STRIDE int
VERTEX_ATTRIB_ARRAY_TYPE int
VERTEX_SHADER int
VIEWPORT int
ZERO int
}
func NewContext ¶
func NewContext(canvas js.Value, ca *ContextAttributes) (*Context, error)
func (*Context) ActiveTexture ¶
func (*Context) BindAttribLocation ¶
func (*Context) BindFramebuffer ¶
func (*Context) BindRenderbuffer ¶
func (*Context) BlendColor ¶
func (*Context) BlendEquation ¶
func (*Context) BlendEquationSeparate ¶
func (*Context) BlendFuncSeparate ¶
func (*Context) BufferData ¶
func (*Context) BufferSubData ¶
func (*Context) CheckFramebufferStatus ¶
func (*Context) ClearColor ¶
func (*Context) ClearDepth ¶
func (*Context) ClearStencil ¶
func (*Context) CompileShader ¶
func (*Context) CopyTexImage2D ¶
func (*Context) CopyTexSubImage2D ¶
func (*Context) CreateBuffer ¶
func (*Context) CreateFramebuffer ¶
func (*Context) CreateProgram ¶
func (*Context) CreateRenderbuffer ¶
func (*Context) CreateTexture ¶
func (*Context) DeleteBuffer ¶
func (*Context) DeleteFramebuffer ¶
func (*Context) DeleteProgram ¶
func (*Context) DeleteRenderbuffer ¶
func (*Context) DeleteShader ¶
func (*Context) DeleteTexture ¶
func (*Context) DepthRange ¶
func (*Context) DetachShader ¶
func (*Context) DisableVertexAttribArray ¶
func (*Context) DrawArrays ¶
func (*Context) DrawElements ¶
func (*Context) EnableVertexAttribArray ¶
func (*Context) FrameBufferRenderBuffer ¶
func (*Context) FramebufferTexture2D ¶
func (*Context) GenerateMipmap ¶
func (*Context) GetActiveAttrib ¶
func (*Context) GetActiveUniform ¶
func (*Context) GetAttachedShaders ¶
func (*Context) GetAttribLocation ¶
func (*Context) GetBufferParameter ¶
func (*Context) GetContextAttributes ¶
func (c *Context) GetContextAttributes() ContextAttributes
func (*Context) GetFramebufferAttachmentParameter ¶
func (*Context) GetProgramParameterb ¶
func (*Context) GetProgramParameteri ¶
func (*Context) GetRenderbufferParameter ¶
func (*Context) GetShaderParameter ¶
func (*Context) GetShaderParameterb ¶
func (*Context) GetSupportedExtensions ¶
func (*Context) GetUniformLocation ¶
func (*Context) GetVertexAttribOffset ¶
func (*Context) IsContextLost ¶
func (*Context) LinkProgram ¶
func (*Context) PixelStorei ¶
func (*Context) PolygonOffset ¶
func (*Context) ReadPixels ¶
func (*Context) RenderbufferStorage ¶
func (*Context) TexImage2D ¶
func (*Context) TexSubImage2D ¶
func (*Context) UniformMatrix2fv ¶
func (*Context) UniformMatrix3fv ¶
func (*Context) UniformMatrix4fv ¶
func (*Context) UseProgram ¶
func (*Context) ValidateProgram ¶
func (*Context) VertexAttribPointer ¶
type ContextAttributes ¶
type ContextAttributes struct {
Alpha bool
Depth bool
Stencil bool
Antialias bool
PremultipliedAlpha bool
PreserveDrawingBuffer bool
}
func DefaultAttributes ¶
func DefaultAttributes() *ContextAttributes
Click to show internal directories.
Click to hide internal directories.