public override void UseLights( Core.Collections.LightList lightList, int limit )
{
// Save previous modelview
OpenGL.MatrixMode( All.Modelview );
GLESConfig.GlCheckError( this );
OpenGL.PushMatrix();
// Just load view matrix (identity world)
float[] mat = new float[ 16 ];
MakeGLMatrix( ref mat, _ViewMatrix );
OpenGL.LoadMatrix( mat );
GLESConfig.GlCheckError( this );
int num = 0;
for ( int i = 0; i < lightList.Count && i < limit; i++, num++ )
{
SetGLLight( num, lightList[ i ] );
_lights[ num ] = lightList[ i ];
}
// Disable extra lights
for ( ; num < numCurrentLights; ++num )
{
SetGLLight( num, null );
_lights[ num ] = null;
}
numCurrentLights = System.Math.Min( limit, lightList.Count );
SetLights();
// restore previous
OpenGL.PopMatrix();
GLESConfig.GlCheckError( this );
}