c++ - Running a game loop inside a Qt window -
How do I play a game loop inside a QT window without creating a new thread?
My "Runframe" method looks like this:
Zero GameInventory :: Runframe () {// Update Game Time. GameTime.Update (); TimeTime + game timeTime time () - the last time; Last time = time of the game time (); While (Timehighand> = TargetTimeStep) {update (); TimeBehind - = targetTimeStep; } Draw (); SwapBuffers (); }
As you can see, it is running as if it is called every event loop. Is there any way that I can get a method in my window which can be called every event loop? Or should I renew my loop around the timer in QT?
I think QTimer is a work and relatively simple measure. It uses the multimedia timer (if necessary) to get the resolution of milliseconds, so it is possible for the game loop.
Comments
Post a Comment