Reputation: 7623
I know that LoadContent and UnloadContent have a chance of being called more than once. However I am wondering if Initialize will have a chance to be called more than once. The documentation doesn't really go into this. Or is it better to do most of my "initialization" in the constructor?
Thanks,
Upvotes: 4
Views: 1239
Reputation: 27245
The information you are looking for is actually in the documentation for Game.Run
. You can only call Game.Run
once, and it calls Game.Initialize
once.
The benefit of doing initialization in Initialize
instead of the constructor is that, when Initialize
runs, the graphics device has been created (although obviously almost all of the things you can actually do with a graphics device should be done in LoadContent
).
For answering this kind of question, Reflector is helpful.
Upvotes: 4