This is how i have declared my light values and their positions
is this correct or is there another more officiant way?
// Lighting values
GLfloat greenLight[] = { 0.0f, 0.6f, 0.0f, 1.0f };
GLfloat redLight[] = { 0.6f, 0.0f, 0.0f, 1.0f };
GLfloat blueLight[] = { 0.0f, 0.6f, 0.0f, 1.0f };
GLfloat whiteLight[] = { 0.2f, 0.2f, 0.2f, 1.0f };
GLfloat sourceLight[] = { 0.9f, 0.9f, 0.9f, 1.0f };
GLfloat lightPos[] = { 0.0f, 0.0f, 0.0f, 1.0f };
GLfloat lightPos1[] = { 5.0f, -5.0f, 0.0f, 0.0f };
GLfloat lightPos2[] = { -5.0f, 5.0f, 0.0f, 0.0f };
GLfloat lightPos3[] = { 5.0f, 5.0f, 0.0f, 0.0f };
There really isn’t any other way to do it using fixed-function OpenGL. Setting the parameters is a small part of the cost of lighting. If you want something more efficient, I would recommend you learn non-deprecated OpenGL and implement lighting in a shader, which will probably be faster than fixed-function lighting.