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) }
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) }
// 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 }