glLightfv, glLightiv
Posted Tuesday, 16 October, 2007 - 19:52 by nythrix in
regards.
Hi there,
first words this library is great. I was sick of fighting with Tao.Sdl so I decided to try out OpenTK. You've been doing a great job, so keep it up!
I have a question about OpenTK.OpenGL.GL.Light(). I found bindings for glLightf & glLighti but I couldn't find anything overloaded for an array. How do i do this then?
float[] amb = { 1.0f, 1.0f, 1.0f, 1.0f };
glLightfv( GL_LIGHT0, GL_AMBIENT, amb );
glLightfv( GL_LIGHT0, GL_AMBIENT, amb );
regards.




Comments
Oct 16
21:51:06Thanks :) Try GL.Lightv()
posted by the Fiddler.Thanks :)
Try GL.Lightv() instead of GL.Light().
It is somewhat unfortunate, but some functions cannot be overloaded "fully", i.e. they have different names for array and non-array forms (like GL.Lightv / GL.Light). This is done to comply with the CLS, which states that a function cannot be overloaded solely on ref/out directives. It's one of those irksome little problems that cannot be solved without a compromise - you have to either break the CLS (which means that some languages won't be able to use some functions), or comply with the CLS and live with a less-than-perfect API.
Oct 17
06:31:17Thank you for the reply. I
posted by nythrixThank you for the reply. I didn't think of that.