
Originally Posted by
john_god
did you use timers ?
I tried with timers and now it works. This is what I have in the thread now:
void GLThread::start_simulation()
{
connect(simtimer, SIGNAL(timeout()), this, SLOT(rotateOneStep()));
simtimer->start(1);
}
void GLThread::start_simulation()
{
connect(simtimer, SIGNAL(timeout()), this, SLOT(rotateOneStep()));
simtimer->start(1);
}
To copy to clipboard, switch view to plain text mode
where:
void GLThread::rotateOneStep()
{
i=i+Tspeed;
emit changeVal(i);
}
void GLThread::rotateOneStep()
{
i=i+Tspeed;
emit changeVal(i);
}
To copy to clipboard, switch view to plain text mode
changeVal signal is connected with the openGL function which executes the rotation and has the updateGL() at the end.
Is this the only way to do this? or is it the best way?
Bookmarks