Example #1
0
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))
}
Example #2
0
File: gl.go Project: 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]))
}
Example #3
0
File: gl.go Project: 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]))
}