nythrix's picture

glLightfv, glLightiv

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 );



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler.'s picture

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.

nythrix's picture

Thank you for the reply. I didn't think of that.