PDA

View Full Version : Lighting not working



truetaurus
10-24-2009, 09:51 PM
i did this:


GLfloat LightAmbient[]= { 0.5f, 0.5f, 0.5f, 1.0f };
GLfloat LightPosition[]= { 0.0f, 0.0f, 2.0f, 1.0f };
glLightfv(GL_LIGHT0, GL_AMBIENT, LightAmbient);

but i get this error:


sample252.c:33: error: expected declaration specifiers or ‘...’ before numeric constant
sample252.c:33: error: expected declaration specifiers or ‘...’ before numeric constant
sample252.c:33: error: expected declaration specifiers or ‘...’ before ‘LightAmbient’
sample252.c:33: warning: data definition has no type or storage class
sample252.c:33: error: conflicting types for ‘glLightfv’
/usr/include/GL/gl.h:1438: error: previous declaration of ‘glLightfv’ was here

whats wrong??

dletozeun
10-25-2009, 02:57 AM
Looks like the gl header inclusion did not succeed for a reason I ignore...

Could we see the preprocessor part of the code?