Initialize(), LoadAllGraphicsContent(), Unload()?
Hi Guys,
Just wondering if anyone could explain to me what is meant to happen in the Initialize and LoadAllGraphicsContent() methods in the skeleton source code. In particular I am unsure about what goes into the normal constructor and what goes into these two methods and what is the difference between each of those methods. Are these methods called only once at the start of the program or are there many calls to these methods?
Thanks for any help offered
Initialize is called once at program startup. You can load any non-graphics content there - sounds, data, etc. LoadAllGraphicsContent is called whenever it's needed, when the graphics device is recreated for some reason, which means your graphics are no longer valid and have to be reloaded. You can put whatever you want in the constructor, but normally I limit it to code that creates objects that are needed before the game is initialized - wave and soundbank objects in addition to the content manager object that gets inserted by the Starter Kit, if you use that.
When the device is created/recreated, LoadAllGraphicsContent is called with an argument of true. When the device is reset, LoadAllGraphicsContent is called with an argument of false.
Alt-tab typically only causes a reset if running in fullscreen mode.