shader

package
v0.0.0-...-ddc071b Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FRAG_SHADER    = gl.FRAGMENT_SHADER
	VERT_SHADER    = gl.VERTEX_SHADER
	GEOM_SHADER    = gl.GEOMETRY_SHADER
	COMPUTE_SHADER = gl.COMPUTE_SHADER
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Program

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

func NewProgram

func NewProgram(name string) *Program

func (*Program) AddShader

func (m *Program) AddShader(sh *Shader) error

Adds Shader

func (*Program) AddUniform

func (m *Program) AddUniform(name string)

Adds Uniform

func (*Program) Address

func (m *Program) Address(name string) *uint32

func (*Program) BindShaderStorage

func (m *Program) BindShaderStorage(name string, layout uint32, length int, data unsafe.Pointer)

func (*Program) DeleteShader

func (m *Program) DeleteShader(name string)

Deletes Shader

func (*Program) DispatchCompute

func (m *Program) DispatchCompute(x int32, y int32, z int32)

func (*Program) GetMaxWorkGroup

func (m *Program) GetMaxWorkGroup() [3]int32

func (*Program) GetUniformLocation

func (m *Program) GetUniformLocation(name string) (uint32, error)

func (*Program) Halt

func (m *Program) Halt()

func (*Program) IsLinked

func (m *Program) IsLinked() bool
func (m *Program) Link() error

Links programs with all attached valid compiled shaders, assumes that all shaders and uniforms expected have been set.

func (*Program) Location

func (m *Program) Location(name string) uint32

func (*Program) ShaderLog

func (m *Program) ShaderLog()

func (*Program) Use

func (m *Program) Use()

type Shader

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

func NewShader

func NewShader(filename string, path string, name string, shader_type uint32) (*Shader, error)

-----------------------------------

Shader

----------------------------------- New shader attempts to create and compile a new shader when instantiated

func NewShaderFromSource

func NewShaderFromSource(source string, name string, shader_type uint32) (*Shader, error)

func (*Shader) Compile

func (m *Shader) Compile() error

Invokes GL Shader Compilation return 0 and error on compilation error

func (*Shader) GetLog

func (m *Shader) GetLog() string

func (*Shader) GetMessage

func (m *Shader) GetMessage() string

func (*Shader) Id

func (m *Shader) Id() uint32

func (*Shader) IsCompiled

func (m *Shader) IsCompiled() bool

func (*Shader) PrintMessage

func (m *Shader) PrintMessage()

Jump to

Keyboard shortcuts

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