Esempio n. 1
0
func (p *Program) Link(fsh, vsh uint32) {
	p.pid = gl.CreateProgram()
	gl.AttachShader(p.pid, fsh)
	gl.AttachShader(p.pid, vsh)
	gl.LinkProgram(p.pid)
	checkProgramLinkStatus(p.pid)
}
Esempio n. 2
0
func NewProgram(fsh FragmentShader, vsh VertexShader) Program {
	pid := gl.CreateProgram()
	gl.AttachShader(pid, fsh.Compile())
	gl.AttachShader(pid, vsh.Compile())
	gl.LinkProgram(pid)
	checkProgramLinkStatus(pid)
	return Program(pid)
}
Esempio n. 3
0
// Create a program from vertex and fragment shaders.
func Program(fsh, vsh uint32) uint32 {
	p := gl.CreateProgram()
	gl.AttachShader(p, fsh)
	gl.AttachShader(p, vsh)
	gl.LinkProgram(p)
	checkProgramLinkStatus(p)
	return p
}