Example #1
0
func glGetInfoLog(shaderOrProgram gl.Uint, isShader bool) string {
	var l = gl.Sizei(256)
	var s = gl.GLStringAlloc(l)
	defer gl.GLStringFree(s)
	if isShader {
		gl.GetShaderInfoLog(shaderOrProgram, l, nil, s)
	} else {
		gl.GetProgramInfoLog(shaderOrProgram, l, nil, s)
	}
	return gl.GoString(s)
}
Example #2
0
func ShaderInfoLog(shaderOrProgram gl.Uint, isShader bool) string {
	var l = gl.Sizei(256)
	var s = gl.GLStringAlloc(l)
	defer gl.GLStringFree(s)
	if isShader {
		gl.GetShaderInfoLog(shaderOrProgram, l, nil, s)
	} else {
		gl.GetProgramInfoLog(shaderOrProgram, l, nil, s)
	}
	PanicIfErrors("ShaderInfoLog(s=%v)", isShader)
	return gl.GoString(s)
}
Example #3
0
File: gl.go Project: vron/fm
func CreateProgram(shaders []g.Uint) g.Uint {
	p := g.CreateProgram()

	for _, v := range shaders {
		g.AttachShader(p, v)
	}
	g.LinkProgram(p)

	var status g.Int
	g.GetProgramiv(p, g.LINK_STATUS, &status)
	if status == g.FALSE {
		var length g.Int
		g.GetProgramiv(p, g.INFO_LOG_LENGTH, &length)
		log.Println(length)
		logStr := g.GLStringAlloc(g.Sizei(length + 1))
		g.GetProgramInfoLog(p, g.Sizei(length), nil, logStr)
		log.Println(g.GoString(logStr))
	}
	return p
}