glTools

package
v0.0.0-...-bb68497 Latest Latest
Warning

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

Go to latest
Published: May 25, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Program

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

Program is a structure of a program

func NewProgram

func NewProgram(shaders ...*Shader) (*Program, error)

NewProgram create a new program

func (*Program) Attach

func (prog *Program) Attach(shaders ...*Shader)

Attach attach a shader to a program

func (*Program) BindFragDataLocation

func (prog *Program) BindFragDataLocation(n uint32, name string)

BindFragDataLocation binds

func (*Program) Delete

func (prog *Program) Delete()

Delete remove a program

func (*Program) GetAttribLocation

func (prog *Program) GetAttribLocation(name string) int32

GetAttribLocation get location of a program

func (*Program) GetUniformLocation

func (prog *Program) GetUniformLocation(name string) int32

GetUniformLocation get location of a program

func (prog *Program) Link() error

Link create a link between OpenGL and the program

func (*Program) Use

func (prog *Program) Use()

Use enable a program

type Shader

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

Shader is a shader struct

func NewShader

func NewShader(src string, sType uint32) (*Shader, error)

NewShader create a new shader

func NewShaderFromFile

func NewShaderFromFile(file string, sType uint32) (*Shader, error)

NewShaderFromFile create a shader from a file

func (*Shader) Delete

func (shader *Shader) Delete()

Delete remove a shader

type Texture

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

Texture contains all elements for an OpenGL texture

func NewTexture

func NewTexture(RGBA64 *image.RGBA64, wrapR, wrapS int32) (*Texture, error)

NewTexture creates a new texture

func (*Texture) Bind

func (tex *Texture) Bind(texUnit uint32)

Bind enables a texture

func (*Texture) SetUniform

func (tex *Texture) SetUniform(uniformLoc int32) error

SetUniform set a uniform texture

func (*Texture) Unbind

func (tex *Texture) Unbind()

Unbind disables a texture

func (*Texture) Update

func (tex *Texture) Update(RGBA64 *image.RGBA64)

Update updates a texture

Jump to

Keyboard shortcuts

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