Exemple #1
0
// TexParameter sets texture parameters.
func TexParameter(targ TextureTarget, parm TexParam, val interface{}) {
	switch v := val.(type) {
	case float32:
		C.glTexParameterf(C.GLenum(targ), C.GLenum(parm), C.GLfloat(v))
	case float64:
		C.glTexParameterf(C.GLenum(targ), C.GLenum(parm), C.GLfloat(v))

	case int32:
		C.glTexParameteri(C.GLenum(targ), C.GLenum(parm), C.GLint(v))
	case int:
		C.glTexParameteri(C.GLenum(targ), C.GLenum(parm), C.GLint(v))
	default:
		panic("TexParameter requires either float32, float64, int32, or int")
	}
}
Exemple #2
0
func TexParameterf(
	target Enum, pname Enum, param float32) {
	C.glTexParameterf(
		C.GLenum(target),
		C.GLenum(pname),
		C.GLfloat(param))
}
Exemple #3
0
func TexParameterf(target, pname Enum, param float32) {
	defer func() {
		errstr := errDrain()
		log.Printf("gl.TexParameterf(%v, %v, %v) %v", target, pname, param, errstr)
	}()
	C.glTexParameterf(target.c(), pname.c(), C.GLfloat(param))
}
Exemple #4
0
func TexParameterf(target, pname Enum, param float32) {
	C.glTexParameterf(target.c(), pname.c(), C.GLfloat(param))
}