webgl

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Rendered for js/wasm

Index

Constants

View Source
const MaxArrayLength = 3 * 2 * 2 * 1000

Variables

This section is empty.

Functions

This section is empty.

Types

type AttribLocation

type AttribLocation js.Value

type BlendFactor

type BlendFactor js.Value

type Buffer

type Buffer js.Value

type BufferBit

type BufferBit int

type BufferTarget

type BufferTarget js.Value

type BufferUsage

type BufferUsage js.Value

type Capability

type Capability js.Value

type DrawMode

type DrawMode js.Value

type GlType

type GlType js.Value

type Program

type Program js.Value

func CreateProgram

func CreateProgram(w *WebGL, vertexShaderCode, fragmentShaderCode string) (*Program, error)

type ProgramParameterBool

type ProgramParameterBool js.Value

type Shader

type Shader js.Value

func CompileShader

func CompileShader(w *WebGL, code string, t ShaderType) (*Shader, error)

type ShaderParameterBool

type ShaderParameterBool js.Value

type ShaderType

type ShaderType js.Value

type Texture

type Texture js.Value

func LoadTexture

func LoadTexture(w *WebGL, image js.Value) *Texture

type TextureFormat

type TextureFormat js.Value

type TextureTarget

type TextureTarget js.Value

type TextureUnit

type TextureUnit js.Value

type UniformLocation

type UniformLocation js.Value

type WebGL

type WebGL struct {
	BLEND Capability

	COLOR_BUFFER_BIT BufferBit
	DEPTH_BUFFER_BIT BufferBit

	ARRAY_BUFFER BufferTarget
	STATIC_DRAW  BufferUsage
	DYNAMIC_DRAW BufferUsage

	TEXTURE_2D TextureTarget
	RGBA       TextureFormat
	TEXTURE0   TextureUnit

	ZERO                BlendFactor
	ONE                 BlendFactor
	SRC_ALPHA           BlendFactor
	ONE_MINUS_SRC_ALPHA BlendFactor

	VERTEX_SHADER   ShaderType
	FRAGMENT_SHADER ShaderType
	LINK_STATUS     ProgramParameterBool
	COMPILE_STATUS  ShaderParameterBool

	POINTS    DrawMode
	TRIANGLES DrawMode

	UNSIGNED_BYTE GlType
	FLOAT         GlType
	SHORT         GlType
	// contains filtered or unexported fields
}

func InitWebgl

func InitWebgl(canvas js.Value) (*WebGL, error)

func (*WebGL) ActiveTexture

func (w *WebGL) ActiveTexture(u TextureUnit)

func (*WebGL) AttachShader

func (w *WebGL) AttachShader(p *Program, s *Shader)

func (*WebGL) BindBuffer

func (w *WebGL) BindBuffer(t BufferTarget, b *Buffer)

func (*WebGL) BindTexture

func (w *WebGL) BindTexture(tt TextureTarget, t *Texture)

func (*WebGL) BlendFunc

func (w *WebGL) BlendFunc(sfactor, dfactor BlendFactor)

func (*WebGL) BufferDataF32

func (w *WebGL) BufferDataF32(t BufferTarget, a []float32, u BufferUsage)

func (*WebGL) BufferDataSize

func (w *WebGL) BufferDataSize(t BufferTarget, size int, u BufferUsage)

func (*WebGL) BufferSubDataF32

func (w *WebGL) BufferSubDataF32(t BufferTarget, offset int, a []float32)

func (*WebGL) BufferSubDataI16

func (w *WebGL) BufferSubDataI16(t BufferTarget, offset int, a []int16)

func (*WebGL) Clear

func (w *WebGL) Clear(colorBits BufferBit)

func (*WebGL) ClearColor

func (w *WebGL) ClearColor(r, g, b, a float64)

func (*WebGL) CompileShader

func (w *WebGL) CompileShader(s *Shader)

func (*WebGL) CreateBuffer

func (w *WebGL) CreateBuffer() *Buffer

func (*WebGL) CreateProgram

func (w *WebGL) CreateProgram() *Program

func (*WebGL) CreateShader

func (w *WebGL) CreateShader(t ShaderType) *Shader

func (*WebGL) CreateTexture

func (w *WebGL) CreateTexture() *Texture

func (*WebGL) DrawArrays

func (w *WebGL) DrawArrays(mode DrawMode, first, size int)

func (*WebGL) Enable

func (w *WebGL) Enable(c Capability)

func (*WebGL) EnableVertexAttribArray

func (w *WebGL) EnableVertexAttribArray(a AttribLocation)

func (*WebGL) GenerateMipmap

func (w *WebGL) GenerateMipmap(target TextureTarget)

func (*WebGL) GetAttribLocation

func (w *WebGL) GetAttribLocation(p *Program, name string) AttribLocation

func (*WebGL) GetError

func (w *WebGL) GetError() js.Value

func (*WebGL) GetProgramInfoLog

func (w *WebGL) GetProgramInfoLog(p *Program) string

func (*WebGL) GetProgramParameterBool

func (w *WebGL) GetProgramParameterBool(p *Program, param ProgramParameterBool) bool

func (*WebGL) GetShaderInfoLog

func (w *WebGL) GetShaderInfoLog(s *Shader) string

func (*WebGL) GetShaderParameterBool

func (w *WebGL) GetShaderParameterBool(s *Shader, param ShaderParameterBool) bool

func (*WebGL) GetUniformLocation

func (w *WebGL) GetUniformLocation(p *Program, name string) UniformLocation

func (*WebGL) LinkProgram

func (w *WebGL) LinkProgram(p *Program)

func (*WebGL) ShaderSource

func (w *WebGL) ShaderSource(s *Shader, code string)

func (*WebGL) TexImage2D

func (w *WebGL) TexImage2D(target TextureTarget, level int, internalFormat TextureFormat, format TextureFormat, type_ GlType, pixels js.Value)

func (*WebGL) Uniform1i

func (w *WebGL) Uniform1i(u UniformLocation, v int)

func (*WebGL) Uniform2fv

func (w *WebGL) Uniform2fv(u UniformLocation, v [2]float32)

func (*WebGL) Uniform4fv

func (w *WebGL) Uniform4fv(u UniformLocation, v [4]float32)

func (*WebGL) UseProgram

func (w *WebGL) UseProgram(p *Program)

func (*WebGL) ValidateProgram

func (w *WebGL) ValidateProgram(p *Program)

func (*WebGL) VertexAttribPointer

func (w *WebGL) VertexAttribPointer(
	a AttribLocation, size int, arrayType GlType, normalized bool, stride, offset int64)

Jump to

Keyboard shortcuts

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