Jump to content
  • Advertisement
Sign in to follow this  
Uphoreum

[.net] [XNA] Base Class

This topic is 4233 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

Do I need to call the base classes overriden methods? Like, base.Initialize(), base.Draw(), base.Update()? Or is there nothing useful in those?

Share this post


Link to post
Share on other sites
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!