Results 1 to 4 of 4

Thread: Me and lights dont get along

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2009
    Posts
    11

    Me and lights dont get along

    I have created an OpenGL program with 50 rotating cubes and a camera so you can move around the scene.I want to lights but they won't work. Please tell me what im doing wrong. The source code code can be found at:

    http://cid-6e18e938c29224cf.skydrive...ublic/main.cpp

    Just click the white page to download.

    Thanks in advance.

  2. #2
    Junior Member Newbie
    Join Date
    Nov 2009
    Posts
    11

    Re: Me and lights dont get along

    I have tried out your code. I had to zoom out and move until the objects were in view. Can you clarify what about the lights don't work?

  3. #3
    Junior Member Newbie
    Join Date
    Dec 2009
    Posts
    9

    Re: Me and lights dont get along

    You need to move the init() function call AFTER the call to glutEnterGameMode.

    This is because glutEnterGameMode creates it's own window, and this window has it's own state associated with it. So, your previous glEnable statements did not affect this window.

    David

  4. #4
    Junior Member Newbie
    Join Date
    Dec 2009
    Posts
    11

    Re: Me and lights dont get along

    Thank you guys.
    Moving the Init() function after glutEnterGameMode solve the problem.

Similar Threads

  1. Speed of built in lights v.s. custom lights
    By STTrife in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 01-23-2013, 05:11 PM
  2. please help me. im new and i dont know anything about this.
    By deko in forum OpenGL: User Software
    Replies: 4
    Last Post: 12-26-2005, 06:37 AM
  3. I dont know
    By ocngull in forum OpenGL: User Software
    Replies: 0
    Last Post: 02-28-2002, 12:38 PM
  4. please help me i dont know what to do
    By beginner in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 07-22-2001, 12:54 PM
  5. Replies: 13
    Last Post: 11-29-2000, 02:19 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