shader

package
v0.0.0-...-7ca6639 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2021 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeVertex   = ShaderType(gl.VERTEX_SHADER)
	TypeFragment = ShaderType(gl.FRAGMENT_SHADER)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CompileErr

type CompileErr struct {
	Log    string
	Shader uint32
}

func (CompileErr) Error

func (cerr CompileErr) Error() string

type LinkErr

type LinkErr struct {
	Log     string
	Program uint32
}

func (LinkErr) Error

func (lerr LinkErr) Error() string

type Program

type Program struct {
	// contains filtered or unexported fields
}

func NewProgram

func NewProgram(vertShader *Shader, fragShader *Shader) (prog *Program, err error)

func (*Program) Bind

func (prog *Program) Bind()

func (*Program) BindFor

func (prog *Program) BindFor(context utils.BindingClosure)

func (*Program) Destroy

func (prog *Program) Destroy()

func (*Program) Id

func (prog *Program) Id() uint32

func (*Program) Unbind

func (prog *Program) Unbind()

func (*Program) Validate

func (prog *Program) Validate() (ok bool, log string)

type Shader

type Shader struct {
	// contains filtered or unexported fields
}

func NewFragmentShader

func NewFragmentShader(source string) (*Shader, error)

func NewShader

func NewShader(source string, shaderType ShaderType) (*Shader, error)

func NewShaderFromPath

func NewShaderFromPath(modulePath string, shaderType ShaderType) (*Shader, error)

func NewVertexShader

func NewVertexShader(source string) (*Shader, error)

func (*Shader) Destroy

func (shader *Shader) Destroy()

func (*Shader) Id

func (shader *Shader) Id() uint32

type ShaderType

type ShaderType int

type Uniform

type Uniform struct {
	// contains filtered or unexported fields
}

func NewUniform

func NewUniform(prog Program, name string) (uni *Uniform, err error)

func (*Uniform) Set

func (u *Uniform) Set(value interface{})

type UniformLinkError

type UniformLinkError struct {
	Name    string
	Program uint32
}

func (UniformLinkError) Error

func (ulerr UniformLinkError) Error() string

Jump to

Keyboard shortcuts

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