Quantcast
Channel: Community | MonoGame - Latest topics
Viewing all articles
Browse latest Browse all 6822

Why does MonoGame calls DoUpdate() before RunLoop()?

$
0
0

@GaijinFox wrote:

I am reading the source code to learn how MonoGame works internally, and in the Run(GameRunBehavior) method of the Game class I noticed the following:

 case GameRunBehavior.Synchronous:
                    // XNA runs one Update even before showing the window
                    DoUpdate( new GameTime() );

                    Platform.RunLoop();
                    EndRun();
                    DoExiting();
                    break;

There's DoUpdate()

Later on, inside the Platform.RunLoop() it calls Game.Tick(), which then calls internally DoUpdate() again

From what I understand, it gets on an endless game loop on Platform.RunLoop() until the user quits the game.

But why is it required to run that isolated DoUpdate() before it gets on the loop?

Posts: 3

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 6822

Trending Articles