shader

package
v0.0.0-...-d216d2d Latest Latest
Warning

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

Go to latest
Published: May 8, 2018 License: MIT Imports: 4 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadBasicShaders

func LoadBasicShaders()

func New

func New(name, vertexShaderSource, fragmentShaderSource string, uniforms []string) error

New creates a new shader object. The shader can later be activated by the given name with the Use function

Types

type Shader

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

Shader is a struct for render programs

func GetActive

func GetActive() *Shader

GetActive get the current shader in the state

func GetShaderByName

func GetShaderByName(name string) (*Shader, error)

GetShaderByName retrieves a loaded shader by its name

func (*Shader) Activate

func (shader *Shader) Activate()

Activate will draw everything with this program and load it if it isnt loaded.

func (*Shader) GetUniform

func (shader *Shader) GetUniform(name string) int32

GetUniform will return the ID for a GLSL uniform

func (*Shader) SetUniform

func (shader *Shader) SetUniform(name string, uniforms ...float32)

SetUniform will set a uniform with provided data

Jump to

Keyboard shortcuts

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