Пример #1
0
func CreateProgram() (r0 Program) {
	defer func() {
		errstr := errDrain()
		log.Printf("gl.CreateProgram() %v%v", r0, errstr)
	}()
	return Program{Value: uint32(C.glCreateProgram())}
}
Пример #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
}
Пример #3
0
func CreateProgram() Program {
	return Program{Value: uint32(C.glCreateProgram())}
}
Пример #4
0
func CreateProgram() uint32 {
	return uint32(C.glCreateProgram())
}
Пример #5
0
Файл: gl.go Проект: extrame/gl
// NewProgram creates an empty program
func NewProgram() *Program {
	return &Program{i: C.glCreateProgram()}
}
Пример #6
0
func CreateProgram() Program {
	return Program{id: C.glCreateProgram()}
}
Пример #7
0
// CreateProgram creates a program object.
func CreateProgram() Program {
	return Program(C.glCreateProgram())
}
Пример #8
0
func CreateProgram() uint {
	return uint(C.glCreateProgram())
}