Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 14th, 2007, 04:12 PM
Registered User
 
Join Date: Jun 2007
Location: , , .
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?
  #2 (permalink)  
Old June 15th, 2007, 04:14 PM
Registered User
 
Join Date: May 2007
Location: , , Denmark.
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

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 09:24 PM.


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