示例#1
0
文件: imp.go 项目: CaptainSoOmA/Uni
func ActualizeLight(n uint) { // n < MaxL
	//
	var L [4]float64
	L[0], L[1], L[2] = lightSource[n].Coord3()
	var l [4]C.GLfloat
	for i := 0; i < 3; i++ {
		l[i] = C.GLfloat(L[i])
	}
	l[3] = C.GLfloat(1.0)
	C.glLightfv(C.GL_LIGHT0+C.GLenum(n), C.GL_POSITION, &l[0])
	C.glLightfv(C.GL_LIGHT0+C.GLenum(n), C.GL_AMBIENT, &aa[n][0])
	C.glLightfv(C.GL_LIGHT0+C.GLenum(n), C.GL_DIFFUSE, &dd[n][0])
	C.glEnable(C.GL_LIGHT0 + C.GLenum(n))
}
示例#2
0
文件: gl.go 项目: james4k/gl
//void glLightfv (GLenum light, GLenum pname, const float *params)
func Lightfv(light GLenum, pname GLenum, params []float32) {
	if len(params) == 0 {
		panic("Invalid params length")
	}
	C.glLightfv(C.GLenum(light), C.GLenum(pname), (*C.GLfloat)(&params[0]))
}
示例#3
0
文件: gl.go 项目: Nvveen/gl
//void glLightfv (GLenum light, GLenum pname, const float *params)
func Lightfv(light GLenum, pname GLenum, params []float32) {
	if len(params) == 0 {
		panic(ErrorInputSize)
	}
	C.glLightfv(C.GLenum(light), C.GLenum(pname), (*C.GLfloat)(&params[0]))
}