Documentation
¶
Index ¶
- type Context
- func (c *Context) ActiveTexture(texture int)
- func (c *Context) AttachShader(program *js.Object, shader *js.Object)
- func (c *Context) BindAttribLocation(program *js.Object, index int, name string)
- func (c *Context) BindBuffer(target int, buffer *js.Object)
- func (c *Context) BindFramebuffer(target int, framebuffer *js.Object)
- func (c *Context) BindRenderbuffer(target int, renderbuffer *js.Object)
- func (c *Context) BindTexture(target int, texture *js.Object)
- 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 float32)
- 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.Object)
- 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.Object
- func (c *Context) CreateFramebuffer() *js.Object
- func (c *Context) CreateProgram() *js.Object
- func (c *Context) CreateRenderbuffer() *js.Object
- func (c *Context) CreateShader(typ int) *js.Object
- func (c *Context) CreateTexture() *js.Object
- func (c *Context) CullFace(mode int)
- func (c *Context) DeleteBuffer(buffer *js.Object)
- func (c *Context) DeleteFramebuffer(framebuffer *js.Object)
- func (c *Context) DeleteProgram(program *js.Object)
- func (c *Context) DeleteRenderbuffer(renderbuffer *js.Object)
- func (c *Context) DeleteShader(shader *js.Object)
- func (c *Context) DeleteTexture(texture *js.Object)
- 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.Object)
- 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.Object)
- func (c *Context) FramebufferTexture2D(target, attachment, textarget int, texture *js.Object, level int)
- func (c *Context) FrontFace(mode int)
- func (c *Context) GenerateMipmap(target int)
- func (c *Context) GetActiveAttrib(program *js.Object, index int) *js.Object
- func (c *Context) GetActiveUniform(program *js.Object, index int) *js.Object
- func (c *Context) GetAttachedShaders(program *js.Object) []*js.Object
- func (c *Context) GetAttribLocation(program *js.Object, name string) int
- func (c *Context) GetBufferParameter(target, pname int) *js.Object
- func (c *Context) GetContextAttributes() ContextAttributes
- func (c *Context) GetError() int
- func (c *Context) GetExtension(name string) *js.Object
- func (c *Context) GetFramebufferAttachmentParameter(target, attachment, pname int) *js.Object
- func (c *Context) GetParameter(pname int) *js.Object
- func (c *Context) GetProgramInfoLog(program *js.Object) string
- func (c *Context) GetProgramParameterb(program *js.Object, pname int) bool
- func (c *Context) GetProgramParameteri(program *js.Object, pname int) int
- func (c *Context) GetRenderbufferParameter(target, pname int) *js.Object
- func (c *Context) GetShaderInfoLog(shader *js.Object) string
- func (c *Context) GetShaderParameter(shader *js.Object, pname int) *js.Object
- func (c *Context) GetShaderParameterb(shader *js.Object, pname int) bool
- func (c *Context) GetShaderSource(shader *js.Object) string
- func (c *Context) GetSupportedExtensions() []string
- func (c *Context) GetTexParameter(target, pname int) *js.Object
- func (c *Context) GetUniform(program, location *js.Object) *js.Object
- func (c *Context) GetUniformLocation(program *js.Object, name string) *js.Object
- func (c *Context) GetVertexAttrib(index, pname int) *js.Object
- func (c *Context) GetVertexAttribOffset(index, pname int) int
- func (c *Context) IsBuffer(buffer *js.Object) bool
- func (c *Context) IsContextLost() bool
- func (c *Context) IsEnabled(capability int) bool
- func (c *Context) IsFramebuffer(framebuffer *js.Object) bool
- func (c *Context) IsProgram(program *js.Object) bool
- func (c *Context) IsRenderbuffer(renderbuffer *js.Object) bool
- func (c *Context) IsShader(shader *js.Object) bool
- func (c *Context) IsTexture(texture *js.Object) bool
- func (c *Context) LineWidth(width float64)
- func (c *Context) LinkProgram(program *js.Object)
- 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.Object)
- func (c *Context) RenderbufferStorage(target, internalFormat, width, height int)
- func (c *Context) Scissor(x, y, width, height int)
- func (c *Context) ShaderSource(shader *js.Object, source string)
- func (c *Context) TexImage2D(target, level, internalFormat, format, kind int, image *js.Object)
- func (c *Context) TexParameteri(target int, pname int, param int)
- func (c *Context) TexSubImage2D(target, level, xoffset, yoffset, format, typ int, image *js.Object)
- func (c *Context) Uniform1f(location *js.Object, x float32)
- func (c *Context) Uniform1i(location *js.Object, x int)
- func (c *Context) Uniform2f(location *js.Object, x, y float32)
- func (c *Context) Uniform2i(location *js.Object, x, y int)
- func (c *Context) Uniform3f(location *js.Object, x, y, z float32)
- func (c *Context) Uniform3i(location *js.Object, x, y, z int)
- func (c *Context) Uniform4f(location *js.Object, x, y, z, w float32)
- func (c *Context) Uniform4i(location *js.Object, x, y, z, w int)
- func (c *Context) UniformMatrix2fv(location *js.Object, transpose bool, value []float32)
- func (c *Context) UniformMatrix3fv(location *js.Object, transpose bool, value []float32)
- func (c *Context) UniformMatrix4fv(location *js.Object, transpose bool, value []float32)
- func (c *Context) UseProgram(program *js.Object)
- func (c *Context) ValidateProgram(program *js.Object)
- 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.Object ARRAY_BUFFER int `js:"ARRAY_BUFFER"` ARRAY_BUFFER_BINDING int `js:"ARRAY_BUFFER_BINDING"` ATTACHED_SHADERS int `js:"ATTACHED_SHADERS"` BACK int `js:"BACK"` BLEND int `js:"BLEND"` BLEND_COLOR int `js:"BLEND_COLOR"` BLEND_DST_ALPHA int `js:"BLEND_DST_ALPHA"` BLEND_DST_RGB int `js:"BLEND_DST_RGB"` BLEND_EQUATION int `js:"BLEND_EQUATION"` BLEND_EQUATION_ALPHA int `js:"BLEND_EQUATION_ALPHA"` BLEND_EQUATION_RGB int `js:"BLEND_EQUATION_RGB"` BLEND_SRC_ALPHA int `js:"BLEND_SRC_ALPHA"` BLEND_SRC_RGB int `js:"BLEND_SRC_RGB"` BLUE_BITS int `js:"BLUE_BITS"` BOOL int `js:"BOOL"` BOOL_VEC2 int `js:"BOOL_VEC2"` BOOL_VEC3 int `js:"BOOL_VEC3"` BOOL_VEC4 int `js:"BOOL_VEC4"` BROWSER_DEFAULT_WEBGL int `js:"BROWSER_DEFAULT_WEBGL"` BUFFER_SIZE int `js:"BUFFER_SIZE"` BUFFER_USAGE int `js:"BUFFER_USAGE"` BYTE int `js:"BYTE"` CCW int `js:"CCW"` CLAMP_TO_EDGE int `js:"CLAMP_TO_EDGE"` COLOR_ATTACHMENT0 int `js:"COLOR_ATTACHMENT0"` COLOR_BUFFER_BIT int `js:"COLOR_BUFFER_BIT"` COLOR_CLEAR_VALUE int `js:"COLOR_CLEAR_VALUE"` COLOR_WRITEMASK int `js:"COLOR_WRITEMASK"` COMPILE_STATUS int `js:"COMPILE_STATUS"` COMPRESSED_TEXTURE_FORMATS int `js:"COMPRESSED_TEXTURE_FORMATS"` CONSTANT_ALPHA int `js:"CONSTANT_ALPHA"` CONSTANT_COLOR int `js:"CONSTANT_COLOR"` CONTEXT_LOST_WEBGL int `js:"CONTEXT_LOST_WEBGL"` CULL_FACE int `js:"CULL_FACE"` CULL_FACE_MODE int `js:"CULL_FACE_MODE"` CURRENT_PROGRAM int `js:"CURRENT_PROGRAM"` CURRENT_VERTEX_ATTRIB int `js:"CURRENT_VERTEX_ATTRIB"` CW int `js:"CW"` DECR int `js:"DECR"` DECR_WRAP int `js:"DECR_WRAP"` DELETE_STATUS int `js:"DELETE_STATUS"` DEPTH_ATTACHMENT int `js:"DEPTH_ATTACHMENT"` DEPTH_BITS int `js:"DEPTH_BITS"` DEPTH_BUFFER_BIT int `js:"DEPTH_BUFFER_BIT"` DEPTH_CLEAR_VALUE int `js:"DEPTH_CLEAR_VALUE"` DEPTH_COMPONENT int `js:"DEPTH_COMPONENT"` DEPTH_COMPONENT16 int `js:"DEPTH_COMPONENT16"` DEPTH_FUNC int `js:"DEPTH_FUNC"` DEPTH_RANGE int `js:"DEPTH_RANGE"` DEPTH_STENCIL int `js:"DEPTH_STENCIL"` DEPTH_STENCIL_ATTACHMENT int `js:"DEPTH_STENCIL_ATTACHMENT"` DEPTH_TEST int `js:"DEPTH_TEST"` DEPTH_WRITEMASK int `js:"DEPTH_WRITEMASK"` DITHER int `js:"DITHER"` DONT_CARE int `js:"DONT_CARE"` DST_ALPHA int `js:"DST_ALPHA"` DST_COLOR int `js:"DST_COLOR"` DYNAMIC_DRAW int `js:"DYNAMIC_DRAW"` ELEMENT_ARRAY_BUFFER int `js:"ELEMENT_ARRAY_BUFFER"` ELEMENT_ARRAY_BUFFER_BINDING int `js:"ELEMENT_ARRAY_BUFFER_BINDING"` EQUAL int `js:"EQUAL"` FASTEST int `js:"FASTEST"` FLOAT int `js:"FLOAT"` FLOAT_MAT2 int `js:"FLOAT_MAT2"` FLOAT_MAT3 int `js:"FLOAT_MAT3"` FLOAT_MAT4 int `js:"FLOAT_MAT4"` FLOAT_VEC2 int `js:"FLOAT_VEC2"` FLOAT_VEC3 int `js:"FLOAT_VEC3"` FLOAT_VEC4 int `js:"FLOAT_VEC4"` FRAGMENT_SHADER int `js:"FRAGMENT_SHADER"` FRAMEBUFFER int `js:"FRAMEBUFFER"` FRAMEBUFFER_ATTACHMENT_OBJECT_NAME int `js:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME"` FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE int `js:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE"` FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE int `js:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE"` FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL int `js:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL"` FRAMEBUFFER_BINDING int `js:"FRAMEBUFFER_BINDING"` FRAMEBUFFER_COMPLETE int `js:"FRAMEBUFFER_COMPLETE"` FRAMEBUFFER_INCOMPLETE_ATTACHMENT int `js:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT"` FRAMEBUFFER_INCOMPLETE_DIMENSIONS int `js:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS"` FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT int `js:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT"` FRAMEBUFFER_UNSUPPORTED int `js:"FRAMEBUFFER_UNSUPPORTED"` FRONT int `js:"FRONT"` FRONT_AND_BACK int `js:"FRONT_AND_BACK"` FRONT_FACE int `js:"FRONT_FACE"` FUNC_ADD int `js:"FUNC_ADD"` FUNC_REVERSE_SUBTRACT int `js:"FUNC_REVERSE_SUBTRACT"` FUNC_SUBTRACT int `js:"FUNC_SUBTRACT"` GENERATE_MIPMAP_HINT int `js:"GENERATE_MIPMAP_HINT"` GEQUAL int `js:"GEQUAL"` GREATER int `js:"GREATER"` GREEN_BITS int `js:"GREEN_BITS"` HIGH_FLOAT int `js:"HIGH_FLOAT"` HIGH_INT int `js:"HIGH_INT"` INCR int `js:"INCR"` INCR_WRAP int `js:"INCR_WRAP"` INFO_LOG_LENGTH int `js:"INFO_LOG_LENGTH"` INT int `js:"INT"` INT_VEC2 int `js:"INT_VEC2"` INT_VEC3 int `js:"INT_VEC3"` INT_VEC4 int `js:"INT_VEC4"` INVALID_ENUM int `js:"INVALID_ENUM"` INVALID_FRAMEBUFFER_OPERATION int `js:"INVALID_FRAMEBUFFER_OPERATION"` INVALID_OPERATION int `js:"INVALID_OPERATION"` INVALID_VALUE int `js:"INVALID_VALUE"` INVERT int `js:"INVERT"` KEEP int `js:"KEEP"` LEQUAL int `js:"LEQUAL"` LESS int `js:"LESS"` LINEAR int `js:"LINEAR"` LINEAR_MIPMAP_LINEAR int `js:"LINEAR_MIPMAP_LINEAR"` LINEAR_MIPMAP_NEAREST int `js:"LINEAR_MIPMAP_NEAREST"` LINES int `js:"LINES"` LINE_LOOP int `js:"LINE_LOOP"` LINE_STRIP int `js:"LINE_STRIP"` LINE_WIDTH int `js:"LINE_WIDTH"` LINK_STATUS int `js:"LINK_STATUS"` LOW_FLOAT int `js:"LOW_FLOAT"` LOW_INT int `js:"LOW_INT"` LUMINANCE int `js:"LUMINANCE"` LUMINANCE_ALPHA int `js:"LUMINANCE_ALPHA"` MAX_COMBINED_TEXTURE_IMAGE_UNITS int `js:"MAX_COMBINED_TEXTURE_IMAGE_UNITS"` MAX_CUBE_MAP_TEXTURE_SIZE int `js:"MAX_CUBE_MAP_TEXTURE_SIZE"` MAX_FRAGMENT_UNIFORM_VECTORS int `js:"MAX_FRAGMENT_UNIFORM_VECTORS"` MAX_RENDERBUFFER_SIZE int `js:"MAX_RENDERBUFFER_SIZE"` MAX_TEXTURE_IMAGE_UNITS int `js:"MAX_TEXTURE_IMAGE_UNITS"` MAX_TEXTURE_SIZE int `js:"MAX_TEXTURE_SIZE"` MAX_VARYING_VECTORS int `js:"MAX_VARYING_VECTORS"` MAX_VERTEX_ATTRIBS int `js:"MAX_VERTEX_ATTRIBS"` MAX_VERTEX_TEXTURE_IMAGE_UNITS int `js:"MAX_VERTEX_TEXTURE_IMAGE_UNITS"` MAX_VERTEX_UNIFORM_VECTORS int `js:"MAX_VERTEX_UNIFORM_VECTORS"` MAX_VIEWPORT_DIMS int `js:"MAX_VIEWPORT_DIMS"` MEDIUM_FLOAT int `js:"MEDIUM_FLOAT"` MEDIUM_INT int `js:"MEDIUM_INT"` MIRRORED_REPEAT int `js:"MIRRORED_REPEAT"` NEAREST int `js:"NEAREST"` NEAREST_MIPMAP_LINEAR int `js:"NEAREST_MIPMAP_LINEAR"` NEAREST_MIPMAP_NEAREST int `js:"NEAREST_MIPMAP_NEAREST"` NEVER int `js:"NEVER"` NICEST int `js:"NICEST"` NONE int `js:"NONE"` NOTEQUAL int `js:"NOTEQUAL"` NO_ERROR int `js:"NO_ERROR"` NUM_COMPRESSED_TEXTURE_FORMATS int `js:"NUM_COMPRESSED_TEXTURE_FORMATS"` ONE int `js:"ONE"` ONE_MINUS_CONSTANT_ALPHA int `js:"ONE_MINUS_CONSTANT_ALPHA"` ONE_MINUS_CONSTANT_COLOR int `js:"ONE_MINUS_CONSTANT_COLOR"` ONE_MINUS_DST_ALPHA int `js:"ONE_MINUS_DST_ALPHA"` ONE_MINUS_DST_COLOR int `js:"ONE_MINUS_DST_COLOR"` ONE_MINUS_SRC_ALPHA int `js:"ONE_MINUS_SRC_ALPHA"` ONE_MINUS_SRC_COLOR int `js:"ONE_MINUS_SRC_COLOR"` OUT_OF_MEMORY int `js:"OUT_OF_MEMORY"` PACK_ALIGNMENT int `js:"PACK_ALIGNMENT"` POINTS int `js:"POINTS"` POLYGON_OFFSET_FACTOR int `js:"POLYGON_OFFSET_FACTOR"` POLYGON_OFFSET_FILL int `js:"POLYGON_OFFSET_FILL"` POLYGON_OFFSET_UNITS int `js:"POLYGON_OFFSET_UNITS"` RED_BITS int `js:"RED_BITS"` RENDERBUFFER int `js:"RENDERBUFFER"` RENDERBUFFER_ALPHA_SIZE int `js:"RENDERBUFFER_ALPHA_SIZE"` RENDERBUFFER_BINDING int `js:"RENDERBUFFER_BINDING"` RENDERBUFFER_BLUE_SIZE int `js:"RENDERBUFFER_BLUE_SIZE"` RENDERBUFFER_DEPTH_SIZE int `js:"RENDERBUFFER_DEPTH_SIZE"` RENDERBUFFER_GREEN_SIZE int `js:"RENDERBUFFER_GREEN_SIZE"` RENDERBUFFER_HEIGHT int `js:"RENDERBUFFER_HEIGHT"` RENDERBUFFER_INTERNAL_FORMAT int `js:"RENDERBUFFER_INTERNAL_FORMAT"` RENDERBUFFER_RED_SIZE int `js:"RENDERBUFFER_RED_SIZE"` RENDERBUFFER_STENCIL_SIZE int `js:"RENDERBUFFER_STENCIL_SIZE"` RENDERBUFFER_WIDTH int `js:"RENDERBUFFER_WIDTH"` RENDERER int `js:"RENDERER"` REPEAT int `js:"REPEAT"` REPLACE int `js:"REPLACE"` RGB int `js:"RGB"` RGB5_A1 int `js:"RGB5_A1"` RGB565 int `js:"RGB565"` RGBA int `js:"RGBA"` RGBA4 int `js:"RGBA4"` SAMPLER_2D int `js:"SAMPLER_2D"` SAMPLER_CUBE int `js:"SAMPLER_CUBE"` SAMPLES int `js:"SAMPLES"` SAMPLE_ALPHA_TO_COVERAGE int `js:"SAMPLE_ALPHA_TO_COVERAGE"` SAMPLE_BUFFERS int `js:"SAMPLE_BUFFERS"` SAMPLE_COVERAGE int `js:"SAMPLE_COVERAGE"` SAMPLE_COVERAGE_INVERT int `js:"SAMPLE_COVERAGE_INVERT"` SAMPLE_COVERAGE_VALUE int `js:"SAMPLE_COVERAGE_VALUE"` SCISSOR_BOX int `js:"SCISSOR_BOX"` SCISSOR_TEST int `js:"SCISSOR_TEST"` SHADER_COMPILER int `js:"SHADER_COMPILER"` SHADER_SOURCE_LENGTH int `js:"SHADER_SOURCE_LENGTH"` SHADER_TYPE int `js:"SHADER_TYPE"` SHADING_LANGUAGE_VERSION int `js:"SHADING_LANGUAGE_VERSION"` SHORT int `js:"SHORT"` SRC_ALPHA int `js:"SRC_ALPHA"` SRC_ALPHA_SATURATE int `js:"SRC_ALPHA_SATURATE"` SRC_COLOR int `js:"SRC_COLOR"` STATIC_DRAW int `js:"STATIC_DRAW"` STENCIL_ATTACHMENT int `js:"STENCIL_ATTACHMENT"` STENCIL_BACK_FAIL int `js:"STENCIL_BACK_FAIL"` STENCIL_BACK_FUNC int `js:"STENCIL_BACK_FUNC"` STENCIL_BACK_PASS_DEPTH_FAIL int `js:"STENCIL_BACK_PASS_DEPTH_FAIL"` STENCIL_BACK_PASS_DEPTH_PASS int `js:"STENCIL_BACK_PASS_DEPTH_PASS"` STENCIL_BACK_REF int `js:"STENCIL_BACK_REF"` STENCIL_BACK_VALUE_MASK int `js:"STENCIL_BACK_VALUE_MASK"` STENCIL_BACK_WRITEMASK int `js:"STENCIL_BACK_WRITEMASK"` STENCIL_BITS int `js:"STENCIL_BITS"` STENCIL_BUFFER_BIT int `js:"STENCIL_BUFFER_BIT"` STENCIL_CLEAR_VALUE int `js:"STENCIL_CLEAR_VALUE"` STENCIL_FAIL int `js:"STENCIL_FAIL"` STENCIL_FUNC int `js:"STENCIL_FUNC"` STENCIL_INDEX int `js:"STENCIL_INDEX"` STENCIL_INDEX8 int `js:"STENCIL_INDEX8"` STENCIL_PASS_DEPTH_FAIL int `js:"STENCIL_PASS_DEPTH_FAIL"` STENCIL_PASS_DEPTH_PASS int `js:"STENCIL_PASS_DEPTH_PASS"` STENCIL_REF int `js:"STENCIL_REF"` STENCIL_TEST int `js:"STENCIL_TEST"` STENCIL_VALUE_MASK int `js:"STENCIL_VALUE_MASK"` STENCIL_WRITEMASK int `js:"STENCIL_WRITEMASK"` STREAM_DRAW int `js:"STREAM_DRAW"` SUBPIXEL_BITS int `js:"SUBPIXEL_BITS"` TEXTURE int `js:"TEXTURE"` TEXTURE0 int `js:"TEXTURE0"` TEXTURE1 int `js:"TEXTURE1"` TEXTURE2 int `js:"TEXTURE2"` TEXTURE3 int `js:"TEXTURE3"` TEXTURE4 int `js:"TEXTURE4"` TEXTURE5 int `js:"TEXTURE5"` TEXTURE6 int `js:"TEXTURE6"` TEXTURE7 int `js:"TEXTURE7"` TEXTURE8 int `js:"TEXTURE8"` TEXTURE9 int `js:"TEXTURE9"` TEXTURE10 int `js:"TEXTURE10"` TEXTURE11 int `js:"TEXTURE11"` TEXTURE12 int `js:"TEXTURE12"` TEXTURE13 int `js:"TEXTURE13"` TEXTURE14 int `js:"TEXTURE14"` TEXTURE15 int `js:"TEXTURE15"` TEXTURE16 int `js:"TEXTURE16"` TEXTURE17 int `js:"TEXTURE17"` TEXTURE18 int `js:"TEXTURE18"` TEXTURE19 int `js:"TEXTURE19"` TEXTURE20 int `js:"TEXTURE20"` TEXTURE21 int `js:"TEXTURE21"` TEXTURE22 int `js:"TEXTURE22"` TEXTURE23 int `js:"TEXTURE23"` TEXTURE24 int `js:"TEXTURE24"` TEXTURE25 int `js:"TEXTURE25"` TEXTURE26 int `js:"TEXTURE26"` TEXTURE27 int `js:"TEXTURE27"` TEXTURE28 int `js:"TEXTURE28"` TEXTURE29 int `js:"TEXTURE29"` TEXTURE30 int `js:"TEXTURE30"` TEXTURE31 int `js:"TEXTURE31"` TEXTURE_2D int `js:"TEXTURE_2D"` TEXTURE_BINDING_2D int `js:"TEXTURE_BINDING_2D"` TEXTURE_BINDING_CUBE_MAP int `js:"TEXTURE_BINDING_CUBE_MAP"` TEXTURE_CUBE_MAP int `js:"TEXTURE_CUBE_MAP"` TEXTURE_CUBE_MAP_NEGATIVE_X int `js:"TEXTURE_CUBE_MAP_NEGATIVE_X"` TEXTURE_CUBE_MAP_NEGATIVE_Y int `js:"TEXTURE_CUBE_MAP_NEGATIVE_Y"` TEXTURE_CUBE_MAP_NEGATIVE_Z int `js:"TEXTURE_CUBE_MAP_NEGATIVE_Z"` TEXTURE_CUBE_MAP_POSITIVE_X int `js:"TEXTURE_CUBE_MAP_POSITIVE_X"` TEXTURE_CUBE_MAP_POSITIVE_Y int `js:"TEXTURE_CUBE_MAP_POSITIVE_Y"` TEXTURE_CUBE_MAP_POSITIVE_Z int `js:"TEXTURE_CUBE_MAP_POSITIVE_Z"` TEXTURE_MAG_FILTER int `js:"TEXTURE_MAG_FILTER"` TEXTURE_MIN_FILTER int `js:"TEXTURE_MIN_FILTER"` TEXTURE_WRAP_S int `js:"TEXTURE_WRAP_S"` TEXTURE_WRAP_T int `js:"TEXTURE_WRAP_T"` TRIANGLES int `js:"TRIANGLES"` TRIANGLE_FAN int `js:"TRIANGLE_FAN"` TRIANGLE_STRIP int `js:"TRIANGLE_STRIP"` UNPACK_ALIGNMENT int `js:"UNPACK_ALIGNMENT"` UNPACK_COLORSPACE_CONVERSION_WEBGL int `js:"UNPACK_COLORSPACE_CONVERSION_WEBGL"` UNPACK_FLIP_Y_WEBGL int `js:"UNPACK_FLIP_Y_WEBGL"` UNPACK_PREMULTIPLY_ALPHA_WEBGL int `js:"UNPACK_PREMULTIPLY_ALPHA_WEBGL"` UNSIGNED_BYTE int `js:"UNSIGNED_BYTE"` UNSIGNED_INT int `js:"UNSIGNED_INT"` UNSIGNED_SHORT int `js:"UNSIGNED_SHORT"` UNSIGNED_SHORT_4_4_4_4 int `js:"UNSIGNED_SHORT_4_4_4_4"` UNSIGNED_SHORT_5_5_5_1 int `js:"UNSIGNED_SHORT_5_5_5_1"` UNSIGNED_SHORT_5_6_5 int `js:"UNSIGNED_SHORT_5_6_5"` VALIDATE_STATUS int `js:"VALIDATE_STATUS"` VENDOR int `js:"VENDOR"` VERSION int `js:"VERSION"` VERTEX_ATTRIB_ARRAY_BUFFER_BINDING int `js:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING"` VERTEX_ATTRIB_ARRAY_ENABLED int `js:"VERTEX_ATTRIB_ARRAY_ENABLED"` VERTEX_ATTRIB_ARRAY_NORMALIZED int `js:"VERTEX_ATTRIB_ARRAY_NORMALIZED"` VERTEX_ATTRIB_ARRAY_POINTER int `js:"VERTEX_ATTRIB_ARRAY_POINTER"` VERTEX_ATTRIB_ARRAY_SIZE int `js:"VERTEX_ATTRIB_ARRAY_SIZE"` VERTEX_ATTRIB_ARRAY_STRIDE int `js:"VERTEX_ATTRIB_ARRAY_STRIDE"` VERTEX_ATTRIB_ARRAY_TYPE int `js:"VERTEX_ATTRIB_ARRAY_TYPE"` VERTEX_SHADER int `js:"VERTEX_SHADER"` VIEWPORT int `js:"VIEWPORT"` ZERO int `js:"ZERO"` }
func NewContext ¶
func NewContext(canvas *js.Object, ca *ContextAttributes) (*Context, error)
NewContext takes an HTML5 canvas object and optional context attributes. If an error is returned it means you won't have access to WebGL functionality.
func (*Context) ActiveTexture ¶
Specifies the active texture unit.
func (*Context) AttachShader ¶
Attaches a WebGLShader object to a WebGLProgram object.
func (*Context) BindAttribLocation ¶
Binds a generic vertex index to a user-defined attribute variable.
func (*Context) BindBuffer ¶
Associates a buffer with a buffer target.
func (*Context) BindFramebuffer ¶
Associates a WebGLFramebuffer object with the FRAMEBUFFER bind target.
func (*Context) BindRenderbuffer ¶
Binds a WebGLRenderbuffer object to be used for rendering.
func (*Context) BindTexture ¶
Binds a named texture object to a target.
func (*Context) BlendColor ¶
The GL_BLEND_COLOR may be used to calculate the source and destination blending factors.
func (*Context) BlendEquation ¶
Sets the equation used to blend RGB and Alpha values of an incoming source fragment with a destination values as stored in the fragment's frame buffer.
func (*Context) BlendEquationSeparate ¶
Controls the blending of an incoming source fragment's R, G, B, and A values with a destination R, G, B, and A values as stored in the fragment's WebGLFramebuffer.
func (*Context) BlendFunc ¶
Sets the blending factors used to combine source and destination pixels.
func (*Context) BlendFuncSeparate ¶
Sets the weighting factors that are used by blendEquationSeparate.
func (*Context) BufferData ¶
Creates a buffer in memory and initializes it with array data. If no array is provided, the contents of the buffer is initialized to 0.
func (*Context) BufferSubData ¶
Used to modify or update some or all of a data store for a bound buffer object.
func (*Context) CheckFramebufferStatus ¶
Returns whether the currently bound WebGLFramebuffer is complete. If not complete, returns the reason why.
func (*Context) ClearColor ¶
Specifies color values to use by the clear method to clear the color buffer.
func (*Context) ClearDepth ¶
Clears the depth buffer to a specific value.
func (*Context) ClearStencil ¶
func (*Context) ColorMask ¶
Lets you set whether individual colors can be written when drawing or rendering to a framebuffer.
func (*Context) CompileShader ¶
Compiles the GLSL shader source into binary data used by the WebGLProgram object.
func (*Context) CopyTexImage2D ¶
Copies a rectangle of pixels from the current WebGLFramebuffer into a texture image.
func (*Context) CopyTexSubImage2D ¶
Replaces a portion of an existing 2D texture image with data from the current framebuffer.
func (*Context) CreateBuffer ¶
Creates and initializes a WebGLBuffer.
func (*Context) CreateFramebuffer ¶
Returns a WebGLFramebuffer object.
func (*Context) CreateProgram ¶
Creates an empty WebGLProgram object to which vector and fragment WebGLShader objects can be bound.
func (*Context) CreateRenderbuffer ¶
Creates and returns a WebGLRenderbuffer object.
func (*Context) CreateShader ¶
Returns an empty vertex or fragment shader object based on the type specified.
func (*Context) CreateTexture ¶
Used to generate a WebGLTexture object to which images can be bound.
func (*Context) CullFace ¶
Sets whether or not front, back, or both facing facets are able to be culled.
func (*Context) DeleteBuffer ¶
Delete a specific buffer.
func (*Context) DeleteFramebuffer ¶
Deletes a specific WebGLFramebuffer object. If you delete the currently bound framebuffer, the default framebuffer will be bound. Deleting a framebuffer detaches all of its attachments.
func (*Context) DeleteProgram ¶
Flags a specific WebGLProgram object for deletion if currently active. It will be deleted when it is no longer being used. Any shader objects associated with the program will be detached. They will be deleted if they were already flagged for deletion.
func (*Context) DeleteRenderbuffer ¶
Deletes the specified renderbuffer object. If the renderbuffer is currently bound, it will become unbound. If the renderbuffer is attached to the currently bound framebuffer, it is detached.
func (*Context) DeleteShader ¶
Deletes a specific shader object.
func (*Context) DeleteTexture ¶
Deletes a specific texture object.
func (*Context) DepthFunc ¶
Sets a function to use to compare incoming pixel depth to the current depth buffer value.
func (*Context) DepthRange ¶
Sets the depth range for normalized coordinates to canvas or viewport depth coordinates.
func (*Context) DetachShader ¶
Detach a shader object from a program object.
func (*Context) DisableVertexAttribArray ¶
Turns off a vertex attribute array at a specific index position.
func (*Context) DrawArrays ¶
Render geometric primitives from bound and enabled vertex data.
func (*Context) DrawElements ¶
Renders geometric primitives indexed by element array data.
func (*Context) EnableVertexAttribArray ¶
Turns on a vertex attribute at a specific index position in a vertex attribute array.
func (*Context) FrameBufferRenderBuffer ¶
func (c *Context) FrameBufferRenderBuffer(target, attachment, renderbufferTarget int, renderbuffer *js.Object)
Attaches a WebGLRenderbuffer object as a logical buffer to the currently bound WebGLFramebuffer object.
func (*Context) FramebufferTexture2D ¶
func (c *Context) FramebufferTexture2D(target, attachment, textarget int, texture *js.Object, level int)
Attaches a texture to a WebGLFramebuffer object.
func (*Context) FrontFace ¶
Sets whether or not polygons are considered front-facing based on their winding direction.
func (*Context) GenerateMipmap ¶
Creates a set of textures for a WebGLTexture object with image dimensions from the original size of the image down to a 1x1 image.
func (*Context) GetActiveAttrib ¶
Returns an WebGLActiveInfo object containing the size, type, and name of a vertex attribute at a specific index position in a program object.
func (*Context) GetActiveUniform ¶
Returns an WebGLActiveInfo object containing the size, type, and name of a uniform attribute at a specific index position in a program object.
func (*Context) GetAttachedShaders ¶
Returns a slice of WebGLShaders bound to a WebGLProgram.
func (*Context) GetAttribLocation ¶
Returns an index to the location in a program of a named attribute variable.
func (*Context) GetBufferParameter ¶
TODO: Create type specific variations. Returns the type of a parameter for a given buffer.
func (*Context) GetContextAttributes ¶
func (c *Context) GetContextAttributes() ContextAttributes
Returns the context attributes active on the context. These values might be different than what was requested on context creation if the browser's implementation doesn't support a feature.
func (*Context) GetExtension ¶
TODO: Create type specific variations. Enables a passed extension, otherwise returns null.
func (*Context) GetFramebufferAttachmentParameter ¶
TODO: Create type specific variations. Gets a parameter value for a given target and attachment.
func (*Context) GetParameter ¶
TODO: Create type specific variations. Returns the natural type value for a constant parameter.
func (*Context) GetProgramInfoLog ¶
Returns information about the last error that occurred during the failed linking or validation of a WebGL program object.
func (*Context) GetProgramParameterb ¶
Returns the value of the program parameter that corresponds to a supplied pname which is interpreted as a bool.
func (*Context) GetProgramParameteri ¶
Returns the value of the program parameter that corresponds to a supplied pname which is interpreted as an int.
func (*Context) GetRenderbufferParameter ¶
TODO: Create type specific variations. Returns a renderbuffer parameter from the currently bound WebGLRenderbuffer object.
func (*Context) GetShaderInfoLog ¶
Returns errors which occur when compiling a shader.
func (*Context) GetShaderParameter ¶
TODO: Create type specific variations. Returns the value of the parameter associated with pname for a shader object.
func (*Context) GetShaderParameterb ¶
Returns the value of the parameter associated with pname for a shader object.
func (*Context) GetShaderSource ¶
Returns source code string associated with a shader object.
func (*Context) GetSupportedExtensions ¶
Returns a slice of supported extension strings.
func (*Context) GetTexParameter ¶
TODO: Create type specific variations. Returns the value for a parameter on an active texture unit.
func (*Context) GetUniform ¶
TODO: Create type specific variations. Gets the uniform value for a specific location in a program.
func (*Context) GetUniformLocation ¶
Returns a WebGLUniformLocation object for the location of a uniform variable within a WebGLProgram object.
func (*Context) GetVertexAttrib ¶
TODO: Create type specific variations. Returns data for a particular characteristic of a vertex attribute at an index in a vertex attribute array.
func (*Context) GetVertexAttribOffset ¶
Returns the address of a specified vertex attribute.
func (*Context) IsContextLost ¶
Returns whether the WebGL context has been lost.
func (*Context) IsFramebuffer ¶
Returns true if buffer is valid, false otherwise.
func (*Context) IsRenderbuffer ¶
Returns true if buffer is valid, false otherwise.
func (*Context) LinkProgram ¶
Links an attached vertex shader and an attached fragment shader to a program so it can be used by the graphics processing unit (GPU).
func (*Context) PixelStorei ¶
Sets pixel storage modes for readPixels and unpacking of textures with texImage2D and texSubImage2D.
func (*Context) PolygonOffset ¶
Sets the implementation-specific units and scale factor used to calculate fragment depth values.
func (*Context) ReadPixels ¶
TODO: Figure out if pixels should be a slice. Reads pixel data into an ArrayBufferView object from a rectangular area in the color buffer of the active frame buffer.
func (*Context) RenderbufferStorage ¶
Creates or replaces the data store for the currently bound WebGLRenderbuffer object.
func (*Context) ShaderSource ¶
Sets and replaces shader source code in a shader object.
func (*Context) TexImage2D ¶
Loads the supplied pixel data into a texture.
func (*Context) TexParameteri ¶
Sets texture parameters for the current texture unit.
func (*Context) TexSubImage2D ¶
Replaces a portion of an existing 2D texture image with all of another image.
func (*Context) Uniform1f ¶
Assigns a floating point value to a uniform variable for the current program object.
func (*Context) Uniform1i ¶
Assigns a integer value to a uniform variable for the current program object.
func (*Context) Uniform2f ¶
Assigns 2 floating point values to a uniform variable for the current program object.
func (*Context) Uniform2i ¶
Assigns 2 integer values to a uniform variable for the current program object.
func (*Context) Uniform3f ¶
Assigns 3 floating point values to a uniform variable for the current program object.
func (*Context) Uniform3i ¶
Assigns 3 integer values to a uniform variable for the current program object.
func (*Context) Uniform4f ¶
Assigns 4 floating point values to a uniform variable for the current program object.
func (*Context) Uniform4i ¶
Assigns 4 integer values to a uniform variable for the current program object.
func (*Context) UniformMatrix2fv ¶
Sets values for a 2x2 floating point vector matrix into a uniform location as a matrix or a matrix array.
func (*Context) UniformMatrix3fv ¶
Sets values for a 3x3 floating point vector matrix into a uniform location as a matrix or a matrix array.
func (*Context) UniformMatrix4fv ¶
Sets values for a 4x4 floating point vector matrix into a uniform location as a matrix or a matrix array.
func (*Context) UseProgram ¶
Set the program object to use for rendering.
func (*Context) ValidateProgram ¶
Returns whether a given program can run in the current WebGL state.
func (*Context) VertexAttribPointer ¶
type ContextAttributes ¶
type ContextAttributes struct { // If Alpha is true, the drawing buffer has an alpha channel for // the purposes of performing OpenGL destination alpha operations // and compositing with the page. Alpha bool // If Depth is true, the drawing buffer has a depth buffer of at least 16 bits. Depth bool // If Stencil is true, the drawing buffer has a stencil buffer of at least 8 bits. Stencil bool // If Antialias is true and the implementation supports antialiasing // the drawing buffer will perform antialiasing using its choice of // technique (multisample/supersample) and quality. Antialias bool // If PremultipliedAlpha is true the page compositor will assume the // drawing buffer contains colors with premultiplied alpha. // This flag is ignored if the alpha flag is false. PremultipliedAlpha bool // If the value is true the buffers will not be cleared and will preserve // their values until cleared or overwritten by the author. PreserveDrawingBuffer bool }
func DefaultAttributes ¶
func DefaultAttributes() *ContextAttributes
Returns a copy of the default WebGL context attributes.