Example #1
0
func CreateProgram() (r0 Program) {
	defer func() {
		errstr := errDrain()
		log.Printf("gl.CreateProgram() %v%v", r0, errstr)
	}()
	return Program{Value: uint32(C.glCreateProgram())}
}
Example #2
0
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
}
Example #3
0
func CreateProgram() Program {
	return Program{Value: uint32(C.glCreateProgram())}
}
Example #4
0
func CreateProgram() uint32 {
	return uint32(C.glCreateProgram())
}
Example #5
0
File: gl.go Project: extrame/gl
// NewProgram creates an empty program
func NewProgram() *Program {
	return &Program{i: C.glCreateProgram()}
}
Example #6
0
func CreateProgram() Program {
	return Program{id: C.glCreateProgram()}
}
Example #7
0
File: shader.go Project: eaburns/gl
// CreateProgram creates a program object.
func CreateProgram() Program {
	return Program(C.glCreateProgram())
}
Example #8
0
func CreateProgram() uint {
	return uint(C.glCreateProgram())
}