예제 #1
0
func VertexShader(s string) uint {
	shader := gl.CreateShader(gl.VERTEX_SHADER)
	gl.ShaderSource(shader, s)
	gl.CompileShader(shader)

	if gl.GetShaderiv(shader, gl.COMPILE_STATUS, make([]int32, 1))[0] == 0 {
		fmt.Printf("VSH:\n%s\n", gl.GetShaderInfoLog(shader, 1000))
	}
	return shader
}
예제 #2
0
func FragmentShader(s string) uint {
	shader := gl.CreateShader(gl.FRAGMENT_SHADER)
	gl.ShaderSource(shader, s)
	gl.CompileShader(shader)

	if stat := gl.GetShaderiv(shader, gl.COMPILE_STATUS, make([]int32, 1)); stat[0] == 0 {
		fmt.Printf("FSH:\n%s\n", gl.GetShaderInfoLog(shader, 1000))

	}
	return shader
}