Concepts of a game engine/main loop

Hi there,

From what I understand, a game loop checks for input, updates the objects and draws everything on the screen.

Are these components all in 1 thread or multiple? I thought the best way is to handle these all in a seperate thread.

Does anyone have source code/structure of a game’s engine? Is my way a good way to handle these things or shall I just keep it in 1 simple main loop?

Kind regards,

Well how do we know what “your way” is?
Check out MERCury, or other engines people are developing on here.

I wrote a pretty extensive article on my blog,, check it out.

If you’re just starting out, don’t think about multi-threading. First off all, you should be able to get off with 1 thread if you’re not making some game with super awesome graphics like AAA. 1 thread should always be enough. You should add another thread for loading stuff if it takes a lot of time.

In all, just do everything in 1 thread. If you’re starting out, don’t think about performance. Just do as much stuff as you can leaving performance behind. I bet 100% you will almost never run into huge performance issues, unless it is something really stupid.

Again, just do as much stuff as you can, ignoring performance.

[quote]I have an issue… I have been trying to get it to work for hours!
Oh, have I an idea!
I use Threads! great threads multi-Man, I draw threading %epera6te eeeeeeeeeeeeeee
*I always kept this advice heart. Found it on a thread from Jimmt, Riven, or some Duke.

Game Threading

Pretty old topic on threading, but it still is spot on when it comes to writing any sort of application or game. It takes a lot of skill to get speed out of multi-threading, so if you don’t understand it then it is probably best to stick to 1 thread.

As for game engines, as far as I know, there is a lot of ways to design an engine. It is just a set of tools and modules catered for one purpose. So, the best way to design an engine is just to keep your tool set modular, so you can use the engine in many different ways.