webgl

package
v0.0.0-...-babf446 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buffer

type Buffer struct {
	js.Value
}

type Canvas

type Canvas struct {
	js.Value
}

func GetCanvasById

func GetCanvasById(id string) Canvas

func NewCanvas

func NewCanvas() Canvas

func (Canvas) GetHeight

func (c Canvas) GetHeight() int

func (Canvas) GetWebGLContext

func (c Canvas) GetWebGLContext() Context

func (Canvas) GetWidth

func (c Canvas) GetWidth() int

func (Canvas) SetHeight

func (c Canvas) SetHeight(h int)

func (Canvas) SetWidth

func (c Canvas) SetWidth(w int)

type Context

type Context struct {
	js.Value
}

func (Context) AttachShader

func (c Context) AttachShader(program Program, shader Shader)

func (Context) BindBuffer

func (c Context) BindBuffer(target GLenum, buffer Buffer)

func (Context) BufferData

func (c Context) BufferData(target GLenum, data interface{}, usage GLenum)

func (Context) Clear

func (c Context) Clear(mask GLbitfield)

func (Context) ClearColor

func (c Context) ClearColor(red GLclampf, green GLclampf, blue GLclampf, alpha GLclampf)

func (Context) ClearDepth

func (c Context) ClearDepth(depth GLclampf)

func (Context) CompileShader

func (c Context) CompileShader(vertShader Shader)

func (Context) CreateBuffer

func (c Context) CreateBuffer() Buffer

func (Context) CreateProgram

func (c Context) CreateProgram() Program

func (Context) CreateShader

func (c Context) CreateShader(t GLenum) Shader

func (Context) DepthFunc

func (c Context) DepthFunc(f GLenum)

func (Context) DrawElements

func (c Context) DrawElements(mode GLenum, count GLsizei, t GLenum, offset GLintptr)

func (Context) Enable

func (c Context) Enable(cap GLenum)

func (Context) EnableVertexAttribArray

func (c Context) EnableVertexAttribArray(index GLuint)

func (Context) GetAttribLocation

func (c Context) GetAttribLocation(program Program, name string) GLint

func (Context) GetUniformLocation

func (c Context) GetUniformLocation(program Program, name string) UniformLocation

func (Context) LinkProgram

func (c Context) LinkProgram(program Program)

func (Context) ShaderSource

func (c Context) ShaderSource(vertShader Shader, vertCode string)

func (Context) UniformMatrix4fv

func (c Context) UniformMatrix4fv(location UniformLocation, transpose GLboolean, value Matrix)

func (Context) UseProgram

func (c Context) UseProgram(program Program)

func (Context) VertexAttribPointer

func (c Context) VertexAttribPointer(index GLuint, size GLint, t GLenum, normalized GLboolean, stride GLsizei, offset GLintptr)

func (Context) Viewport

func (c Context) Viewport(x GLint, y GLint, width GLsizei, height GLsizei)

type GLbitfield

type GLbitfield = int

type GLboolean

type GLboolean = bool

type GLclampf

type GLclampf = float64

type GLenum

type GLenum = int
const (
	DEPTH_BUFFER_BIT   GLenum = 0x00000100
	STENCIL_BUFFER_BIT GLenum = 0x00000400
	COLOR_BUFFER_BIT   GLenum = 0x00004000
)

ClearBufferMask

const (
	FRAGMENT_SHADER                  GLenum = 0x8B30
	VERTEX_SHADER                    GLenum = 0x8B31
	MAX_VERTEX_ATTRIBS               GLenum = 0x8869
	MAX_VERTEX_UNIFORM_VECTORS       GLenum = 0x8DFB
	MAX_VARYING_VECTORS              GLenum = 0x8DFC
	MAX_COMBINED_TEXTURE_IMAGE_UNITS GLenum = 0x8B4D
	MAX_VERTEX_TEXTURE_IMAGE_UNITS   GLenum = 0x8B4C
	MAX_TEXTURE_IMAGE_UNITS          GLenum = 0x8872
	MAX_FRAGMENT_UNIFORM_VECTORS     GLenum = 0x8DFD
	SHADER_TYPE                      GLenum = 0x8B4F
	DELETE_STATUS                    GLenum = 0x8B80
	LINK_STATUS                      GLenum = 0x8B82
	VALIDATE_STATUS                  GLenum = 0x8B83
	ATTACHED_SHADERS                 GLenum = 0x8B85
	ACTIVE_UNIFORMS                  GLenum = 0x8B86
	ACTIVE_ATTRIBUTES                GLenum = 0x8B89
	SHADING_LANGUAGE_VERSION         GLenum = 0x8B8C
	CURRENT_PROGRAM                  GLenum = 0x8B8D
)

Shaders

const (
	ARRAY_BUFFER                 GLenum = 0x8892
	ELEMENT_ARRAY_BUFFER         GLenum = 0x8893
	ARRAY_BUFFER_BINDING         GLenum = 0x8894
	ELEMENT_ARRAY_BUFFER_BINDING GLenum = 0x8895
	STREAM_DRAW                  GLenum = 0x88E0
	STATIC_DRAW                  GLenum = 0x88E4
	DYNAMIC_DRAW                 GLenum = 0x88E8
	BUFFER_SIZE                  GLenum = 0x8764
	BUFFER_USAGE                 GLenum = 0x8765
	CURRENT_VERTEX_ATTRIB        GLenum = 0x8626
)

Buffer Objects

const (
	BYTE           GLenum = 0x1400
	UNSIGNED_BYTE  GLenum = 0x1401
	SHORT          GLenum = 0x1402
	UNSIGNED_SHORT GLenum = 0x1403
	INT            GLenum = 0x1404
	UNSIGNED_INT   GLenum = 0x1405
	FLOAT          GLenum = 0x1406
)

DataType

const (
	CULL_FACE                GLenum = 0x0B44
	BLEND                    GLenum = 0x0BE2
	DITHER                   GLenum = 0x0BD0
	STENCIL_TEST             GLenum = 0x0B90
	DEPTH_TEST               GLenum = 0x0B71
	SCISSOR_TEST             GLenum = 0x0C11
	POLYGON_OFFSET_FILL      GLenum = 0x8037
	SAMPLE_ALPHA_TO_COVERAGE GLenum = 0x809E
	SAMPLE_COVERAGE          GLenum = 0x80A0
)

TEXTURE_2D

const (
	NEVER    GLenum = 0x0200
	LESS     GLenum = 0x0201
	EQUAL    GLenum = 0x0202
	LEQUAL   GLenum = 0x0203
	GREATER  GLenum = 0x0204
	NOTEQUAL GLenum = 0x0205
	GEQUAL   GLenum = 0x0206
	ALWAYS   GLenum = 0x0207
)

StencilFunction

const (
	POINTS         GLenum = 0x0000
	LINES          GLenum = 0x0001
	LINE_LOOP      GLenum = 0x0002
	LINE_STRIP     GLenum = 0x0003
	TRIANGLES      GLenum = 0x0004
	TRIANGLE_STRIP GLenum = 0x0005
	TRIANGLE_FAN   GLenum = 0x0006
)

BeginMode

type GLint

type GLint = int

type GLintptr

type GLintptr = int

type GLsizei

type GLsizei = int

type GLuint

type GLuint = int

type Matrix

type Matrix []float32

func (Matrix) ToJS

func (m Matrix) ToJS() js.Value

type Program

type Program struct {
	js.Value
}

type Shader

type Shader struct {
	js.Value
}

type UniformLocation

type UniformLocation struct {
	js.Value
}

Jump to

Keyboard shortcuts

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