I do cross-platform game using Qt (from Linux). Qt has chosen it, because in the future we will need a graphical interface for all editors, as well as it is pre-installed on almost all Linux systems.
I tried to use the standard QApplication :: exec () loop and make a timer with a zero interval. But all this was very twitching, although it was still normal in full screen mode. Here is the code:
QApplication app; QTimer t; t.setSingleShot(false); t.start(0); app.exec();
Then I tried to make my infinite loop, calling processEvents, and after it updating the game. It became better, but still it still jerks in windowed mode. It produces FPS from 50 to 70, although in the Windows version WinAPI was more than 200. Code:
while(running) { QApplication::processEvents(); engine->Step(); }
The code that I tried on WinAPI, when I have not yet switched to Linux:
while(GetMessage(...)) { TranslateMessage(&msg); DispatchMessage(&msg); engine->Step(); }
It seems the same as on Qt, but on Qt it slows down, but not on WinAPI. Although the experiment was not entirely clean, I measured FPS on WinAPI on Windows, and I measured FPS on Qt on Linux.