示例#1
0
文件: shader.go 项目: remogatto/egles
func VertexShader(s string) gl.Uint {

	shader := gl.CreateShader(gl.VERTEX_SHADER)
	gl.ShaderSource(shader, 1, &s, nil)
	gl.CompileShader(shader)
	var stat gl.Int
	gl.GetShaderiv(shader, gl.COMPILE_STATUS, &stat)
	if stat != 0 {
		log.Fatalln(stat)
	}
	return shader
}
示例#2
0
文件: shader.go 项目: remogatto/egles
func FragmentShader(s string) uint32 {
	shader := gl.CreateShader(gl.FRAGMENT_SHADER)
	gl.ShaderSource(shader, 1, &s, nil)
	gl.CompileShader(shader)
	var stat int32
	gl.GetShaderiv(shader, gl.COMPILE_STATUS, &stat)
	if stat != 0 {
		log.Fatalln(stat)
	}
	return shader

}