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