Wrox Programmer Forums
|
BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6
This is the forum to discuss the Wrox book Professional XNA Game Programming: For Xbox 360 and Windows by Benjamin Nitschke; ISBN: 9780470126776
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 14th, 2007, 04:12 PM
Registered User
 
Join Date: Jun 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Difference in book and examples

Ben, in the book, says "Microsoft also added the LoadGraphicsContent and UnloadGraphicsContent helper methods by default to the Game1.cs class...but these methods will never be used in this book because it is much simpler to have all initialization and loading code at one place in the Initialize function". But in the first examples Ben uses the LoadGraphicsContent to load the code. Is there a difference?
 
Old June 15th, 2007, 04:14 PM
Registered User
 
Join Date: May 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Initialize method will only be called ONCE. (ie. when the game is started)
The LoadGraphicsContent MIGHT be called several times. (ie. when the game looses its graphics context for some reason like when the game is minimized or a screensaver starts or something like that)

Graphics Content is directly tied to the graphics context, so when the context is lost, the content needs to be reloaded. Placing the content loading in LoadGraphicsContent makes sure that xna can reload the appropriate content when the graphics context is first created and when it is lost and regained.

Correct me if im wrong.

/Henning






Similar Threads
Thread Thread Starter Forum Replies Last Post
My application based on book examples in C#. agresor BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 2 May 6th, 2008 02:06 AM
problems with examples in book skicrud Javascript How-To 2 May 27th, 2004 08:52 AM
Problems with the examples from the J2EE book alf.guzman J2EE 0 April 20th, 2004 09:43 AM
Book examples duff? Vormulac ASP.NET 1.0 and 1.1 Basics 2 September 8th, 2003 04:37 AM
Book Examples luisfco Pro VB 6 1 September 5th, 2003 06:50 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.