Results 1 to 2 of 2

Thread: glutTimerfunc

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2002
    Posts
    15

    glutTimerfunc

    Hi I have to use glutTimerFunc
    in order to simulate day and night
    I have a directional light source which shows the day, this light source then should be disabled for the night
    kindly suggest

  2. #2
    Member Newbie
    Join Date
    Nov 2002
    Location
    paris, france
    Posts
    37

    Re: glutTimerfunc

    supposing your light is GL_LIGHT0 :

    glutTimerFunc( 10000, &timerFunc, 0 );
    // change every 10seconds

    timerFunc( int value ) {
    static bool daylight = true;

    if( daylight )
    glEnable(GL_LIGHT0);
    else
    glDisable(GL_LIGHT0);

    daylight = !daylight;

    /* rearm the timer */
    glutTimerFunc( 10000, &timerFunc, 0 );
    }
    Sébastien Kuntz
    SNCF VR Lab

Similar Threads

  1. How do I use gluttimerfunc .......?
    By karika in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 09-01-2015, 04:59 PM
  2. glutTimerFunc
    By jsim1982 in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 04-11-2005, 11:26 PM
  3. Need some help with glutTimerFunc
    By ShinGouki in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 05-09-2003, 12:01 AM
  4. glutTimerFunc()?
    By beet6 in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 01-19-2002, 08:24 PM
  5. How to use glutTimerFunc()?
    By beet6 in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 01-18-2002, 06:39 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