Results 1 to 3 of 3

Thread: Qt OpenGL equivalent of glutIdleFunc()?

  1. #1
    Join Date
    Jul 2008
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Qt OpenGL equivalent of glutIdleFunc()?

    I'm just learning OpenGL programming now, the tutorials in the guide use glut but I'm trying to do them with QGLWidget instead.

    Does anyone know if there is an equivalent for glutIdleFunc() in QGLWidget? It sets a function that is called whenever the program is idle, used for animation in the example.

    I was thinking I could set it up a signal and slot with a timer, but that could result in either gaps between the animations if the timer is too high, or weird behaviour if the timer is too low.

  2. #2
    Join Date
    Jul 2008
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Qt OpenGL equivalent of glutIdleFunc()?

    Ok never mind, turns out setting the interval on a QTimer to 0 does exactly what I want, but I can't find out how to delete this thread.

  3. #3
    Join Date
    Jul 2007
    Location
    California, USA
    Posts
    62
    Thanks
    17
    Thanked 7 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt OpenGL equivalent of glutIdleFunc()?

    You need to use timers. Your slot for the timer callback will be the equivalent of the glutIdelFunc. If you set the timer interval to be 1, it will be continuously called. if you set it to 0, it will be called when all the events in the window system's event queue have been processed.

Similar Threads

  1. OpenGL and Qt Question
    By ToddAtWSU in forum Qt Programming
    Replies: 2
    Last Post: 18th April 2009, 18:04
  2. QT + OpenGL + Thread => aaaahhhhh !
    By anthibug in forum Qt Programming
    Replies: 7
    Last Post: 26th July 2008, 13:36
  3. Qtopia Core & OpenGL ES?
    By zelko in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 28th May 2007, 07:21

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.