webapi: github.com/gowebapi/webapi/graphics/webgl Index | Examples | Files

package webgl

import "github.com/gowebapi/webapi/graphics/webgl"

Package webgl allows rendering using an API that conforms closely to the OpenGL ES 2.0 API.

Source: WebGL Specification (https://www.khronos.org/registry/webgl/specs/latest/1.0/)

A triangle

Code:

package main

import (
    "fmt"

    "github.com/gowebapi/webapi"
    "github.com/gowebapi/webapi/core/js"
    "github.com/gowebapi/webapi/core/jsconv"
    "github.com/gowebapi/webapi/graphics/webgl"
    "github.com/gowebapi/webapi/html/canvas"
)

//see https://github.com/golang/go/wiki/WebAssembly
//see https://github.com/bobcob7/wasm-basic-triangle

// A triangle
func main() {
    c := make(chan struct{}, 0)
    fmt.Println("Go/WASM loaded")

    addCanvas()
    <-c
}

func addCanvas() {
    doc := webapi.GetWindow().Document()
    app := doc.GetElementById("app")
    body := doc.GetElementById("body")
    width := body.ClientWidth()
    height := body.ClientHeight()

    canvasE := webapi.GetWindow().Document().CreateElement("canvas", &webapi.Union{js.ValueOf("dom.Node")}) //TODO this seems wrong since we have to use js. for node
    canvasE.SetId("canvas42")
    app.AppendChild(&canvasE.Node)
    canvasHTML := canvas.HTMLCanvasElementFromJS(canvasE)
    canvasHTML.SetWidth(uint(width))
    canvasHTML.SetHeight(uint(height))
    //canvasHTML.RequestFullscreen(&dom.FullscreenOptions{})	//TODO find a way to do fullscreen request

    contextU := canvasHTML.GetContext("webgl", nil)
    gl := webgl.RenderingContextFromJS(contextU)

    vBuffer, iBuffer, icount := createBuffers(gl)

    //// Shaders ////
    prog := setupShaders(gl)

    //// Associating shaders to buffer objects ////

    // Bind vertex buffer object
    gl.BindBuffer(webgl.ARRAY_BUFFER, vBuffer)

    // Bind index buffer object
    gl.BindBuffer(webgl.ELEMENT_ARRAY_BUFFER, iBuffer)

    // Get the attribute location
    coord := gl.GetAttribLocation(prog, "coordinates")

    // Point an attribute to the currently bound VBO
    gl.VertexAttribPointer(uint(coord), 3, webgl.FLOAT, false, 0, 0)

    // Enable the attribute
    gl.EnableVertexAttribArray(uint(coord))

    //// Drawing the triangle ////

    // Clear the canvas
    gl.ClearColor(0.5, 0.5, 0.5, 0.9)
    gl.Clear(webgl.COLOR_BUFFER_BIT)

    // Enable the depth test
    gl.Enable(webgl.DEPTH_TEST)

    // Set the view port
    gl.Viewport(0, 0, width, height)

    // Draw the triangle
    gl.DrawElements(webgl.TRIANGLES, icount, webgl.UNSIGNED_SHORT, 0)

    fmt.Println("done")
}

func createBuffers(gl *webgl.RenderingContext) (*webgl.Buffer, *webgl.Buffer, int) {
    //// VERTEX BUFFER ////
    var verticesNative = []float32{
        -0.5, 0.5, 0,
        -0.5, -0.5, 0,
        0.5, -0.5, 0,
    }
    var vertices = jsconv.Float32ToJs(verticesNative)
    // Create buffer
    vBuffer := gl.CreateBuffer()
    // Bind to buffer
    gl.BindBuffer(webgl.ARRAY_BUFFER, vBuffer)
    // Pass data to buffer
    gl.BufferData2(webgl.ARRAY_BUFFER, webgl.UnionFromJS(vertices), webgl.STATIC_DRAW)
    // Unbind buffer
    gl.BindBuffer(webgl.ARRAY_BUFFER, &webgl.Buffer{})

    // INDEX BUFFER ////
    var indicesNative = []uint32{
        2, 1, 0,
    }
    var indices = jsconv.UInt32ToJs(indicesNative)

    // Create buffer
    iBuffer := gl.CreateBuffer()

    // Bind to buffer
    gl.BindBuffer(webgl.ELEMENT_ARRAY_BUFFER, iBuffer)

    // Pass data to buffer
    gl.BufferData2(webgl.ELEMENT_ARRAY_BUFFER, webgl.UnionFromJS(indices), webgl.STATIC_DRAW)

    // Unbind buffer
    gl.BindBuffer(webgl.ELEMENT_ARRAY_BUFFER, &webgl.Buffer{})
    return vBuffer, iBuffer, len(indicesNative)
}

func setupShaders(gl *webgl.RenderingContext) *webgl.Program {
    // Vertex shader source code
    vertCode := `
	attribute vec3 coordinates;
	void main(void) {
		gl_Position = vec4(coordinates, 1.0);
	}`

    // Create a vertex shader object
    vShader := gl.CreateShader(webgl.VERTEX_SHADER)

    // Attach vertex shader source code
    gl.ShaderSource(vShader, vertCode)

    // Compile the vertex shader
    gl.CompileShader(vShader)

    //fragment shader source code
    fragCode := `
	void main(void) {
		gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0);
	}`

    // Create fragment shader object
    fShader := gl.CreateShader(webgl.FRAGMENT_SHADER)

    // Attach fragment shader source code
    gl.ShaderSource(fShader, fragCode)

    // Compile the fragmentt shader
    gl.CompileShader(fShader)

    // Create a shader program object to store
    // the combined shader program
    prog := gl.CreateProgram()

    // Attach a vertex shader
    gl.AttachShader(prog, vShader)

    // Attach a fragment shader
    gl.AttachShader(prog, fShader)

    // Link both the programs
    gl.LinkProgram(prog)

    // Use the combined shader program object
    gl.UseProgram(prog)

    return prog
}

Index

Examples

Package Files

doc.go webgl.go

Constants

const (
    DEPTH_BUFFER_BIT                             uint = 0x00000100
    STENCIL_BUFFER_BIT                           uint = 0x00000400
    COLOR_BUFFER_BIT                             uint = 0x00004000
    POINTS                                       uint = 0x0000
    LINES                                        uint = 0x0001
    LINE_LOOP                                    uint = 0x0002
    LINE_STRIP                                   uint = 0x0003
    TRIANGLES                                    uint = 0x0004
    TRIANGLE_STRIP                               uint = 0x0005
    TRIANGLE_FAN                                 uint = 0x0006
    ZERO                                         uint = 0
    ONE                                          uint = 1
    SRC_COLOR                                    uint = 0x0300
    ONE_MINUS_SRC_COLOR                          uint = 0x0301
    SRC_ALPHA                                    uint = 0x0302
    ONE_MINUS_SRC_ALPHA                          uint = 0x0303
    DST_ALPHA                                    uint = 0x0304
    ONE_MINUS_DST_ALPHA                          uint = 0x0305
    DST_COLOR                                    uint = 0x0306
    ONE_MINUS_DST_COLOR                          uint = 0x0307
    SRC_ALPHA_SATURATE                           uint = 0x0308
    FUNC_ADD                                     uint = 0x8006
    BLEND_EQUATION                               uint = 0x8009
    BLEND_EQUATION_RGB                           uint = 0x8009
    BLEND_EQUATION_ALPHA                         uint = 0x883D
    FUNC_SUBTRACT                                uint = 0x800A
    FUNC_REVERSE_SUBTRACT                        uint = 0x800B
    BLEND_DST_RGB                                uint = 0x80C8
    BLEND_SRC_RGB                                uint = 0x80C9
    BLEND_DST_ALPHA                              uint = 0x80CA
    BLEND_SRC_ALPHA                              uint = 0x80CB
    CONSTANT_COLOR                               uint = 0x8001
    ONE_MINUS_CONSTANT_COLOR                     uint = 0x8002
    CONSTANT_ALPHA                               uint = 0x8003
    ONE_MINUS_CONSTANT_ALPHA                     uint = 0x8004
    BLEND_COLOR                                  uint = 0x8005
    ARRAY_BUFFER                                 uint = 0x8892
    ELEMENT_ARRAY_BUFFER                         uint = 0x8893
    ARRAY_BUFFER_BINDING                         uint = 0x8894
    ELEMENT_ARRAY_BUFFER_BINDING                 uint = 0x8895
    STREAM_DRAW                                  uint = 0x88E0
    STATIC_DRAW                                  uint = 0x88E4
    DYNAMIC_DRAW                                 uint = 0x88E8
    BUFFER_SIZE                                  uint = 0x8764
    BUFFER_USAGE                                 uint = 0x8765
    CURRENT_VERTEX_ATTRIB                        uint = 0x8626
    FRONT                                        uint = 0x0404
    BACK                                         uint = 0x0405
    FRONT_AND_BACK                               uint = 0x0408
    CULL_FACE                                    uint = 0x0B44
    BLEND                                        uint = 0x0BE2
    DITHER                                       uint = 0x0BD0
    STENCIL_TEST                                 uint = 0x0B90
    DEPTH_TEST                                   uint = 0x0B71
    SCISSOR_TEST                                 uint = 0x0C11
    POLYGON_OFFSET_FILL                          uint = 0x8037
    SAMPLE_ALPHA_TO_COVERAGE                     uint = 0x809E
    SAMPLE_COVERAGE                              uint = 0x80A0
    NO_ERROR                                     uint = 0
    INVALID_ENUM                                 uint = 0x0500
    INVALID_VALUE                                uint = 0x0501
    INVALID_OPERATION                            uint = 0x0502
    OUT_OF_MEMORY                                uint = 0x0505
    CW                                           uint = 0x0900
    CCW                                          uint = 0x0901
    LINE_WIDTH                                   uint = 0x0B21
    ALIASED_POINT_SIZE_RANGE                     uint = 0x846D
    ALIASED_LINE_WIDTH_RANGE                     uint = 0x846E
    CULL_FACE_MODE                               uint = 0x0B45
    FRONT_FACE                                   uint = 0x0B46
    DEPTH_RANGE                                  uint = 0x0B70
    DEPTH_WRITEMASK                              uint = 0x0B72
    DEPTH_CLEAR_VALUE                            uint = 0x0B73
    DEPTH_FUNC                                   uint = 0x0B74
    STENCIL_CLEAR_VALUE                          uint = 0x0B91
    STENCIL_FUNC                                 uint = 0x0B92
    STENCIL_FAIL                                 uint = 0x0B94
    STENCIL_PASS_DEPTH_FAIL                      uint = 0x0B95
    STENCIL_PASS_DEPTH_PASS                      uint = 0x0B96
    STENCIL_REF                                  uint = 0x0B97
    STENCIL_VALUE_MASK                           uint = 0x0B93
    STENCIL_WRITEMASK                            uint = 0x0B98
    STENCIL_BACK_FUNC                            uint = 0x8800
    STENCIL_BACK_FAIL                            uint = 0x8801
    STENCIL_BACK_PASS_DEPTH_FAIL                 uint = 0x8802
    STENCIL_BACK_PASS_DEPTH_PASS                 uint = 0x8803
    STENCIL_BACK_REF                             uint = 0x8CA3
    STENCIL_BACK_VALUE_MASK                      uint = 0x8CA4
    STENCIL_BACK_WRITEMASK                       uint = 0x8CA5
    VIEWPORT                                     uint = 0x0BA2
    SCISSOR_BOX                                  uint = 0x0C10
    COLOR_CLEAR_VALUE                            uint = 0x0C22
    COLOR_WRITEMASK                              uint = 0x0C23
    UNPACK_ALIGNMENT                             uint = 0x0CF5
    PACK_ALIGNMENT                               uint = 0x0D05
    MAX_TEXTURE_SIZE                             uint = 0x0D33
    MAX_VIEWPORT_DIMS                            uint = 0x0D3A
    SUBPIXEL_BITS                                uint = 0x0D50
    RED_BITS                                     uint = 0x0D52
    GREEN_BITS                                   uint = 0x0D53
    BLUE_BITS                                    uint = 0x0D54
    ALPHA_BITS                                   uint = 0x0D55
    DEPTH_BITS                                   uint = 0x0D56
    STENCIL_BITS                                 uint = 0x0D57
    POLYGON_OFFSET_UNITS                         uint = 0x2A00
    POLYGON_OFFSET_FACTOR                        uint = 0x8038
    TEXTURE_BINDING_2D                           uint = 0x8069
    SAMPLE_BUFFERS                               uint = 0x80A8
    SAMPLES                                      uint = 0x80A9
    SAMPLE_COVERAGE_VALUE                        uint = 0x80AA
    SAMPLE_COVERAGE_INVERT                       uint = 0x80AB
    COMPRESSED_TEXTURE_FORMATS                   uint = 0x86A3
    DONT_CARE                                    uint = 0x1100
    FASTEST                                      uint = 0x1101
    NICEST                                       uint = 0x1102
    GENERATE_MIPMAP_HINT                         uint = 0x8192
    BYTE                                         uint = 0x1400
    UNSIGNED_BYTE                                uint = 0x1401
    SHORT                                        uint = 0x1402
    UNSIGNED_SHORT                               uint = 0x1403
    INT                                          uint = 0x1404
    UNSIGNED_INT                                 uint = 0x1405
    FLOAT                                        uint = 0x1406
    DEPTH_COMPONENT                              uint = 0x1902
    ALPHA                                        uint = 0x1906
    RGB                                          uint = 0x1907
    RGBA                                         uint = 0x1908
    LUMINANCE                                    uint = 0x1909
    LUMINANCE_ALPHA                              uint = 0x190A
    UNSIGNED_SHORT_4_4_4_4                       uint = 0x8033
    UNSIGNED_SHORT_5_5_5_1                       uint = 0x8034
    UNSIGNED_SHORT_5_6_5                         uint = 0x8363
    FRAGMENT_SHADER                              uint = 0x8B30
    VERTEX_SHADER                                uint = 0x8B31
    MAX_VERTEX_ATTRIBS                           uint = 0x8869
    MAX_VERTEX_UNIFORM_VECTORS                   uint = 0x8DFB
    MAX_VARYING_VECTORS                          uint = 0x8DFC
    MAX_COMBINED_TEXTURE_IMAGE_UNITS             uint = 0x8B4D
    MAX_VERTEX_TEXTURE_IMAGE_UNITS               uint = 0x8B4C
    MAX_TEXTURE_IMAGE_UNITS                      uint = 0x8872
    MAX_FRAGMENT_UNIFORM_VECTORS                 uint = 0x8DFD
    SHADER_TYPE                                  uint = 0x8B4F
    DELETE_STATUS                                uint = 0x8B80
    LINK_STATUS                                  uint = 0x8B82
    VALIDATE_STATUS                              uint = 0x8B83
    ATTACHED_SHADERS                             uint = 0x8B85
    ACTIVE_UNIFORMS                              uint = 0x8B86
    ACTIVE_ATTRIBUTES                            uint = 0x8B89
    SHADING_LANGUAGE_VERSION                     uint = 0x8B8C
    CURRENT_PROGRAM                              uint = 0x8B8D
    NEVER                                        uint = 0x0200
    LESS                                         uint = 0x0201
    EQUAL                                        uint = 0x0202
    LEQUAL                                       uint = 0x0203
    GREATER                                      uint = 0x0204
    NOTEQUAL                                     uint = 0x0205
    GEQUAL                                       uint = 0x0206
    ALWAYS                                       uint = 0x0207
    KEEP                                         uint = 0x1E00
    REPLACE                                      uint = 0x1E01
    INCR                                         uint = 0x1E02
    DECR                                         uint = 0x1E03
    INVERT                                       uint = 0x150A
    INCR_WRAP                                    uint = 0x8507
    DECR_WRAP                                    uint = 0x8508
    VENDOR                                       uint = 0x1F00
    RENDERER                                     uint = 0x1F01
    VERSION                                      uint = 0x1F02
    NEAREST                                      uint = 0x2600
    LINEAR                                       uint = 0x2601
    NEAREST_MIPMAP_NEAREST                       uint = 0x2700
    LINEAR_MIPMAP_NEAREST                        uint = 0x2701
    NEAREST_MIPMAP_LINEAR                        uint = 0x2702
    LINEAR_MIPMAP_LINEAR                         uint = 0x2703
    TEXTURE_MAG_FILTER                           uint = 0x2800
    TEXTURE_MIN_FILTER                           uint = 0x2801
    TEXTURE_WRAP_S                               uint = 0x2802
    TEXTURE_WRAP_T                               uint = 0x2803
    TEXTURE_2D                                   uint = 0x0DE1
    TEXTURE                                      uint = 0x1702
    TEXTURE_CUBE_MAP                             uint = 0x8513
    TEXTURE_BINDING_CUBE_MAP                     uint = 0x8514
    TEXTURE_CUBE_MAP_POSITIVE_X                  uint = 0x8515
    TEXTURE_CUBE_MAP_NEGATIVE_X                  uint = 0x8516
    TEXTURE_CUBE_MAP_POSITIVE_Y                  uint = 0x8517
    TEXTURE_CUBE_MAP_NEGATIVE_Y                  uint = 0x8518
    TEXTURE_CUBE_MAP_POSITIVE_Z                  uint = 0x8519
    TEXTURE_CUBE_MAP_NEGATIVE_Z                  uint = 0x851A
    MAX_CUBE_MAP_TEXTURE_SIZE                    uint = 0x851C
    TEXTURE0                                     uint = 0x84C0
    TEXTURE1                                     uint = 0x84C1
    TEXTURE2                                     uint = 0x84C2
    TEXTURE3                                     uint = 0x84C3
    TEXTURE4                                     uint = 0x84C4
    TEXTURE5                                     uint = 0x84C5
    TEXTURE6                                     uint = 0x84C6
    TEXTURE7                                     uint = 0x84C7
    TEXTURE8                                     uint = 0x84C8
    TEXTURE9                                     uint = 0x84C9
    TEXTURE10                                    uint = 0x84CA
    TEXTURE11                                    uint = 0x84CB
    TEXTURE12                                    uint = 0x84CC
    TEXTURE13                                    uint = 0x84CD
    TEXTURE14                                    uint = 0x84CE
    TEXTURE15                                    uint = 0x84CF
    TEXTURE16                                    uint = 0x84D0
    TEXTURE17                                    uint = 0x84D1
    TEXTURE18                                    uint = 0x84D2
    TEXTURE19                                    uint = 0x84D3
    TEXTURE20                                    uint = 0x84D4
    TEXTURE21                                    uint = 0x84D5
    TEXTURE22                                    uint = 0x84D6
    TEXTURE23                                    uint = 0x84D7
    TEXTURE24                                    uint = 0x84D8
    TEXTURE25                                    uint = 0x84D9
    TEXTURE26                                    uint = 0x84DA
    TEXTURE27                                    uint = 0x84DB
    TEXTURE28                                    uint = 0x84DC
    TEXTURE29                                    uint = 0x84DD
    TEXTURE30                                    uint = 0x84DE
    TEXTURE31                                    uint = 0x84DF
    ACTIVE_TEXTURE                               uint = 0x84E0
    REPEAT                                       uint = 0x2901
    CLAMP_TO_EDGE                                uint = 0x812F
    MIRRORED_REPEAT                              uint = 0x8370
    FLOAT_VEC2                                   uint = 0x8B50
    FLOAT_VEC3                                   uint = 0x8B51
    FLOAT_VEC4                                   uint = 0x8B52
    INT_VEC2                                     uint = 0x8B53
    INT_VEC3                                     uint = 0x8B54
    INT_VEC4                                     uint = 0x8B55
    BOOL                                         uint = 0x8B56
    BOOL_VEC2                                    uint = 0x8B57
    BOOL_VEC3                                    uint = 0x8B58
    BOOL_VEC4                                    uint = 0x8B59
    FLOAT_MAT2                                   uint = 0x8B5A
    FLOAT_MAT3                                   uint = 0x8B5B
    FLOAT_MAT4                                   uint = 0x8B5C
    SAMPLER_2D                                   uint = 0x8B5E
    SAMPLER_CUBE                                 uint = 0x8B60
    VERTEX_ATTRIB_ARRAY_ENABLED                  uint = 0x8622
    VERTEX_ATTRIB_ARRAY_SIZE                     uint = 0x8623
    VERTEX_ATTRIB_ARRAY_STRIDE                   uint = 0x8624
    VERTEX_ATTRIB_ARRAY_TYPE                     uint = 0x8625
    VERTEX_ATTRIB_ARRAY_NORMALIZED               uint = 0x886A
    VERTEX_ATTRIB_ARRAY_POINTER                  uint = 0x8645
    VERTEX_ATTRIB_ARRAY_BUFFER_BINDING           uint = 0x889F
    IMPLEMENTATION_COLOR_READ_TYPE               uint = 0x8B9A
    IMPLEMENTATION_COLOR_READ_FORMAT             uint = 0x8B9B
    COMPILE_STATUS                               uint = 0x8B81
    LOW_FLOAT                                    uint = 0x8DF0
    MEDIUM_FLOAT                                 uint = 0x8DF1
    HIGH_FLOAT                                   uint = 0x8DF2
    LOW_INT                                      uint = 0x8DF3
    MEDIUM_INT                                   uint = 0x8DF4
    HIGH_INT                                     uint = 0x8DF5
    FRAMEBUFFER                                  uint = 0x8D40
    RENDERBUFFER                                 uint = 0x8D41
    RGBA4                                        uint = 0x8056
    RGB5_A1                                      uint = 0x8057
    RGB565                                       uint = 0x8D62
    DEPTH_COMPONENT16                            uint = 0x81A5
    STENCIL_INDEX8                               uint = 0x8D48
    DEPTH_STENCIL                                uint = 0x84F9
    RENDERBUFFER_WIDTH                           uint = 0x8D42
    RENDERBUFFER_HEIGHT                          uint = 0x8D43
    RENDERBUFFER_INTERNAL_FORMAT                 uint = 0x8D44
    RENDERBUFFER_RED_SIZE                        uint = 0x8D50
    RENDERBUFFER_GREEN_SIZE                      uint = 0x8D51
    RENDERBUFFER_BLUE_SIZE                       uint = 0x8D52
    RENDERBUFFER_ALPHA_SIZE                      uint = 0x8D53
    RENDERBUFFER_DEPTH_SIZE                      uint = 0x8D54
    RENDERBUFFER_STENCIL_SIZE                    uint = 0x8D55
    FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE           uint = 0x8CD0
    FRAMEBUFFER_ATTACHMENT_OBJECT_NAME           uint = 0x8CD1
    FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL         uint = 0x8CD2
    FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE uint = 0x8CD3
    COLOR_ATTACHMENT0                            uint = 0x8CE0
    DEPTH_ATTACHMENT                             uint = 0x8D00
    STENCIL_ATTACHMENT                           uint = 0x8D20
    DEPTH_STENCIL_ATTACHMENT                     uint = 0x821A
    NONE                                         uint = 0
    FRAMEBUFFER_COMPLETE                         uint = 0x8CD5
    FRAMEBUFFER_INCOMPLETE_ATTACHMENT            uint = 0x8CD6
    FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT    uint = 0x8CD7
    FRAMEBUFFER_INCOMPLETE_DIMENSIONS            uint = 0x8CD9
    FRAMEBUFFER_UNSUPPORTED                      uint = 0x8CDD
    FRAMEBUFFER_BINDING                          uint = 0x8CA6
    RENDERBUFFER_BINDING                         uint = 0x8CA7
    MAX_RENDERBUFFER_SIZE                        uint = 0x84E8
    INVALID_FRAMEBUFFER_OPERATION                uint = 0x0506
    UNPACK_FLIP_Y_WEBGL                          uint = 0x9240
    UNPACK_PREMULTIPLY_ALPHA_WEBGL               uint = 0x9241
    CONTEXT_LOST_WEBGL                           uint = 0x9242
    UNPACK_COLORSPACE_CONVERSION_WEBGL           uint = 0x9243
    BROWSER_DEFAULT_WEBGL                        uint = 0x9244
)

type ActiveInfo Uses

type ActiveInfo struct {
    // Value_JS holds a reference to a javascript value
    Value_JS js.Value
}

class: WebGLActiveInfo

func ActiveInfoFromJS Uses

func ActiveInfoFromJS(value js.Wrapper) *ActiveInfo

ActiveInfoFromJS is casting a js.Wrapper into ActiveInfo.

func (*ActiveInfo) JSValue Uses

func (_this *ActiveInfo) JSValue() js.Value

func (*ActiveInfo) Name Uses

func (_this *ActiveInfo) Name() string

Name returning attribute 'name' with type string (idl: DOMString).

func (*ActiveInfo) Size Uses

func (_this *ActiveInfo) Size() int

Size returning attribute 'size' with type int (idl: long).

func (*ActiveInfo) Type Uses

func (_this *ActiveInfo) Type() uint

Type returning attribute 'type' with type uint (idl: unsigned long).

type Buffer Uses

type Buffer struct {
    Object
}

class: WebGLBuffer

func BufferFromJS Uses

func BufferFromJS(value js.Wrapper) *Buffer

BufferFromJS is casting a js.Wrapper into Buffer.

type ContextAttributes Uses

type ContextAttributes struct {
    Alpha                        bool
    Depth                        bool
    Stencil                      bool
    Antialias                    bool
    PremultipliedAlpha           bool
    PreserveDrawingBuffer        bool
    PowerPreference              PowerPreference
    FailIfMajorPerformanceCaveat bool
    XrCompatible                 bool
}

dictionary: WebGLContextAttributes

func ContextAttributesFromJS Uses

func ContextAttributesFromJS(value js.Wrapper) *ContextAttributes

ContextAttributesFromJS is allocating a new ContextAttributes object and copy all values from input javascript object

func (*ContextAttributes) JSValue Uses

func (_this *ContextAttributes) JSValue() js.Value

JSValue is allocating a new javasript object and copy all values

type ContextEvent Uses

type ContextEvent struct {
    domcore.Event
}

class: WebGLContextEvent

func ContextEventFromJS Uses

func ContextEventFromJS(value js.Wrapper) *ContextEvent

ContextEventFromJS is casting a js.Wrapper into ContextEvent.

func NewWebGLContextEvent Uses

func NewWebGLContextEvent(_type string, eventInit *ContextEventInit) (_result *ContextEvent)

func (*ContextEvent) StatusMessage Uses

func (_this *ContextEvent) StatusMessage() string

StatusMessage returning attribute 'statusMessage' with type string (idl: DOMString).

type ContextEventInit Uses

type ContextEventInit struct {
    Bubbles       bool
    Cancelable    bool
    Composed      bool
    StatusMessage string
}

dictionary: WebGLContextEventInit

func ContextEventInitFromJS Uses

func ContextEventInitFromJS(value js.Wrapper) *ContextEventInit

ContextEventInitFromJS is allocating a new ContextEventInit object and copy all values from input javascript object

func (*ContextEventInit) JSValue Uses

func (_this *ContextEventInit) JSValue() js.Value

JSValue is allocating a new javasript object and copy all values

type Framebuffer Uses

type Framebuffer struct {
    Object
}

class: WebGLFramebuffer

func FramebufferFromJS Uses

func FramebufferFromJS(value js.Wrapper) *Framebuffer

FramebufferFromJS is casting a js.Wrapper into Framebuffer.

type Object Uses

type Object struct {
    // Value_JS holds a reference to a javascript value
    Value_JS js.Value
}

class: WebGLObject

func ObjectFromJS Uses

func ObjectFromJS(value js.Wrapper) *Object

ObjectFromJS is casting a js.Wrapper into Object.

func (*Object) JSValue Uses

func (_this *Object) JSValue() js.Value

type PowerPreference Uses

type PowerPreference int

enum: WebGLPowerPreference

const (
    DefaultWebGLPowerPreference PowerPreference = iota
    LowPowerWebGLPowerPreference
    HighPerformanceWebGLPowerPreference
)

func PowerPreferenceFromJS Uses

func PowerPreferenceFromJS(value js.Value) PowerPreference

PowerPreferenceFromJS is converting a javascript value into a PowerPreference enum value.

func (*PowerPreference) JSValue Uses

func (this *PowerPreference) JSValue() js.Value

JSValue is converting this enum into a javascript object

func (PowerPreference) Value Uses

func (this PowerPreference) Value() string

Value is converting this into javascript defined string value

type Program Uses

type Program struct {
    Object
}

class: WebGLProgram

func ProgramFromJS Uses

func ProgramFromJS(value js.Wrapper) *Program

ProgramFromJS is casting a js.Wrapper into Program.

type Renderbuffer Uses

type Renderbuffer struct {
    Object
}

class: WebGLRenderbuffer

func RenderbufferFromJS Uses

func RenderbufferFromJS(value js.Wrapper) *Renderbuffer

RenderbufferFromJS is casting a js.Wrapper into Renderbuffer.

type RenderingContext Uses

type RenderingContext struct {
    // Value_JS holds a reference to a javascript value
    Value_JS js.Value
}

class: WebGLRenderingContext

func RenderingContextFromJS Uses

func RenderingContextFromJS(value js.Wrapper) *RenderingContext

RenderingContextFromJS is casting a js.Wrapper into RenderingContext.

func (*RenderingContext) ActiveTexture Uses

func (_this *RenderingContext) ActiveTexture(texture uint)

func (*RenderingContext) AttachShader Uses

func (_this *RenderingContext) AttachShader(program *Program, shader *Shader)

func (*RenderingContext) BindAttribLocation Uses

func (_this *RenderingContext) BindAttribLocation(program *Program, index uint, name string)

func (*RenderingContext) BindBuffer Uses

func (_this *RenderingContext) BindBuffer(target uint, buffer *Buffer)

func (*RenderingContext) BindFramebuffer Uses

func (_this *RenderingContext) BindFramebuffer(target uint, framebuffer *Framebuffer)

func (*RenderingContext) BindRenderbuffer Uses

func (_this *RenderingContext) BindRenderbuffer(target uint, renderbuffer *Renderbuffer)

func (*RenderingContext) BindTexture Uses

func (_this *RenderingContext) BindTexture(target uint, texture *Texture)

func (*RenderingContext) BlendColor Uses

func (_this *RenderingContext) BlendColor(red float32, green float32, blue float32, alpha float32)

func (*RenderingContext) BlendEquation Uses

func (_this *RenderingContext) BlendEquation(mode uint)

func (*RenderingContext) BlendEquationSeparate Uses

func (_this *RenderingContext) BlendEquationSeparate(modeRGB uint, modeAlpha uint)

func (*RenderingContext) BlendFunc Uses

func (_this *RenderingContext) BlendFunc(sfactor uint, dfactor uint)

func (*RenderingContext) BlendFuncSeparate Uses

func (_this *RenderingContext) BlendFuncSeparate(srcRGB uint, dstRGB uint, srcAlpha uint, dstAlpha uint)

func (*RenderingContext) BufferData Uses

func (_this *RenderingContext) BufferData(target uint, size int, usage uint)

func (*RenderingContext) BufferData2 Uses

func (_this *RenderingContext) BufferData2(target uint, data *Union, usage uint)

func (*RenderingContext) BufferSubData Uses

func (_this *RenderingContext) BufferSubData(target uint, offset int, data *Union)

func (*RenderingContext) Canvas Uses

func (_this *RenderingContext) Canvas() *Union

Canvas returning attribute 'canvas' with type Union (idl: Union).

func (*RenderingContext) CheckFramebufferStatus Uses

func (_this *RenderingContext) CheckFramebufferStatus(target uint) (_result uint)

func (*RenderingContext) Clear Uses

func (_this *RenderingContext) Clear(mask uint)

func (*RenderingContext) ClearColor Uses

func (_this *RenderingContext) ClearColor(red float32, green float32, blue float32, alpha float32)

func (*RenderingContext) ClearDepth Uses

func (_this *RenderingContext) ClearDepth(depth float32)

func (*RenderingContext) ClearStencil Uses

func (_this *RenderingContext) ClearStencil(s int)

func (*RenderingContext) ColorMask Uses

func (_this *RenderingContext) ColorMask(red bool, green bool, blue bool, alpha bool)

func (*RenderingContext) CompileShader Uses

func (_this *RenderingContext) CompileShader(shader *Shader)

func (*RenderingContext) CompressedTexImage2D Uses

func (_this *RenderingContext) CompressedTexImage2D(target uint, level int, internalformat uint, width int, height int, border int, data *Union)

func (*RenderingContext) CompressedTexSubImage2D Uses

func (_this *RenderingContext) CompressedTexSubImage2D(target uint, level int, xoffset int, yoffset int, width int, height int, format uint, data *Union)

func (*RenderingContext) CopyTexImage2D Uses

func (_this *RenderingContext) CopyTexImage2D(target uint, level int, internalformat uint, x int, y int, width int, height int, border int)

func (*RenderingContext) CopyTexSubImage2D Uses

func (_this *RenderingContext) CopyTexSubImage2D(target uint, level int, xoffset int, yoffset int, x int, y int, width int, height int)

func (*RenderingContext) CreateBuffer Uses

func (_this *RenderingContext) CreateBuffer() (_result *Buffer)

func (*RenderingContext) CreateFramebuffer Uses

func (_this *RenderingContext) CreateFramebuffer() (_result *Framebuffer)

func (*RenderingContext) CreateProgram Uses

func (_this *RenderingContext) CreateProgram() (_result *Program)

func (*RenderingContext) CreateRenderbuffer Uses

func (_this *RenderingContext) CreateRenderbuffer() (_result *Renderbuffer)

func (*RenderingContext) CreateShader Uses

func (_this *RenderingContext) CreateShader(_type uint) (_result *Shader)

func (*RenderingContext) CreateTexture Uses

func (_this *RenderingContext) CreateTexture() (_result *Texture)

func (*RenderingContext) CullFace Uses

func (_this *RenderingContext) CullFace(mode uint)

func (*RenderingContext) DeleteBuffer Uses

func (_this *RenderingContext) DeleteBuffer(buffer *Buffer)

func (*RenderingContext) DeleteFramebuffer Uses

func (_this *RenderingContext) DeleteFramebuffer(framebuffer *Framebuffer)

func (*RenderingContext) DeleteProgram Uses

func (_this *RenderingContext) DeleteProgram(program *Program)

func (*RenderingContext) DeleteRenderbuffer Uses

func (_this *RenderingContext) DeleteRenderbuffer(renderbuffer *Renderbuffer)

func (*RenderingContext) DeleteShader Uses

func (_this *RenderingContext) DeleteShader(shader *Shader)

func (*RenderingContext) DeleteTexture Uses

func (_this *RenderingContext) DeleteTexture(texture *Texture)

func (*RenderingContext) DepthFunc Uses

func (_this *RenderingContext) DepthFunc(_func uint)

func (*RenderingContext) DepthMask Uses

func (_this *RenderingContext) DepthMask(flag bool)

func (*RenderingContext) DepthRange Uses

func (_this *RenderingContext) DepthRange(zNear float32, zFar float32)

func (*RenderingContext) DetachShader Uses

func (_this *RenderingContext) DetachShader(program *Program, shader *Shader)

func (*RenderingContext) Disable Uses

func (_this *RenderingContext) Disable(cap uint)

func (*RenderingContext) DisableVertexAttribArray Uses

func (_this *RenderingContext) DisableVertexAttribArray(index uint)

func (*RenderingContext) DrawArrays Uses

func (_this *RenderingContext) DrawArrays(mode uint, first int, count int)

func (*RenderingContext) DrawElements Uses

func (_this *RenderingContext) DrawElements(mode uint, count int, _type uint, offset int)

func (*RenderingContext) DrawingBufferHeight Uses

func (_this *RenderingContext) DrawingBufferHeight() int

DrawingBufferHeight returning attribute 'drawingBufferHeight' with type int (idl: long).

func (*RenderingContext) DrawingBufferWidth Uses

func (_this *RenderingContext) DrawingBufferWidth() int

DrawingBufferWidth returning attribute 'drawingBufferWidth' with type int (idl: long).

func (*RenderingContext) Enable Uses

func (_this *RenderingContext) Enable(cap uint)

func (*RenderingContext) EnableVertexAttribArray Uses

func (_this *RenderingContext) EnableVertexAttribArray(index uint)

func (*RenderingContext) Finish Uses

func (_this *RenderingContext) Finish()

func (*RenderingContext) Flush Uses

func (_this *RenderingContext) Flush()

func (*RenderingContext) FramebufferRenderbuffer Uses

func (_this *RenderingContext) FramebufferRenderbuffer(target uint, attachment uint, renderbuffertarget uint, renderbuffer *Renderbuffer)

func (*RenderingContext) FramebufferTexture2D Uses

func (_this *RenderingContext) FramebufferTexture2D(target uint, attachment uint, textarget uint, texture *Texture, level int)

func (*RenderingContext) FrontFace Uses

func (_this *RenderingContext) FrontFace(mode uint)

func (*RenderingContext) GenerateMipmap Uses

func (_this *RenderingContext) GenerateMipmap(target uint)

func (*RenderingContext) GetActiveAttrib Uses

func (_this *RenderingContext) GetActiveAttrib(program *Program, index uint) (_result *ActiveInfo)

func (*RenderingContext) GetActiveUniform Uses

func (_this *RenderingContext) GetActiveUniform(program *Program, index uint) (_result *ActiveInfo)

func (*RenderingContext) GetAttachedShaders Uses

func (_this *RenderingContext) GetAttachedShaders(program *Program) (_result []*Shader)

func (*RenderingContext) GetAttribLocation Uses

func (_this *RenderingContext) GetAttribLocation(program *Program, name string) (_result int)

func (*RenderingContext) GetBufferParameter Uses

func (_this *RenderingContext) GetBufferParameter(target uint, pname uint) (_result js.Value)

func (*RenderingContext) GetContextAttributes Uses

func (_this *RenderingContext) GetContextAttributes() (_result *ContextAttributes)

func (*RenderingContext) GetError Uses

func (_this *RenderingContext) GetError() (_result uint)

func (*RenderingContext) GetExtension Uses

func (_this *RenderingContext) GetExtension(name string) (_result *javascript.Object)

func (*RenderingContext) GetFramebufferAttachmentParameter Uses

func (_this *RenderingContext) GetFramebufferAttachmentParameter(target uint, attachment uint, pname uint) (_result js.Value)

func (*RenderingContext) GetParameter Uses

func (_this *RenderingContext) GetParameter(pname uint) (_result js.Value)

func (*RenderingContext) GetProgramInfoLog Uses

func (_this *RenderingContext) GetProgramInfoLog(program *Program) (_result *string)

func (*RenderingContext) GetProgramParameter Uses

func (_this *RenderingContext) GetProgramParameter(program *Program, pname uint) (_result js.Value)

func (*RenderingContext) GetRenderbufferParameter Uses

func (_this *RenderingContext) GetRenderbufferParameter(target uint, pname uint) (_result js.Value)

func (*RenderingContext) GetShaderInfoLog Uses

func (_this *RenderingContext) GetShaderInfoLog(shader *Shader) (_result *string)

func (*RenderingContext) GetShaderParameter Uses

func (_this *RenderingContext) GetShaderParameter(shader *Shader, pname uint) (_result js.Value)

func (*RenderingContext) GetShaderPrecisionFormat Uses

func (_this *RenderingContext) GetShaderPrecisionFormat(shadertype uint, precisiontype uint) (_result *ShaderPrecisionFormat)

func (*RenderingContext) GetShaderSource Uses

func (_this *RenderingContext) GetShaderSource(shader *Shader) (_result *string)

func (*RenderingContext) GetSupportedExtensions Uses

func (_this *RenderingContext) GetSupportedExtensions() (_result []string)

func (*RenderingContext) GetTexParameter Uses

func (_this *RenderingContext) GetTexParameter(target uint, pname uint) (_result js.Value)

func (*RenderingContext) GetUniform Uses

func (_this *RenderingContext) GetUniform(program *Program, location *UniformLocation) (_result js.Value)

func (*RenderingContext) GetUniformLocation Uses

func (_this *RenderingContext) GetUniformLocation(program *Program, name string) (_result *UniformLocation)

func (*RenderingContext) GetVertexAttrib Uses

func (_this *RenderingContext) GetVertexAttrib(index uint, pname uint) (_result js.Value)

func (*RenderingContext) GetVertexAttribOffset Uses

func (_this *RenderingContext) GetVertexAttribOffset(index uint, pname uint) (_result int)

func (*RenderingContext) Hint Uses

func (_this *RenderingContext) Hint(target uint, mode uint)

func (*RenderingContext) IsBuffer Uses

func (_this *RenderingContext) IsBuffer(buffer *Buffer) (_result bool)

func (*RenderingContext) IsContextLost Uses

func (_this *RenderingContext) IsContextLost() (_result bool)

func (*RenderingContext) IsEnabled Uses

func (_this *RenderingContext) IsEnabled(cap uint) (_result bool)

func (*RenderingContext) IsFramebuffer Uses

func (_this *RenderingContext) IsFramebuffer(framebuffer *Framebuffer) (_result bool)

func (*RenderingContext) IsProgram Uses

func (_this *RenderingContext) IsProgram(program *Program) (_result bool)

func (*RenderingContext) IsRenderbuffer Uses

func (_this *RenderingContext) IsRenderbuffer(renderbuffer *Renderbuffer) (_result bool)

func (*RenderingContext) IsShader Uses

func (_this *RenderingContext) IsShader(shader *Shader) (_result bool)

func (*RenderingContext) IsTexture Uses

func (_this *RenderingContext) IsTexture(texture *Texture) (_result bool)

func (*RenderingContext) JSValue Uses

func (_this *RenderingContext) JSValue() js.Value

func (*RenderingContext) LineWidth Uses

func (_this *RenderingContext) LineWidth(width float32)

func (*RenderingContext) LinkProgram Uses

func (_this *RenderingContext) LinkProgram(program *Program)

func (*RenderingContext) MakeXRCompatible Uses

func (_this *RenderingContext) MakeXRCompatible() (_result *javascript.PromiseVoid)

func (*RenderingContext) PixelStorei Uses

func (_this *RenderingContext) PixelStorei(pname uint, param int)

func (*RenderingContext) PolygonOffset Uses

func (_this *RenderingContext) PolygonOffset(factor float32, units float32)

func (*RenderingContext) ReadPixels Uses

func (_this *RenderingContext) ReadPixels(x int, y int, width int, height int, format uint, _type uint, pixels *Union)

func (*RenderingContext) RenderbufferStorage Uses

func (_this *RenderingContext) RenderbufferStorage(target uint, internalformat uint, width int, height int)

func (*RenderingContext) SampleCoverage Uses

func (_this *RenderingContext) SampleCoverage(value float32, invert bool)

func (*RenderingContext) Scissor Uses

func (_this *RenderingContext) Scissor(x int, y int, width int, height int)

func (*RenderingContext) ShaderSource Uses

func (_this *RenderingContext) ShaderSource(shader *Shader, source string)

func (*RenderingContext) StencilFunc Uses

func (_this *RenderingContext) StencilFunc(_func uint, ref int, mask uint)

func (*RenderingContext) StencilFuncSeparate Uses

func (_this *RenderingContext) StencilFuncSeparate(face uint, _func uint, ref int, mask uint)

func (*RenderingContext) StencilMask Uses

func (_this *RenderingContext) StencilMask(mask uint)

func (*RenderingContext) StencilMaskSeparate Uses

func (_this *RenderingContext) StencilMaskSeparate(face uint, mask uint)

func (*RenderingContext) StencilOp Uses

func (_this *RenderingContext) StencilOp(fail uint, zfail uint, zpass uint)

func (*RenderingContext) StencilOpSeparate Uses

func (_this *RenderingContext) StencilOpSeparate(face uint, fail uint, zfail uint, zpass uint)

func (*RenderingContext) TexImage2D Uses

func (_this *RenderingContext) TexImage2D(target uint, level int, internalformat int, width int, height int, border int, format uint, _type uint, pixels *Union)

func (*RenderingContext) TexImage2D2 Uses

func (_this *RenderingContext) TexImage2D2(target uint, level int, internalformat int, format uint, _type uint, source *Union)

func (*RenderingContext) TexParameterf Uses

func (_this *RenderingContext) TexParameterf(target uint, pname uint, param float32)

func (*RenderingContext) TexParameteri Uses

func (_this *RenderingContext) TexParameteri(target uint, pname uint, param int)

func (*RenderingContext) TexSubImage2D Uses

func (_this *RenderingContext) TexSubImage2D(target uint, level int, xoffset int, yoffset int, width int, height int, format uint, _type uint, pixels *Union)

func (*RenderingContext) TexSubImage2D2 Uses

func (_this *RenderingContext) TexSubImage2D2(target uint, level int, xoffset int, yoffset int, format uint, _type uint, source *Union)

func (*RenderingContext) Uniform1f Uses

func (_this *RenderingContext) Uniform1f(location *UniformLocation, x float32)

func (*RenderingContext) Uniform1fv Uses

func (_this *RenderingContext) Uniform1fv(location *UniformLocation, v *Union)

func (*RenderingContext) Uniform1i Uses

func (_this *RenderingContext) Uniform1i(location *UniformLocation, x int)

func (*RenderingContext) Uniform1iv Uses

func (_this *RenderingContext) Uniform1iv(location *UniformLocation, v *Union)

func (*RenderingContext) Uniform2f Uses

func (_this *RenderingContext) Uniform2f(location *UniformLocation, x float32, y float32)

func (*RenderingContext) Uniform2fv Uses

func (_this *RenderingContext) Uniform2fv(location *UniformLocation, v *Union)

func (*RenderingContext) Uniform2i Uses

func (_this *RenderingContext) Uniform2i(location *UniformLocation, x int, y int)

func (*RenderingContext) Uniform2iv Uses

func (_this *RenderingContext) Uniform2iv(location *UniformLocation, v *Union)

func (*RenderingContext) Uniform3f Uses

func (_this *RenderingContext) Uniform3f(location *UniformLocation, x float32, y float32, z float32)

func (*RenderingContext) Uniform3fv Uses

func (_this *RenderingContext) Uniform3fv(location *UniformLocation, v *Union)

func (*RenderingContext) Uniform3i Uses

func (_this *RenderingContext) Uniform3i(location *UniformLocation, x int, y int, z int)

func (*RenderingContext) Uniform3iv Uses

func (_this *RenderingContext) Uniform3iv(location *UniformLocation, v *Union)

func (*RenderingContext) Uniform4f Uses

func (_this *RenderingContext) Uniform4f(location *UniformLocation, x float32, y float32, z float32, w float32)

func (*RenderingContext) Uniform4fv Uses

func (_this *RenderingContext) Uniform4fv(location *UniformLocation, v *Union)

func (*RenderingContext) Uniform4i Uses

func (_this *RenderingContext) Uniform4i(location *UniformLocation, x int, y int, z int, w int)

func (*RenderingContext) Uniform4iv Uses

func (_this *RenderingContext) Uniform4iv(location *UniformLocation, v *Union)

func (*RenderingContext) UniformMatrix2fv Uses

func (_this *RenderingContext) UniformMatrix2fv(location *UniformLocation, transpose bool, value *Union)

func (*RenderingContext) UniformMatrix3fv Uses

func (_this *RenderingContext) UniformMatrix3fv(location *UniformLocation, transpose bool, value *Union)

func (*RenderingContext) UniformMatrix4fv Uses

func (_this *RenderingContext) UniformMatrix4fv(location *UniformLocation, transpose bool, value *Union)

func (*RenderingContext) UseProgram Uses

func (_this *RenderingContext) UseProgram(program *Program)

func (*RenderingContext) ValidateProgram Uses

func (_this *RenderingContext) ValidateProgram(program *Program)

func (*RenderingContext) VertexAttrib1f Uses

func (_this *RenderingContext) VertexAttrib1f(index uint, x float32)

func (*RenderingContext) VertexAttrib1fv Uses

func (_this *RenderingContext) VertexAttrib1fv(index uint, values *Union)

func (*RenderingContext) VertexAttrib2f Uses

func (_this *RenderingContext) VertexAttrib2f(index uint, x float32, y float32)

func (*RenderingContext) VertexAttrib2fv Uses

func (_this *RenderingContext) VertexAttrib2fv(index uint, values *Union)

func (*RenderingContext) VertexAttrib3f Uses

func (_this *RenderingContext) VertexAttrib3f(index uint, x float32, y float32, z float32)

func (*RenderingContext) VertexAttrib3fv Uses

func (_this *RenderingContext) VertexAttrib3fv(index uint, values *Union)

func (*RenderingContext) VertexAttrib4f Uses

func (_this *RenderingContext) VertexAttrib4f(index uint, x float32, y float32, z float32, w float32)

func (*RenderingContext) VertexAttrib4fv Uses

func (_this *RenderingContext) VertexAttrib4fv(index uint, values *Union)

func (*RenderingContext) VertexAttribPointer Uses

func (_this *RenderingContext) VertexAttribPointer(index uint, size int, _type uint, normalized bool, stride int, offset int)

func (*RenderingContext) Viewport Uses

func (_this *RenderingContext) Viewport(x int, y int, width int, height int)

type Shader Uses

type Shader struct {
    Object
}

class: WebGLShader

func ShaderFromJS Uses

func ShaderFromJS(value js.Wrapper) *Shader

ShaderFromJS is casting a js.Wrapper into Shader.

type ShaderPrecisionFormat Uses

type ShaderPrecisionFormat struct {
    // Value_JS holds a reference to a javascript value
    Value_JS js.Value
}

class: WebGLShaderPrecisionFormat

func ShaderPrecisionFormatFromJS Uses

func ShaderPrecisionFormatFromJS(value js.Wrapper) *ShaderPrecisionFormat

ShaderPrecisionFormatFromJS is casting a js.Wrapper into ShaderPrecisionFormat.

func (*ShaderPrecisionFormat) JSValue Uses

func (_this *ShaderPrecisionFormat) JSValue() js.Value

func (*ShaderPrecisionFormat) Precision Uses

func (_this *ShaderPrecisionFormat) Precision() int

Precision returning attribute 'precision' with type int (idl: long).

func (*ShaderPrecisionFormat) RangeMax Uses

func (_this *ShaderPrecisionFormat) RangeMax() int

RangeMax returning attribute 'rangeMax' with type int (idl: long).

func (*ShaderPrecisionFormat) RangeMin Uses

func (_this *ShaderPrecisionFormat) RangeMin() int

RangeMin returning attribute 'rangeMin' with type int (idl: long).

type Texture Uses

type Texture struct {
    Object
}

class: WebGLTexture

func TextureFromJS Uses

func TextureFromJS(value js.Wrapper) *Texture

TextureFromJS is casting a js.Wrapper into Texture.

type UniformLocation Uses

type UniformLocation struct {
    // Value_JS holds a reference to a javascript value
    Value_JS js.Value
}

class: WebGLUniformLocation

func UniformLocationFromJS Uses

func UniformLocationFromJS(value js.Wrapper) *UniformLocation

UniformLocationFromJS is casting a js.Wrapper into UniformLocation.

func (*UniformLocation) JSValue Uses

func (_this *UniformLocation) JSValue() js.Value

type Union Uses

type Union struct {
    Value js.Value
}

func UnionFromJS Uses

func UnionFromJS(value js.Value) *Union

func (*Union) JSValue Uses

func (u *Union) JSValue() js.Value

Package webgl imports 3 packages (graph) and is imported by 2 packages. Updated 2019-09-18. Refresh now. Tools for package owners.