webgl

package
v0.0.0-...-41cedfc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2022 License: BSD-3-Clause Imports: 4 Imported by: 2

Documentation

Overview

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/)

Example (Triangle)

A triangle

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.HTMLCanvasElementFromWrapper(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.RenderingContextFromWrapper(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
}
Output:

Index

Examples

Constants

View Source
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
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ActiveInfo

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

class: WebGLActiveInfo

func ActiveInfoFromJS

func ActiveInfoFromJS(value js.Value) *ActiveInfo

ActiveInfoFromJS is casting a js.Value into ActiveInfo.

func ActiveInfoFromWrapper

func ActiveInfoFromWrapper(input core.Wrapper) *ActiveInfo

ActiveInfoFromJS is casting from something that holds a js.Value into ActiveInfo.

func (*ActiveInfo) JSValue

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

JSValue returns the js.Value or js.Null() if _this is nil

func (*ActiveInfo) Name

func (_this *ActiveInfo) Name() string

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

func (*ActiveInfo) Size

func (_this *ActiveInfo) Size() int

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

func (*ActiveInfo) Type

func (_this *ActiveInfo) Type() uint

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

type Buffer

type Buffer struct {
	Object
}

class: WebGLBuffer

func BufferFromJS

func BufferFromJS(value js.Value) *Buffer

BufferFromJS is casting a js.Value into Buffer.

func BufferFromWrapper

func BufferFromWrapper(input core.Wrapper) *Buffer

BufferFromJS is casting from something that holds a js.Value into Buffer.

type ContextAttributes

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

func ContextAttributesFromJS(value js.Value) *ContextAttributes

ContextAttributesFromJS is allocating a new ContextAttributes object and copy all values in the value javascript object.

func (*ContextAttributes) JSValue

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

JSValue is allocating a new javascript object and copy all values

type ContextEvent

type ContextEvent struct {
	domcore.Event
}

class: WebGLContextEvent

func ContextEventFromJS

func ContextEventFromJS(value js.Value) *ContextEvent

ContextEventFromJS is casting a js.Value into ContextEvent.

func ContextEventFromWrapper

func ContextEventFromWrapper(input core.Wrapper) *ContextEvent

ContextEventFromJS is casting from something that holds a js.Value into ContextEvent.

func NewWebGLContextEvent

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

func (*ContextEvent) StatusMessage

func (_this *ContextEvent) StatusMessage() string

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

type ContextEventInit

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

dictionary: WebGLContextEventInit

func ContextEventInitFromJS

func ContextEventInitFromJS(value js.Value) *ContextEventInit

ContextEventInitFromJS is allocating a new ContextEventInit object and copy all values in the value javascript object.

func (*ContextEventInit) JSValue

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

JSValue is allocating a new javascript object and copy all values

type Framebuffer

type Framebuffer struct {
	Object
}

class: WebGLFramebuffer

func FramebufferFromJS

func FramebufferFromJS(value js.Value) *Framebuffer

FramebufferFromJS is casting a js.Value into Framebuffer.

func FramebufferFromWrapper

func FramebufferFromWrapper(input core.Wrapper) *Framebuffer

FramebufferFromJS is casting from something that holds a js.Value into Framebuffer.

type Object

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

class: WebGLObject

func ObjectFromJS

func ObjectFromJS(value js.Value) *Object

ObjectFromJS is casting a js.Value into Object.

func ObjectFromWrapper

func ObjectFromWrapper(input core.Wrapper) *Object

ObjectFromJS is casting from something that holds a js.Value into Object.

func (*Object) JSValue

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

JSValue returns the js.Value or js.Null() if _this is nil

type PowerPreference

type PowerPreference int

enum: WebGLPowerPreference

const (
	DefaultWebGLPowerPreference PowerPreference = iota
	LowPowerWebGLPowerPreference
	HighPerformanceWebGLPowerPreference
)

func PowerPreferenceFromJS

func PowerPreferenceFromJS(value js.Value) PowerPreference

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

func (*PowerPreference) JSValue

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

JSValue is converting this enum into a javascript object

func (PowerPreference) Value

func (this PowerPreference) Value() string

Value is converting this into javascript defined string value

type Program

type Program struct {
	Object
}

class: WebGLProgram

func ProgramFromJS

func ProgramFromJS(value js.Value) *Program

ProgramFromJS is casting a js.Value into Program.

func ProgramFromWrapper

func ProgramFromWrapper(input core.Wrapper) *Program

ProgramFromJS is casting from something that holds a js.Value into Program.

type Renderbuffer

type Renderbuffer struct {
	Object
}

class: WebGLRenderbuffer

func RenderbufferFromJS

func RenderbufferFromJS(value js.Value) *Renderbuffer

RenderbufferFromJS is casting a js.Value into Renderbuffer.

func RenderbufferFromWrapper

func RenderbufferFromWrapper(input core.Wrapper) *Renderbuffer

RenderbufferFromJS is casting from something that holds a js.Value into Renderbuffer.

type RenderingContext

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

class: WebGLRenderingContext

func RenderingContextFromJS

func RenderingContextFromJS(value js.Value) *RenderingContext

RenderingContextFromJS is casting a js.Value into RenderingContext.

func RenderingContextFromWrapper

func RenderingContextFromWrapper(input core.Wrapper) *RenderingContext

RenderingContextFromJS is casting from something that holds a js.Value into RenderingContext.

func (*RenderingContext) ActiveTexture

func (_this *RenderingContext) ActiveTexture(texture uint)

func (*RenderingContext) AttachShader

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

func (*RenderingContext) BindAttribLocation

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

func (*RenderingContext) BindBuffer

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

func (*RenderingContext) BindFramebuffer

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

func (*RenderingContext) BindRenderbuffer

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

func (*RenderingContext) BindTexture

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

func (*RenderingContext) BlendColor

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

func (*RenderingContext) BlendEquation

func (_this *RenderingContext) BlendEquation(mode uint)

func (*RenderingContext) BlendEquationSeparate

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

func (*RenderingContext) BlendFunc

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

func (*RenderingContext) BlendFuncSeparate

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

func (*RenderingContext) BufferData

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

func (*RenderingContext) BufferData2

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

func (*RenderingContext) BufferSubData

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

func (*RenderingContext) Canvas

func (_this *RenderingContext) Canvas() *Union

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

func (*RenderingContext) CheckFramebufferStatus

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

func (*RenderingContext) Clear

func (_this *RenderingContext) Clear(mask uint)

func (*RenderingContext) ClearColor

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

func (*RenderingContext) ClearDepth

func (_this *RenderingContext) ClearDepth(depth float32)

func (*RenderingContext) ClearStencil

func (_this *RenderingContext) ClearStencil(s int)

func (*RenderingContext) ColorMask

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

func (*RenderingContext) CompileShader

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

func (*RenderingContext) CompressedTexImage2D

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

func (*RenderingContext) CompressedTexSubImage2D

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

func (*RenderingContext) CopyTexImage2D

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

func (*RenderingContext) CopyTexSubImage2D

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

func (*RenderingContext) CreateBuffer

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

func (*RenderingContext) CreateFramebuffer

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

func (*RenderingContext) CreateProgram

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

func (*RenderingContext) CreateRenderbuffer

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

func (*RenderingContext) CreateShader

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

func (*RenderingContext) CreateTexture

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

func (*RenderingContext) CullFace

func (_this *RenderingContext) CullFace(mode uint)

func (*RenderingContext) DeleteBuffer

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

func (*RenderingContext) DeleteFramebuffer

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

func (*RenderingContext) DeleteProgram

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

func (*RenderingContext) DeleteRenderbuffer

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

func (*RenderingContext) DeleteShader

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

func (*RenderingContext) DeleteTexture

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

func (*RenderingContext) DepthFunc

func (_this *RenderingContext) DepthFunc(_func uint)

func (*RenderingContext) DepthMask

func (_this *RenderingContext) DepthMask(flag bool)

func (*RenderingContext) DepthRange

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

func (*RenderingContext) DetachShader

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

func (*RenderingContext) Disable

func (_this *RenderingContext) Disable(cap uint)

func (*RenderingContext) DisableVertexAttribArray

func (_this *RenderingContext) DisableVertexAttribArray(index uint)

func (*RenderingContext) DrawArrays

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

func (*RenderingContext) DrawElements

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

func (*RenderingContext) DrawingBufferHeight

func (_this *RenderingContext) DrawingBufferHeight() int

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

func (*RenderingContext) DrawingBufferWidth

func (_this *RenderingContext) DrawingBufferWidth() int

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

func (*RenderingContext) Enable

func (_this *RenderingContext) Enable(cap uint)

func (*RenderingContext) EnableVertexAttribArray

func (_this *RenderingContext) EnableVertexAttribArray(index uint)

func (*RenderingContext) Finish

func (_this *RenderingContext) Finish()

func (*RenderingContext) Flush

func (_this *RenderingContext) Flush()

func (*RenderingContext) FramebufferRenderbuffer

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

func (*RenderingContext) FramebufferTexture2D

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

func (*RenderingContext) FrontFace

func (_this *RenderingContext) FrontFace(mode uint)

func (*RenderingContext) GenerateMipmap

func (_this *RenderingContext) GenerateMipmap(target uint)

func (*RenderingContext) GetActiveAttrib

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

func (*RenderingContext) GetActiveUniform

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

func (*RenderingContext) GetAttachedShaders

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

func (*RenderingContext) GetAttribLocation

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

func (*RenderingContext) GetBufferParameter

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

func (*RenderingContext) GetContextAttributes

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

func (*RenderingContext) GetError

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

func (*RenderingContext) GetExtension

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

func (*RenderingContext) GetFramebufferAttachmentParameter

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

func (*RenderingContext) GetParameter

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

func (*RenderingContext) GetProgramInfoLog

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

func (*RenderingContext) GetProgramParameter

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

func (*RenderingContext) GetRenderbufferParameter

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

func (*RenderingContext) GetShaderInfoLog

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

func (*RenderingContext) GetShaderParameter

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

func (*RenderingContext) GetShaderPrecisionFormat

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

func (*RenderingContext) GetShaderSource

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

func (*RenderingContext) GetSupportedExtensions

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

func (*RenderingContext) GetTexParameter

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

func (*RenderingContext) GetUniform

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

func (*RenderingContext) GetUniformLocation

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

func (*RenderingContext) GetVertexAttrib

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

func (*RenderingContext) GetVertexAttribOffset

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

func (*RenderingContext) Hint

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

func (*RenderingContext) IsBuffer

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

func (*RenderingContext) IsContextLost

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

func (*RenderingContext) IsEnabled

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

func (*RenderingContext) IsFramebuffer

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

func (*RenderingContext) IsProgram

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

func (*RenderingContext) IsRenderbuffer

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

func (*RenderingContext) IsShader

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

func (*RenderingContext) IsTexture

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

func (*RenderingContext) JSValue

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

JSValue returns the js.Value or js.Null() if _this is nil

func (*RenderingContext) LineWidth

func (_this *RenderingContext) LineWidth(width float32)

func (*RenderingContext) LinkProgram

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

func (*RenderingContext) MakeXRCompatible

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

func (*RenderingContext) PixelStorei

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

func (*RenderingContext) PolygonOffset

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

func (*RenderingContext) ReadPixels

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

func (*RenderingContext) RenderbufferStorage

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

func (*RenderingContext) SampleCoverage

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

func (*RenderingContext) Scissor

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

func (*RenderingContext) ShaderSource

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

func (*RenderingContext) StencilFunc

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

func (*RenderingContext) StencilFuncSeparate

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

func (*RenderingContext) StencilMask

func (_this *RenderingContext) StencilMask(mask uint)

func (*RenderingContext) StencilMaskSeparate

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

func (*RenderingContext) StencilOp

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

func (*RenderingContext) StencilOpSeparate

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

func (*RenderingContext) TexImage2D

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

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

func (*RenderingContext) TexParameterf

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

func (*RenderingContext) TexParameteri

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

func (*RenderingContext) TexSubImage2D

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

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

func (*RenderingContext) Uniform1f

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

func (*RenderingContext) Uniform1fv

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

func (*RenderingContext) Uniform1i

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

func (*RenderingContext) Uniform1iv

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

func (*RenderingContext) Uniform2f

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

func (*RenderingContext) Uniform2fv

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

func (*RenderingContext) Uniform2i

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

func (*RenderingContext) Uniform2iv

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

func (*RenderingContext) Uniform3f

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

func (*RenderingContext) Uniform3fv

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

func (*RenderingContext) Uniform3i

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

func (*RenderingContext) Uniform3iv

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

func (*RenderingContext) Uniform4f

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

func (*RenderingContext) Uniform4fv

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

func (*RenderingContext) Uniform4i

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

func (*RenderingContext) Uniform4iv

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

func (*RenderingContext) UniformMatrix2fv

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

func (*RenderingContext) UniformMatrix3fv

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

func (*RenderingContext) UniformMatrix4fv

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

func (*RenderingContext) UseProgram

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

func (*RenderingContext) ValidateProgram

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

func (*RenderingContext) VertexAttrib1f

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

func (*RenderingContext) VertexAttrib1fv

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

func (*RenderingContext) VertexAttrib2f

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

func (*RenderingContext) VertexAttrib2fv

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

func (*RenderingContext) VertexAttrib3f

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

func (*RenderingContext) VertexAttrib3fv

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

func (*RenderingContext) VertexAttrib4f

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

func (*RenderingContext) VertexAttrib4fv

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

func (*RenderingContext) VertexAttribPointer

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

func (*RenderingContext) Viewport

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

type Shader

type Shader struct {
	Object
}

class: WebGLShader

func ShaderFromJS

func ShaderFromJS(value js.Value) *Shader

ShaderFromJS is casting a js.Value into Shader.

func ShaderFromWrapper

func ShaderFromWrapper(input core.Wrapper) *Shader

ShaderFromJS is casting from something that holds a js.Value into Shader.

type ShaderPrecisionFormat

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

class: WebGLShaderPrecisionFormat

func ShaderPrecisionFormatFromJS

func ShaderPrecisionFormatFromJS(value js.Value) *ShaderPrecisionFormat

ShaderPrecisionFormatFromJS is casting a js.Value into ShaderPrecisionFormat.

func ShaderPrecisionFormatFromWrapper

func ShaderPrecisionFormatFromWrapper(input core.Wrapper) *ShaderPrecisionFormat

ShaderPrecisionFormatFromJS is casting from something that holds a js.Value into ShaderPrecisionFormat.

func (*ShaderPrecisionFormat) JSValue

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

JSValue returns the js.Value or js.Null() if _this is nil

func (*ShaderPrecisionFormat) Precision

func (_this *ShaderPrecisionFormat) Precision() int

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

func (*ShaderPrecisionFormat) RangeMax

func (_this *ShaderPrecisionFormat) RangeMax() int

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

func (*ShaderPrecisionFormat) RangeMin

func (_this *ShaderPrecisionFormat) RangeMin() int

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

type Texture

type Texture struct {
	Object
}

class: WebGLTexture

func TextureFromJS

func TextureFromJS(value js.Value) *Texture

TextureFromJS is casting a js.Value into Texture.

func TextureFromWrapper

func TextureFromWrapper(input core.Wrapper) *Texture

TextureFromJS is casting from something that holds a js.Value into Texture.

type UniformLocation

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

class: WebGLUniformLocation

func UniformLocationFromJS

func UniformLocationFromJS(value js.Value) *UniformLocation

UniformLocationFromJS is casting a js.Value into UniformLocation.

func UniformLocationFromWrapper

func UniformLocationFromWrapper(input core.Wrapper) *UniformLocation

UniformLocationFromJS is casting from something that holds a js.Value into UniformLocation.

func (*UniformLocation) JSValue

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

JSValue returns the js.Value or js.Null() if _this is nil

type Union

type Union struct {
	Value js.Value
}

func UnionFromJS

func UnionFromJS(value js.Value) *Union

func (*Union) JSValue

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL