Sign in to follow this  

[.net] [XNA] Base Class

This topic is 4023 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When setting up a new "Windows Game" project, the template main game class they make for you that derives from Microsoft.Xna.Framework.Game does explicitly call base.Initialize(), base.Draw(), base.Update(), etc. for its respective overridden functions so I'd assume that's necessary. Not sure what exactly they do though.

Share this post


Link to post
Share on other sites
Oh, okay. I'll just do it, it can't hurt.

As a side question here, I forgot when Initialize is called, and what you should do in there. Should I set variable values in there?

Share this post


Link to post
Share on other sites
The XNA documentation suggests "Override [Initialize()] to query for any required services and load any non-graphics resources".

The docs also list the effects of calling base.Intialize/Draw/Update/etc() under the "Remarks" category of the respective functions of Microsoft.Xna.Framework.Game if you're interested in seeing what exactly they do. base.Initialize() will apparently "enumerate through any components and call their Initialize methods."

Share this post


Link to post
Share on other sites

This topic is 4023 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this