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

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -