//for animation
QTimer *timer = new QTimer( this );
//this creates a Qt timer event
connect( timer, SIGNAL(timeout()), c, SLOT(animate()) );
//this specifies what is to happen when the timer sends
// a signal, ie, when the timer event occurs
// (SIGNAL(timeout)) send a signal to
// SLOT(animate()) - which is in glbox.cpp
timer->start( 4, FALSE );
//this specifies that the timer event happens every 4
// milliseconds and that it is infinite loop
private: GLfloat rotate;
public slots: void animate();
void GLBox::animate()
{
rotate += 5;
updateGL();
}
glRotatef( rotate, 0.0, 0.0, 1.0 );
Useful References
OpenGL Programming Guide
(The Red Book).
OpenGL Index in Alphabetic Order
(This is pretty long)
The OpenGL Website - tutorials
Contact me
email: pj@cpsc.ucalgary.ca
Tel: (403) 220 7041.