Results 1 to 2 of 2

Thread: Lighting not working

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2009
    Posts
    6

    Lighting not working

    i did this:
    Code :
    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:
    Code :
    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??

  2. #2
    Senior Member OpenGL Pro dletozeun's Avatar
    Join Date
    Jan 2006
    Location
    FRANCE
    Posts
    1,367

    Re: Lighting not working

    Looks like the gl header inclusion did not succeed for a reason I ignore...

    Could we see the preprocessor part of the code?

Similar Threads

  1. Basic lighting not working
    By Elijah1920 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-09-2017, 02:44 AM
  2. Lighting not working
    By Nick85 in forum OpenGL: Drivers
    Replies: 2
    Last Post: 02-02-2011, 04:41 PM
  3. lighting not working
    By Sergiu in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 01-31-2009, 01:14 PM
  4. material lighting not working correctly
    By GameMaker in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 01-28-2003, 04:59 AM
  5. Lighting & Texturing not working despite using GL_MODULATE
    By Tod Baudais in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 03-02-2001, 08:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean