I have two timers to repaint a QGLWidget and determine the FPS
QObject::connect(&fpsTimer, SIGNAL(timeout()), this, SLOT(updateFps()));
fpsTimer.start(1000);
QObject::connect(&updateTimer, SIGNAL(timeout()), this, SLOT(updatePanel()));
updateTimer.start(0);
void GLPanel::updatePanel()
{
updateBuffers();
updateGL();
frameCount++;
}
I also update the vbos with new data each and every frame.
On my machine with Qt installed I get a consistent 60 FPS since the update timer will fire based off the GUI thread. I have tried setting it to update every 15ms instead of relying on the GUI thread with no luck. On other machines it ramps up to around 1000 FPS.
Another problem I am having is that my points are not drawing correctly on other machines. They are drawn in the wrong place and colors. As to whether this is related to Qt or OpenGL...?
Any ideas on what would cause this?
Other machines after clicking in the middle of the screen Other machines
Working Dev Machine after clicking on a point Working Dev Machine
They are both supposed to look exactly the same.
Your drawing timer is using interval of 0 ms. So the program tries to draw as fast as possible. That's why the other computers have very high frame rates. Your computer is most probably using the display driver's vsync setting. Vsync will synchronize the drawing to the refresh rate of the monitor, that's why the 60 Hz framerate. So you can limit the other computers' frame rate to 60 by using the vsync setting.
However, some old and cheap display cards do not support the vsync at all. Then you need to change the timer's interval, for example to 15 ms. It won't produce as good results as vsync, but it is much better than drawing at 1000 Hz.