func AttachShader(p Program, s Shader) { defer func() { errstr := errDrain() log.Printf("gl.AttachShader(%v, %v) %v", p, s, errstr) }() C.glAttachShader(p.c(), s.c()) }
func createProgram(vertShaderSrc string, fragShaderSrc string) C.GLuint { vertShader := loadShader(C.GL_VERTEX_SHADER, vertShaderSrc) fragShader := loadShader(C.GL_FRAGMENT_SHADER, fragShaderSrc) prog := C.glCreateProgram() if prog == 0 { panic("Failed to create shader program") } C.glAttachShader(prog, vertShader) checkGLError() C.glAttachShader(prog, fragShader) checkGLError() C.glLinkProgram(prog) var linkStatus C.GLint C.glGetProgramiv(prog, C.GL_LINK_STATUS, &linkStatus) if linkStatus != C.GL_TRUE { log := GetProgramInfoLog(prog) panic(fmt.Errorf("Failed to link program: %v", log)) } return prog }
func AttachShader(p Program, s Shader) { C.glAttachShader(p.c(), s.c()) }
func AttachShader( program uint32, shader uint32) { C.glAttachShader( C.GLuint(program), C.GLuint(shader)) }
// Attach attaches a shader object func (p *Program) Attach(s Shader) { C.glAttachShader(p.i, C.GLuint(s)) }
func (program *Program) AttachShader(shader Shader) { C.glAttachShader(program.id, C.GLuint(shader)) program.shadersValid = false }
// AttachShader attaches a shader object to a program object. func (p Program) AttachShader(s Shader) { C.glAttachShader(C.GLuint(p), C.GLuint(s)) }
func (program Program) AttachShader(shader Shader) { C.glAttachShader(C.GLuint(program), C.GLuint(shader)) }