Advertisement

Game initialization.

Started by May 24, 2019 09:17 PM
9 comments, last by irreversible 5 years, 3 months ago
On 5/25/2019 at 12:34 AM, Randy Gaul said:

There's no good reason to not initialize things from main directly. Typically people try to build complicated systems that rely on running code from constructors inside of global or static objects. After trying a few out and writing some myself I personally decided they are unnecessary and not worth the trouble.

In my own code I just call functions from main in a deterministic and simple way.

I second this. The few things I initialize statically include my type library, memory manager and any singletons that deal with system-wide marshaling (of which there's one or two). The assumption here is that these are somehow interdependent.

This topic is closed to new replies.

Advertisement